From 83dddfbfabd25f8a8e1192e05f7cff3c2d881b2a Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 26 Feb 2016 16:18:27 +0000 Subject: Rename remaining src/drivers/XXX.h to XXX.H - continued git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11227 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Darwin/Fl_Darwin_System_Driver.h | 50 -------- src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 153 +++++++++++++++++++++++++ src/drivers/OpenGL/Fl_OpenGL_Display_Device.H | 37 ++++++ src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.h | 102 ----------------- src/drivers/Posix/Fl_Posix_System_Driver.h | 50 -------- src/drivers/Quartz/Fl_Quartz_Display_Device.h | 34 ------ src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h | 75 ------------ src/drivers/WinAPI/Fl_WinAPI_System_Driver.h | 50 -------- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 57 +++++++++ src/drivers/X11/Fl_X11_Screen_Driver.H | 78 +++++++++++++ src/drivers/X11/Fl_X11_Window_Driver.h | 58 ---------- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h | 126 -------------------- 12 files changed, 325 insertions(+), 545 deletions(-) delete mode 100644 src/drivers/Darwin/Fl_Darwin_System_Driver.h create mode 100644 src/drivers/GDI/Fl_GDI_Graphics_Driver.H create mode 100644 src/drivers/OpenGL/Fl_OpenGL_Display_Device.H delete mode 100644 src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.h delete mode 100644 src/drivers/Posix/Fl_Posix_System_Driver.h delete mode 100644 src/drivers/Quartz/Fl_Quartz_Display_Device.h delete mode 100644 src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h delete mode 100644 src/drivers/WinAPI/Fl_WinAPI_System_Driver.h create mode 100644 src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H create mode 100644 src/drivers/X11/Fl_X11_Screen_Driver.H delete mode 100644 src/drivers/X11/Fl_X11_Window_Driver.h delete mode 100644 src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h (limited to 'src') 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/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H new file mode 100644 index 000000000..a25274e08 --- /dev/null +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -0,0 +1,153 @@ +// +// "$Id$" +// +// 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. +// +// 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_GDI_Graphics_Driver.H + \brief Definition of MSWindows GDI graphics driver. + */ + +#ifndef FL_GDI_GRAPHICS_DRIVER_H +#define FL_GDI_GRAPHICS_DRIVER_H + +#include +#include + + +/** + \brief The MSWindows-specific graphics class. + * + This class is implemented only on the MSWindows platform. + */ +class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver { +protected: + 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_GDI_Graphics_Driver() {mask_bitmap_ = NULL;} + virtual int has_feature(driver_feature mask) { return mask & NATIVE; } + 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); + void draw(const char* str, int n, int x, int y); + void draw(int angle, const char *str, int n, int x, int y); + void rtl_draw(const char* str, int n, int x, int y); + void font(Fl_Font face, Fl_Fontsize size); + void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); + void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); + void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy); + void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0); + void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3); + void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0); + void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); + fl_uintptr_t cache(Fl_Pixmap *img, int w, int h, const char *const*array); + fl_uintptr_t cache(Fl_Bitmap *img, int w, int h, const uchar *array); + void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_); + double width(const char *str, int n); + double width(unsigned int c); + void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h); + int height(); + int descent(); +#if ! defined(FL_DOXYGEN) + 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/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); + 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); + // --- clipping + 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 begin_complex_polygon(); + void transformed_vertex(double xf, double yf); + void vertex(double x, double y); + void end_points(); + void end_line(); + void end_loop(); + void end_polygon(); + void end_complex_polygon(); + void gap(); + 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); +}; + +/** + 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); +}; + +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_Screen_Driver.h b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h deleted file mode 100644 index d6f5f01f1..000000000 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" -// -// Definition of MSWindows Win32/64 Screen interface -// 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_Screen_Driver.h - \brief Definition of MSWindows Win32/64 Screen interface. - */ - -#ifndef FL_WINAPI_SCREEN_DRIVER_H -#define FL_WINAPI_SCREEN_DRIVER_H - -#include -#include - - -class Fl_Window; - - -class FL_EXPORT Fl_WinAPI_Screen_Driver : public Fl_Screen_Driver -{ -protected: - RECT screens[MAX_SCREENS]; - RECT work_area[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 int visual(int flags); - // --- screen configuration - virtual void init(); - virtual int x(); - virtual int y(); - virtual int w(); - virtual int h(); - virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); - virtual void screen_dpi(float &h, float &v, int n=0); - virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); - // --- audible output - virtual void beep(int type); - // --- global events - virtual void flush(); - virtual double wait(double time_to_wait); - virtual int ready(); - virtual void grab(Fl_Window* win); - // --- global colors - virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b); - virtual void get_system_colors(); - virtual const char *get_system_scheme(); -}; - - -#endif // FL_WINAPI_SCREEN_DRIVER_H - -// -// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". -// 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/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H new file mode 100644 index 000000000..8a4998753 --- /dev/null +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -0,0 +1,57 @@ +// +// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" +// +// Definition of Apple Cocoa window 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_Window_Driver.H + \brief Definition of MSWindows window driver. + */ + +#ifndef FL_WINAPI_WINDOW_DRIVER_H +#define FL_WINAPI_WINDOW_DRIVER_H + +#include + +/* + Move everything here that manages the native window interface. + + There is one window driver for each Fl_Window. Window drivers manage window + actions such as resizing, events, decoration, fullscreen modes, etc. . All + drawing and rendering is managed by the Surface device and the associated + graphics driver. + + - window specific event handling + - window types and styles, depth, etc. + - decorations + + ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? + */ + +class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver +{ +public: + Fl_WinAPI_Window_Driver(Fl_Window*); +}; + + + +#endif // FL_WINAPI_WINDOW_DRIVER_H + +// +// End of "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $". +// diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H new file mode 100644 index 000000000..fc9114c3c --- /dev/null +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -0,0 +1,78 @@ +// +// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" +// +// Definition of X11 Screen interface +// 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_X11_Screen_Driver.H + \brief Definition of X11 Screen interface + */ + +#ifndef FL_X11_SCREEN_DRIVER_H +#define FL_X11_SCREEN_DRIVER_H + +#include + + +class Fl_Window; + + +class FL_EXPORT Fl_X11_Screen_Driver : public Fl_Screen_Driver +{ +protected: + typedef struct { + short x_org; + short y_org; + short width; + short height; + } FLScreenInfo; + FLScreenInfo screens[MAX_SCREENS]; + float dpi[MAX_SCREENS][2]; + +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(); + virtual int w(); + virtual int h(); + virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n); + virtual void screen_dpi(float &h, float &v, int n=0); + virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n); + // --- audible output + virtual void beep(int type); + // --- global events + virtual void flush(); + virtual double wait(double time_to_wait); + virtual int ready(); + virtual void grab(Fl_Window* win); + // --- global colors + virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b); + virtual void get_system_colors(); + virtual const char *get_system_scheme(); +}; + + +#endif // FL_X11_SCREEN_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/X11/Fl_X11_Window_Driver.h deleted file mode 100644 index d6500c5a4..000000000 --- a/src/drivers/X11/Fl_X11_Window_Driver.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// "$Id: quartz.H 11017 2016-01-20 21:40:12Z matt $" -// -// Definition of X11 window 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_Cocoa_Window_Driver.h - \brief Definition of X11 window driver. - */ - -#ifndef FL_X11_WINDOW_DRIVER_H -#define FL_X11_WINDOW_DRIVER_H - -#include - -/* - Move everything here that manages the native window interface. - - There is one window driver for each Fl_Window. Window drivers manage window - actions such as resizing, events, decoration, fullscreen modes, etc. . All - drawing and rendering is managed by the Surface device and the associated - graphics driver. - - - window specific event handling - - window types and styles, depth, etc. - - decorations - - ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? - */ - -class FL_EXPORT Fl_X11_Window_Driver : public Fl_Window_Driver -{ -public: - Fl_X11_Window_Driver(Fl_Window*); - virtual void take_focus(); -}; - - - -#endif // FL_X11_WINDOW_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/Xlib/Fl_Xlib_Graphics_Driver.h deleted file mode 100644 index 6c7c402c3..000000000 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h +++ /dev/null @@ -1,126 +0,0 @@ -// -// "$Id$" -// -// 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. -// -// 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_Xlib_Graphics_Driver.h - \brief Definition of X11 Xlib graphics driver. - */ - -#ifndef FL_CFG_GFX_XLIB_H -#define FL_CFG_GFX_XLIB_H - -#include - -/** - \brief The Xlib-specific graphics class. - * - This class is implemented only on the Xlib platform. - */ -class FL_EXPORT Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver { -protected: - static GC gc_; - uchar **mask_bitmap_; - uchar **mask_bitmap() {return mask_bitmap_;} - void mask_bitmap(uchar **value) { mask_bitmap_ = value; } -public: - Fl_Xlib_Graphics_Driver(void); - virtual int has_feature(driver_feature mask) { return mask & NATIVE; } - virtual void *gc() { return gc_; } - char can_do_alpha_blending(); - - // --- bitmap stuff - Fl_Bitmask create_bitmask(int w, int h, const uchar *array); - void delete_bitmask(Fl_Bitmask bm); - void draw(const char* str, int n, int x, int y); - void draw(int angle, const char *str, int n, int x, int y); - void rtl_draw(const char* str, int n, int x, int y); - void font(Fl_Font face, Fl_Fontsize size); - void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); - void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy); - void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy); - void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0); - void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3); - void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0); - void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1); - fl_uintptr_t cache(Fl_Pixmap *img, int w, int h, const char *const*array); - fl_uintptr_t cache(Fl_Bitmap *img, int w, int h, const uchar *array); - void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_); - double width(const char *str, int n); - double width(unsigned int c); - 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); -#endif -protected: - // --- implementation is in src/fl_rect.cxx which includes src/cfg_gfx/xlib_rect.cxx - 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); - // --- clipping - 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 begin_complex_polygon(); - void transformed_vertex(double xf, double yf); - void vertex(double x, double y); - void end_points(); - void end_line(); - void end_loop(); - void end_polygon(); - void end_complex_polygon(); - void gap(); - 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); -}; - - -#endif // FL_CFG_GFX_XLIB_H - -// -// End of "$Id$". -// -- cgit v1.2.3