You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xf86vncModule.cc 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. /* This is the xf86 module code for the vnc extension.
  19. */
  20. #ifdef HAVE_DIX_CONFIG_H
  21. #include <dix-config.h>
  22. #endif
  23. #include <rfb/Configuration.h>
  24. #include <rfb/Logger_stdio.h>
  25. #include <rfb/LogWriter.h>
  26. #include <rfb/ScreenSet.h>
  27. #include <rfb/screenTypes.h>
  28. #include "xorg-version.h"
  29. extern "C" {
  30. #define class c_class
  31. #define private c_private
  32. #define bool c_bool
  33. #define new c_new
  34. #include "xf86.h"
  35. #include "xf86Module.h"
  36. #ifdef RANDR
  37. #include "randrstr.h"
  38. #endif /* RANDR */
  39. #undef class
  40. #undef private
  41. #undef bool
  42. #undef new
  43. using namespace rfb;
  44. extern void vncExtensionInit();
  45. static void vncExtensionInitWithParams(INITARGS);
  46. char *listenaddr = NULL;
  47. static MODULESETUPPROTO(vncSetup);
  48. ExtensionModule vncExt =
  49. {
  50. vncExtensionInitWithParams,
  51. "VNC",
  52. #if XORG < 112
  53. NULL,
  54. NULL,
  55. #endif
  56. NULL
  57. };
  58. static XF86ModuleVersionInfo vncVersRec =
  59. {
  60. "vnc",
  61. "Constantin Kaplinsky",
  62. MODINFOSTRING1,
  63. MODINFOSTRING2,
  64. XORG_VERSION_CURRENT,
  65. 1, 0, 0,
  66. ABI_CLASS_EXTENSION, /* needs the server extension ABI */
  67. ABI_EXTENSION_VERSION,
  68. MOD_CLASS_EXTENSION,
  69. {0,0,0,0}
  70. };
  71. _X_EXPORT XF86ModuleData vncModuleData = { &vncVersRec, vncSetup, NULL };
  72. static pointer
  73. vncSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
  74. LoadExtension(&vncExt, FALSE);
  75. /* Need a non-NULL return value to indicate success */
  76. return (pointer)1;
  77. }
  78. static void vncExtensionInitWithParams(INITARGS)
  79. {
  80. rfb::initStdIOLoggers();
  81. rfb::LogWriter::setLogParams("*:stderr:30");
  82. rfb::Configuration::enableServerParams();
  83. for (int scr = 0; scr < screenInfo.numScreens; scr++) {
  84. ScrnInfoPtr pScrn = xf86Screens[scr];
  85. for (ParameterIterator i; i.param; i.next()) {
  86. const char *val;
  87. #if XORG < 112
  88. val = xf86FindOptionValue(pScrn->options, i.param->getName());
  89. #else
  90. val = xf86FindOptionValue((XF86OptionPtr)pScrn->options, i.param->getName());
  91. #endif
  92. if (val)
  93. i.param->setParam(val);
  94. }
  95. }
  96. vncExtensionInit();
  97. }
  98. }
  99. RRModePtr vncRandRModeGet(int width, int height)
  100. {
  101. return NULL;
  102. }
  103. RROutputPtr vncRandROutputCreate(ScreenPtr pScreen)
  104. {
  105. return NULL;
  106. }