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
This commit is contained in:
Matthias Melcher
2016-02-13 12:57:00 +00:00
parent 8deac1e6ba
commit 5d1df0e789
83 changed files with 361 additions and 330 deletions
+3 -3
View File
@@ -54,7 +54,7 @@ struct Fl_Label;
# else # else
# define FL_SOCKET int # define FL_SOCKET int
# endif # endif
#elif defined(__APPLE__) // PORTME: socket types #elif defined(__APPLE__) // PORTME: Fl_System_Driver - socket types
# define FL_SOCKET int # define FL_SOCKET int
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a type for FL_SOCKET" # pragma message "FL_PORTING: define a type for FL_SOCKET"
@@ -199,7 +199,7 @@ public: // should be private!
static Fl_Window* grab_; static Fl_Window* grab_;
static int compose_state; // used for dead keys (WIN32) or marked text (MacOS) static int compose_state; // used for dead keys (WIN32) or marked text (MacOS)
static void call_screen_init(); // recompute screen number and dimensions 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 reset_marked_text(); // resets marked text
static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
#elif defined(WIN32) #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 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 // not needed
#elif defined(WIN32) #elif defined(WIN32)
// not needed // not needed
+2 -2
View File
@@ -53,7 +53,7 @@ private:
int width; int width;
int height; int height;
Fl_Paged_Device *helper; Fl_Paged_Device *helper;
#ifdef __APPLE__ // PORTME: platform surface driver #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform surface driver
CFMutableDataRef pdfdata; CFMutableDataRef pdfdata;
CGContextRef oldgc; CGContextRef oldgc;
CGContextRef gc; CGContextRef gc;
@@ -86,7 +86,7 @@ public:
int h() { return height; } 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() */ /* Mac class to reimplement Fl_Paged_Device::printable_rect() */
class FL_EXPORT Fl_Quartz_Surface_ : public Fl_System_Printer { class FL_EXPORT Fl_Quartz_Surface_ : public Fl_System_Printer {
+1 -1
View File
@@ -239,7 +239,7 @@ public:
Fl::event_y() to the pixel units used by the OpenGL source code. Fl::event_y() to the pixel units used by the OpenGL source code.
\version 1.3.4 \version 1.3.4
*/ */
#ifdef __APPLE__ // PORTME: additional functionality #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - additional functionality
int pixels_per_unit(); int pixels_per_unit();
#elif defined(WIN32) #elif defined(WIN32)
int pixels_per_unit() { return 1; } int pixels_per_unit() { return 1; }
+1 -1
View File
@@ -51,7 +51,7 @@ typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
#ifdef WIN32 #ifdef WIN32
typedef int COORD_T; typedef int COORD_T;
# define XPOINT XPoint # 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 float COORD_T;
typedef struct { float x; float y; } QPoint; typedef struct { float x; float y; } QPoint;
# define XPOINT QPoint # define XPOINT QPoint
+2 -2
View File
@@ -50,7 +50,7 @@ private:
int width; int width;
int height; int height;
Fl_Paged_Device *helper; Fl_Paged_Device *helper;
#ifdef __APPLE__ // PORTME: platform image surface driver #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform image surface driver
#elif defined(WIN32) #elif defined(WIN32)
HDC _sgc; HDC _sgc;
Window _sw; Window _sw;
@@ -75,7 +75,7 @@ public:
Fl_Shared_Image *highres_image(); 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 */ /* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */
class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ { class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ {
public: public:
+4 -4
View File
@@ -40,7 +40,7 @@ typedef void fl_BROWSEINFOW;
# include <FL/filename.H> // FL_EXPORT # include <FL/filename.H> // FL_EXPORT
// Use Apple's chooser // 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 # define MAXFILTERS 80
# include <FL/filename.H> // FL_EXPORT # include <FL/filename.H> // FL_EXPORT
@@ -192,7 +192,7 @@ private:
void clear_filters(); void clear_filters();
void add_filter(const char *, const char *); 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: private:
int _btype; // kind-of browser to show() int _btype; // kind-of browser to show()
int _options; // general options 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 { class FL_EXPORT Fl_FLTK_File_Chooser {
friend class Fl_Native_File_Chooser; friend class Fl_Native_File_Chooser;
protected: protected:
@@ -328,7 +328,7 @@ private:
static int custom_gtk_filter_function(const GtkFileFilterInfo*, Fl_GTK_File_Chooser::pair*); static int custom_gtk_filter_function(const GtkFileFilterInfo*, Fl_GTK_File_Chooser::pair*);
static void free_pair(pair *p); 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*/ #endif /*FL_NATIVE_FILE_CHOOSER_H*/
+3 -3
View File
@@ -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_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); }; 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); }; void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); };
#elif defined(WIN32) #elif defined(WIN32)
// not needed // 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. 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 { 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; CGContextRef gc;
#elif defined(WIN32) #elif defined(WIN32)
// not needed // not needed
@@ -265,7 +265,7 @@ public:
void untranslate(void); void untranslate(void);
int end_page (void); int end_page (void);
void end_job(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(); } void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
#elif defined(WIN32) #elif defined(WIN32)
// not needed // not needed
+5 -5
View File
@@ -32,7 +32,7 @@
#include <stdio.h> #include <stdio.h>
#ifdef WIN32 #ifdef WIN32
#include <commdlg.h> #include <commdlg.h>
#elif defined(__APPLE__) // PORTME: platform printer driver #elif defined(__APPLE__) // PORTME: Fl_Surface_Driver ? - platform printer driver
// not needed // not needed
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: include files needed for printing support" # pragma message "FL_PORTING: include files needed for printing support"
@@ -40,7 +40,7 @@
#include <FL/Fl_PostScript.H> #include <FL/Fl_PostScript.H>
#endif #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. Print support under MSWindows and Mac OS.
@@ -54,7 +54,7 @@ private:
/** \brief the printer's graphics context, if there's one, NULL otherwise */ /** \brief the printer's graphics context, if there's one, NULL otherwise */
void *gc; void *gc;
void set_current(void); void set_current(void);
#ifdef __APPLE__ // PORTME: platform printer driver #ifdef __APPLE__ // PORTME: Fl_Surface_Driver ? - platform printer driver
float scale_x; float scale_x;
float scale_y; float scale_y;
float angle; // rotation angle in radians float angle; // rotation angle in radians
@@ -88,7 +88,7 @@ public:
void untranslate(void); void untranslate(void);
int end_page (void); int end_page (void);
void end_job (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); void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y);
#endif #endif
/** \brief The destructor */ /** \brief The destructor */
@@ -235,7 +235,7 @@ public:
~Fl_Printer(void); ~Fl_Printer(void);
private: 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; Fl_System_Printer *printer;
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: instantiate your own Fl_xxx_Printer here" # pragma message "FL_PORTING: instantiate your own Fl_xxx_Printer here"
+4
View File
@@ -44,6 +44,8 @@ protected:
public: public:
static Fl_Screen_Driver *newScreenDriver(); static Fl_Screen_Driver *newScreenDriver();
// --- display management
virtual void display(const char *disp);
// --- screen configuration // --- screen configuration
virtual void init() = 0; virtual void init() = 0;
virtual int x() = 0; virtual int x() = 0;
@@ -65,6 +67,8 @@ public:
virtual void beep(int type) = 0; virtual void beep(int type) = 0;
// --- global events // --- global events
virtual void flush() = 0; virtual void flush() = 0;
// --- global colors
virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b) = 0;
}; };
+2 -2
View File
@@ -22,7 +22,7 @@
#include "Fl_Menu_Bar.H" #include "Fl_Menu_Bar.H"
#include "x.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. 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; 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 #endif // Fl_Sys_Menu_Bar_H
+1 -18
View File
@@ -78,7 +78,6 @@ public:
static Fl_Color textcolor() { return textcolor_; } static Fl_Color textcolor() { return textcolor_; }
/** Sets the color of the text in the tooltip. The default is black. */ /** Sets the color of the text in the tooltip. The default is black. */
static void textcolor(Fl_Color c) { textcolor_ = c; } 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. */ /** Gets the amount of extra space left/right of the tooltip's text. Default is 3. */
static int margin_width() { return margin_width_; } static int margin_width() { return margin_width_; }
/** Sets the amount of extra space left/right of the tooltip's text. Default is 3. */ /** 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_; } static int wrap_width() { return wrap_width_; }
/** Sets the maximum width for tooltip's text before it word wraps. Default is 400. */ /** Sets the maximum width for tooltip's text before it word wraps. Default is 400. */
static void wrap_width(int v) { wrap_width_ = v; } static void wrap_width(int v) { wrap_width_ = v; }
#else /** Returns the window that is used for tooltips */
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
static Fl_Window* current_window(void); 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... // These should not be public, but Fl_Widget::tooltip() needs them...
// fabien: made it private with only a friend function access // fabien: made it private with only a friend function access
@@ -125,11 +110,9 @@ private:
static Fl_Font font_; static Fl_Font font_;
static Fl_Fontsize size_; static Fl_Fontsize size_;
static Fl_Widget* widget_; //!< Keeps track of the current target widget 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_width_; //!< distance around tooltip text left+right
static int margin_height_; //!< distance around tooltip text top+bottom static int margin_height_; //!< distance around tooltip text top+bottom
static int wrap_width_; //!< maximum width of tooltip text before it word wraps static int wrap_width_; //!< maximum width of tooltip text before it word wraps
#endif
}; };
#endif #endif
+4 -5
View File
@@ -79,7 +79,7 @@ class FL_EXPORT Fl_Window : public Fl_Group {
#ifdef WIN32 #ifdef WIN32
HICON big_icon; HICON big_icon;
HICON small_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 // not needed
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: define storage for per-window icons here if needed" # 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 lw_; ///< width of shape image
int lh_; ///< height of shape image int lh_; ///< height of shape image
Fl_Image* shape_; ///< 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; typedef struct CGImage* CGImageRef;
CGImageRef mask; CGImageRef mask;
#elif defined(WIN32) #elif defined(WIN32)
@@ -130,7 +130,7 @@ public:
\see void shape(const Fl_Image* img) \see void shape(const Fl_Image* img)
*/ */
inline void shape(const Fl_Image& b) { shape(&b); } 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) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need a combine_mask() function in Fl_Window?" # pragma message "FL_PORTING: do you need a combine_mask() function in Fl_Window?"
#else // X11 #else // X11
@@ -138,7 +138,6 @@ public:
#endif #endif
private: private:
void size_range_(); void size_range_();
void _Fl_Window(); // constructor innards void _Fl_Window(); // constructor innards
void fullscreen_x(); // platform-specific part of sending a window to full screen void fullscreen_x(); // platform-specific part of sending a window to full screen
@@ -457,7 +456,7 @@ public:
#ifdef WIN32 #ifdef WIN32
static void default_icons(HICON big_icon, HICON small_icon); static void default_icons(HICON big_icon, HICON small_icon);
void 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 // not needed
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: define functions to handle window icons here if needed" # pragma message "FL_PORTING: define functions to handle window icons here if needed"
+1 -1
View File
@@ -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 */ /* 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); 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 // not needed
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?" # pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?"
+1 -1
View File
@@ -28,7 +28,7 @@
# ifdef WIN32 # ifdef WIN32
# include "win32.H" # 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" # include "mac.H"
# elif defined(ANDROID) # elif defined(ANDROID)
# pragma message "A clean port requires a driver-style system for Fl_X" # pragma message "A clean port requires a driver-style system for Fl_X"
+16 -26
View File
@@ -60,7 +60,7 @@
#endif // DEBUG || DEBUG_WATCH #endif // DEBUG || DEBUG_WATCH
#ifdef WIN32 #ifdef WIN32
#elif defined(__APPLE__) // PORTME: window driver and main loop #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - window driver and main loop
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement global variables for your platform here" # pragma message "FL_PORTING: implement global variables for your platform here"
#else // X11 #else // X11
@@ -73,7 +73,7 @@ HBRUSH fl_brush_action(int action);
void fl_cleanup_pens(void); void fl_cleanup_pens(void);
void fl_release_dc(HWND,HDC); void fl_release_dc(HWND,HDC);
void fl_cleanup_dc_list(void); void fl_cleanup_dc_list(void);
#elif defined(__APPLE__) // PORTME: platform functions #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform functions
extern double fl_mac_flush_and_wait(double time_to_wait); extern double fl_mac_flush_and_wait(double time_to_wait);
#endif // WIN32 #endif // WIN32
@@ -159,7 +159,7 @@ bool Fl::cfg_sys_win32 = 0;
// //
// Globals... // Globals...
// //
#if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: platform text #if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: Fl_Screen_Driver - platform text
const char *Fl_Mac_App_Menu::about = "About %@"; const char *Fl_Mac_App_Menu::about = "About %@";
const char *Fl_Mac_App_Menu::print = "Print Front Window"; const char *Fl_Mac_App_Menu::print = "Print Front Window";
const char *Fl_Mac_App_Menu::services = "Services"; const char *Fl_Mac_App_Menu::services = "Services";
@@ -167,7 +167,7 @@ const char *Fl_Mac_App_Menu::hide = "Hide %@";
const char *Fl_Mac_App_Menu::hide_others = "Hide Others"; const char *Fl_Mac_App_Menu::hide_others = "Hide Others";
const char *Fl_Mac_App_Menu::show = "Show All"; const char *Fl_Mac_App_Menu::show = "Show All";
const char *Fl_Mac_App_Menu::quit = "Quit %@"; const char *Fl_Mac_App_Menu::quit = "Quit %@";
#endif // __APPLE__ // PORTME: platform text, system menu #endif // __APPLE__ // PORTME: Fl_Screen_Driver - platform text, system menu
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
Fl_Widget *Fl::belowmouse_, Fl_Widget *Fl::belowmouse_,
*Fl::pushed_, *Fl::pushed_,
@@ -341,7 +341,7 @@ int Fl::event_inside(const Fl_Widget *o) /*const*/ {
// implementation in Fl_win32.cxx // implementation in Fl_win32.cxx
#elif defined(__APPLE__) // PORTME: core stuff from screen, platform, and window driver #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - core stuff from screen, platform, and window driver
// implementation in Fl_cocoa.mm (was Fl_mac.cxx) // implementation in Fl_cocoa.mm (was Fl_mac.cxx)
@@ -644,7 +644,7 @@ double Fl::wait(double time_to_wait) {
return fl_wait(time_to_wait); return fl_wait(time_to_wait);
#elif defined(__APPLE__) // PORTME: platform fl_wait #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform fl_wait
run_checks(); run_checks();
return fl_mac_flush_and_wait(time_to_wait); return fl_mac_flush_and_wait(time_to_wait);
@@ -787,7 +787,7 @@ int Fl::check() {
\endcode \endcode
*/ */
int Fl::ready() { int Fl::ready() {
#if defined( WIN32 ) || defined(__APPLE__) // PORTME: platform timeouts #if defined( WIN32 ) || defined(__APPLE__) // PORTME: Fl_System_Driver - platform timeouts
// not used // not used
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: you may need to handle timers here." # pragma message "FL_PORTING: you may need to handle timers here."
@@ -1071,7 +1071,7 @@ void Fl::focus(Fl_Widget *o) {
if (!w1) w1 = o->window(); if (!w1) w1 = o->window();
while (w1) { win=w1; w1=win->window(); } while (w1) { win=w1; w1=win->window(); }
if (win) { if (win) {
#ifdef __APPLE__ // PORTME: platform window focus #ifdef __APPLE__ // PORTME: Fl_Window_Driver - platform window focus
if (fl_xfocus != win) { if (fl_xfocus != win) {
Fl_X *x = Fl_X::i(win); Fl_X *x = Fl_X::i(win);
if (x) x->set_key_window(); if (x) x->set_key_window();
@@ -1210,9 +1210,7 @@ void fl_fix_focus() {
} }
} }
#if !(defined(WIN32) || defined(__APPLE__)) // PORTME: platform selection
extern Fl_Widget *fl_selection_requestor; // from Fl_x.cxx extern Fl_Widget *fl_selection_requestor; // from Fl_x.cxx
#endif
// This function is called by ~Fl_Widget() and by Fl_Widget::deactivate() // This function is called by ~Fl_Widget() and by Fl_Widget::deactivate()
// and by Fl_Widget::hide(). It indicates that the widget does not want // and by Fl_Widget::hide(). It indicates that the widget does not want
@@ -1228,15 +1226,7 @@ void fl_throw_focus(Fl_Widget *o) {
#endif // DEBUG #endif // DEBUG
if (o->contains(Fl::pushed())) Fl::pushed_ = 0; if (o->contains(Fl::pushed())) Fl::pushed_ = 0;
#ifdef WIN32
// not used
#elif defined(__APPLE__) // PORTME: platform selection
// not used
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: platform specific code when deleting a window"
#else
if (o->contains(fl_selection_requestor)) fl_selection_requestor = 0; if (o->contains(fl_selection_requestor)) fl_selection_requestor = 0;
#endif
if (o->contains(Fl::belowmouse())) Fl::belowmouse_ = 0; if (o->contains(Fl::belowmouse())) Fl::belowmouse_ = 0;
if (o->contains(Fl::focus())) Fl::focus_ = 0; if (o->contains(Fl::focus())) Fl::focus_ = 0;
if (o == fl_xfocus) fl_xfocus = 0; if (o == fl_xfocus) fl_xfocus = 0;
@@ -1626,7 +1616,7 @@ extern void fl_destroy_xft_draw(Window);
#endif #endif
void Fl_Window::hide() { void Fl_Window::hide() {
#ifdef WIN32 #ifdef WIN32 // platform fix
// STR#3079: if there remains a window and a non-modal window, and the window is deleted, // STR#3079: if there remains a window and a non-modal window, and the window is deleted,
// the app remains running without any apparent window. // the app remains running without any apparent window.
// Bug mechanism: hiding an owner window unmaps the owned (non-modal) window(s) // Bug mechanism: hiding an owner window unmaps the owned (non-modal) window(s)
@@ -1659,7 +1649,7 @@ void Fl_Window::hide() {
Fl_X** pp = &Fl_X::first; Fl_X** pp = &Fl_X::first;
for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return; for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return;
*pp = ip->next; *pp = ip->next;
#ifdef __APPLE__ // PORTME: platform pointer handling #ifdef __APPLE__ // platform fix
// MacOS X manages a single pointer per application. Make sure that hiding // MacOS X manages a single pointer per application. Make sure that hiding
// a toplevel window will not leave us with some random pointer shape, or // a toplevel window will not leave us with some random pointer shape, or
// worst case, an invisible pointer // worst case, an invisible pointer
@@ -1708,7 +1698,7 @@ void Fl_Window::hide() {
if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0);
# endif # endif
} }
#elif defined(__APPLE_QUARTZ__) // PORTME: platform window unmapping #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window unmapping
Fl_X::q_release_context(ip); Fl_X::q_release_context(ip);
if ( ip->xid == fl_window ) if ( ip->xid == fl_window )
fl_window = 0; fl_window = 0;
@@ -1740,7 +1730,7 @@ void Fl_Window::hide() {
} }
delete[] doit; delete[] doit;
} }
#elif defined(__APPLE_QUARTZ__) // PORTME: platform window unmapping #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window unmapping
ip->destroy(); ip->destroy();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to destroy a window on screen" # pragma message "FL_PORTING: code to destroy a window on screen"
@@ -1774,13 +1764,13 @@ int Fl_Window::handle(int ev)
else { else {
#if defined(USE_X11) || defined(WIN32) #if defined(USE_X11) || defined(WIN32)
XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless
#elif defined(__APPLE_QUARTZ__) // PORTME: platform window mapping #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window mapping
i->map(); i->map();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to show a window on screen" # pragma message "FL_PORTING: code to show a window on screen"
#else #else
# error unsupported platform # error unsupported platform
#endif // __APPLE__ // PORTME: platform window mapping #endif // __APPLE__ // PORTME: Fl_Window_Driver - platform window mapping
} }
break; break;
case FL_HIDE: case FL_HIDE:
@@ -1798,7 +1788,7 @@ int Fl_Window::handle(int ev)
} }
#if defined(USE_X11) || defined(WIN32) #if defined(USE_X11) || defined(WIN32)
XUnmapWindow(fl_display, fl_xid(this)); XUnmapWindow(fl_display, fl_xid(this));
#elif defined(__APPLE_QUARTZ__) // PORTME: platform window unmapping, again #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window unmapping, again
i->unmap(); i->unmap();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to hide a window from screen" # pragma message "FL_PORTING: code to hide a window from screen"
@@ -1966,7 +1956,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
Fl_Region R = XRectangleRegion(X, Y, W, H); Fl_Region R = XRectangleRegion(X, Y, W, H);
CombineRgn(i->region, i->region, R, RGN_OR); CombineRgn(i->region, i->region, R, RGN_OR);
XDestroyRegion(R); XDestroyRegion(R);
#elif defined(__APPLE_QUARTZ__) // PORTME: platform damage region #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform damage region
CGRect arg = fl_cgrectmake_cocoa(X, Y, W, H); CGRect arg = fl_cgrectmake_cocoa(X, Y, W, H);
int j; // don't add a rectangle totally inside the Fl_Region int j; // don't add a rectangle totally inside the Fl_Region
for(j = 0; j < i->region->count; j++) { for(j = 0; j < i->region->count; j++) {
+7 -7
View File
@@ -21,7 +21,7 @@
#include <FL/Fl.H> #include <FL/Fl.H>
#if defined(__APPLE__) // PORTME: platform copy surface #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform copy surface
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
Fl_Quartz_Surface_::Fl_Quartz_Surface_(int w, int h) : Fl_System_Printer(), width(w), height(h) { Fl_Quartz_Surface_::Fl_Quartz_Surface_(int w, int h) : Fl_System_Printer(), width(w), height(h) {
@@ -75,7 +75,7 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
{ {
width = w; width = w;
height = h; height = h;
#ifdef __APPLE__ // PORTME: platform copy surface #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform copy surface
helper = new Fl_Quartz_Surface_(width, height); helper = new Fl_Quartz_Surface_(width, height);
driver(helper->driver()); driver(helper->driver());
prepare_copy_pdf_and_tiff(w, h); prepare_copy_pdf_and_tiff(w, h);
@@ -120,7 +120,7 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
*/ */
Fl_Copy_Surface::~Fl_Copy_Surface() Fl_Copy_Surface::~Fl_Copy_Surface()
{ {
#ifdef __APPLE__ // PORTME: platform copy surface #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform copy surface
complete_copy_pdf_and_tiff(); complete_copy_pdf_and_tiff();
fl_gc = oldgc; fl_gc = oldgc;
delete (Fl_Quartz_Surface_*)helper; delete (Fl_Quartz_Surface_*)helper;
@@ -165,7 +165,7 @@ void Fl_Copy_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
void Fl_Copy_Surface::set_current() void Fl_Copy_Surface::set_current()
{ {
#if defined(__APPLE__) || defined(WIN32) // PORTME: platform copy surface #if defined(__APPLE__) || defined(WIN32) // PORTME: Fl_Surface_Driver - platform copy surface
fl_gc = gc; fl_gc = gc;
fl_window = (Window)1; fl_window = (Window)1;
Fl_Surface_Device::set_current(); Fl_Surface_Device::set_current();
@@ -180,7 +180,7 @@ void Fl_Copy_Surface::set_current()
} }
#if defined(__APPLE__) // PORTME: platform copy surface #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform copy surface
size_t Fl_Copy_Surface::MyPutBytes(void* info, const void* buffer, size_t count) size_t Fl_Copy_Surface::MyPutBytes(void* info, const void* buffer, size_t count)
{ {
@@ -218,7 +218,7 @@ void Fl_Copy_Surface::prepare_copy_pdf_and_tiff(int w, int h)
CGContextSaveGState(gc); CGContextSaveGState(gc);
} }
#endif // __APPLE__ // PORTME: platform copy surface #endif // __APPLE__ // PORTME: Fl_Surface_Driver - platform copy surface
/** Copies a window and its borders and title bar to the clipboard. /** Copies a window and its borders and title bar to the clipboard.
@@ -232,7 +232,7 @@ void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int del
} }
#if defined(WIN32) #if defined(WIN32)
#elif defined(__APPLE__) // PORTME: platform copy surface #elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform copy surface
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need a helper class for your graphics driver" # pragma message "FL_PORTING: do you need a helper class for your graphics driver"
#elif !defined(FL_DOXYGEN) #elif !defined(FL_DOXYGEN)
+2 -2
View File
@@ -143,7 +143,7 @@ void Fl_Double_Window::flush(int eraseoverlay) {
clear_damage(FL_DAMAGE_ALL); clear_damage(FL_DAMAGE_ALL);
} }
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: call a function to clear any graphics port damage flags" # pragma message "FL_PORTING: Fl_Window_Driver - call a function to clear any graphics port damage flags"
#else #else
# error unsupported platform # error unsupported platform
#endif #endif
@@ -187,7 +187,7 @@ void Fl_Double_Window::flush(int eraseoverlay) {
//# if defined(FLTK_USE_CAIRO) //# if defined(FLTK_USE_CAIRO)
//if Fl::cairo_autolink_context() Fl::cairo_make_current(this); // capture gc changes automatically to update the cairo context adequately //if Fl::cairo_autolink_context() Fl::cairo_make_current(this); // capture gc changes automatically to update the cairo context adequately
//# endif //# endif
#elif defined(__APPLE__) // PORTME: platform double buffering #elif defined(__APPLE__) // PORTME: Fl_Window_Driver - platform double buffering
if ( myi->other_xid ) { if ( myi->other_xid ) {
fl_begin_offscreen( myi->other_xid ); fl_begin_offscreen( myi->other_xid );
fl_clip_region( 0 ); fl_clip_region( 0 );
+5 -5
View File
@@ -26,7 +26,7 @@
// Fl_File_Browser::filter() - Set the filename filter. // Fl_File_Browser::filter() - Set the filename filter.
// //
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform file browser #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the internals of your file browser here" # pragma message "FL_PORTING: implement the internals of your file browser here"
#else #else
@@ -62,11 +62,11 @@
# include <os2.h> # include <os2.h>
#endif // __EMX__ #endif // __EMX__
#if defined(__APPLE__) // PORTME: platform file browser #if defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
# include <sys/param.h> # include <sys/param.h>
# include <sys/ucred.h> # include <sys/ucred.h>
# include <sys/mount.h> # include <sys/mount.h>
#endif // __APPLE__ // PORTME: platform file browser #endif // __APPLE__ // PORTME: Fl_Screen_Driver - platform file browser
#if defined(_AIX) #if defined(_AIX)
extern "C" { extern "C" {
@@ -518,7 +518,7 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
num_files ++; num_files ++;
} }
#elif defined(__APPLE__) // PORTME: platform file browser #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
// MacOS X and Darwin use getfsstat() system call... // MacOS X and Darwin use getfsstat() system call...
int numfs; // Number of file systems int numfs; // Number of file systems
struct statfs *fs; // Buffer for file system info struct statfs *fs; // Buffer for file system info
@@ -664,7 +664,7 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
// window after requesting filesystem list. // window after requesting filesystem list.
add("/", icon); add("/", icon);
} }
#endif // WIN32 || __EMX__ || __APPLE__ || _AIX || ... // PORTME: platform file browser #endif // WIN32 || __EMX__ || __APPLE__ || _AIX || ... // PORTME: Fl_Screen_Driver - platform file browser
} }
else else
{ {
+1 -1
View File
@@ -357,7 +357,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform file browser #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the internals of your filechooser here" # pragma message "FL_PORTING: implement the internals of your filechooser here"
#else #else
+1 -1
View File
@@ -51,7 +51,7 @@
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <FL/filename.H> #include <FL/filename.H>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform file browser #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement file type interpretation here" # pragma message "FL_PORTING: implement file type interpretation here"
#else #else
+7 -7
View File
@@ -26,7 +26,7 @@
#include <config.h> #include <config.h>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform font stuff #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform font stuff
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement font descriptor details here" # pragma message "FL_PORTING: implement font descriptor details here"
#else #else
@@ -36,7 +36,7 @@
#if USE_XFT #if USE_XFT
typedef struct _XftFont XftFont; typedef struct _XftFont XftFont;
#elif defined(WIN32) #elif defined(WIN32)
#elif defined(__APPLE__) // PORTME: platform font stuff #elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform font stuff
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you want to include Xutf8.h?" # pragma message "FL_PORTING: do you want to include Xutf8.h?"
#else #else
@@ -61,7 +61,7 @@ public:
TEXTMETRIC metr; TEXTMETRIC metr;
int angle; int angle;
FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size); FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
# elif defined(__APPLE_QUARTZ__) // PORTME: platform font stuff # elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Graphics_Driver - platform font stuff
FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size); FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
ATSUTextLayout layout; ATSUTextLayout layout;
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
@@ -84,9 +84,9 @@ public:
# endif # endif
# if HAVE_GL # if HAVE_GL
unsigned int listbase;// base of display list, 0 = none unsigned int listbase;// base of display list, 0 = none
#ifndef __APPLE_QUARTZ__ // PORTME: platform font stuff #ifndef __APPLE_QUARTZ__ // PORTME: Fl_Graphics_Driver - platform font stuff
char glok[64]; char glok[64];
#endif // __APPLE_QUARTZ__ // PORTME: platform font stuff #endif // __APPLE_QUARTZ__ // PORTME: Fl_Graphics_Driver - platform font stuff
# endif // HAVE_GL # endif // HAVE_GL
FL_EXPORT ~Fl_Font_Descriptor(); FL_EXPORT ~Fl_Font_Descriptor();
@@ -101,7 +101,7 @@ struct Fl_Fontdesc {
char fontname[128]; // "Pretty" font name char fontname[128]; // "Pretty" font name
Fl_Font_Descriptor *first; // linked list of sizes of this style Fl_Font_Descriptor *first; // linked list of sizes of this style
#ifdef WIN32 #ifdef WIN32
#elif defined(__APPLE__) // PORTME: platform font stuff #elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform font stuff
char **xlist; // matched X font names char **xlist; // matched X font names
int n; // size of xlist, negative = don't free xlist! int n; // size of xlist, negative = don't free xlist!
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
@@ -115,7 +115,7 @@ struct Fl_Fontdesc {
extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
#ifdef WIN32 #ifdef WIN32
#elif defined(__APPLE__) // PORTME: platform font stuff #elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform font stuff
// functions for parsing X font names: // functions for parsing X font names:
FL_EXPORT const char* fl_font_word(const char *p, int n); FL_EXPORT const char* fl_font_word(const char *p, int n);
FL_EXPORT char *fl_find_fontsize(char *name); FL_EXPORT char *fl_find_fontsize(char *name);
+7 -7
View File
@@ -24,14 +24,14 @@
#include <FL/Fl_RGB_Image.H> #include <FL/Fl_RGB_Image.H>
#include "FL/Fl.H" #include "FL/Fl.H"
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform OpenGL management #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform OpenGL management
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement code to read OpenGL renderings into RGB maps" # pragma message "FL_PORTING: implement code to read OpenGL renderings into RGB maps"
#else #else
#endif #endif
#if defined(__APPLE__) // PORTME: platform OpenGL management #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform OpenGL management
uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth) uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
{ {
uchar *newimg = new uchar[3*w*h]; uchar *newimg = new uchar[3*w*h];
@@ -59,7 +59,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
stored from bottom to top. stored from bottom to top.
*/ */
{ {
#if defined(__APPLE__) // PORTME: platform OpenGL management #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform OpenGL management
const int bytesperpixel = 4; const int bytesperpixel = 4;
int factor = glw->pixels_per_unit(); int factor = glw->pixels_per_unit();
if (factor > 1) { if (factor > 1) {
@@ -81,14 +81,14 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
mByteWidth = (mByteWidth + 3) & ~3; // Align to 4 bytes mByteWidth = (mByteWidth + 3) & ~3; // Align to 4 bytes
uchar *baseAddress = new uchar[mByteWidth * h]; uchar *baseAddress = new uchar[mByteWidth * h];
glReadPixels(x, glw->pixel_h() - (y+h), w, h, glReadPixels(x, glw->pixel_h() - (y+h), w, h,
#if defined(__APPLE__) // PORTME: platform OpenGL management #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform OpenGL management
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
#else #else
GL_RGB, GL_UNSIGNED_BYTE, GL_RGB, GL_UNSIGNED_BYTE,
#endif #endif
baseAddress); baseAddress);
glPopClientAttrib(); glPopClientAttrib();
#if defined(__APPLE__) // PORTME: platform OpenGL management #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform OpenGL management
baseAddress = convert_BGRA_to_RGB(baseAddress, w, h, mByteWidth); baseAddress = convert_BGRA_to_RGB(baseAddress, w, h, mByteWidth);
mByteWidth = 3 * w; mByteWidth = 3 * w;
#endif #endif
@@ -97,7 +97,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
return img; return img;
} }
#ifdef __APPLE__ // PORTME: platform OpenGL management #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform OpenGL management
static void imgProviderReleaseData (void *info, const void *data, size_t size) static void imgProviderReleaseData (void *info, const void *data, size_t size)
{ {
delete (Fl_RGB_Image *)info; delete (Fl_RGB_Image *)info;
@@ -116,7 +116,7 @@ public:
Fl_Gl_Window *glw = w->as_gl_window(); Fl_Gl_Window *glw = w->as_gl_window();
if (!glw) return 0; if (!glw) return 0;
Fl_RGB_Image *img = capture_gl_rectangle(glw, 0, 0, glw->w(), glw->h()); Fl_RGB_Image *img = capture_gl_rectangle(glw, 0, 0, glw->w(), glw->h());
#ifdef __APPLE__ // PORTME: platform OpenGL management #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform OpenGL management
if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) {
// convert the image to CGImage, and draw it at full res (useful on retina display) // convert the image to CGImage, and draw it at full res (useful on retina display)
CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB(); CGColorSpaceRef cSpace = CGColorSpaceCreateDeviceRGB();
+4 -4
View File
@@ -26,7 +26,7 @@
#endif #endif
#if defined(WIN32) #if defined(WIN32)
#elif defined(__APPLE__) // PORTME: platform image surface #elif defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform image surface
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement image surface handling here" # pragma message "FL_PORTING: implement image surface handling here"
#else #else
@@ -80,7 +80,7 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h, int highres) : Fl_Surface_Devic
/** The destructor. /** The destructor.
*/ */
Fl_Image_Surface::~Fl_Image_Surface() { Fl_Image_Surface::~Fl_Image_Surface() {
#ifdef __APPLE__ // PORTME: platform image surface #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform image surface
void *data = CGBitmapContextGetData((CGContextRef)offscreen); void *data = CGBitmapContextGetData((CGContextRef)offscreen);
free(data); free(data);
CGContextRelease((CGContextRef)offscreen); CGContextRelease((CGContextRef)offscreen);
@@ -162,7 +162,7 @@ void Fl_Image_Surface::draw(Fl_Widget *widget, int delta_x, int delta_y)
void Fl_Image_Surface::set_current() void Fl_Image_Surface::set_current()
{ {
#if defined(__APPLE__) // PORTME: platform image surface #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform image surface
fl_gc = offscreen; fl_window = 0; fl_gc = offscreen; fl_window = 0;
Fl_Surface_Device::set_current(); Fl_Surface_Device::set_current();
Fl_X::set_high_resolution( CGBitmapContextGetWidth(offscreen) > width ); Fl_X::set_high_resolution( CGBitmapContextGetWidth(offscreen) > width );
@@ -186,7 +186,7 @@ void Fl_Image_Surface::set_current()
#endif #endif
} }
#if defined(__APPLE__) // PORTME: platform image surface #if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform image surface
Fl_Quartz_Flipped_Surface_::Fl_Quartz_Flipped_Surface_(int w, int h) : Fl_Quartz_Surface_(w, h) { Fl_Quartz_Flipped_Surface_::Fl_Quartz_Flipped_Surface_(int w, int h) : Fl_Quartz_Surface_(w, h) {
} }
+1 -1
View File
@@ -368,7 +368,7 @@ int Fl_Input::handle_key() {
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: platform compose
if (Fl::compose_state) { if (Fl::compose_state) {
this->mark( this->position() - Fl::compose_state ); this->mark( this->position() - Fl::compose_state );
} }
#endif #endif
return 1; return 1;
} }
+4 -4
View File
@@ -346,7 +346,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int offset2; int offset2;
if (pp <= e) x2 = xpos + (float)expandpos(p, pp, buf, &offset2); if (pp <= e) x2 = xpos + (float)expandpos(p, pp, buf, &offset2);
else offset2 = (int) strlen(buf); else offset2 = (int) strlen(buf);
#ifdef __APPLE__ // PORTME: Mac OS: underline marked ( = selected + Fl::compose_state != 0) text #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
if (Fl::compose_state) { if (Fl::compose_state) {
fl_color(textcolor()); fl_color(textcolor());
} }
@@ -358,7 +358,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
fl_color(fl_contrast(textcolor(), selection_color())); fl_color(fl_contrast(textcolor(), selection_color()));
} }
fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc)); fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc));
#ifdef __APPLE__ // PORTME: Mac OS: underline marked ( = selected + Fl::compose_state != 0) text #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
if (Fl::compose_state) { if (Fl::compose_state) {
fl_color( fl_color_average(textcolor(), color(), 0.6) ); fl_color( fl_color_average(textcolor(), color(), 0.6) );
float width = fl_width(buf+offset1, offset2-offset1); float width = fl_width(buf+offset1, offset2-offset1);
@@ -380,7 +380,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
CONTINUE2: CONTINUE2:
// draw the cursor: // draw the cursor:
if (Fl::focus() == this && ( if (Fl::focus() == this && (
#ifdef __APPLE__ // PORTME: compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - compose
Fl::compose_state || Fl::compose_state ||
#endif #endif
selstart == selend) && selstart == selend) &&
@@ -395,7 +395,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
} else { } else {
fl_rectf((int)(xpos+curx+0.5), Y+ypos, 2, height); fl_rectf((int)(xpos+curx+0.5), Y+ypos, 2, height);
} }
#ifdef __APPLE__ // PORTME: compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - compose
Fl::insertion_point_location(xpos+curx, Y+ypos+height, height); Fl::insertion_point_location(xpos+curx, Y+ypos+height, height);
#endif #endif
} }
+3 -3
View File
@@ -122,7 +122,7 @@ class menuwindow : public Fl_Menu_Window {
public: public:
menutitle* title; menutitle* title;
int handle(int); int handle(int);
#if defined (__APPLE__) || defined (USE_X11) // PORTME: menubar #if defined (__APPLE__) || defined (USE_X11) // PORTME: Fl_Screen_Driver - menubar
int early_hide_handle(int); int early_hide_handle(int);
#endif #endif
int itemheight; // zero == menubar int itemheight; // zero == menubar
@@ -653,7 +653,7 @@ static int backward(int menu) { // previous item in menu menu if possible
} }
int menuwindow::handle(int e) { int menuwindow::handle(int e) {
#if defined (__APPLE__) || defined (USE_X11) // PORTME: menubar #if defined (__APPLE__) || defined (USE_X11) // PORTME: Fl_Screen_Driver - menubar
// This off-route takes care of the "detached menu" bug on OS X. // This off-route takes care of the "detached menu" bug on OS X.
// Apple event handler requires that we hide all menu windows right // Apple event handler requires that we hide all menu windows right
// now, so that Carbon can continue undisturbed with handling window // now, so that Carbon can continue undisturbed with handling window
@@ -746,7 +746,7 @@ int menuwindow::early_hide_handle(int e) {
} }
break; break;
case FL_MOVE: case FL_MOVE:
#if ! (defined(WIN32) || defined(__APPLE__)) // PORTME: menubar #if ! (defined(WIN32) || defined(__APPLE__)) // PORTME: Fl_Screen_Driver - menubar
if (pp.state == DONE_STATE) { if (pp.state == DONE_STATE) {
return 1; // Fix for STR #2619 return 1; // Fix for STR #2619
} }
+1 -1
View File
@@ -21,7 +21,7 @@
#include "Fl_Native_File_Chooser_WIN32.cxx" #include "Fl_Native_File_Chooser_WIN32.cxx"
// Use Apple's chooser // Use Apple's chooser
#elif defined(__APPLE__) // PORTME: native file chooser #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - native file chooser
#include <FL/Fl_Native_File_Chooser.H> #include <FL/Fl_Native_File_Chooser.H>
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
+2 -2
View File
@@ -142,7 +142,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
win->make_current(); win->make_current();
uchar *image_data; uchar *image_data;
image_data = fl_read_image(NULL, x, y, w, h); image_data = fl_read_image(NULL, x, y, w, h);
#ifdef __APPLE__ // PORTME: platform paged device #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform paged device
Fl_X::q_release_context(); // matches make_current() call above Fl_X::q_release_context(); // matches make_current() call above
#endif #endif
if (save_front != win) save_front->show(); if (save_front != win) save_front->show();
@@ -324,7 +324,7 @@ void Fl_Paged_Device::draw_decorated_window(Fl_Window *win, int x_offset, int y_
this->print_widget(win, x_offset + wsides, y_offset + toph); this->print_widget(win, x_offset + wsides, y_offset + toph);
} }
#if !defined(__APPLE__) // PORTME: platform paged device // Mac OS version in Fl_Cocoa.mm #if !defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform paged device // Mac OS version in Fl_Cocoa.mm
void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset) void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
{ {
draw_decorated_window(win, x_offset, y_offset); draw_decorated_window(win, x_offset, y_offset);
+4 -4
View File
@@ -61,7 +61,7 @@ Fl_PostScript_Graphics_Driver::~Fl_PostScript_Graphics_Driver() {
*/ */
Fl_PostScript_File_Device::Fl_PostScript_File_Device(void) Fl_PostScript_File_Device::Fl_PostScript_File_Device(void)
{ {
#ifdef __APPLE__ // PORTME: platform PostScript #ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform PostScript
gc = fl_gc; // the display context is used by fl_text_extents() gc = fl_gc; // the display context is used by fl_text_extents()
#endif #endif
Fl_Surface_Device::driver( new Fl_PostScript_Graphics_Driver() ); Fl_Surface_Device::driver( new Fl_PostScript_Graphics_Driver() );
@@ -176,7 +176,7 @@ int Fl_PostScript_Graphics_Driver::clocale_printf(const char *format, ...)
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
#if ! (defined(__APPLE__) || defined(WIN32) ) // PORTME: platform PostScript #if ! (defined(__APPLE__) || defined(WIN32) ) // PORTME: Fl_Surface_Driver - platform PostScript
# include "print_panel.cxx" # include "print_panel.cxx"
#endif #endif
@@ -1562,7 +1562,7 @@ void Fl_PostScript_File_Device::end_job (void)
#endif // FL_DOXYGEN #endif // FL_DOXYGEN
#if defined(__APPLE__) // PORTME: platform PostScript #if defined(__APPLE__) // PORTME: Fl_Surface_Driver ? - platform PostScript
#elif defined(WIN32) #elif defined(WIN32)
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement postscript printing" # pragma message "FL_PORTING: implement postscript printing"
@@ -1664,7 +1664,7 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
return ps->start_postscript(pages, format, layout); // start printing return ps->start_postscript(pages, format, layout); // start printing
} }
#endif // ! (defined(__APPLE__) || defined(WIN32) ) // PORTME: platform PostScript #endif // ! (defined(__APPLE__) || defined(WIN32) ) // PORTME: Fl_Surface_Driver - platform PostScript
// //
+6 -6
View File
@@ -29,7 +29,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform Preferences #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_System_Driver - platform Preferences
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement some file storage in a designated place" # pragma message "FL_PORTING: implement some file storage in a designated place"
#else #else
@@ -43,7 +43,7 @@
// on Windows, which is supposed to be POSIX compliant... // on Windows, which is supposed to be POSIX compliant...
# define access _access # define access _access
# define mkdir _mkdir # define mkdir _mkdir
#elif defined (__APPLE__) // PORTME: platform Preferences #elif defined (__APPLE__) // PORTME: Fl_System_Driver - platform Preferences
# include <ApplicationServices/ApplicationServices.h> # include <ApplicationServices/ApplicationServices.h>
# include <unistd.h> # include <unistd.h>
# include <config.h> # include <config.h>
@@ -86,7 +86,7 @@ Fl_Preferences *Fl_Preferences::runtimePrefs = 0;
* The buffer is overwritten during every call to this function! * The buffer is overwritten during every call to this function!
*/ */
const char *Fl_Preferences::newUUID() { const char *Fl_Preferences::newUUID() {
#ifdef __APPLE__ // PORTME: platform Preferences #ifdef __APPLE__ // PORTME: Fl_System_Driver - platform Preferences
CFUUIDRef theUUID = CFUUIDCreate(NULL); CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFUUIDBytes b = CFUUIDGetUUIDBytes(theUUID); CFUUIDBytes b = CFUUIDGetUUIDBytes(theUUID);
sprintf(uuidBuffer, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", sprintf(uuidBuffer, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
@@ -1026,7 +1026,7 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char
snprintf(filename + strlen(filename), sizeof(filename) - strlen(filename), snprintf(filename + strlen(filename), sizeof(filename) - strlen(filename),
"/%s/%s.prefs", vendor, application); "/%s/%s.prefs", vendor, application);
for (char *s = filename; *s; s++) if (*s == '\\') *s = '/'; for (char *s = filename; *s; s++) if (*s == '\\') *s = '/';
#elif defined ( __APPLE__ ) // PORTME: platform Preferences #elif defined ( __APPLE__ ) // PORTME: Fl_System_Driver - platform Preferences
// TODO: verify that this is the Apple sanctioned way of finding these folders // TODO: verify that this is the Apple sanctioned way of finding these folders
// (On MSWindows, this frequently leads to issues with internationalized systems) // (On MSWindows, this frequently leads to issues with internationalized systems)
// Carbon: err = FindFolder( kLocalDomain, kPreferencesFolderType, 1, &spec.vRefNum, &spec.parID ); // Carbon: err = FindFolder( kLocalDomain, kPreferencesFolderType, 1, &spec.vRefNum, &spec.parID );
@@ -1168,7 +1168,7 @@ int Fl_Preferences::RootNode::write() {
fprintf( f, "; application: %s\n", application_ ); fprintf( f, "; application: %s\n", application_ );
prefs_->node->write( f ); prefs_->node->write( f );
fclose( f ); fclose( f );
#if !(defined(__APPLE__) || defined(WIN32)) // PORTME: platform Preferences #if !(defined(__APPLE__) || defined(WIN32)) // PORTME: Fl_System_Driver - platform Preferences
// unix: make sure that system prefs are user-readable // unix: make sure that system prefs are user-readable
if (strncmp(filename_, "/etc/fltk/", 10) == 0) { if (strncmp(filename_, "/etc/fltk/", 10) == 0) {
char *p; char *p;
@@ -1197,7 +1197,7 @@ char Fl_Preferences::RootNode::getPath( char *path, int pathlen ) {
if ( !s ) return 0; if ( !s ) return 0;
*s = 0; *s = 0;
char ret = fl_make_path( path ); char ret = fl_make_path( path );
#if !(defined(__APPLE__) || defined(WIN32)) // PORTME: platform Preferences #if !(defined(__APPLE__) || defined(WIN32)) // PORTME: Fl_System_Driver - platform Preferences
// unix: make sure that system prefs dir. is user-readable // unix: make sure that system prefs dir. is user-readable
if (strncmp(path, "/etc/fltk/", 10) == 0) { if (strncmp(path, "/etc/fltk/", 10) == 0) {
fl_chmod(path, 0755); // rwxr-xr-x fl_chmod(path, 0755); // rwxr-xr-x
+5 -5
View File
@@ -66,7 +66,7 @@ const char *Fl_Printer::property_cancel = NULL;
#else #else
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform printing #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform printing
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the printer device specifics" # pragma message "FL_PORTING: implement the printer device specifics"
#else #else
@@ -116,7 +116,7 @@ const char *Fl_Printer::property_save = "Save";
/** [this text may be customized at run-time] */ /** [this text may be customized at run-time] */
const char *Fl_Printer::property_cancel = "Cancel"; const char *Fl_Printer::property_cancel = "Cancel";
#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) // PORTME: platform printing #if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) // PORTME: Fl_Screen_Driver - platform printing
const char *Fl_System_Printer::class_id = Fl_Printer::class_id; const char *Fl_System_Printer::class_id = Fl_Printer::class_id;
#endif #endif
#if defined(__APPLE__) || defined(WIN32) #if defined(__APPLE__) || defined(WIN32)
@@ -126,10 +126,10 @@ const char *Fl_System_Printer::class_id = Fl_Printer::class_id;
const char *Fl_PostScript_Printer::class_id = Fl_Printer::class_id; const char *Fl_PostScript_Printer::class_id = Fl_Printer::class_id;
#endif #endif
#if defined(__APPLE__) || defined(WIN32) // PORTME: platform printing #if defined(__APPLE__) || defined(WIN32) // PORTME: Fl_Screen_Driver - platform printing
void Fl_System_Printer::set_current(void) void Fl_System_Printer::set_current(void)
{ {
#ifdef __APPLE__ // PORTME: platform printing #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform printing
fl_gc = (CGContextRef)gc; fl_gc = (CGContextRef)gc;
#elif defined(WIN32) #elif defined(WIN32)
fl_gc = (HDC)gc; fl_gc = (HDC)gc;
@@ -145,7 +145,7 @@ void Fl_System_Printer::origin(int *x, int *y)
#endif #endif
Fl_Printer::Fl_Printer(void) { Fl_Printer::Fl_Printer(void) {
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform printing #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform printing
printer = new Fl_System_Printer(); printer = new Fl_System_Printer();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the printer device specifics" # pragma message "FL_PORTING: implement the printer device specifics"
+5
View File
@@ -28,6 +28,11 @@ num_screens(-1)
} }
void Fl_Screen_Driver::display(const char *) {
// blank
}
void Fl_Screen_Driver::screen_xywh(int &X, int &Y, int &W, int &H) void Fl_Screen_Driver::screen_xywh(int &X, int &Y, int &W, int &H)
{ {
int x, y; int x, y;
+2 -2
View File
@@ -32,7 +32,7 @@
* Many other calls of the parent class don't work. * Many other calls of the parent class don't work.
*/ */
#if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: platform system menu bar #if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: Fl_Screen_Driver - platform system menu bar
#include <FL/Fl_Menu_Item.H> #include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Sys_Menu_Bar.H> #include <FL/Fl_Sys_Menu_Bar.H>
#include <FL/x.H> #include <FL/x.H>
@@ -524,7 +524,7 @@ void Fl_Mac_App_Menu::custom_application_menu_items(const Fl_Menu_Item *m)
[item release]; [item release];
} }
} }
#endif /* __APPLE__ */ // PORTME: platform system menu bar #endif /* __APPLE__ */ // PORTME: Fl_Screen_Driver - platform system menu bar
// //
// End of "$Id$". // End of "$Id$".
+6 -6
View File
@@ -31,7 +31,7 @@
#include <FL/Fl_Text_Display.H> #include <FL/Fl_Text_Display.H>
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform editor feel #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform editor feel
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: look out for some code that visualizes character composing" # pragma message "FL_PORTING: look out for some code that visualizes character composing"
#else #else
@@ -2144,7 +2144,7 @@ void Fl_Text_Display::draw_string(int style,
if (style & PRIMARY_MASK) { if (style & PRIMARY_MASK) {
if (Fl::focus() == (Fl_Widget*)this) { if (Fl::focus() == (Fl_Widget*)this) {
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
if (Fl::compose_state) background = color();// Mac OS: underline marked text if (Fl::compose_state) background = color();// Mac OS: underline marked text
else else
#endif #endif
@@ -2181,7 +2181,7 @@ void Fl_Text_Display::draw_string(int style,
if (!(style & BG_ONLY_MASK)) { if (!(style & BG_ONLY_MASK)) {
fl_color( foreground ); fl_color( foreground );
fl_font( font, fsize ); fl_font( font, fsize );
#if !(defined(__APPLE__) || defined(WIN32)) && USE_XFT // PORTME: platform editor feel #if !(defined(__APPLE__) || defined(WIN32)) && USE_XFT // PORTME: Fl_Graphics_Driver - platform editor feel (fix this: fonts should not leak!)
// makes sure antialiased ÄÖÜ do not leak on line above // makes sure antialiased ÄÖÜ do not leak on line above
fl_push_clip(X, Y, toX - X, mMaxsize); fl_push_clip(X, Y, toX - X, mMaxsize);
#endif #endif
@@ -2277,7 +2277,7 @@ void Fl_Text_Display::draw_cursor( int X, int Y ) {
if ( X < text_area.x - 1 || X > text_area.x + text_area.w ) if ( X < text_area.x - 1 || X > text_area.x + text_area.w )
return; return;
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
Fl::insertion_point_location(X, bot, fontHeight); Fl::insertion_point_location(X, bot, fontHeight);
#endif #endif
/* For cursors other than the block, make them around 2/3 of a character /* For cursors other than the block, make them around 2/3 of a character
@@ -3703,7 +3703,7 @@ void Fl_Text_Display::draw(void) {
int has_selection = buffer()->selection_position(&start, &end); int has_selection = buffer()->selection_position(&start, &end);
if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE) if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE)
&& ( && (
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
Fl::compose_state || Fl::compose_state ||
#endif #endif
!has_selection || mCursorPos < start || mCursorPos > end) && !has_selection || mCursorPos < start || mCursorPos > end) &&
@@ -3881,7 +3881,7 @@ int Fl_Text_Display::handle(int event) {
if (dragType==DRAG_START_DND) { if (dragType==DRAG_START_DND) {
if (!Fl::event_is_click() && Fl::dnd_text_ops()) { if (!Fl::event_is_click() && Fl::dnd_text_ops()) {
const char* copy = buffer()->selection_text(); const char* copy = buffer()->selection_text();
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform behavior
Fl_X::dnd(1); Fl_X::dnd(1);
#else #else
Fl::dnd(); Fl::dnd();
+6 -6
View File
@@ -25,7 +25,7 @@
#include <FL/Fl_Text_Editor.H> #include <FL/Fl_Text_Editor.H>
#include <FL/fl_ask.H> #include <FL/fl_ask.H>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform editor #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform editor
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: add common shortcut for your platform here" # pragma message "FL_PORTING: add common shortcut for your platform here"
#else #else
@@ -146,7 +146,7 @@ static struct {
{ FL_Insert, FL_SHIFT, Fl_Text_Editor::kf_paste }, { FL_Insert, FL_SHIFT, Fl_Text_Editor::kf_paste },
{ 'a', FL_CTRL, Fl_Text_Editor::kf_select_all }, { 'a', FL_CTRL, Fl_Text_Editor::kf_select_all },
#ifdef __APPLE__ // PORTME: platform editor feel #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform editor feel
// Define CMD+key accelerators... // Define CMD+key accelerators...
{ 'z', FL_COMMAND, Fl_Text_Editor::kf_undo }, { 'z', FL_COMMAND, Fl_Text_Editor::kf_undo },
{ 'x', FL_COMMAND, Fl_Text_Editor::kf_cut }, { 'x', FL_COMMAND, Fl_Text_Editor::kf_cut },
@@ -161,7 +161,7 @@ static struct {
{ FL_Right, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move }, { FL_Right, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
{ FL_Up, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move }, { FL_Up, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
{ FL_Down, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move }, { FL_Down, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
#endif // __APPLE__ // PORTME: platform editor feel #endif // __APPLE__ // PORTME: Fl_Screen_Driver - platform editor feel
{ 0, 0, 0 } { 0, 0, 0 }
}; };
@@ -543,11 +543,11 @@ int Fl_Text_Editor::handle_key() {
if (insert_mode()) insert(Fl::event_text()); if (insert_mode()) insert(Fl::event_text());
else overstrike(Fl::event_text()); else overstrike(Fl::event_text());
} }
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
if (Fl::compose_state) { if (Fl::compose_state) {
int pos = this->insert_position(); int pos = this->insert_position();
this->buffer()->select(pos - Fl::compose_state, pos); this->buffer()->select(pos - Fl::compose_state, pos);
} }
#endif #endif
show_insert_position(); show_insert_position();
set_changed(); set_changed();
@@ -586,7 +586,7 @@ int Fl_Text_Editor::handle(int event) {
case FL_UNFOCUS: case FL_UNFOCUS:
show_cursor(mCursorOn); // redraws the cursor show_cursor(mCursorOn); // redraws the cursor
#ifdef __APPLE__ // PORTME: platform compose #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
if (buffer()->selected() && Fl::compose_state) { if (buffer()->selected() && Fl::compose_state) {
int pos = insert_position(); int pos = insert_position();
buffer()->select(pos, pos); buffer()->select(pos, pos);
+1 -6
View File
@@ -31,11 +31,9 @@ Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK; Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
Fl_Font Fl_Tooltip::font_ = FL_HELVETICA; Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
Fl_Fontsize Fl_Tooltip::size_ = -1; Fl_Fontsize Fl_Tooltip::size_ = -1;
#if FLTK_ABI_VERSION >= 10301
int Fl_Tooltip::margin_width_ = 3; int Fl_Tooltip::margin_width_ = 3;
int Fl_Tooltip::margin_height_ = 3; int Fl_Tooltip::margin_height_ = 3;
int Fl_Tooltip::wrap_width_ = 400; int Fl_Tooltip::wrap_width_ = 400;
#endif
static const char* tip; static const char* tip;
@@ -75,13 +73,10 @@ Fl_Widget* Fl_Tooltip::widget_ = 0;
static Fl_TooltipBox *window = 0; static Fl_TooltipBox *window = 0;
static int Y,H; static int Y,H;
#ifdef __APPLE__ // PORTME: platform additonal function
// returns the unique tooltip window
Fl_Window *Fl_Tooltip::current_window(void) Fl_Window *Fl_Tooltip::current_window(void)
{ {
return (Fl_Window*)window; return (Fl_Window*)window;
} }
#endif
void Fl_TooltipBox::layout() { void Fl_TooltipBox::layout() {
fl_font(Fl_Tooltip::font(), Fl_Tooltip::size()); fl_font(Fl_Tooltip::font(), Fl_Tooltip::size());
@@ -156,7 +151,7 @@ static void tooltip_timeout(void*) {
if (window) window->hide(); if (window) window->hide();
} else { } else {
int condition = 1; int condition = 1;
#if !(defined(__APPLE__) || defined(WIN32)) // PORTME: platform ?? #if !(defined(__APPLE__) || defined(WIN32)) // PORTME: Fl_Screen_Driver - platform ??
condition = (Fl::grab() == NULL); condition = (Fl::grab() == NULL);
#endif #endif
if ( condition ) { if ( condition ) {
+1 -1
View File
@@ -869,7 +869,7 @@ static void draw_item_focus(Fl_Boxtype B, Fl_Color fg, Fl_Color bg, int X, int Y
} }
fl_color(fl_contrast(fg, bg)); fl_color(fl_contrast(fg, bg));
#if defined(USE_X11) || defined(__APPLE_QUARTZ__) // PORTME: platform look and feel #if defined(USE_X11) || defined(__APPLE_QUARTZ__) // PORTME: Fl_Graphics_Driver - platform look and feel
fl_line_style(FL_DOT); fl_line_style(FL_DOT);
fl_rect(X + Fl::box_dx(B), Y + Fl::box_dy(B), fl_rect(X + Fl::box_dx(B), Y + Fl::box_dy(B),
W - Fl::box_dw(B) - 1, H - Fl::box_dh(B) - 1); W - Fl::box_dw(B) - 1, H - Fl::box_dh(B) - 1);
+7 -7
View File
@@ -28,7 +28,7 @@
// These can be replaced via prefs.openicon()/closeicon() // These can be replaced via prefs.openicon()/closeicon()
// //
static const char * const L_open_xpm[] = { static const char * const L_open_xpm[] = {
#ifdef __APPLE__ // PORTME: platform look and feel #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform look and feel
"11 11 2 1", "11 11 2 1",
". c None", ". c None",
"@ c #000000", "@ c #000000",
@@ -43,7 +43,7 @@ static const char * const L_open_xpm[] = {
"...@@@.....", "...@@@.....",
"...@@......", "...@@......",
"...@......." "...@......."
#else /* __APPLE__ */ // PORTME: platform look and feel #else /* __APPLE__ */ // PORTME: Fl_Screen_Driver - platform look and feel
"11 11 3 1", "11 11 3 1",
". c #fefefe", ". c #fefefe",
"# c #444444", "# c #444444",
@@ -59,12 +59,12 @@ static const char * const L_open_xpm[] = {
"#.........#", "#.........#",
"#.........#", "#.........#",
"###########" "###########"
#endif /* __APPLE__ */ // PORTME: platform look and feel #endif /* __APPLE__ */ // PORTME: Fl_Screen_Driver - platform look and feel
}; };
static Fl_Pixmap L_openpixmap(L_open_xpm); static Fl_Pixmap L_openpixmap(L_open_xpm);
static const char * const L_close_xpm[] = { static const char * const L_close_xpm[] = {
#ifdef __APPLE__ // PORTME: platform look and feel #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform look and feel
"11 11 2 1", "11 11 2 1",
". c None", ". c None",
"@ c #000000", "@ c #000000",
@@ -79,7 +79,7 @@ static const char * const L_close_xpm[] = {
".....@.....", ".....@.....",
"...........", "...........",
"..........." "..........."
#else /* __APPLE__ */ // PORTME: platform look and feel #else /* __APPLE__ */ // PORTME: Fl_Screen_Driver - platform look and feel
"11 11 3 1", "11 11 3 1",
". c #fefefe", ". c #fefefe",
"# c #444444", "# c #444444",
@@ -95,7 +95,7 @@ static const char * const L_close_xpm[] = {
"#.........#", "#.........#",
"#.........#", "#.........#",
"###########" "###########"
#endif /* __APPLE__ */ // PORTME: platform look and feel #endif /* __APPLE__ */ // PORTME: Fl_Screen_Driver - platform look and feel
}; };
static Fl_Pixmap L_closepixmap(L_close_xpm); static Fl_Pixmap L_closepixmap(L_close_xpm);
@@ -157,7 +157,7 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() {
_labelfgcolor = FL_BLACK; _labelfgcolor = FL_BLACK;
_labelbgcolor = 0xffffffff; // we use this as 'transparent' _labelbgcolor = 0xffffffff; // we use this as 'transparent'
_connectorcolor = Fl_Color(43); _connectorcolor = Fl_Color(43);
#ifdef __APPLE__ // PORTME: platform look and feel #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform look and feel
_connectorstyle = FL_TREE_CONNECTOR_NONE; _connectorstyle = FL_TREE_CONNECTOR_NONE;
#else /* __APPLE__ */ #else /* __APPLE__ */
_connectorstyle = FL_TREE_CONNECTOR_DOTTED; _connectorstyle = FL_TREE_CONNECTOR_DOTTED;
+3 -3
View File
@@ -90,7 +90,7 @@ Fl_Window::~Fl_Window() {
delete icon_; delete icon_;
if (shape_data_) { if (shape_data_) {
if (shape_data_->todelete_) delete shape_data_->todelete_; if (shape_data_->todelete_) delete shape_data_->todelete_;
#if defined(__APPLE__) // PORTME: platform window driver #if defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
if (shape_data_->mask) { if (shape_data_->mask) {
CGImageRelease(shape_data_->mask); CGImageRelease(shape_data_->mask);
} }
@@ -404,7 +404,7 @@ void Fl_Window::free_icons() {
} }
#ifndef __APPLE__ // PORTME: platform window driver #ifndef __APPLE__ // PORTME: Fl_Window_Driver - platform window driver
/** /**
Waits for the window to be displayed after calling show(). Waits for the window to be displayed after calling show().
@@ -482,7 +482,7 @@ void Fl_Window::capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Im
#endif #endif
#endif // ! __APPLE__ // PORTME: platform window driver #endif // ! __APPLE__ // PORTME: Fl_Window_Driver - platform window driver
// //
// End of "$Id$". // End of "$Id$".
+1 -1
View File
@@ -45,7 +45,7 @@ void Fl_Window::border(int b) {
#elif defined(WIN32) #elif defined(WIN32)
// not yet implemented, but it's possible // not yet implemented, but it's possible
// for full fullscreen we have to make the window topmost as well // for full fullscreen we have to make the window topmost as well
#elif defined(__APPLE_QUARTZ__) // PORTME: platform window driver #elif defined(__APPLE_QUARTZ__) // PORTME: Fl_Window_Driver - platform window driver
// warning: not implemented in Quartz/Carbon // warning: not implemented in Quartz/Carbon
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "handle window border setting" # pragma message "handle window border setting"
+1 -1
View File
@@ -49,7 +49,7 @@ void Fl_Window::hotspot(int X, int Y, int offscreen) {
top = bottom = GetSystemMetrics(SM_CYFIXEDFRAME); top = bottom = GetSystemMetrics(SM_CYFIXEDFRAME);
} }
top += GetSystemMetrics(SM_CYCAPTION); top += GetSystemMetrics(SM_CYCAPTION);
#elif defined(__APPLE__) // PORTME: platform window driver #elif defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
top = 24; top = 24;
left = 2; left = 2;
right = 2; right = 2;
+1 -1
View File
@@ -27,7 +27,7 @@ void Fl_Window::iconize() {
} else { } else {
#ifdef WIN32 #ifdef WIN32
ShowWindow(i->xid, SW_SHOWMINNOACTIVE); ShowWindow(i->xid, SW_SHOWMINNOACTIVE);
#elif defined(__APPLE__) // PORTME: platform window driver #elif defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
i->collapse(); i->collapse();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to iconify a window" # pragma message "FL_PORTING: add code to iconify a window"
+8 -8
View File
@@ -24,7 +24,7 @@
#include <FL/Fl_Pixmap.H> #include <FL/Fl_Pixmap.H>
#include <string.h> #include <string.h>
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform window driver #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to implement arbitrarily shaped windows" # pragma message "FL_PORTING: add code to implement arbitrarily shaped windows"
#else #else
@@ -32,7 +32,7 @@
#ifdef WIN32 #ifdef WIN32
# include <malloc.h> // needed for VisualC2010 # include <malloc.h> // needed for VisualC2010
#elif !defined(__APPLE__) // PORTME: platform window driver #elif !defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
#include <config.h> #include <config.h>
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
#include <dlfcn.h> #include <dlfcn.h>
@@ -42,7 +42,7 @@
#endif #endif
#if defined(__APPLE__) // PORTME: platform window driver #if defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
static void MyProviderReleaseData (void *info, const void *data, size_t size) { static void MyProviderReleaseData (void *info, const void *data, size_t size) {
delete[] (uchar*)data; delete[] (uchar*)data;
@@ -175,12 +175,12 @@ void Fl_Window::combine_mask()
} }
#endif // !FL_DOXYGEN #endif // !FL_DOXYGEN
#endif // __APPLE__ // PORTME: platform window driver #endif // __APPLE__ // PORTME: Fl_Window_Driver - platform window driver
void Fl_Window::shape_bitmap_(Fl_Image* b) { void Fl_Window::shape_bitmap_(Fl_Image* b) {
shape_data_->shape_ = b; shape_data_->shape_ = b;
#if defined(__APPLE__) // PORTME: platform window driver #if defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
if (b) { if (b) {
// complement mask bits and perform bitwise inversion of all bytes and also reverse top and bottom // complement mask bits and perform bitwise inversion of all bytes and also reverse top and bottom
int bytes_per_row = (b->w() + 7)/8; int bytes_per_row = (b->w() + 7)/8;
@@ -201,7 +201,7 @@ void Fl_Window::shape_bitmap_(Fl_Image* b) {
} }
#if defined(__APPLE__) // on the mac, use an 8-bit mask // PORTME: platform window driver #if defined(__APPLE__) // on the mac, use an 8-bit mask // PORTME: Fl_Window_Driver - platform window driver
/* the image can be of any depth /* the image can be of any depth
offset gives the byte offset from the pixel start to the byte used to construct the shape offset gives the byte offset from the pixel start to the byte used to construct the shape
*/ */
@@ -325,7 +325,7 @@ void Fl_Window::shape_pixmap_(Fl_Image* pixmap) {
void Fl_Window::shape(const Fl_Image* img) { void Fl_Window::shape(const Fl_Image* img) {
if (shape_data_) { if (shape_data_) {
if (shape_data_->todelete_) { delete shape_data_->todelete_; } if (shape_data_->todelete_) { delete shape_data_->todelete_; }
#if defined(__APPLE__) // PORTME: platform window driver #if defined(__APPLE__) // PORTME: Fl_Window_Driver - platform window driver
if (shape_data_->mask) { CGImageRelease(shape_data_->mask); } if (shape_data_->mask) { CGImageRelease(shape_data_->mask); }
#endif #endif
} }
@@ -391,7 +391,7 @@ void Fl_Window::draw() {
} }
draw_children(); draw_children();
#ifdef __APPLE_QUARTZ__ // PORTME: platform window driver #ifdef __APPLE_QUARTZ__ // PORTME: Fl_Window_Driver - platform window driver
// on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right // on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right
// corner. This code draws a little ribbed triangle for dragging. // corner. This code draws a little ribbed triangle for dragging.
if (fl_mac_os_version < 100700 && fl_gc && !parent() && resizable() && if (fl_mac_os_version < 100700 && fl_gc && !parent() && resizable() &&
+1 -1
View File
@@ -26,7 +26,7 @@
#include <stdarg.h> #include <stdarg.h>
#include "flstring.h" #include "flstring.h"
#if defined(WIN32) || defined(__APPLE__) // PORTME: native message box #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - native message box
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: use native message box below if one is available" # pragma message "FL_PORTING: use native message box below if one is available"
#else #else
+11 -11
View File
@@ -28,13 +28,13 @@
#include <ctype.h> #include <ctype.h>
#include "flstring.h" #include "flstring.h"
#if defined(WIN32) || defined(__APPLE__) // PORTME: command line arguments #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_System_Driver - command line arguments
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement special command line handling" # pragma message "FL_PORTING: implement special command line handling"
#else #else
#endif #endif
#if defined(WIN32) || defined(__APPLE__) || defined(FL_PORTING) // PORTME: parse geometry #if defined(WIN32) || defined(__APPLE__) || defined(FL_PORTING) // PORTME: Fl_System_Driver - parse geometry
int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*); int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*);
# define NoValue 0x0000 # define NoValue 0x0000
# define XValue 0x0001 # define XValue 0x0001
@@ -175,13 +175,13 @@ int Fl::arg(int argc, char **argv, int &i) {
Fl_Tooltip::disable(); Fl_Tooltip::disable();
i++; i++;
return 1; return 1;
#ifdef __APPLE__ // PORTME: platform command line #ifdef __APPLE__ // PORTME: Fl_System_Driver - platform command line
// The Finder application in MacOS X passes the "-psn_N_NNNNN" option // The Finder application in MacOS X passes the "-psn_N_NNNNN" option
// to all apps... // to all apps...
} else if (strncmp(s, "psn_", 4) == 0) { } else if (strncmp(s, "psn_", 4) == 0) {
i++; i++;
return 1; return 1;
#endif // __APPLE__ // PORTME: platform command line #endif // __APPLE__ // PORTME: Fl_System_Driver - platform command line
} }
const char *v = argv[i+1]; const char *v = argv[i+1];
@@ -195,16 +195,16 @@ int Fl::arg(int argc, char **argv, int &i) {
if (!flags) return 0; if (!flags) return 0;
geometry = v; geometry = v;
#if !defined(WIN32) && !defined(__APPLE__) // PORTME: platform command line #if !defined(WIN32) && !defined(__APPLE__) // PORTME: Fl_System_Driver - platform command line
} else if (fl_match(s, "display", 2)) { } else if (fl_match(s, "display", 2)) {
Fl::display(v); Fl::display(v);
#endif #endif
#ifdef __APPLE__ // PORTME: platform command line #ifdef __APPLE__ // PORTME: Fl_System_Driver - platform command line
// Xcode in MacOS X may pass "-NSDocumentRevisionsDebugMode YES" // Xcode in MacOS X may pass "-NSDocumentRevisionsDebugMode YES"
} else if (strcmp(s, "NSDocumentRevisionsDebugMode") == 0) { } else if (strcmp(s, "NSDocumentRevisionsDebugMode") == 0) {
// nothing to do // nothing to do
#endif // __APPLE__ // PORTME: platform command line #endif // __APPLE__ // PORTME: Fl_System_Driver - platform command line
} else if (fl_match(s, "title", 2)) { } else if (fl_match(s, "title", 2)) {
title = v; title = v;
@@ -303,7 +303,7 @@ void Fl_Window::show(int argc, char **argv) {
Fl::get_system_colors(); Fl::get_system_colors();
#if defined(WIN32) #if defined(WIN32)
#elif defined(__APPLE__) // PORTME: platform default parameters #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver- platform default parameters
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: Parse additional default settings" # pragma message "FL_PORTING: Parse additional default settings"
#else // X11 #else // X11
@@ -367,7 +367,7 @@ void Fl_Window::show(int argc, char **argv) {
show(); show();
#if defined(WIN32) #if defined(WIN32)
#elif defined(__APPLE__) // PORTME: platform properties #elif defined(__APPLE__) // PORTME: Fl_System_Driver - platform properties
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: Parse additional default settings" # pragma message "FL_PORTING: Parse additional default settings"
#else // X11 #else // X11
@@ -380,7 +380,7 @@ void Fl_Window::show(int argc, char **argv) {
XChangeProperty(fl_display, fl_xid(this), XA_WM_COMMAND, XA_STRING, 8, 0, XChangeProperty(fl_display, fl_xid(this), XA_WM_COMMAND, XA_STRING, 8, 0,
(unsigned char *)buffer, p-buffer-1); (unsigned char *)buffer, p-buffer-1);
delete[] buffer; delete[] buffer;
#endif // !WIN32 && !__APPLE__ // PORTME: platform properties #endif // !WIN32 && !__APPLE__ // PORTME: Fl_System_Driver - platform properties
} }
// Calls useful for simple demo programs, with automatic help message: // Calls useful for simple demo programs, with automatic help message:
@@ -417,7 +417,7 @@ void Fl::args(int argc, char **argv) {
int i; if (Fl::args(argc,argv,i) < argc) Fl::error(helpmsg); int i; if (Fl::args(argc,argv,i) < argc) Fl::error(helpmsg);
} }
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform command line arguments #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_System_Driver - platform command line arguments
/* the following function was stolen from the X sources as indicated. */ /* the following function was stolen from the X sources as indicated. */
+12 -10
View File
@@ -26,12 +26,12 @@ Utility functions to support text input.
#ifndef FL_DOXYGEN #ifndef FL_DOXYGEN
int Fl::compose_state = 0; int Fl::compose_state = 0;
#ifdef __APPLE__ // PORTME: platform character composition #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform character composition
int Fl_X::next_marked_length = 0; int Fl_X::next_marked_length = 0;
#endif #endif
#endif #endif
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform character composition #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform character composition
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard composing in the code below" # pragma message "FL_PORTING: implement keyboard composing in the code below"
#else // X11 #else // X11
@@ -80,23 +80,23 @@ extern XIC fl_xim_ic;
*/ */
int Fl::compose(int& del) { int Fl::compose(int& del) {
int condition; int condition;
#if defined(__APPLE__) // PORTME: platform character composition #if defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform character composition
int has_text_key = Fl::compose_state || Fl::e_keysym <= '~' || Fl::e_keysym == FL_Iso_Key || int has_text_key = Fl::compose_state || Fl::e_keysym <= '~' || Fl::e_keysym == FL_Iso_Key ||
(Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last && Fl::e_keysym != FL_KP_Enter); (Fl::e_keysym >= FL_KP && Fl::e_keysym <= FL_KP_Last && Fl::e_keysym != FL_KP_Enter);
condition = Fl::e_state&(FL_META | FL_CTRL) || condition = Fl::e_state&(FL_META | FL_CTRL) ||
(Fl::e_keysym >= FL_Shift_L && Fl::e_keysym <= FL_Alt_R) || // called from flagsChanged (Fl::e_keysym >= FL_Shift_L && Fl::e_keysym <= FL_Alt_R) || // called from flagsChanged
!has_text_key ; !has_text_key ;
#else #else
unsigned char ascii = (unsigned char)e_text[0]; unsigned char ascii = (unsigned char)e_text[0];
#if defined(WIN32) #if defined(WIN32)
condition = (e_state & (FL_ALT | FL_META)) && !(ascii & 128) ; condition = (e_state & (FL_ALT | FL_META)) && !(ascii & 128) ;
#else #else
condition = (e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) ; condition = (e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) ;
#endif // WIN32 #endif // WIN32
#endif // __APPLE__ // PORTME: platform character composition #endif // __APPLE__ // PORTME: Fl_Screen_Driver - platform character composition
if (condition) { del = 0; return 0;} // this stuff is to be treated as a function key if (condition) { del = 0; return 0;} // this stuff is to be treated as a function key
del = Fl::compose_state; del = Fl::compose_state;
#ifdef __APPLE__ // PORTME: platform character composition #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform character composition
Fl::compose_state = Fl_X::next_marked_length; Fl::compose_state = Fl_X::next_marked_length;
#else #else
Fl::compose_state = 0; Fl::compose_state = 0;
@@ -106,7 +106,7 @@ unsigned char ascii = (unsigned char)e_text[0];
return 1; return 1;
} }
#ifdef __APPLE__ // PORTME: platform character composition #ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform character composition
static int insertion_point_x = 0; static int insertion_point_x = 0;
static int insertion_point_y = 0; static int insertion_point_y = 0;
static int insertion_point_height = 0; static int insertion_point_height = 0;
@@ -116,7 +116,8 @@ void Fl::reset_marked_text() {
Fl::compose_state = 0; Fl::compose_state = 0;
Fl_X::next_marked_length = 0; Fl_X::next_marked_length = 0;
insertion_point_location_is_valid = false; insertion_point_location_is_valid = false;
} }
int Fl_X::insertion_point_location(int *px, int *py, int *pheight) int Fl_X::insertion_point_location(int *px, int *py, int *pheight)
// return true if the current coordinates of the insertion point are available // return true if the current coordinates of the insertion point are available
{ {
@@ -126,13 +127,14 @@ int Fl_X::insertion_point_location(int *px, int *py, int *pheight)
*pheight = insertion_point_height; *pheight = insertion_point_height;
return true; return true;
} }
void Fl::insertion_point_location(int x, int y, int height) { void Fl::insertion_point_location(int x, int y, int height) {
insertion_point_location_is_valid = true; insertion_point_location_is_valid = true;
insertion_point_x = x; insertion_point_x = x;
insertion_point_y = y; insertion_point_y = y;
insertion_point_height = height; insertion_point_height = height;
} }
#endif // __APPLE__ // PORTME: platform character composition #endif // __APPLE__ // PORTME: Fl_Screen_Driver - platform character composition
/** /**
If the user moves the cursor, be sure to call Fl::compose_reset(). If the user moves the cursor, be sure to call Fl::compose_reset().
@@ -143,7 +145,7 @@ void Fl::insertion_point_location(int x, int y, int height) {
void Fl::compose_reset() void Fl::compose_reset()
{ {
Fl::compose_state = 0; Fl::compose_state = 0;
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform character composition #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform character composition
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: compose reset extra functions" # pragma message "FL_PORTING: compose reset extra functions"
#else #else
+11 -23
View File
@@ -20,32 +20,20 @@
// Using setenv makes programs that are exec'd use the same display. // Using setenv makes programs that are exec'd use the same display.
#include <FL/Fl.H> #include <FL/Fl.H>
#include <stdlib.h> #include <FL/Fl_Screen_Driver.H>
#include "flstring.h"
/** /**
Sets the X display to use for all windows. Actually this just sets \brief Sets the X display to use for all windows.
the environment variable $DISPLAY to the passed string, so this only
works before you show() the first window or otherwise open the display, Actually this just sets the environment variable $DISPLAY to the passed string,
and does nothing useful under WIN32. so this only works before you show() the first window or otherwise open the
display.
This does nothing on other platforms.
*/ */
void Fl::display(const char *d) { void Fl::display(const char *d)
#if defined(__APPLE__) || defined(WIN32) // PORTME: platform screen stuff {
(void)d; screen_driver()->display(d);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: initiate a connection to the display"
#else
static char e[1024];
strcpy(e,"DISPLAY=");
strlcat(e,d,sizeof(e));
for (char *c = e+8; *c!=':'; c++) {
if (!*c) {
strlcat(e,":0.0",sizeof(e));
break;
}
}
putenv(e);
#endif // __APPLE__ // PORTME: platform screen stuff
} }
// //
+1 -1
View File
@@ -18,7 +18,7 @@
#ifdef WIN32 #ifdef WIN32
# include "Fl_get_key_win32.cxx" # include "Fl_get_key_win32.cxx"
#elif defined(__APPLE__) // PORTME: platform keyboard stuff #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform keyboard stuff
# include "Fl_get_key_mac.cxx" # include "Fl_get_key_mac.cxx"
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard reading and interpretation in its own file" # pragma message "FL_PORTING: implement keyboard reading and interpretation in its own file"
+5 -41
View File
@@ -17,6 +17,7 @@
// //
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/Fl_Screen_Driver.H>
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <FL/x.H> #include <FL/x.H>
#include <FL/math.h> #include <FL/math.h>
@@ -92,47 +93,10 @@ static void set_selection_color(uchar r, uchar g, uchar b) {
Fl::set_color(FL_SELECTION_COLOR,r,g,b); Fl::set_color(FL_SELECTION_COLOR,r,g,b);
} }
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform system colors
# include <stdio.h>
// simulation of XParseColor:
int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) { int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) {
if (*p == '#') p++; Fl::screen_driver()->parse_color(p, r, g, b);
size_t n = strlen(p);
size_t m = n/3;
const char *pattern = 0;
switch(m) {
case 1: pattern = "%1x%1x%1x"; break;
case 2: pattern = "%2x%2x%2x"; break;
case 3: pattern = "%3x%3x%3x"; break;
case 4: pattern = "%4x%4x%4x"; break;
default: return 0;
}
int R,G,B; if (sscanf(p,pattern,&R,&G,&B) != 3) return 0;
switch(m) {
case 1: R *= 0x11; G *= 0x11; B *= 0x11; break;
case 3: R >>= 4; G >>= 4; B >>= 4; break;
case 4: R >>= 8; G >>= 8; B >>= 8; break;
}
r = (uchar)R; g = (uchar)G; b = (uchar)B;
return 1;
} }
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement fl_parse_color"
int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) { return 0; }
#else
// Wrapper around XParseColor...
int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) {
XColor x;
if (!fl_display) fl_open_display();
if (XParseColor(fl_display, fl_colormap, p, &x)) {
r = (uchar)(x.red>>8);
g = (uchar)(x.green>>8);
b = (uchar)(x.blue>>8);
return 1;
} else return 0;
}
#endif // WIN32 || __APPLE__ // PORTME: platform system colors
/** \fn Fl::get_system_colors() /** \fn Fl::get_system_colors()
@@ -172,7 +136,7 @@ void Fl::get_system_colors() {
getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color); getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color);
} }
#elif defined(__APPLE__) // PORTME: platform system colors #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform system colors
// MacOS X currently supports two color schemes - Blue and Graphite. // MacOS X currently supports two color schemes - Blue and Graphite.
// Since we aren't emulating the Aqua interface (even if Apple would // Since we aren't emulating the Aqua interface (even if Apple would
@@ -300,7 +264,7 @@ static Fl_Pixmap tile(tile_xpm);
int Fl::scheme(const char *s) { int Fl::scheme(const char *s) {
if (!s) { if (!s) {
if ((s = getenv("FLTK_SCHEME")) == NULL) { if ((s = getenv("FLTK_SCHEME")) == NULL) {
#if defined(WIN32) || defined(__APPLE__) // PORTME: platform system scheme #if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform system scheme
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement Fl::scheme" # pragma message "FL_PORTING: implement Fl::scheme"
#else #else
@@ -309,7 +273,7 @@ int Fl::scheme(const char *s) {
if (!key) key = "fltk"; if (!key) key = "fltk";
fl_open_display(); fl_open_display();
s = XGetDefault(fl_display, key, "scheme"); s = XGetDefault(fl_display, key, "scheme");
#endif // !WIN32 && !__APPLE__ // PORTME: platform system scheme #endif // !WIN32 && !__APPLE__ // PORTME: Fl_Screen_Driver - platform system scheme
} }
} }
+3 -3
View File
@@ -36,7 +36,7 @@ extern void fl_fix_focus(); // in Fl.cxx
// see where and how this is used. // see where and how this is used.
extern HWND fl_capture; extern HWND fl_capture;
#elif defined(__APPLE__) // PORTME: platform focus grabbing #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform focus grabbing
extern void *fl_capture; extern void *fl_capture;
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
@@ -61,7 +61,7 @@ void Fl::grab(Fl_Window* win) {
#ifdef WIN32 #ifdef WIN32
SetActiveWindow(fl_capture = fl_xid(first_window())); SetActiveWindow(fl_capture = fl_xid(first_window()));
SetCapture(fl_capture); SetCapture(fl_capture);
#elif defined(__APPLE__) // PORTME: platform focus grabbing #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform focus grabbing
fl_capture = Fl_X::i(first_window())->xid; fl_capture = Fl_X::i(first_window())->xid;
Fl_X::i(first_window())->set_key_window(); Fl_X::i(first_window())->set_key_window();
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
@@ -92,7 +92,7 @@ void Fl::grab(Fl_Window* win) {
#ifdef WIN32 #ifdef WIN32
fl_capture = 0; fl_capture = 0;
ReleaseCapture(); ReleaseCapture();
#elif defined(__APPLE__) // PORTME: platform focus grabbing #elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform focus grabbing
fl_capture = 0; fl_capture = 0;
#elif defined(FL_PORTING) #elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement event grabbing" # pragma message "FL_PORTING: implement event grabbing"

Some files were not shown because too many files have changed in this diff Show More