#include "CConn.h" | #include "CConn.h" | ||||
#include "OptionsDialog.h" | #include "OptionsDialog.h" | ||||
#include "DesktopWindow.h" | |||||
#include "i18n.h" | #include "i18n.h" | ||||
#include "parameters.h" | #include "parameters.h" | ||||
#include "vncviewer.h" | #include "vncviewer.h" |
#ifndef __CCONN_H__ | #ifndef __CCONN_H__ | ||||
#define __CCONN_H__ | #define __CCONN_H__ | ||||
#include <FL/Fl.H> | |||||
#include <rfb/CConnection.h> | #include <rfb/CConnection.h> | ||||
#include <network/Socket.h> | #include <network/Socket.h> | ||||
#include "DesktopWindow.h" | |||||
class DesktopWindow; | |||||
class CConn : public rfb::CConnection, | class CConn : public rfb::CConnection, | ||||
public rdr::FdInStreamBlockCallback | public rdr::FdInStreamBlockCallback |
#include "parameters.h" | #include "parameters.h" | ||||
#include "vncviewer.h" | #include "vncviewer.h" | ||||
#include "CConn.h" | #include "CConn.h" | ||||
#include "Viewport.h" | |||||
#include <FL/Fl.H> | |||||
#include <FL/Fl_Scroll.H> | #include <FL/Fl_Scroll.H> | ||||
#include <FL/x.H> | #include <FL/x.H> | ||||
viewport->setColourMapEntries(firstColour, nColours, rgbs); | viewport->setColourMapEntries(firstColour, nColours, rgbs); | ||||
} | } | ||||
void DesktopWindow::fillRect(const rfb::Rect& r, rfb::Pixel pix) { | |||||
viewport->fillRect(r, pix); | |||||
} | |||||
void DesktopWindow::imageRect(const rfb::Rect& r, void* pixels) { | |||||
viewport->imageRect(r, pixels); | |||||
} | |||||
void DesktopWindow::copyRect(const rfb::Rect& r, int srcX, int srcY) { | |||||
viewport->copyRect(r, srcX, srcY); | |||||
} | |||||
rdr::U8* DesktopWindow::getBufferRW(const rfb::Rect& r, int* stride) { | |||||
return viewport->getBufferRW(r, stride); | |||||
} | |||||
void DesktopWindow::damageRect(const rfb::Rect& r) { | |||||
viewport->damageRect(r); | |||||
} | |||||
// Copy the areas of the framebuffer that have been changed (damaged) | // Copy the areas of the framebuffer that have been changed (damaged) | ||||
// to the displayed window. | // to the displayed window. |
#include <map> | #include <map> | ||||
#include <rfb/Rect.h> | #include <rfb/Rect.h> | ||||
#include <rfb/Pixel.h> | |||||
#include "Viewport.h" | |||||
#include <FL/Fl.H> | |||||
#include <FL/Fl_Window.H> | #include <FL/Fl_Window.H> | ||||
class CConn; | class CConn; | ||||
class Viewport; | |||||
class Fl_Scroll; | class Fl_Scroll; | ||||
class DesktopWindow : public Fl_Window { | class DesktopWindow : public Fl_Window { | ||||
void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); | void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); | ||||
void fillRect(const rfb::Rect& r, rfb::Pixel pix) { | |||||
viewport->fillRect(r, pix); | |||||
} | |||||
void imageRect(const rfb::Rect& r, void* pixels) { | |||||
viewport->imageRect(r, pixels); | |||||
} | |||||
void copyRect(const rfb::Rect& r, int srcX, int srcY) { | |||||
viewport->copyRect(r, srcX, srcY); | |||||
} | |||||
rdr::U8* getBufferRW(const rfb::Rect& r, int* stride) { | |||||
return viewport->getBufferRW(r, stride); | |||||
} | |||||
void damageRect(const rfb::Rect& r) { | |||||
viewport->damageRect(r); | |||||
} | |||||
void fillRect(const rfb::Rect& r, rfb::Pixel pix); | |||||
void imageRect(const rfb::Rect& r, void* pixels); | |||||
void copyRect(const rfb::Rect& r, int srcX, int srcY); | |||||
rdr::U8* getBufferRW(const rfb::Rect& r, int* stride); | |||||
void damageRect(const rfb::Rect& r); | |||||
void resizeFramebuffer(int new_w, int new_h); | void resizeFramebuffer(int new_w, int new_h); | ||||
#include <rfb/CMsgWriter.h> | #include <rfb/CMsgWriter.h> | ||||
#include <rfb/LogWriter.h> | #include <rfb/LogWriter.h> | ||||
#include <rfb/PixelTransformer.h> | |||||
// FLTK can pull in the X11 headers on some systems | // FLTK can pull in the X11 headers on some systems | ||||
#ifndef XK_VoidSymbol | #ifndef XK_VoidSymbol | ||||
#include "Viewport.h" | #include "Viewport.h" | ||||
#include "CConn.h" | #include "CConn.h" | ||||
#include "OptionsDialog.h" | #include "OptionsDialog.h" | ||||
#include "DesktopWindow.h" | |||||
#include "i18n.h" | #include "i18n.h" | ||||
#include "fltk_layout.h" | #include "fltk_layout.h" | ||||
#include "parameters.h" | #include "parameters.h" | ||||
#include "menukey.h" | #include "menukey.h" | ||||
#include "vncviewer.h" | #include "vncviewer.h" | ||||
#if defined(WIN32) | |||||
#include "Win32PixelBuffer.h" | |||||
#elif defined(__APPLE__) | |||||
#include "OSXPixelBuffer.h" | |||||
#else | |||||
#include "X11PixelBuffer.h" | |||||
#endif | |||||
// We also have a generic version of the above, using pure FLTK: | |||||
// | |||||
// #include "PlatformPixelBuffer.h" | |||||
// | |||||
#include <FL/fl_draw.H> | #include <FL/fl_draw.H> | ||||
#include <FL/fl_ask.H> | #include <FL/fl_ask.H> | ||||
damage.clear(); | damage.clear(); | ||||
} | } | ||||
void Viewport::fillRect(const rfb::Rect& r, rfb::Pixel pix) { | |||||
if (pixelTrans) { | |||||
rfb::Pixel pix2; | |||||
if (colourMapChange) | |||||
commitColourMap(); | |||||
pixelTrans->translatePixels(&pix, &pix2, 1); | |||||
pix = pix2; | |||||
} | |||||
frameBuffer->fillRect(r, pix); | |||||
damageRect(r); | |||||
} | |||||
void Viewport::imageRect(const rfb::Rect& r, void* pixels) { | |||||
if (pixelTrans) { | |||||
if (colourMapChange) | |||||
commitColourMap(); | |||||
pixelTrans->translateRect(pixels, r.width(), | |||||
rfb::Rect(0, 0, r.width(), r.height()), | |||||
frameBuffer->data, frameBuffer->getStride(), | |||||
r.tl); | |||||
} else { | |||||
frameBuffer->imageRect(r, pixels); | |||||
} | |||||
damageRect(r); | |||||
} | |||||
void Viewport::copyRect(const rfb::Rect& r, int srcX, int srcY) { | |||||
frameBuffer->copyRect(r, rfb::Point(r.tl.x-srcX, r.tl.y-srcY)); | |||||
damageRect(r); | |||||
} | |||||
rdr::U8* Viewport::getBufferRW(const rfb::Rect& r, int* stride) { | |||||
return frameBuffer->getBufferRW(r, stride); | |||||
} | |||||
void Viewport::damageRect(const rfb::Rect& r) { | |||||
damage.assign_union(rfb::Region(r)); | |||||
if (!Fl::has_timeout(handleUpdateTimeout, this)) | |||||
Fl::add_timeout(0.500, handleUpdateTimeout, this); | |||||
}; | |||||
#ifdef HAVE_FLTK_CURSOR | #ifdef HAVE_FLTK_CURSOR | ||||
static const char * dotcursor_xpm[] = { | static const char * dotcursor_xpm[] = { | ||||
"5 5 2 1", | "5 5 2 1", |
#include <map> | #include <map> | ||||
#include <FL/Fl.H> | |||||
#include <FL/Fl_Widget.H> | #include <FL/Fl_Widget.H> | ||||
#include <rfb/Region.h> | #include <rfb/Region.h> | ||||
#include <rfb/PixelTransformer.h> | |||||
#if defined(WIN32) | |||||
#include "Win32PixelBuffer.h" | |||||
#elif defined(__APPLE__) | |||||
#include "OSXPixelBuffer.h" | |||||
#else | |||||
#include "X11PixelBuffer.h" | |||||
#endif | |||||
// We also have a generic version of the above, using pure FLTK: | |||||
// | |||||
// #include "PlatformPixelBuffer.h" | |||||
// | |||||
#include <rfb/Pixel.h> | |||||
#include <rfb/ColourMap.h> | |||||
class Fl_Menu_Button; | class Fl_Menu_Button; | ||||
class Fl_RGB_Image; | class Fl_RGB_Image; | ||||
namespace rfb { class PixelTransformer; } | |||||
class CConn; | class CConn; | ||||
class PlatformPixelBuffer; | |||||
class Viewport : public Fl_Widget { | class Viewport : public Fl_Widget { | ||||
public: | public: | ||||
void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); | void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); | ||||
void fillRect(const rfb::Rect& r, rfb::Pixel pix) { | |||||
if (pixelTrans) { | |||||
rfb::Pixel pix2; | |||||
if (colourMapChange) | |||||
commitColourMap(); | |||||
pixelTrans->translatePixels(&pix, &pix2, 1); | |||||
pix = pix2; | |||||
} | |||||
frameBuffer->fillRect(r, pix); | |||||
damageRect(r); | |||||
} | |||||
void imageRect(const rfb::Rect& r, void* pixels) { | |||||
if (pixelTrans) { | |||||
if (colourMapChange) | |||||
commitColourMap(); | |||||
pixelTrans->translateRect(pixels, r.width(), | |||||
rfb::Rect(0, 0, r.width(), r.height()), | |||||
frameBuffer->data, frameBuffer->getStride(), | |||||
r.tl); | |||||
} else { | |||||
frameBuffer->imageRect(r, pixels); | |||||
} | |||||
damageRect(r); | |||||
} | |||||
void copyRect(const rfb::Rect& r, int srcX, int srcY) { | |||||
frameBuffer->copyRect(r, rfb::Point(r.tl.x-srcX, r.tl.y-srcY)); | |||||
damageRect(r); | |||||
} | |||||
rdr::U8* getBufferRW(const rfb::Rect& r, int* stride) { | |||||
return frameBuffer->getBufferRW(r, stride); | |||||
} | |||||
void damageRect(const rfb::Rect& r) { | |||||
damage.assign_union(rfb::Region(r)); | |||||
if (!Fl::has_timeout(handleUpdateTimeout, this)) | |||||
Fl::add_timeout(0.500, handleUpdateTimeout, this); | |||||
}; | |||||
void fillRect(const rfb::Rect& r, rfb::Pixel pix); | |||||
void imageRect(const rfb::Rect& r, void* pixels); | |||||
void copyRect(const rfb::Rect& r, int srcX, int srcY); | |||||
rdr::U8* getBufferRW(const rfb::Rect& r, int* stride); | |||||
void damageRect(const rfb::Rect& r); | |||||
void setCursor(int width, int height, const rfb::Point& hotspot, | void setCursor(int width, int height, const rfb::Point& hotspot, | ||||
void* data, void* mask); | void* data, void* mask); |