Updated platform specific #if's to report unimplemented code when compiling with FL_PORTING defined and WIN32 and __APPLE__ undefined>

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10989 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2016-01-03 22:54:29 +00:00
parent 933b00b9c9
commit acf6c881d3
89 changed files with 628 additions and 47 deletions

View File

@ -577,6 +577,10 @@ enum Fl_When { // Fl_Widget::when():
#ifdef __APPLE__
# 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)
# pragma message "FL_PORTING: you need to define aliases for FL_COMMAND and FL_CONTROL"
# define FL_COMMAND FL_CTRL
# define FL_CONTROL FL_META
#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

27
FL/Fl.H
View File

@ -50,6 +50,11 @@ struct Fl_Label;
# else
# define FL_SOCKET int
# endif
#elif defined(__APPLE__)
# define FL_SOCKET int
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a type for FL_SOCKET"
# define FL_SOCKET int // default if not ported
#else
# define FL_SOCKET int
#endif
@ -158,6 +163,13 @@ public: // should be private!
#ifdef __APPLE__
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)
// not needed in WIN32
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a type for FL_SOCKET"
// no default implementation
#else
// not needed in X11
#endif
#endif // FL_DOXYGEN
@ -856,9 +868,18 @@ public:
static void copy(const char* stuff, int len, int destination, const char *type);
static void copy(const char* stuff, int len, int destination = 0);
#endif
#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // platform dependent
#if defined(__APPLE__)
// not needed
#elif defined(WIN32)
// not needed
#elif defined(FL_DOXYGEN)
// don't show in documentation
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need to implement copy_image() ?"
// not implemented by default
#else
static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // X11 platform dependent
#endif
/**
Pastes the data from the selection buffer (\p source is 0) or the clipboard

View File

@ -48,6 +48,9 @@ public:
#if defined(__APPLE__) || defined(WIN32)
/** for internal use */
void *id_;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables to hold a native bitmap in Fl_Bitmap"
unsigned id_; // default if not ported
#else
/** for internal use */
unsigned id_;

View File

@ -29,15 +29,17 @@
# include <FL/Fl_Export.H>
# if defined(USE_X11) // X11
#if defined(USE_X11) // X11
# include <cairo-xlib.h>
# elif defined(WIN32)
#elif defined(WIN32)
# include <cairo-win32.h>
# elif defined(__APPLE_QUARTZ__)
#elif defined(__APPLE_QUARTZ__)
# include <cairo-quartz.h>
# else
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: is the Cairo library available on this platform?"
#else
# error Cairo is not supported on that platform.
# endif
#endif
/**
\addtogroup group_cairo

View File

@ -64,6 +64,9 @@ private:
#elif defined(WIN32)
HDC oldgc;
HDC gc;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables to hold a native offscreen bitmap in Fl_Copy_Surface"
// no default implementation
#else // Xlib
Fl_Offscreen xid;
Window oldwindow;
@ -115,6 +118,10 @@ public:
virtual ~Fl_GDI_Surface_();
};
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a drawing surface for your platform"
#elif !defined(FL_DOXYGEN)
/* Xlib class to implement translate()/untranslate() */

View File

@ -57,6 +57,11 @@ typedef float COORD_T;
typedef struct { float x; float y; } QPoint;
# define XPOINT QPoint
extern float fl_quartz_line_width_;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define types for COORD_T and XPOINT"
typedef int COORD_T; // default if not ported
typedef struct { int x; int y; } QPoint;
# define XPOINT QPoint
#else
typedef short COORD_T;
# define XPOINT XPoint
@ -131,6 +136,13 @@ private:
#ifdef WIN32
int numcount;
int counts[20];
#elif defined(__APPLE__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables for Fl_Graphics_Driver if needed."
// not needed
#else
// not needed in X11
#endif
Fl_Font_Descriptor *font_descriptor_;
void transformed_vertex0(COORD_T x, COORD_T y);
@ -166,6 +178,12 @@ protected:
friend void fl_draw(const char *str, int n, int x, int y);
#ifdef __APPLE__
friend void fl_draw(const char *str, int n, float x, float y);
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add floating point text positioning if your platform supports it"
#else
// not needed
#endif
friend void fl_draw(int angle, const char *str, int n, int x, int y);
friend void fl_rtl_draw(const char *str, int n, int x, int y);
@ -251,6 +269,12 @@ protected:
virtual void draw(const char *str, int n, int x, int y) {}
#ifdef __APPLE__
virtual void draw(const char *str, int n, float x, float y) { draw(str, n, (int)(x+0.5), (int)(y+0.5));}
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add floating point text positioning if your platform supports it"
#else
// not needed
#endif
/** \brief see fl_draw(int angle, const char *str, int n, int x, int y). */
virtual void draw(int angle, const char *str, int n, int x, int y) {}
@ -412,7 +436,9 @@ public:
virtual ~Fl_Graphics_Driver() { if (p) free(p); }
};
#if defined(__APPLE__) || defined(FL_DOXYGEN)
#if defined(__APPLE__)
/**
\brief The Mac OS X-specific graphics class.
*
@ -449,8 +475,9 @@ public:
#endif
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
};
#endif
#if defined(WIN32) || defined(FL_DOXYGEN)
#elif defined(WIN32) || defined(FL_DOXYGEN)
/**
\brief The MSWindows-specific graphics class.
*
@ -497,8 +524,13 @@ public:
void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
int draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP);
};
#endif
#if !(defined(__APPLE__) || defined(WIN32))
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a native graphics driver Fl_xxx_Graphics_Driver"
#else // X11
/**
\brief The Xlib-specific graphics class.
*
@ -531,6 +563,7 @@ public:
void copy_offscreen_with_alpha(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
#endif
};
#endif
/**
@ -590,6 +623,10 @@ class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
friend class Fl_Graphics_Driver;
static bool high_res_window_; //< true when drawing to a window of a retina display (Mac OS X only)
static bool high_resolution() {return high_res_window_;}
#elif defined(WIN32)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement functions for extra high res drawing if your platform supports it"
#else
#endif
public:
static const char *class_id;

View File

@ -240,6 +240,10 @@ public:
*/
#ifdef __APPLE__
int pixels_per_unit();
#elif defined(WIN32)
int pixels_per_unit() { return 1; }
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define mutiple resolution OpenGL rendering if your platform supports it"
#else
int pixels_per_unit() { return 1; }
#endif

