diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-02-13 12:57:00 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-02-13 12:57:00 +0000 |
| commit | 5d1df0e789c794b8040c5db0d84b03ae2b42fd8d (patch) | |
| tree | 4e99ebb978d30bf6c7138181489dd37ce435c310 /FL | |
| parent | 8deac1e6baf7a016aabd3b6cb5ccffd7f09263cd (diff) | |
Details on PORTME items. Move fl_parse_color() to screen drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11163 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl.H | 6 | ||||
| -rw-r--r-- | FL/Fl_Copy_Surface.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Gl_Window.H | 2 | ||||
| -rw-r--r-- | FL/Fl_Graphics_Driver.H | 2 | ||||
| -rw-r--r-- | FL/Fl_Image_Surface.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Native_File_Chooser.H | 8 | ||||
| -rw-r--r-- | FL/Fl_PostScript.H | 6 | ||||
| -rw-r--r-- | FL/Fl_Printer.H | 10 | ||||
| -rw-r--r-- | FL/Fl_Screen_Driver.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Sys_Menu_Bar.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Tooltip.H | 19 | ||||
| -rw-r--r-- | FL/Fl_Window.H | 9 | ||||
| -rw-r--r-- | FL/fl_utf8.h | 2 | ||||
| -rw-r--r-- | FL/x.H | 2 |
14 files changed, 34 insertions, 48 deletions
@@ -54,7 +54,7 @@ struct Fl_Label; # else # define FL_SOCKET int # endif -#elif defined(__APPLE__) // PORTME: socket types +#elif defined(__APPLE__) // PORTME: Fl_System_Driver - socket types # define FL_SOCKET int #elif defined(FL_PORTING) # pragma message "FL_PORTING: define a type for FL_SOCKET" @@ -199,7 +199,7 @@ public: // should be private! static Fl_Window* grab_; static int compose_state; // used for dead keys (WIN32) or marked text (MacOS) static void call_screen_init(); // recompute screen number and dimensions -#ifdef __APPLE__ // PORTME: additional functions +#ifdef __APPLE__ // PORTME: add for all platforms - additional functions static void reset_marked_text(); // resets marked text static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point #elif defined(WIN32) @@ -907,7 +907,7 @@ int main() { */ static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent -#if defined(__APPLE__) // PORTME: additional functions +#if defined(__APPLE__) // PORTME: Fl_Screen_Driver ? - additional functions // not needed #elif defined(WIN32) // not needed diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H index 9488175d3..d85c32ead 100644 --- a/FL/Fl_Copy_Surface.H +++ b/FL/Fl_Copy_Surface.H @@ -53,7 +53,7 @@ private: int width; int height; Fl_Paged_Device *helper; -#ifdef __APPLE__ // PORTME: platform surface driver +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform surface driver CFMutableDataRef pdfdata; CGContextRef oldgc; CGContextRef gc; @@ -86,7 +86,7 @@ public: int h() { return height; } }; -#if defined(__APPLE__) // PORTME: platform surface driver +#if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform surface driver /* Mac class to reimplement Fl_Paged_Device::printable_rect() */ class FL_EXPORT Fl_Quartz_Surface_ : public Fl_System_Printer { diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H index f18f8a526..8c5b9b723 100644 --- a/FL/Fl_Gl_Window.H +++ b/FL/Fl_Gl_Window.H @@ -239,7 +239,7 @@ public: Fl::event_y() to the pixel units used by the OpenGL source code. \version 1.3.4 */ -#ifdef __APPLE__ // PORTME: additional functionality +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - additional functionality int pixels_per_unit(); #elif defined(WIN32) int pixels_per_unit() { return 1; } diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 6a544d7be..cdf2f6611 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -51,7 +51,7 @@ typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf); #ifdef WIN32 typedef int COORD_T; # define XPOINT XPoint -#elif defined(__APPLE__) // PORTME: platform specific types +#elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform specific types typedef float COORD_T; typedef struct { float x; float y; } QPoint; # define XPOINT QPoint diff --git a/FL/Fl_Image_Surface.H b/FL/Fl_Image_Surface.H index a926a8d6e..bcd868d59 100644 --- a/FL/Fl_Image_Surface.H +++ b/FL/Fl_Image_Surface.H @@ -50,7 +50,7 @@ private: int width; int height; Fl_Paged_Device *helper; -#ifdef __APPLE__ // PORTME: platform image surface driver +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform image surface driver #elif defined(WIN32) HDC _sgc; Window _sw; @@ -75,7 +75,7 @@ public: Fl_Shared_Image *highres_image(); }; -#ifdef __APPLE__ // PORTME: platform surface driver +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform surface driver /* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */ class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ { public: diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H index 5e9d51bbe..cafdf9d95 100644 --- a/FL/Fl_Native_File_Chooser.H +++ b/FL/Fl_Native_File_Chooser.H @@ -40,7 +40,7 @@ typedef void fl_BROWSEINFOW; # include <FL/filename.H> // FL_EXPORT // Use Apple's chooser -#elif defined(__APPLE__) // PORTME: native file chooser support +#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - native file chooser support # define MAXFILTERS 80 # include <FL/filename.H> // FL_EXPORT @@ -192,7 +192,7 @@ private: void clear_filters(); void add_filter(const char *, const char *); -#elif defined(__APPLE__) // PORTME: native file chooser support +#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - native file chooser support private: int _btype; // kind-of browser to show() int _options; // general options @@ -244,7 +244,7 @@ private: }; -#if !defined(__APPLE__) && !defined(WIN32) && !defined(FL_PORTING) // PORTME: FLTK file chooser option +#if !defined(__APPLE__) && !defined(WIN32) && !defined(FL_PORTING) // PORTME: Fl_Screen_Driver - FLTK file chooser option class FL_EXPORT Fl_FLTK_File_Chooser { friend class Fl_Native_File_Chooser; protected: @@ -328,7 +328,7 @@ private: static int custom_gtk_filter_function(const GtkFileFilterInfo*, Fl_GTK_File_Chooser::pair*); static void free_pair(pair *p); }; -#endif // !defined(__APPLE__) && !defined(WIN32) // PORTME: native file chooser option +#endif // !defined(__APPLE__) && !defined(WIN32) // PORTME: Fl_Screen_Driver - native file chooser option #endif /*FL_NATIVE_FILE_CHOOSER_H*/ diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H index 861fe590c..64e49f45d 100644 --- a/FL/Fl_PostScript.H +++ b/FL/Fl_PostScript.H @@ -199,7 +199,7 @@ class Clip { void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1); void draw(const char* s, int nBytes, int x, int y) {transformed_draw(s,nBytes,x,y); }; -#ifdef __APPLE__ // PORTME: additional functionality +#ifdef __APPLE__ // PORTME: merge into code - additional functionality void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); }; #elif defined(WIN32) // not needed @@ -233,7 +233,7 @@ class Clip { two variants of which are usable and allow to specify what page format and layout are desired. */ class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device { -#ifdef __APPLE__ // PORTME: platform specifics for PostScript +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver ? - platform specifics for PostScript CGContextRef gc; #elif defined(WIN32) // not needed @@ -265,7 +265,7 @@ public: void untranslate(void); int end_page (void); void end_job(void); -#ifdef __APPLE__ // PORTME: platform specifics for PostScript +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver ? - platform specifics for PostScript void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); } #elif defined(WIN32) // not needed diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index b975d0701..c65dba83a 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -32,7 +32,7 @@ #include <stdio.h> #ifdef WIN32 #include <commdlg.h> -#elif defined(__APPLE__) // PORTME: platform printer driver +#elif defined(__APPLE__) // PORTME: Fl_Surface_Driver ? - platform printer driver // not needed #elif defined(FL_PORTING) # pragma message "FL_PORTING: include files needed for printing support" @@ -40,7 +40,7 @@ #include <FL/Fl_PostScript.H> #endif -#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) // PORTME: platform printer driver +#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) // PORTME: Fl_Surface_Driver ? - platform printer driver /** Print support under MSWindows and Mac OS. @@ -54,7 +54,7 @@ private: /** \brief the printer's graphics context, if there's one, NULL otherwise */ void *gc; void set_current(void); -#ifdef __APPLE__ // PORTME: platform printer driver +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver ? - platform printer driver float scale_x; float scale_y; float angle; // rotation angle in radians @@ -88,7 +88,7 @@ public: void untranslate(void); int end_page (void); void end_job (void); -#ifdef __APPLE__ // PORTME: platform printer driver +#ifdef __APPLE__ // PORTME: Fl_Surface_Driver ? - platform printer driver void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y); #endif /** \brief The destructor */ @@ -235,7 +235,7 @@ public: ~Fl_Printer(void); private: -#if defined(WIN32) || defined(__APPLE__) // PORTME: system printer driver +#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Surface_Driver ? - system printer driver Fl_System_Printer *printer; #elif defined(FL_PORTING) # pragma message "FL_PORTING: instantiate your own Fl_xxx_Printer here" diff --git a/FL/Fl_Screen_Driver.H b/FL/Fl_Screen_Driver.H index 3fe3837b6..d00cbb46a 100644 --- a/FL/Fl_Screen_Driver.H +++ b/FL/Fl_Screen_Driver.H @@ -44,6 +44,8 @@ protected: public: static Fl_Screen_Driver *newScreenDriver(); + // --- display management + virtual void display(const char *disp); // --- screen configuration virtual void init() = 0; virtual int x() = 0; @@ -65,6 +67,8 @@ public: virtual void beep(int type) = 0; // --- global events virtual void flush() = 0; + // --- global colors + virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b) = 0; }; diff --git a/FL/Fl_Sys_Menu_Bar.H b/FL/Fl_Sys_Menu_Bar.H index 1103f599a..b635fedc6 100644 --- a/FL/Fl_Sys_Menu_Bar.H +++ b/FL/Fl_Sys_Menu_Bar.H @@ -22,7 +22,7 @@ #include "Fl_Menu_Bar.H" #include "x.H" -#if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: system menu bar +#if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: Fl_Screen_Driver - system menu bar /** A class to create, modify and delete menus that appear on Mac OS X in the menu bar at the top of the screen. @@ -105,7 +105,7 @@ typedef Fl_Menu_Bar Fl_Sys_Menu_Bar; typedef Fl_Menu_Bar Fl_Sys_Menu_Bar; -#endif // defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: system menu bar +#endif // defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: Fl_Screen_Driver - system menu bar #endif // Fl_Sys_Menu_Bar_H diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H index 84b2aba73..a7ddaa744 100644 --- a/FL/Fl_Tooltip.H +++ b/FL/Fl_Tooltip.H @@ -78,7 +78,6 @@ public: static Fl_Color textcolor() { return textcolor_; } /** Sets the color of the text in the tooltip. The default is black. */ static void textcolor(Fl_Color c) { textcolor_ = c; } -#if FLTK_ABI_VERSION >= 10301 /** Gets the amount of extra space left/right of the tooltip's text. Default is 3. */ static int margin_width() { return margin_width_; } /** Sets the amount of extra space left/right of the tooltip's text. Default is 3. */ @@ -91,22 +90,8 @@ public: static int wrap_width() { return wrap_width_; } /** Sets the maximum width for tooltip's text before it word wraps. Default is 400. */ static void wrap_width(int v) { wrap_width_ = v; } -#else - static int margin_width() { return 3; } - static int margin_height() { return 3; } - static int wrap_width() { return 400; } -#endif - -#ifdef __APPLE__ // PORTME: additional functionality? - // the unique tooltip window + /** Returns the window that is used for tooltips */ static Fl_Window* current_window(void); -#elif defined(WIN32) - // not needed -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: do you need to remember the tooltip parent window?" -#else // X11 - // not needed -#endif // These should not be public, but Fl_Widget::tooltip() needs them... // fabien: made it private with only a friend function access @@ -125,11 +110,9 @@ private: static Fl_Font font_; static Fl_Fontsize size_; static Fl_Widget* widget_; //!< Keeps track of the current target widget -#if FLTK_ABI_VERSION >= 10301 static int margin_width_; //!< distance around tooltip text left+right static int margin_height_; //!< distance around tooltip text top+bottom static int wrap_width_; //!< maximum width of tooltip text before it word wraps -#endif }; #endif diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index dc8a1579a..b4ba45034 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -79,7 +79,7 @@ class FL_EXPORT Fl_Window : public Fl_Group { #ifdef WIN32 HICON big_icon; HICON small_icon; -#elif defined(__APPLE__) // PORTME: per-window icons +#elif defined(__APPLE__) // PORTME: Fl_Window_Driver - per-window icons, move to FL_X/Fl_Window_Driver // not needed #elif defined(FL_PORTING) # pragma message "FL_PORTING: define storage for per-window icons here if needed" @@ -106,7 +106,7 @@ protected: int lw_; ///< width of shape image int lh_; ///< height of shape image Fl_Image* shape_; ///< shape image -#if defined(__APPLE__) // PORTME: per-window shape information +#if defined(__APPLE__) // PORTME: Fl_Window_Driver - per-window shape information, move to Fl_X/Fl_Window_Driver typedef struct CGImage* CGImageRef; CGImageRef mask; #elif defined(WIN32) @@ -130,7 +130,7 @@ public: \see void shape(const Fl_Image* img) */ inline void shape(const Fl_Image& b) { shape(&b); } -#if defined(WIN32) || defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: per-window shape +#if defined(WIN32) || defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: Fl_Window_Driver - per-window shape #elif defined(FL_PORTING) # pragma message "FL_PORTING: do you need a combine_mask() function in Fl_Window?" #else // X11 @@ -138,7 +138,6 @@ public: #endif private: - void size_range_(); void _Fl_Window(); // constructor innards void fullscreen_x(); // platform-specific part of sending a window to full screen @@ -457,7 +456,7 @@ public: #ifdef WIN32 static void default_icons(HICON big_icon, HICON small_icon); void icons(HICON big_icon, HICON small_icon); -#elif defined(__APPLE__) // PORTME: per-window icon +#elif defined(__APPLE__) // PORTME: Fl_Window_Driver - per-window icon // not needed #elif defined(FL_PORTING) # pragma message "FL_PORTING: define functions to handle window icons here if needed" diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index 5e2ab947e..e1dc45bdc 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -164,7 +164,7 @@ FL_EXPORT char *fl_utf8_to_locale(const char *s, int len, unsigned int codepage) /* OD: Attempt to convert a string in the current locale to UTF-8 */ FL_EXPORT char *fl_locale_to_utf8(const char *s, int len, unsigned int codepage); -#elif defined(__APPLE__) // PORTME: platform text encoding and conversion +#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver ? - platform text encoding and conversion // not needed #elif defined(FL_PORTING) # pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?" @@ -28,7 +28,7 @@ # ifdef WIN32 # include "win32.H" -# elif defined(__APPLE__) // PORTME: Fl_X Window Driver interface +# elif defined(__APPLE__) // PORTME: Fl_Window_Driver - Fl_X Window Driver interface # include "mac.H" # elif defined(ANDROID) # pragma message "A clean port requires a driver-style system for Fl_X" |
