選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DesktopWindow.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2011 Pierre Ossman <ossman@cendio.se> 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. #ifndef __DESKTOPWINDOW_H__
  20. #define __DESKTOPWINDOW_H__
  21. #include <map>
  22. #include <rfb/Rect.h>
  23. #include <rfb/Pixel.h>
  24. #include <FL/Fl_Window.H>
  25. namespace rfb { class ModifiablePixelBuffer; }
  26. class CConn;
  27. class Viewport;
  28. class Fl_Scroll;
  29. class DesktopWindow : public Fl_Window {
  30. public:
  31. DesktopWindow(int w, int h, const char *name,
  32. const rfb::PixelFormat& serverPF, CConn* cc_);
  33. ~DesktopWindow();
  34. // Most efficient format (from DesktopWindow's point of view)
  35. const rfb::PixelFormat &getPreferredPF();
  36. // Flush updates to screen
  37. void updateWindow();
  38. // Updated session title
  39. void setName(const char *name);
  40. // Return a pointer to the framebuffer for decoders to write into
  41. rfb::ModifiablePixelBuffer* getFramebuffer(void);
  42. // Resize the current framebuffer, but retain the contents
  43. void resizeFramebuffer(int new_w, int new_h);
  44. // New image for the locally rendered cursor
  45. void setCursor(int width, int height, const rfb::Point& hotspot,
  46. void* data, void* mask);
  47. // Fl_Window callback methods
  48. void resize(int x, int y, int w, int h);
  49. int handle(int event);
  50. void fullscreen_on();
  51. private:
  52. static int fltkHandle(int event, Fl_Window *win);
  53. void grabKeyboard();
  54. void ungrabKeyboard();
  55. static void handleGrab(void *data);
  56. void maximizeWindow();
  57. void handleDesktopSize();
  58. static void handleResizeTimeout(void *data);
  59. void remoteResize(int width, int height);
  60. void repositionViewport();
  61. static void handleClose(Fl_Widget *wnd, void *data);
  62. static void handleOptions(void *data);
  63. static void handleFullscreenTimeout(void *data);
  64. static void handleEdgeScroll(void *data);
  65. private:
  66. CConn* cc;
  67. Fl_Scroll *scroll;
  68. Viewport *viewport;
  69. bool firstUpdate;
  70. bool delayedFullscreen;
  71. bool delayedDesktopSize;
  72. };
  73. #endif