diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.h b/src/drivers/Darwin/Fl_Darwin_System_Driver.h deleted file mode 100644 index c09359e9d..000000000 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" -// -// Definition of Apple Darwin system driver -// for the Fast Light Tool Kit (FLTK). -// -// Copyright 2010-2016 by Bill Spitzak and others. -// -// This library is free software. Distribution and use rights are outlined in -// the file "COPYING" which should have been included with this file. If this -// file is missing or damaged, see the license at: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -/** - \file Fl_Darwin_System_Driver.h - \brief Definition of Apple Darwin system driver. - */ - -#ifndef FL_DARWIN_SYSTEM_DRIVER_H -#define FL_DARWIN_SYSTEM_DRIVER_H - -#include - -/* - Move everything here that manages the system interface. - - There is excatly one system driver. - - - filename and pathname management - - directory and file access - - system time and system timer - - multithreading - */ - -class Fl_Darwin_System_Driver : public Fl_System_Driver -{ -public: -}; - -#endif // FL_DARWIN_SYSTEM_DRIVER_H - -// -// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". -// diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H similarity index 72% rename from src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h rename to src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 6c7c402c3..a25274e08 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -1,7 +1,7 @@ // // "$Id$" // -// Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device +// Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -18,32 +18,37 @@ // /** - \file Fl_Xlib_Graphics_Driver.h - \brief Definition of X11 Xlib graphics driver. + \file Fl_GDI_Graphics_Driver.H + \brief Definition of MSWindows GDI graphics driver. */ -#ifndef FL_CFG_GFX_XLIB_H -#define FL_CFG_GFX_XLIB_H +#ifndef FL_GDI_GRAPHICS_DRIVER_H +#define FL_GDI_GRAPHICS_DRIVER_H #include +#include + /** - \brief The Xlib-specific graphics class. + \brief The MSWindows-specific graphics class. * - This class is implemented only on the Xlib platform. + This class is implemented only on the MSWindows platform. */ -class FL_EXPORT Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver { +class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver { protected: - static GC gc_; + HDC gc_; + int numcount; + int counts[20]; uchar **mask_bitmap_; uchar **mask_bitmap() {return mask_bitmap_;} void mask_bitmap(uchar **value) { mask_bitmap_ = value; } public: - Fl_Xlib_Graphics_Driver(void); + Fl_GDI_Graphics_Driver() {mask_bitmap_ = NULL;} virtual int has_feature(driver_feature mask) { return mask & NATIVE; } - virtual void *gc() { return gc_; } char can_do_alpha_blending(); - + virtual void gc(void *ctxt) {if (ctxt != gc_) global_gc(); gc_ = (HDC)ctxt;} + virtual void *gc() {return gc_;} + // --- bitmap stuff Fl_Bitmask create_bitmask(int w, int h, const uchar *array); void delete_bitmask(Fl_Bitmask bm); @@ -66,14 +71,15 @@ public: void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h); int height(); int descent(); - void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); #if ! defined(FL_DOXYGEN) - void copy_offscreen_with_alpha(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); + void copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy); #endif + void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); protected: - // --- implementation is in src/fl_rect.cxx which includes src/cfg_gfx/xlib_rect.cxx + // --- implementation is in src/fl_rect.cxx which includes src/cfg_gfx/gdi_rect.cxx void point(int x, int y); void rect(int x, int y, int w, int h); + void focus_rect(int x, int y, int w, int h); void rectf(int x, int y, int w, int h); void line(int x, int y, int x1, int y1); void line(int x, int y, int x1, int y1, int x2, int y2); @@ -118,8 +124,29 @@ protected: void color(uchar r, uchar g, uchar b); }; +/** + The graphics driver used when printing on MSWindows. + * + This class is implemented only on the MSWindows platform. It 's extremely similar to Fl_GDI_Graphics_Driver. + */ +class FL_EXPORT Fl_GDI_Printer_Graphics_Driver : public Fl_GDI_Graphics_Driver { +public: + virtual int has_feature(driver_feature mask) { return mask & (NATIVE | PRINTER); } + void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); + void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy); + int draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP); +}; -#endif // FL_CFG_GFX_XLIB_H +class Fl_Translated_GDI_Graphics_Driver : public Fl_GDI_Graphics_Driver { + unsigned depth; + POINT origins[10]; +public: + Fl_Translated_GDI_Graphics_Driver() {depth = 0;} + virtual void translate_all(int x, int y); + virtual void untranslate_all(void); +}; + +#endif // FL_GDI_GRAPHICS_DRIVER_H // // End of "$Id$". diff --git a/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H new file mode 100644 index 000000000..9730fc9c4 --- /dev/null +++ b/src/drivers/OpenGL/Fl_OpenGL_Display_Device.H @@ -0,0 +1,37 @@ +// +// "$Id$" +// +// implementation of class Fl_Gl_Device_Plugin for the Fast Light Tool Kit (FLTK). +// +// Copyright 2010-2014 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems to: +// +// http://www.fltk.org/str.php +// + + +#include + +class Fl_OpenGL_Graphics_Driver; + +/** + OpenGL Surface. + This surface is needed as an interface between GL windows and the GL graphics driver. + */ +class FL_EXPORT Fl_OpenGL_Display_Device : public Fl_Surface_Device { +public: + Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *graphics_driver); + static Fl_OpenGL_Display_Device *display_device(); +}; + + +// +// End of "$Id$". +// diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.h b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.h deleted file mode 100644 index b12e661f9..000000000 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// "$Id$" -// -// Definition of OpenGL graphics driver -// for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2016 by Bill Spitzak and others. -// -// This library is free software. Distribution and use rights are outlined in -// the file "COPYING" which should have been included with this file. If this -// file is missing or damaged, see the license at: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -/** - \file opengl.H - \brief Definition of OpenGL graphics driver. - */ - -#ifndef FL_CFG_GFX_OPENGL_H -#define FL_CFG_GFX_OPENGL_H - -#include - - -/** - \brief OpenGL specific graphics class. - */ -class FL_EXPORT Fl_OpenGL_Graphics_Driver : public Fl_Graphics_Driver { -public: - // --- line and polygon drawing with integer coordinates - void point(int x, int y); - void rect(int x, int y, int w, int h); - void rectf(int x, int y, int w, int h); - void line(int x, int y, int x1, int y1); - void line(int x, int y, int x1, int y1, int x2, int y2); - void xyline(int x, int y, int x1); - void xyline(int x, int y, int x1, int y2); - void xyline(int x, int y, int x1, int y2, int x3); - void yxline(int x, int y, int y1); - void yxline(int x, int y, int y1, int x2); - void yxline(int x, int y, int y1, int x2, int y3); - void loop(int x0, int y0, int x1, int y1, int x2, int y2); - void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); - void polygon(int x0, int y0, int x1, int y1, int x2, int y2); - void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); - void push_clip(int x, int y, int w, int h); - int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H); - int not_clipped(int x, int y, int w, int h); - void push_no_clip(); - void pop_clip(); - void restore_clip(); - // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx - void transformed_vertex0(COORD_T x, COORD_T y); - void transformed_vertex(double xf, double yf); - void vertex(double x, double y); - void begin_points(); - void end_points(); - void begin_line(); - void end_line(); - void begin_loop(); - void end_loop(); - void begin_polygon(); - void end_polygon(); - void begin_complex_polygon(); - void gap(); - void end_complex_polygon(); - void fixloop(); - void circle(double x, double y, double r); - // --- implementation is in src/fl_arc.cxx which includes src/cfg_gfx/xxx_arc.cxx if needed - // using void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end); - // --- implementation is in src/fl_arci.cxx which includes src/cfg_gfx/xxx_arci.cxx - void arc(int x, int y, int w, int h, double a1, double a2); - void pie(int x, int y, int w, int h, double a1, double a2); - // --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx - void line_style(int style, int width=0, char* dashes=0); - // --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx - void color(Fl_Color c); - Fl_Color color() { return color_; } - void color(uchar r, uchar g, uchar b); - // --- implementation is in src/fl_font.cxx which includes src/cfg_gfx/xxx_font.cxx - void draw(const char *str, int n, int x, int y); - double width(const char *str, int n); - void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h); - int height(); - int descent(); - // --- - Fl_Bitmask create_bitmask(int w, int h, const uchar *array) { return 0L; } - void delete_bitmask(Fl_Bitmask bm) { }; -}; - - -#endif // FL_CFG_GFX_OPENGL_H - -// -// End of "$Id$". -// diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.h b/src/drivers/Posix/Fl_Posix_System_Driver.h deleted file mode 100644 index 1b688d705..000000000 --- a/src/drivers/Posix/Fl_Posix_System_Driver.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" -// -// Definition of Posix system driver -// for the Fast Light Tool Kit (FLTK). -// -// Copyright 2010-2016 by Bill Spitzak and others. -// -// This library is free software. Distribution and use rights are outlined in -// the file "COPYING" which should have been included with this file. If this -// file is missing or damaged, see the license at: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -/** - \file Fl_Posix_System_Driver.h - \brief Definition of Posix system driver. - */ - -#ifndef FL_POSIX_SYSTEM_DRIVER_H -#define FL_POSIX_SYSTEM_DRIVER_H - -#include - -/* - Move everything here that manages the system interface. - - There is excatly one system driver. - - - filename and pathname management - - directory and file access - - system time and system timer - - multithreading - */ - -class Fl_Posix_System_Driver : public Fl_System_Driver -{ -public: -}; - -#endif // FL_POSIX_SYSTEM_DRIVER_H - -// -// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". -// diff --git a/src/drivers/Quartz/Fl_Quartz_Display_Device.h b/src/drivers/Quartz/Fl_Quartz_Display_Device.h deleted file mode 100644 index 15724cc84..000000000 --- a/src/drivers/Quartz/Fl_Quartz_Display_Device.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// "$Id$" -// -// Definition of class Fl_Quartz_Display_Device -// for the Fast Light Tool Kit (FLTK). -// -// Copyright 2010-2016 by Bill Spitzak and others. -// -// This library is free software. Distribution and use rights are outlined in -// the file "COPYING" which should have been included with this file. If this -// file is missing or damaged, see the license at: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -/** \file Fl_Quartz_Disply_Device.h - \brief Implement a connection between the Cocoa window management and the - Quartz graphics driver on OS X. -*/ - -#ifndef FL_QUARTZ_DISPLAY_DEVICE_H -#define FL_QUARTZ_DISPLAY_DEVICE_H - -// FIXME: implement this - -#endif // FL_QUARTZ_DISPLAY_DEVICE_H - -// -// End of "$Id$". -// diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.h b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.h deleted file mode 100644 index 379d74160..000000000 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" -// -// Definition of MSWindows system driver -// for the Fast Light Tool Kit (FLTK). -// -// Copyright 2010-2016 by Bill Spitzak and others. -// -// This library is free software. Distribution and use rights are outlined in -// the file "COPYING" which should have been included with this file. If this -// file is missing or damaged, see the license at: -// -// http://www.fltk.org/COPYING.php -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -/** - \file Fl_WinAPI_System_Driver.h - \brief Definition of MSWindows system driver. - */ - -#ifndef FL_WINAPI_SYSTEM_DRIVER_H -#define FL_WINAPI_SYSTEM_DRIVER_H - -#include - -/* - Move everything here that manages the system interface. - - There is excatly one system driver. - - - filename and pathname management - - directory and file access - - system time and system timer - - multithreading - */ - -class Fl_WinAPI_System_Driver : public Fl_System_Driver -{ -public: -}; - -#endif // FL_WINAPI_SYSTEM_DRIVER_H - -// -// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". -// diff --git a/src/drivers/X11/Fl_X11_Window_Driver.h b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H similarity index 77% rename from src/drivers/X11/Fl_X11_Window_Driver.h rename to src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index d6500c5a4..8a4998753 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.h +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -1,7 +1,7 @@ // // "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" // -// Definition of X11 window driver +// Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -18,12 +18,12 @@ // /** - \file Fl_Cocoa_Window_Driver.h - \brief Definition of X11 window driver. + \file Fl_WinAPI_Window_Driver.H + \brief Definition of MSWindows window driver. */ -#ifndef FL_X11_WINDOW_DRIVER_H -#define FL_X11_WINDOW_DRIVER_H +#ifndef FL_WINAPI_WINDOW_DRIVER_H +#define FL_WINAPI_WINDOW_DRIVER_H #include @@ -42,16 +42,15 @@ ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? */ -class FL_EXPORT Fl_X11_Window_Driver : public Fl_Window_Driver +class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver { public: - Fl_X11_Window_Driver(Fl_Window*); - virtual void take_focus(); + Fl_WinAPI_Window_Driver(Fl_Window*); }; -#endif // FL_X11_WINDOW_DRIVER_H +#endif // FL_WINAPI_WINDOW_DRIVER_H // // End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h b/src/drivers/X11/Fl_X11_Screen_Driver.H similarity index 74% rename from src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h rename to src/drivers/X11/Fl_X11_Screen_Driver.H index d6f5f01f1..fc9114c3c 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -1,7 +1,7 @@ // // "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" // -// Definition of MSWindows Win32/64 Screen interface +// Definition of X11 Screen interface // for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2016 by Bill Spitzak and others. @@ -18,34 +18,37 @@ // /** - \file Fl_WinAPI_Screen_Driver.h - \brief Definition of MSWindows Win32/64 Screen interface. + \file Fl_X11_Screen_Driver.H + \brief Definition of X11 Screen interface */ -#ifndef FL_WINAPI_SCREEN_DRIVER_H -#define FL_WINAPI_SCREEN_DRIVER_H +#ifndef FL_X11_SCREEN_DRIVER_H +#define FL_X11_SCREEN_DRIVER_H #include -#include class Fl_Window; -class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver +class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver { protected: - RECT screens[MAX_SCREENS]; - RECT work_area[MAX_SCREENS]; + typedef struct { + short x_org; + short y_org; + short width; + short height; + } FLScreenInfo; + FLScreenInfo screens[MAX_SCREENS]; float dpi[MAX_SCREENS][2]; - static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM); - BOOL screen_cb(HMONITOR mon, HDC, LPRECT r); - public: // --- display management + virtual void display(const char *disp); virtual int visual(int flags); // --- screen configuration + void init_workarea(); virtual void init(); virtual int x(); virtual int y(); @@ -68,7 +71,7 @@ public: }; -#endif // FL_WINAPI_SCREEN_DRIVER_H +#endif // FL_X11_SCREEN_DRIVER_H // // End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $".