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.

vncModule.c 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2015 Pierre Ossman for Cendio AB
  3. *
  4. * This is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This software is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this software; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  17. * USA.
  18. */
  19. /* This is the xf86 module code for the vnc extension.
  20. */
  21. #ifdef HAVE_DIX_CONFIG_H
  22. #include <dix-config.h>
  23. #endif
  24. #include "opaque.h"
  25. #include "randrstr.h"
  26. #include "xorg-version.h"
  27. #include "xf86.h"
  28. #include "xf86Module.h"
  29. #include "vncExtInit.h"
  30. #include "RFBGlue.h"
  31. #include "XorgGlue.h"
  32. #include "RandrGlue.h"
  33. static void vncModuleInit(INITARGS);
  34. static MODULESETUPPROTO(vncSetup);
  35. ExtensionModule vncExt =
  36. {
  37. vncModuleInit,
  38. "VNC",
  39. NULL
  40. };
  41. static XF86ModuleVersionInfo vncVersRec =
  42. {
  43. "vnc",
  44. "TigerVNC Project",
  45. MODINFOSTRING1,
  46. MODINFOSTRING2,
  47. XORG_VERSION_CURRENT,
  48. 1, 0, 0,
  49. ABI_CLASS_EXTENSION, /* needs the server extension ABI */
  50. ABI_EXTENSION_VERSION,
  51. MOD_CLASS_EXTENSION,
  52. {0,0,0,0}
  53. };
  54. _X_EXPORT XF86ModuleData vncModuleData = { &vncVersRec, vncSetup, NULL };
  55. static void *
  56. vncSetup(void * module, void * opts, int *errmaj, int *errmin) {
  57. LoadExtensionList(&vncExt, 1, FALSE);
  58. /* Need a non-NULL return value to indicate success */
  59. return (void *)1;
  60. }
  61. static void vncModuleInit(INITARGS)
  62. {
  63. static char once = 0;
  64. if (!once) {
  65. once++;
  66. vncInitRFB();
  67. for (int scr = 0; scr < screenInfo.numScreens; scr++) {
  68. ScrnInfoPtr pScrn;
  69. XF86OptionPtr option;
  70. pScrn = xf86Screens[scr];
  71. option = pScrn->options;
  72. while (option != NULL) {
  73. vncSetParam(xf86OptionName(option), xf86OptionValue(option));
  74. option = xf86NextOption(option);
  75. }
  76. }
  77. }
  78. vncExtensionInit();
  79. }
  80. void vncClientGone(int fd)
  81. {
  82. }
  83. int vncRandRCanCreateScreenOutputs(int scrIdx, int extraOutputs)
  84. {
  85. return 0;
  86. }
  87. int vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs)
  88. {
  89. return 0;
  90. }
  91. int vncRandRCanCreateModes(void)
  92. {
  93. return 0;
  94. }
  95. void* vncRandRCreateMode(void* output, int width, int height)
  96. {
  97. return 0;
  98. }
  99. void* vncRandRSetPreferredMode(void* output, void* mode)
  100. {
  101. /*
  102. * We're not going to change which modes are preferred,
  103. * so just return the incoming mode.
  104. */
  105. return mode;
  106. }