summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-11 12:02:36 +0000
commit50ee3bcd66c4baa6bb3388f5b955d726bfc6bdd8 (patch)
tree4b62978d21ee57df7027461b8ea2846c17308d11 /FL
parenta3c0dac034c919c2714f3f129a9f5d9d26ae3de4 (diff)
Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Enumerations.H4
-rw-r--r--FL/Fl.H6
-rw-r--r--FL/Fl_Cairo.H2
-rw-r--r--FL/Fl_Copy_Surface.H4
-rw-r--r--FL/Fl_Gl_Window.H2
-rw-r--r--FL/Fl_Graphics_Driver.H2
-rw-r--r--FL/Fl_Image_Surface.H4
-rw-r--r--FL/Fl_Menu_Item.H2
-rw-r--r--FL/Fl_Native_File_Chooser.H8
-rw-r--r--FL/Fl_PostScript.H6
-rw-r--r--FL/Fl_Printer.H10
-rw-r--r--FL/Fl_Sys_Menu_Bar.H4
-rw-r--r--FL/Fl_Tooltip.H2
-rw-r--r--FL/Fl_Window.H8
-rw-r--r--FL/fl_utf8.h4
-rw-r--r--FL/gl.h6
-rw-r--r--FL/glu.h2
-rw-r--r--FL/mac.H1
-rw-r--r--FL/x.H2
19 files changed, 39 insertions, 40 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 4bfba5052..2983dfc69 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -574,7 +574,7 @@ enum Fl_When { // Fl_Widget::when():
#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
// FIXME: Unicode needs 24 bits!
-#ifdef __APPLE__
+#ifdef __APPLE__ // look and feel
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
#elif defined(FL_PORTING)
@@ -584,7 +584,7 @@ enum Fl_When { // Fl_Widget::when():
#else
# define FL_COMMAND FL_CTRL ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_META ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
-#endif // __APPLE__
+#endif // __APPLE__ look and feel
/*@}*/ // group: Event States
diff --git a/FL/Fl.H b/FL/Fl.H
index 0615a280d..31f0a567b 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -54,7 +54,7 @@ struct Fl_Label;
# else
# define FL_SOCKET int
# endif
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: socket types
# define FL_SOCKET int
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a type for FL_SOCKET"
@@ -199,7 +199,7 @@ public: // should be private!
static Fl_Window* grab_;
static int compose_state; // used for dead keys (WIN32) or marked text (MacOS)
static void call_screen_init(); // recompute screen number and dimensions
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: additional functions
static void reset_marked_text(); // resets marked text
static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
#elif defined(WIN32)
@@ -907,7 +907,7 @@ int main() {
*/
static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: additional functions
// not needed
#elif defined(WIN32)
// not needed
diff --git a/FL/Fl_Cairo.H b/FL/Fl_Cairo.H
index 2637ecc28..10e68392a 100644
--- a/FL/Fl_Cairo.H
+++ b/FL/Fl_Cairo.H
@@ -33,7 +33,7 @@
# include <cairo-xlib.h>
#elif defined(WIN32)
# include <cairo-win32.h>
-#elif defined(__APPLE_QUARTZ__)
+#elif defined(__APPLE_QUARTZ__) // PORTME: Cairo Support
# include <cairo-quartz.h>
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: is the Cairo library available on this platform?"
diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H
index b598e8dd0..9488175d3 100644
--- a/FL/Fl_Copy_Surface.H
+++ b/FL/Fl_Copy_Surface.H
@@ -53,7 +53,7 @@ private:
int width;
int height;
Fl_Paged_Device *helper;
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform surface driver
CFMutableDataRef pdfdata;
CGContextRef oldgc;
CGContextRef gc;
@@ -86,7 +86,7 @@ public:
int h() { return height; }
};
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: platform surface driver
/* Mac class to reimplement Fl_Paged_Device::printable_rect() */
class FL_EXPORT Fl_Quartz_Surface_ : public Fl_System_Printer {
diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H
index 2fd5f9804..f18f8a526 100644
--- a/FL/Fl_Gl_Window.H
+++ b/FL/Fl_Gl_Window.H
@@ -239,7 +239,7 @@ public:
Fl::event_y() to the pixel units used by the OpenGL source code.
\version 1.3.4
*/
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: additional functionality
int pixels_per_unit();
#elif defined(WIN32)
int pixels_per_unit() { return 1; }
diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H
index 1b5452bed..6a544d7be 100644
--- a/FL/Fl_Graphics_Driver.H
+++ b/FL/Fl_Graphics_Driver.H
@@ -51,7 +51,7 @@ typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
#ifdef WIN32
typedef int COORD_T;
# define XPOINT XPoint
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: platform specific types
typedef float COORD_T;
typedef struct { float x; float y; } QPoint;
# define XPOINT QPoint
diff --git a/FL/Fl_Image_Surface.H b/FL/Fl_Image_Surface.H
index d6ed05e55..29d951893 100644
--- a/FL/Fl_Image_Surface.H
+++ b/FL/Fl_Image_Surface.H
@@ -49,7 +49,7 @@ private:
int width;
int height;
Fl_Paged_Device *helper;
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform image surface driver
#elif defined(WIN32)
HDC _sgc;
Window _sw;
@@ -73,7 +73,7 @@ public:
void draw_decorated_window(Fl_Window* win, int delta_x = 0, int delta_y = 0);
};
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform surface driver
/* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */
class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ {
public:
diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H
index 3c2b5ebcf..d29751afc 100644
--- a/FL/Fl_Menu_Item.H
+++ b/FL/Fl_Menu_Item.H
@@ -22,7 +22,7 @@
# include "Fl_Widget.H"
# include "Fl_Image.H"
-# if (defined(__APPLE__) || defined(FL_PORTING)) && defined(check)
+# if (defined(__APPLE__) || defined(FL_PORTING)) && defined(check) // name conflict
# undef check
# endif
diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H
index 2fdb8b555..5e9d51bbe 100644
--- a/FL/Fl_Native_File_Chooser.H
+++ b/FL/Fl_Native_File_Chooser.H
@@ -40,7 +40,7 @@ typedef void fl_BROWSEINFOW;
# include <FL/filename.H> // FL_EXPORT
// Use Apple's chooser
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: native file chooser support
# define MAXFILTERS 80
# include <FL/filename.H> // FL_EXPORT
@@ -192,7 +192,7 @@ private:
void clear_filters();
void add_filter(const char *, const char *);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: native file chooser support
private:
int _btype; // kind-of browser to show()
int _options; // general options
@@ -244,7 +244,7 @@ private:
};
-#if !defined(__APPLE__) && !defined(WIN32) && !defined(FL_PORTING)
+#if !defined(__APPLE__) && !defined(WIN32) && !defined(FL_PORTING) // PORTME: FLTK file chooser option
class FL_EXPORT Fl_FLTK_File_Chooser {
friend class Fl_Native_File_Chooser;
protected:
@@ -328,7 +328,7 @@ private:
static int custom_gtk_filter_function(const GtkFileFilterInfo*, Fl_GTK_File_Chooser::pair*);
static void free_pair(pair *p);
};
-#endif // !defined(__APPLE__) && !defined(WIN32)
+#endif // !defined(__APPLE__) && !defined(WIN32) // PORTME: native file chooser option
#endif /*FL_NATIVE_FILE_CHOOSER_H*/
diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H
index e749451df..861fe590c 100644
--- a/FL/Fl_PostScript.H
+++ b/FL/Fl_PostScript.H
@@ -199,7 +199,7 @@ class Clip {
void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1);
void draw(const char* s, int nBytes, int x, int y) {transformed_draw(s,nBytes,x,y); };
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: additional functionality
void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); };
#elif defined(WIN32)
// not needed
@@ -233,7 +233,7 @@ class Clip {
two variants of which are usable and allow to specify what page format and layout are desired.
*/
class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device {
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform specifics for PostScript
CGContextRef gc;
#elif defined(WIN32)
// not needed
@@ -265,7 +265,7 @@ public:
void untranslate(void);
int end_page (void);
void end_job(void);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform specifics for PostScript
void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
#elif defined(WIN32)
// not needed
diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H
index 559cdcbaa..b975d0701 100644
--- a/FL/Fl_Printer.H
+++ b/FL/Fl_Printer.H
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifdef WIN32
#include <commdlg.h>
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: platform printer driver
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: include files needed for printing support"
@@ -40,7 +40,7 @@
#include <FL/Fl_PostScript.H>
#endif
-#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
+#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) // PORTME: platform printer driver
/**
Print support under MSWindows and Mac OS.
@@ -54,7 +54,7 @@ private:
/** \brief the printer's graphics context, if there's one, NULL otherwise */
void *gc;
void set_current(void);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform printer driver
float scale_x;
float scale_y;
float angle; // rotation angle in radians
@@ -88,7 +88,7 @@ public:
void untranslate(void);
int end_page (void);
void end_job (void);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: platform printer driver
void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y);
#endif
/** \brief The destructor */
@@ -235,7 +235,7 @@ public:
~Fl_Printer(void);
private:
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(WIN32) || defined(__APPLE__) // PORTME: system printer driver
Fl_System_Printer *printer;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: instantiate your own Fl_xxx_Printer here"
diff --git a/FL/Fl_Sys_Menu_Bar.H b/FL/Fl_Sys_Menu_Bar.H
index da80e8913..1103f599a 100644
--- a/FL/Fl_Sys_Menu_Bar.H
+++ b/FL/Fl_Sys_Menu_Bar.H
@@ -22,7 +22,7 @@
#include "Fl_Menu_Bar.H"
#include "x.H"
-#if defined(__APPLE__) || defined(FL_DOXYGEN)
+#if defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: system menu bar
/**
A class to create, modify and delete menus that appear on Mac OS X in the menu bar at the top of the screen.
@@ -105,7 +105,7 @@ typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
-#endif // defined(__APPLE__) || defined(FL_DOXYGEN)
+#endif // defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: system menu bar
#endif // Fl_Sys_Menu_Bar_H
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
index d0e905b22..84b2aba73 100644
--- a/FL/Fl_Tooltip.H
+++ b/FL/Fl_Tooltip.H
@@ -97,7 +97,7 @@ public:
static int wrap_width() { return 400; }
#endif
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: additional functionality?
// the unique tooltip window
static Fl_Window* current_window(void);
#elif defined(WIN32)
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index 1005e9469..a97b371c4 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -78,7 +78,7 @@ class FL_EXPORT Fl_Window : public Fl_Group {
#ifdef WIN32
HICON big_icon;
HICON small_icon;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: per-window icons
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define storage for per-window icons here if needed"
@@ -105,7 +105,7 @@ protected:
int lw_; ///< width of shape image
int lh_; ///< height of shape image
Fl_Image* shape_; ///< shape image
-#if defined(__APPLE__)
+#if defined(__APPLE__) // PORTME: per-window shape information
typedef struct CGImage* CGImageRef;
CGImageRef mask;
#elif defined(WIN32)
@@ -129,7 +129,7 @@ public:
\see void shape(const Fl_Image* img)
*/
inline void shape(const Fl_Image& b) { shape(&b); }
-#if defined(WIN32) || defined(__APPLE__) || defined(FL_DOXYGEN)
+#if defined(WIN32) || defined(__APPLE__) || defined(FL_DOXYGEN) // PORTME: per-window shape
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need a combine_mask() function in Fl_Window?"
#else // X11
@@ -456,7 +456,7 @@ public:
#ifdef WIN32
static void default_icons(HICON big_icon, HICON small_icon);
void icons(HICON big_icon, HICON small_icon);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: per-window icon
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define functions to handle window icons here if needed"
diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h
index 2b283400d..5e2ab947e 100644
--- a/FL/fl_utf8.h
+++ b/FL/fl_utf8.h
@@ -53,7 +53,7 @@
# undef chdir
# define chdir _chdir
# endif
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: should not be in the header
# include <wchar.h>
# include <sys/stat.h>
# define xchar wchar_t
@@ -164,7 +164,7 @@ FL_EXPORT char *fl_utf8_to_locale(const char *s, int len, unsigned int codepage)
/* OD: Attempt to convert a string in the current locale to UTF-8 */
FL_EXPORT char *fl_locale_to_utf8(const char *s, int len, unsigned int codepage);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) // PORTME: platform text encoding and conversion
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?"
diff --git a/FL/gl.h b/FL/gl.h
index 2d2fdc274..4cf6ca902 100644
--- a/FL/gl.h
+++ b/FL/gl.h
@@ -54,11 +54,11 @@
# endif
# endif
-# ifdef __APPLE__
+# ifdef __APPLE__ // PORTME: OpenGL path abstraction
# include <OpenGL/gl.h>
# else
# include <GL/gl.h>
-# endif // __APPLE__
+# endif // __APPLE__ // PORTME: OpenGL Path abstraction
FL_EXPORT void gl_start();
FL_EXPORT void gl_finish();
@@ -89,7 +89,7 @@ FL_EXPORT void gl_draw(const char*, int n, int x, int y);
FL_EXPORT void gl_draw(const char*, int n, float x, float y);
FL_EXPORT void gl_draw(const char*, int x, int y, int w, int h, Fl_Align);
FL_EXPORT void gl_measure(const char*, int& x, int& y);
-#ifdef __APPLE__
+#ifdef __APPLE__ // PORTME: OpenGL platform texture
extern FL_EXPORT void gl_texture_pile_height(int max);
extern FL_EXPORT int gl_texture_pile_height();
#elif defined(WIN32)
diff --git a/FL/glu.h b/FL/glu.h
index 6795b762f..4ab7b1ea2 100644
--- a/FL/glu.h
+++ b/FL/glu.h
@@ -38,7 +38,7 @@
# endif
# endif
-# ifdef __APPLE__
+# ifdef __APPLE__ // PORTME: OpenGL Path abstraction
# include <OpenGL/glu.h>
# else
# include <GL/glu.h>
diff --git a/FL/mac.H b/FL/mac.H
index 178af4191..314a58ff5 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -138,7 +138,6 @@ extern NSCursor *fl_default_cursor;
// This object contains all mac-specific stuff about a window:
// WARNING: this object is highly subject to change!
class Fl_X {
-
public:
Window xid; // pointer to the Cocoa window object (FLWindow*)
Fl_Offscreen other_xid; // pointer for offscreen bitmaps (overlay window)
diff --git a/FL/x.H b/FL/x.H
index 8ad59bade..9adcf48c6 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -28,7 +28,7 @@
# ifdef WIN32
# include "win32.H"
-# elif defined(__APPLE__)
+# elif defined(__APPLE__) // PORTME: Fl_X Window Driver interface
# include "mac.H"
# elif defined(ANDROID)
# pragma message "A clean port requires a driver-style system for Fl_X"