View File

@ -208,6 +208,8 @@ public:
#if defined(__APPLE__) || defined(WIN32)
void *id_; // for internal use
void *mask_; // for internal use (mask bitmap)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables to hold an RGB image and a mask for Fl_RGB_Image"
#else
unsigned id_; // for internal use
unsigned mask_; // for internal use (mask bitmap)

View File

@ -55,6 +55,8 @@ private:
Window _sw;
Fl_Surface_Device *_ss;
int _savedc;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables to hold imaga data for Fl_Image_Surface"
#else
Fl_Surface_Device *previous;
Window pre_window;
@ -81,6 +83,10 @@ public:
void untranslate();
virtual ~Fl_Quartz_Flipped_Surface_() {};
};
#elif defined(WIN32)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a helper class for Fl_Image_Surface if needed"
#else
#endif
#endif // Fl_Image_Surface_H

View File

@ -25,6 +25,7 @@
// Use Windows' chooser
#ifdef WIN32
// #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx'
#if defined(FL_LIBRARY) || FLTK_ABI_VERSION < 10304
# include <windows.h>
@ -36,18 +37,21 @@ typedef BROWSEINFOW fl_BROWSEINFOW;
typedef void fl_OPENFILENAMEW;
typedef void fl_BROWSEINFOW;
#endif
#endif
# include <FL/filename.H> // FL_EXPORT
// Use Apple's chooser
#ifdef __APPLE__
#elif defined(__APPLE__)
# define MAXFILTERS 80
#endif
# include <FL/filename.H> // FL_EXPORT
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define a file chooser if one is available on your platform"
# include <FL/Fl_File_Chooser.H> // default to FLTK file chooser if none id ported
// All else falls back to FLTK's own chooser
#if ! defined(__APPLE__) && !defined(WIN32)
# include <FL/Fl_File_Chooser.H>
#else
# include <FL/filename.H> // FL_EXPORT
# include <FL/Fl_File_Chooser.H>
#endif
class Fl_FLTK_File_Chooser;
@ -192,9 +196,8 @@ private:
void parse_filter(const char *);
void clear_filters();
void add_filter(const char *, const char *);
#endif
#ifdef __APPLE__
#elif defined(__APPLE__)
private:
int _btype; // kind-of browser to show()
int _options; // general options
@ -230,9 +233,12 @@ private:
void parse_filter(const char *from);
int post();
int runmodal();
#endif
#if ! defined(__APPLE__) && !defined(WIN32)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define member variables for file chooser if one is available on your platform"
#else
private:
#if FLTK_ABI_VERSION <= 10302
int _btype; // kind-of browser to show()
@ -254,7 +260,8 @@ private:
#endif
};
#if !defined(__APPLE__) && !defined(WIN32)
#if !defined(__APPLE__) && !defined(WIN32) && !defined(FL_PORTING)
class FL_EXPORT Fl_FLTK_File_Chooser {
friend class Fl_Native_File_Chooser;
protected:

View File

@ -36,7 +36,14 @@
or Fl_PostScript_File_Device instead.
*/
class FL_EXPORT Fl_Paged_Device : public Fl_Surface_Device {
#ifndef __APPLE__
#ifdef __APPLE__
// not needed
#elif defined(WIN32)
friend class Fl_Copy_Surface;
void draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define member variables to support Fl_Copy_Surface in Fl_Paged_Device"
#else // X11
friend class Fl_Copy_Surface;
void draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset);
#endif

View File

@ -64,10 +64,13 @@ class FL_EXPORT Fl_Pixmap : public Fl_Image {
static // a static member is needed for ABI compatibility
#endif
UINT pixmap_bg_color; // RGB color used for pixmap background
#endif // WIN32
#if defined(__APPLE__) || defined(WIN32)
void *id_; // for internal use
void *mask_; // for internal use (mask bitmap)
#elif defined(__APPLE__)
void *id_; // for internal use
void *mask_; // for internal use (mask bitmap)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define member variables to store an RGB image and a mask for Fl_Pixmap"
#else
unsigned id_; // for internal use
unsigned mask_; // for internal use (mask bitmap)

View File

@ -201,6 +201,12 @@ class Clip {
void draw(const char* s, int nBytes, int x, int y) {transformed_draw(s,nBytes,x,y); };
#ifdef __APPLE__
void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); };
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define floating point position text drawing if you have it"
#else // X11
// not needed
#endif
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* s, int n, int x, int y);
@ -226,6 +232,12 @@ class Clip {
class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device {
#ifdef __APPLE__
CGContextRef gc;
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define storage for your graphics context in Fl_Postscript_File_Device if needed"
#else // X11
// not needed
#endif
protected:
Fl_PostScript_Graphics_Driver *driver();
@ -252,6 +264,12 @@ public:
void end_job(void);
#ifdef __APPLE__
void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: set access to your graphics context in Fl_Postscript_File_Device if needed"
#else // X11
// not needed
#endif
static const char *file_chooser_title;

View File

@ -30,10 +30,14 @@
#include <FL/Fl_RGB_Image.H>
#include <FL/Fl_Bitmap.H>
#include <stdio.h>
#if !(defined(__APPLE__) || defined(WIN32))
#include <FL/Fl_PostScript.H>
#elif defined(WIN32)
#ifdef WIN32
#include <commdlg.h>
#elif defined(__APPLE__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: include files needed for printing support"
#else // X11
#include <FL/Fl_PostScript.H>
#endif
#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
@ -91,9 +95,12 @@ public:
~Fl_System_Printer(void);
}; // class Fl_System_Printer
#endif
#if !(defined(__APPLE__) || defined(WIN32) )
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define your own Fl_xxx_Printer class"
#else
/**
Print support under Unix/Linux.
@ -224,6 +231,8 @@ public:
private:
#if defined(WIN32) || defined(__APPLE__)
Fl_System_Printer *printer;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: instantiate your own Fl_xxx_Printer here"
#else
Fl_PostScript_Printer *printer;
#endif

View File

@ -93,6 +93,14 @@ public:
void setonly (Fl_Menu_Item *item) { Fl_Menu_::setonly(item); update(); }
};
#elif defined(WIN32)
typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define your own system menu class"
#else
typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;

View File

@ -100,6 +100,12 @@ public:
#ifdef __APPLE__
// the unique tooltip window
static Fl_Window* current_window(void);
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do we need to remember the tooltip parent window?"
#else // X11
// not needed
#endif
// These should not be public, but Fl_Widget::tooltip() needs them...

View File

@ -103,6 +103,12 @@ class FL_EXPORT Fl_Window : public Fl_Group {
#ifdef WIN32
HICON big_icon;
HICON small_icon;
#elif defined(__APPLE__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define storage for per-window icons here if needed"
#else // X11
// not needed
#endif
};
@ -129,6 +135,12 @@ protected:
#if defined(__APPLE__)
typedef struct CGImage* CGImageRef;
CGImageRef mask;
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define storage for a window mask here if needed"
#else // X11
// not needed
#endif
Fl_Bitmap *todelete_; ///< auxiliary bitmap image
};
@ -147,7 +159,10 @@ 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)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need a combine_mask() function in Fl_Window?"
#else // X11
void combine_mask(void);
#endif
private:
@ -471,6 +486,12 @@ public:
#ifdef WIN32
static void default_icons(HICON big_icon, HICON small_icon);
void icons(HICON big_icon, HICON small_icon);
#elif defined(__APPLE__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define functions to handle window icons here if needed"
#else // X11
// not needed
#endif
/* for legacy compatibility */

View File

@ -81,6 +81,9 @@ struct dirent {char d_name[1];};
# include <sys/types.h>
# include <direct.h>
# elif defined(FL_PORTING)
# pragma message "FL_PORTING: insert the equivalent to dirent.h on your system"
struct dirent {char d_name[1];}; // default if not ported
# else
/*
* WARNING: on some systems (very few nowadays?) <dirent.h> may not exist.

View File

@ -57,6 +57,9 @@
# include <wchar.h>
# include <sys/stat.h>
# define xchar wchar_t
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: include utf8 support files and define utf8 types"
# define xchar unsigned short
#else /* X11 */
# include <sys/types.h>
# include <sys/stat.h>
@ -158,6 +161,12 @@ 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__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?"
#else // X11
// not needed
#endif
/*****************************************************************************

View File

@ -92,6 +92,12 @@ FL_EXPORT void gl_measure(const char*, int& x, int& y);
#ifdef __APPLE__
extern FL_EXPORT void gl_texture_pile_height(int max);
extern FL_EXPORT int gl_texture_pile_height();
#elif defined(WIN32)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define functions to control OpenGL texture pile height if supported"
#else // X11
// not needed
#endif
FL_EXPORT void gl_draw_image(const uchar *, int x,int y,int w,int h, int d=3, int ld=0);

4
FL/x.H
View File

@ -30,7 +30,9 @@
# include "win32.H"
# elif defined(__APPLE__)
# include "mac.H"
# else
# elif defined(FL_PORTING)
# pragma message "FL_PORTING: write a header file based on this file, win32.H, or mac.H to define the FLTK core internals"
# else // X11
# if defined(_ABIN32) || defined(_ABI64) // fix for broken SGI Irix X .h files
# pragma set woff 3322
# endif

View File

@ -58,6 +58,13 @@
# include <stdio.h>
#endif // DEBUG || DEBUG_WATCH
#ifdef WIN32
#elif defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement global variables for your platform here"
#else // X11
#endif
#ifdef WIN32
# include <ole2.h>
void fl_free_fonts(void);
@ -243,6 +250,10 @@ int Fl::event_inside(const Fl_Widget *o) /*const*/ {
// implementation in Fl_cocoa.mm (was Fl_mac.cxx)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement timers in your platform specific core file"
#else
//
@ -543,6 +554,10 @@ double Fl::wait(double time_to_wait) {
run_checks();
return fl_mac_flush_and_wait(time_to_wait);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement waiting for a timer or a message from the system"
#else
if (first_timeout) {
@ -676,7 +691,11 @@ int Fl::check() {
\endcode
*/
int Fl::ready() {
#if ! defined( WIN32 ) && ! defined(__APPLE__)
#if defined( WIN32 ) || defined(__APPLE__)
// not used
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: you may need to handle timers here."
#else // X11
if (first_timeout) {
elapse_timeouts();
if (first_timeout->time <= 0) return 1;
@ -780,6 +799,8 @@ void Fl::flush() {
#elif defined (__APPLE_QUARTZ__)
if (fl_gc)
CGContextFlush(fl_gc);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: flush your graohics context here"
#else
# error unsupported platform
#endif
@ -978,6 +999,9 @@ void Fl::focus(Fl_Widget *o) {
else if (x) // New WMs use the NETWM attribute:
Fl_X::activate_window(x->xid);
}
#elif defined(WIN32)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: handle platform specifics for change of keyboard focus here"
#endif
fl_xfocus = win;
}
@ -1119,7 +1143,13 @@ void fl_throw_focus(Fl_Widget *o) {
#endif // DEBUG
if (o->contains(Fl::pushed())) Fl::pushed_ = 0;
#if !(defined(WIN32) || defined(__APPLE__))
#ifdef WIN32
// not used
#elif defined(__APPLE__)
// 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;
#endif
if (o->contains(Fl::belowmouse())) Fl::belowmouse_ = 0;
@ -1627,6 +1657,8 @@ void Fl_Window::hide() {
}
#elif defined(__APPLE_QUARTZ__)
ip->destroy();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to destroy a window on screen"
#else
# error unsupported platform
#endif
@ -1659,6 +1691,8 @@ int Fl_Window::handle(int ev)
XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless
#elif defined(__APPLE_QUARTZ__)
i->map();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to show a window on screen"
#else
# error unsupported platform
#endif // __APPLE__
@ -1681,6 +1715,8 @@ int Fl_Window::handle(int ev)
XUnmapWindow(fl_display, fl_xid(this));
#elif defined(__APPLE_QUARTZ__)
i->unmap();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to hide a window from screen"
#else
# error platform unsupported
#endif
@ -1867,6 +1903,8 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
i->region->rects = (CGRect*)realloc(i->region->rects, (++(i->region->count)) * sizeof(CGRect));
i->region->rects[i->region->count - 1] = arg;
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to merge damage regions"
#else
# error unsupported platform
#endif

View File

@ -150,6 +150,10 @@ void fl_delete_bitmask(Fl_Bitmask bm) {
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement fl_create_bitmap"
#else // X11 bitmask functions
@ -262,8 +266,10 @@ int Fl_Bitmap::start(int XP, int YP, int WP, int HP, int &cx, int &cy,
if (H <= 0) return 1;
#if defined(WIN32)
if (!id_) id_ = fl_create_bitmap(w(), h(), array);
#else
#elif defined(__APPLE__) || defined(USE_X11)
if (!id_) id_ = fl_create_bitmask(w(), h(), array);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: call the right funtion to create a bitmap"
#endif
return 0;
}
@ -345,6 +351,10 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP,
DeleteDC(tempdc);
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement Fl_Xlib_Graphics_Driver::draw()"
#else // Xlib
void Fl_Xlib_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {
int X, Y, W, H;
@ -375,8 +385,10 @@ void Fl_Bitmap::uncache() {
if (id_) {
#ifdef __APPLE_QUARTZ__
fl_delete_bitmask((Fl_Bitmask)id_);
#else
#elif defined(WIN32) || defined(USE_X11)
fl_delete_bitmask((Fl_Offscreen)id_);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: call the right funtion to create a bitmask"
#endif
id_ = 0;
}

View File

@ -97,6 +97,8 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
SetTextAlign(gc, TA_BASELINE|TA_LEFT);
SetBkMode(gc, TRANSPARENT);
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: initialize memebrs of Fl_Copy_Surface"
#else // Xlib
helper = new Fl_Xlib_Surface_();
driver(helper->driver());
@ -133,6 +135,8 @@ Fl_Copy_Surface::~Fl_Copy_Surface()
DeleteDC(gc);
fl_gc = oldgc;
delete (Fl_GDI_Surface_*)helper;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: free resources in destructo of Fl_Copy_Surface"
#else // Xlib
fl_pop_clip();
unsigned char *data = fl_read_image(NULL,0,0,width,height,0);
@ -162,6 +166,8 @@ void Fl_Copy_Surface::set_current()
fl_gc = gc;
fl_window = (Window)1;
Fl_Surface_Device::set_current();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement Fl_Copy_Surface::set_current"
#else
fl_window=xid;
_ss = Fl_Surface_Device::surface();

View File

@ -20,6 +20,12 @@
#include <FL/Fl_Device.H>
#include <FL/Fl_Image.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: instantiate and implement various device drivers here"
#else
#endif
const char *Fl_Device::class_id = "Fl_Device";
const char *Fl_Surface_Device::class_id = "Fl_Surface_Device";
const char *Fl_Display_Device::class_id = "Fl_Display_Device";
@ -86,6 +92,8 @@ Fl_Display_Device *Fl_Display_Device::display_device() {
Fl_Quartz_Graphics_Driver
#elif defined(WIN32)
Fl_GDI_Graphics_Driver
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: instantiate your display driver here"
#else
Fl_Xlib_Graphics_Driver
#endif

View File

@ -108,6 +108,8 @@ void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx
((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->copy_offscreen(x, y, w, h, pixmap, srcx, srcy);
#elif defined(__APPLE__)
((Fl_Quartz_Graphics_Driver*)fl_graphics_driver)->copy_offscreen(x, y, w, h, pixmap, srcx, srcy);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: call our version of fl_copy_offscreen"
#endif
}
else { // when copy is not to the display
@ -379,6 +381,7 @@ void fl_end_offscreen() {
#else
# pragma message "FL_PORTING: implement offscreen render space generation and management"
# error unsupported platform
#endif
@ -416,6 +419,7 @@ void Fl_Double_Window::flush(int eraseoverlay) {
clear_damage(FL_DAMAGE_ALL);
}
#else
# pragma message "FL_PORTING: call a function to clear any graphics port damage flags"
# error unsupported platform
#endif
}
@ -467,6 +471,8 @@ void Fl_Double_Window::flush(int eraseoverlay) {
} else {
draw();
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: manage double buffered drawing"
#else // X:
fl_window = myi->other_xid;
draw();

View File

@ -26,6 +26,12 @@
// Fl_File_Browser::filter() - Set the filename filter.
//
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the iternals of your file browser here"
#else
#endif
//
// Include necessary header files...
//

View File

@ -357,6 +357,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the internal of your filechooser here"
#else
#endif
#if defined(WIN32) && ! defined (__CYGWIN__)
# include <direct.h>
# include <io.h>

View File

@ -51,6 +51,11 @@
#include <FL/fl_draw.H>
#include <FL/filename.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement file type interpretation here"
#else
#endif
//
// Define missing POSIX/XPG4 macros as needed...

View File

@ -26,6 +26,13 @@
#include <config.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement font descriptor details here"
#else
#endif
# if USE_XFT
typedef struct _XftFont XftFont;
# elif !defined(WIN32) && !defined(__APPLE__)
@ -65,6 +72,8 @@ public:
//const char* encoding;
int angle;
FL_EXPORT Fl_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle);
# elif defined(FL_PORTING)
# pragma message "FL_PORTING: define variables and storage types for font handling"
# else
XUtf8FontStruct* font; // X UTF-8 font information
FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
@ -87,15 +96,28 @@ struct Fl_Fontdesc {
const char *name;
char fontname[128]; // "Pretty" font name
Fl_Font_Descriptor *first; // linked list of sizes of this style
# ifndef WIN32
#ifdef WIN32
#elif defined(__APPLE__)
char **xlist; // matched X font names
int n; // size of xlist, negative = don't free xlist!
# endif
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need additional storage in Fl_Fontdesc?"
#else
char **xlist; // matched X font names
int n; // size of xlist, negative = don't free xlist!
#endif
};
extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
# ifndef WIN32
#ifdef WIN32
#elif defined(__APPLE__)
// functions for parsing X font names:
FL_EXPORT const char* fl_font_word(const char *p, int n);
FL_EXPORT char *fl_find_fontsize(char *name);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need additional functions for font handling?"
#else
// functions for parsing X font names:
FL_EXPORT const char* fl_font_word(const char *p, int n);
FL_EXPORT char *fl_find_fontsize(char *name);

View File

@ -45,6 +45,12 @@
#ifndef Fl_Gl_Choice_H
#define Fl_Gl_Choice_H
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to list and select OpenGL drawing contexts"
#else
#endif
// Warning: whatever GLContext is defined to must take exactly the same
// space in a structure as a void*!!!
#ifdef WIN32
@ -77,6 +83,8 @@ public:
PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing
#elif defined(__APPLE_QUARTZ__)
NSOpenGLPixelFormat* pixelformat;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define OpenGL pixel format containers"
#else
XVisualInfo *vis; // the visual to use
Colormap colormap; // a colormap for that visual
@ -97,6 +105,10 @@ GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
GLContext fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*, int layer=0);
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define fl_create_gl_context function"
#else
GLContext fl_create_gl_context(XVisualInfo* vis);

View File

@ -27,6 +27,12 @@
# include "flstring.h"
# include <FL/fl_utf8.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to list and select OpenGL drawing contexts"
#else
#endif
# ifdef WIN32
void fl_save_dc(HWND, HDC);
#elif defined(__APPLE__)

View File

@ -23,6 +23,12 @@
#include <FL/Fl_RGB_Image.H>
#include "FL/Fl.H"
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement code to read OpenGL renderings into RGB maps"
#else
#endif
#if defined(__APPLE__)
uchar *convert_BGRA_to_RGB(uchar *baseAddress, int w, int h, int mByteWidth)
{

View File

@ -25,6 +25,12 @@
#include <FL/Fl_Gl_Window.H>
#include <stdlib.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement OpenGL hardware overlays if they are availbale in a compatible way. This is rarely needed."
#else
#endif
#if !HAVE_GL_OVERLAY
int Fl_Gl_Window::can_do_overlay() {return 0;}

View File

@ -32,6 +32,12 @@ extern int fl_gl_load_plugin;
#include <stdlib.h>
#include <FL/fl_utf8.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the creation and destruction of OpenGL surfaces"
#else
#endif
////////////////////////////////////////////////////////////////
// The symbol SWAP_TYPE defines what is in the back buffer after doing

View File

@ -25,6 +25,12 @@
#include <FL/Fl_Printer.H>
#include "flstring.h"
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement RGB image handling here"
#else
#endif
#ifdef WIN32
void fl_release_dc(HWND, HDC); // from Fl_win32.cxx
#endif

View File

@ -20,6 +20,11 @@
#include <FL/Fl_Printer.H>
#include <FL/Fl.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement image surface handling here"
#else
#endif
const char *Fl_Image_Surface::class_id = "Fl_Image_Surface";

View File

@ -22,6 +22,13 @@
// In theory you can replace this code with another subclass to change
// the keybindings.
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement text input specifics here"
// current custom code is for OS X keybaord specifics only
#else
#endif
#include <stdio.h>
#include <stdlib.h>
#include <FL/Fl.H>

View File

@ -27,6 +27,13 @@
#include <stdlib.h>
#include <ctype.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: manage character composing here"
#else
#endif
#define MAXBUF 1024
#if defined(USE_X11) && !USE_XFT
const int secret_char = '*'; // asterisk to hide secret input

View File

@ -19,15 +19,16 @@
// Use Windows' chooser
#ifdef WIN32
#include "Fl_Native_File_Chooser_WIN32.cxx"
#endif
// Use Apple's chooser
#ifdef __APPLE__
#elif defined(__APPLE__)
#include <FL/Fl_Native_File_Chooser.H>
#endif
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the native file chooser interface"
// All else falls back to FLTK's own chooser
#if ! defined(__APPLE__) && !defined(WIN32)
#else
#include "Fl_Native_File_Chooser_FLTK.cxx"
#endif

View File

@ -32,6 +32,12 @@
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Printer.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: this file needs a lot of custom code to draw Pixmaps correctly"
#else
#endif
#if defined(USE_X11)
# if HAVE_X11_XREGION_H
# include <X11/Xregion.h>

View File

@ -29,6 +29,12 @@
#include <sys/stat.h>
#include <time.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement some file storage in a designated place"
#else
#endif
#if defined(WIN32) && !defined(__CYGWIN__)
# include <windows.h>
# include <direct.h>

View File

@ -19,6 +19,12 @@
#include <FL/Fl_Printer.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the printer device specifics"
#else
#endif
#if defined(WIN32)
#include "Fl_GDI_Printer.cxx"
#endif

View File

@ -31,6 +31,12 @@
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Window.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: look out for some code that visualizes character composing"
#else
#endif
#undef min
#undef max

View File

@ -25,6 +25,11 @@
#include <FL/Fl_Text_Editor.H>
#include <FL/fl_ask.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add common shortcut for your platform here"
#else
#endif
/* Keyboard Control Matrix

View File

@ -29,6 +29,8 @@ void Fl_Window::iconize() {
ShowWindow(i->xid, SW_SHOWMINNOACTIVE);
#elif defined(__APPLE__)
i->collapse();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to iconify a window"
#else
XIconifyWindow(fl_display, i->xid, fl_screen);
#endif

View File

@ -24,6 +24,12 @@
#include <FL/Fl_Pixmap.H>
#include <string.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to implement arbitrarily shaped windows"
#else
#endif
#ifdef WIN32
# include <malloc.h> // needed for VisualC2010
#elif !defined(__APPLE__)

View File

@ -26,6 +26,12 @@
#include <stdarg.h>
#include "flstring.h"
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: use native message box below if one is available"
#else
#endif
#ifdef WIN32
# include <windows.h>

View File

@ -28,6 +28,12 @@
#include <ctype.h>
#include "flstring.h"
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement special command line handling"
#else
#endif
#if defined(WIN32) || defined(__APPLE__)
int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*);
# define NoValue 0x0000

View File

@ -21,6 +21,11 @@
Utility functions to support text input.
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard composing in the code below"
#else
#endif
#include <FL/Fl.H>
#include <FL/x.H>

View File

@ -32,6 +32,8 @@
void Fl::display(const char *d) {
#if defined(__APPLE__) || defined(WIN32)
(void)d;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: initiate a connection to the display"
#else
static char e[1024];
strcpy(e,"DISPLAY=");

View File

@ -20,6 +20,8 @@
# include "Fl_get_key_win32.cxx"
#elif defined(__APPLE__)
# include "Fl_get_key_mac.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard reading and interpretation in its own file"
#else
// Return the current state of a key. This is the X version. I identify

View File

@ -200,6 +200,10 @@ void Fl::get_system_colors()
#endif
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement code to find the current desktop color scheme"
#else // --- X11 ---
// Read colors that KDE writes to the xrdb database.

View File

@ -30,6 +30,12 @@
extern void fl_fix_focus(); // in Fl.cxx
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: tell a window to grab all following events"
#else
#endif
#ifdef WIN32
// We have to keep track of whether we have captured the mouse, since
// MSWindows shows little respect for this... Grep for fl_capture to

View File

@ -389,6 +389,10 @@ void lock_ring() {
pthread_mutex_lock(ring_mutex);
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement simple locking and unlocking for basic multithreading support"
#else
void unlock_ring() {

View File

@ -45,6 +45,11 @@ void Fl::own_colormap() {}
// MacOS X always provides a TrueColor interface...
void Fl::own_colormap() {}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement color map handling if you don;t have an RGB screen"
#else
// X version

View File

@ -73,6 +73,9 @@ int Fl::visual(int flags) {
return 1;
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to handle RGB and color index visuals"
#else
#if USE_XDBE

View File

@ -20,6 +20,8 @@
//# include "Fl_win32.cxx"
#elif defined(__APPLE__)
//# include "Fl_mac.cxx" // now Fl_cocoa.mm
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the FLTK core in its own file"
#elif !defined(FL_DOXYGEN)
# define CONSOLIDATE_MOTION 1

View File

@ -20,6 +20,13 @@
#include <FL/filename.H>
#ifdef WIN32
#elif defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement directory and filename handling for your platfomr if needed"
#else // X11
#endif
/** Gets the extensions of a filename.
\code
#include <FL/filename.H>

View File

@ -25,6 +25,12 @@
#include <FL/filename.H>
#include <FL/fl_utf8.h>
#ifdef WIN32
#elif defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement directory and filename handling for your platfomr if needed"
#else // X11
#endif
#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__)
static inline int isdirsep(char c) {return c=='/' || c=='\\';}

View File

@ -26,6 +26,13 @@
#include <FL/x.H>
#endif
#ifdef WIN32
#elif defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement directory and filename handling for your platfomr if needed"
#else // X11
#endif
extern "C" {
#ifndef HAVE_SCANDIR
int fl_scandir (const char *dir, dirent ***namelist,

View File

@ -69,6 +69,7 @@ void Fl_Graphics_Driver::arc(int x,int y,int w,int h,double a1,double a2) {
CGContextStrokePath(fl_gc);
CGContextSetShouldAntialias(fl_gc, false);
#else
# pragma message "FL_PORTING: implement arc drawing"
# error unsupported platform
#endif
}
@ -114,6 +115,7 @@ void Fl_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) {
CGContextFillPath(fl_gc);
CGContextSetShouldAntialias(fl_gc, false);
#else
# pragma message "FL_PORTING: implement pie drawing (mmmh, apple pie)"
# error unsupported platform
#endif
}

View File

@ -309,6 +309,8 @@ void fl_beep(int type) {
default :
break;
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement beeping or other noise generating functions"
#else
switch (type) {
case FL_BEEP_DEFAULT :

View File

@ -37,6 +37,12 @@
* Microsoft(r) Windows(r) that allows for it.
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement 'main()' here if your platform provides another app entry point"
#else
#endif
#if defined(WIN32) && !defined(FL_DLL) && !defined (__GNUC__)
# include <windows.h>

View File

@ -27,6 +27,8 @@
# include "fl_color_win32.cxx"
#elif defined(__APPLE__)
# include "fl_color_mac.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement color handling in your own file based on fl_color.cxx"
#else
// Also code to look at the X visual and figure out the best way to turn

View File

@ -20,6 +20,8 @@
# include "fl_dnd_win32.cxx"
#elif defined(__APPLE__)
//# include "fl_dnd_mac.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement drag and drop in its own platform file"
#else
# include "fl_dnd_x.cxx"
#endif

View File

@ -30,6 +30,8 @@
# include "fl_draw_image_win32.cxx"
#elif defined(__APPLE__)
# include "fl_draw_image_mac.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement image drawing in its own file"
#else
// A list of assumptions made about the X display:

View File

@ -38,6 +38,12 @@
#include <stdio.h>
#include "flstring.h"
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement platform specific about pixmap drawing here"
#else
#endif
static int ncolors, chars_per_pixel;
/**

View File

@ -51,6 +51,8 @@
# include "fl_font_mac.cxx"
#elif USE_XFT
# include "fl_font_xft.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement font handling specific in its own file"
#else
# include "fl_font_x.cxx"
#endif // WIN32

View File

@ -155,6 +155,7 @@ void Fl_Graphics_Driver::line_style(int style, int width, char* dashes) {
}
fl_quartz_restore_line_style_();
#else
# pragma message "FL_PORTING: implement line styles here"
# error unsupported platform
#endif
}

View File

@ -142,6 +142,9 @@ fl_open_uri(const char *uri, char *msg, int msglen) {
return run_program("/usr/bin/open", argv, msg, msglen) != 0;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: add code to open any file type with an external app"
#else // !WIN32 && !__APPLE__
// Run any of several well-known commands to open the URI.
//

View File

@ -25,6 +25,12 @@
# include <stdio.h>
#endif // DEBUG
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement code to read RGB data from screen"
#else
#endif
#if defined(__APPLE__)
# include "fl_read_image_mac.cxx"
#else

View File

@ -33,6 +33,12 @@
#include <FL/fl_draw.H>
#include <FL/x.H>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement al the line drawing functions below"
#else
#endif
// fl_line_width_ must contain the absolute value of the current
// line width to be used for X11 clipping (see below).
// This is defined in src/fl_line_style.cxx

View File

@ -151,6 +151,7 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
CFRelease(img);
}
#else
# pragma message "FL_PORTING: implement scrolling of the screen contents"
# error unsupported platform
#endif
if (dx) draw_area(data, clip_x, dest_y, clip_w, src_h);

View File

@ -28,6 +28,8 @@
# include "fl_set_fonts_mac.cxx"
#elif USE_XFT
# include "fl_set_fonts_xft.cxx"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement changes in font in its own file"
#else
# include "fl_set_fonts_x.cxx"
#endif // WIN32

View File

@ -42,6 +42,12 @@
#include <FL/x.H>
#endif
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement keyboard shortcut handling here"
#else
#endif
/**
Tests the current event, which must be an FL_KEYBOARD or
FL_SHORTCUT, against a shortcut value (described in Fl_Button).

View File

@ -22,6 +22,12 @@
#include <string.h>
#include <stdlib.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: llok out for some unicode functions here. Default should be fine though."
#else
#endif
/** \addtogroup fl_unicode
@{
*/

View File

@ -21,6 +21,12 @@
#include <FL/filename.H>
#include <stdarg.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: verify code for utf8 handling"
#else
#endif
#if defined(WIN32) || defined(__CYGWIN__)
# include <ctype.h>
# include <io.h>

View File

@ -28,6 +28,12 @@
// matt: the Quartz implementation purposely doesn't use the Quartz matrix
// operations for reasons of compatibility and maintainability
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement functions below for vector drawing"
#else
#endif
#include <config.h>
#include <FL/fl_draw.H>
#include <FL/x.H>

View File

@ -52,6 +52,8 @@ void fl_gettime(long* sec, long* usec) {
*sec = (long) tp.time;
*usec = tp.millitm * 1000;
# endif
#elif defined(FL_PORTING) && !defined(__APPLE__)
# pragma message "FL_PORTING: implement time, rarely needed, if ever."
#else
struct timeval tp;
struct timezone tzp;

View File

@ -19,6 +19,12 @@
// Functions from <FL/gl.h>
// See also Fl_Gl_Window and gl_start.cxx
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement OpenGL text rendering here"
#else
#endif
#include "flstring.h"
#if HAVE_GL || defined(FL_DOXYGEN)

View File

@ -28,6 +28,12 @@
// be erased when the buffers are swapped (when double buffer hardware
// is being used)
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: if possible, add OpenGL rendering in non-OpenGL contexts"
#else
#endif
#include <config.h>
#if HAVE_GL

View File

@ -142,6 +142,10 @@ static void screen_init() {
num_screens = count;
}
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: return various information about the screens in the system"
#else
#if HAVE_XINERAMA

View File

@ -14,6 +14,12 @@
* http://www.fltk.org/str.php
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: utf8 functionality"
#else
#endif
/*
* This file is required on all platforms for utf8 support
*/

View File

@ -16,7 +16,15 @@
* http://www.fltk.org/str.php
*/
#if !defined(WIN32) && !defined(__APPLE__)
#if defined(WIN32) || defined(__APPLE__)
// not needed
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: include the character encoding file below if needed"
#else
#ifndef CP936
#ifdef NEED_TOWC

View File

@ -14,6 +14,12 @@
* http://www.fltk.org/str.php
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: utf8"
#else
#endif
/*
* Unicode to UTF-8 conversion functions.
*/

View File

@ -14,6 +14,12 @@
* http://www.fltk.org/str.php
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: utf8"
#else
#endif
/*
* X11 UTF-8 text drawing functions.
*/

View File

@ -34,6 +34,12 @@
// Audio headers...
#include <config.h>
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: FLTK does not provide cross platform access to system sound"
#else
#endif
#ifndef WIN32
# include <unistd.h>
# include <sys/time.h>

View File

@ -46,6 +46,12 @@
# include <unistd.h>
#endif // !WIN32
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: FLTK does not provide cross platform sound support"
#else
#endif
#ifdef HAVE_ALSA_ASOUNDLIB_H
# define ALSA_PCM_NEW_HW_PARAMS_API
# include <alsa/asoundlib.h>