diff options
Diffstat (limited to 'src')
44 files changed, 727 insertions, 52 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index e205f4407..db4e8de4e 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -556,7 +556,8 @@ double Fl::wait(double time_to_wait) { #elif defined(FL_PORTING) -# pragma message "FL_PORTING: implement waiting for a timer or a message from the system" +# pragma message "FL_PORTING: implement waiting for a timer or a message from the system" + return fl_wait(time_to_wait); #else diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx index 04dbc8564..1f0b654c5 100644 --- a/src/Fl_Copy_Surface.cxx +++ b/src/Fl_Copy_Surface.cxx @@ -221,11 +221,22 @@ void Fl_Copy_Surface::prepare_copy_pdf_and_tiff(int w, int h) /** Copies a window and its borders and title bar to the clipboard. */ void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int delta_y) { +#if defined(WIN32) helper->draw_decorated_window(win, delta_x, delta_y, this); +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to draw a window border around a printout" +#else + helper->draw_decorated_window(win, delta_x, delta_y, this); +#endif } #endif -#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you need a helper class for your graphics driver" +#elif !defined(FL_DOXYGEN) /* graphics driver that translates all graphics coordinates before calling Xlib */ class Fl_translated_Xlib_Graphics_Driver_ : public Fl_Xlib_Graphics_Driver { int offset_x, offset_y; // translation between user and graphical coordinates: graphical = user + offset diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index 7a487cd26..418157b7e 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -41,8 +41,12 @@ const char *Fl_GDI_Graphics_Driver::class_id = "Fl_GDI_Graphics_Driver"; const char *Fl_GDI_Printer_Graphics_Driver::class_id = "Fl_GDI_Printer_Graphics_Driver"; #endif #if !(defined(__APPLE__) || defined(WIN32)) +#if defined(FL_PORTING) +# pragma message "FL_PORTING: instantiate the main graphics driver here" +#else const char *Fl_Xlib_Graphics_Driver::class_id = "Fl_Xlib_Graphics_Driver"; #endif +#endif /** \brief Make this surface the current drawing surface. @@ -94,6 +98,7 @@ Fl_Display_Device *Fl_Display_Device::display_device() { Fl_GDI_Graphics_Driver #elif defined(FL_PORTING) # pragma message "FL_PORTING: instantiate your display driver here" + Fl_XXX_Graphics_Driver #else Fl_Xlib_Graphics_Driver #endif diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index 9bf3db289..559056a46 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -379,9 +379,9 @@ void fl_end_offscreen() { /** @} */ - -#else +#elif defined(FL_PORTING) # pragma message "FL_PORTING: implement offscreen render space generation and management" +#else # error unsupported platform #endif @@ -418,8 +418,9 @@ void Fl_Double_Window::flush(int eraseoverlay) { myi->other_xid = fl_create_offscreen(w(), h()); clear_damage(FL_DAMAGE_ALL); } -#else +#elif defined(FL_PORTING) # pragma message "FL_PORTING: call a function to clear any graphics port damage flags" +#else # error unsupported platform #endif } diff --git a/src/Fl_Font.H b/src/Fl_Font.H index 561f249a2..a265d1aa4 100644 --- a/src/Fl_Font.H +++ b/src/Fl_Font.H @@ -33,11 +33,15 @@ #endif -# if USE_XFT +#if USE_XFT typedef struct _XftFont XftFont; -# elif !defined(WIN32) && !defined(__APPLE__) -# include "Xutf8.h" -# endif // USE_XFT +#elif defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h?" +#else +# include "Xutf8.h" +#endif // USE_XFT /** This a structure for an actual system font, with junk to diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index cc28fdb89..08cdeba7c 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -791,6 +791,10 @@ int Fl_GDI_Printer_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, i return 1; } +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement RGB image handling here" + #else void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy) { int X, Y, W, H; diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx index c7303fb27..b73561fe4 100644 --- a/src/Fl_Image_Surface.cxx +++ b/src/Fl_Image_Surface.cxx @@ -34,7 +34,11 @@ const char *Fl_Image_Surface::class_id = "Fl_Image_Surface"; Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) { width = w; height = h; -#if !(defined(__APPLE__) || defined(WIN32)) +#if defined(__APPLE__) +#elif defined(WIN32) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Image_Surface" +#else gc = 0; if (!fl_gc) { // allows use of this class before any window is shown fl_open_display(); @@ -52,6 +56,8 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h) : Fl_Surface_Device(NULL) { #elif defined(WIN32) helper = new Fl_GDI_Surface_(); driver(helper->driver()); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Image_Surface" #else helper = new Fl_Xlib_Surface_(); driver(helper->driver()); @@ -66,6 +72,8 @@ Fl_Image_Surface::~Fl_Image_Surface() { delete (Fl_Quartz_Flipped_Surface_*)helper; #elif defined(WIN32) delete (Fl_GDI_Surface_*)helper; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Image_Surface" #else if (gc) { XFreeGC(fl_display, gc); fl_gc = 0; } delete (Fl_Xlib_Surface_*)helper; @@ -90,6 +98,8 @@ Fl_RGB_Image* Fl_Image_Surface::image() _ss->set_current(); fl_window=_sw; fl_gc = _sgc; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Image_Surface" #else fl_pop_clip(); data = fl_read_image(NULL, 0, 0, width, height, 0); @@ -127,6 +137,8 @@ void Fl_Image_Surface::set_current() _savedc = SaveDC(fl_gc); fl_window=(HWND)offscreen; fl_push_no_clip(); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Image_Surface" #else pre_window = fl_window; fl_window = offscreen; diff --git a/src/Fl_Native_File_Chooser.cxx b/src/Fl_Native_File_Chooser.cxx index 37fa49dfc..3993b5890 100644 --- a/src/Fl_Native_File_Chooser.cxx +++ b/src/Fl_Native_File_Chooser.cxx @@ -25,7 +25,8 @@ #include <FL/Fl_Native_File_Chooser.H> #elif defined(FL_PORTING) -# pragma message "FL_PORTING: implement the native file chooser interface" +# pragma message "FL_PORTING: implement the native file chooser interface" +# include "Fl_Native_File_Chooser_FLTK.cxx" // All else falls back to FLTK's own chooser #else diff --git a/src/Fl_Native_File_Chooser_FLTK.cxx b/src/Fl_Native_File_Chooser_FLTK.cxx index 1228a5447..64da6e69d 100644 --- a/src/Fl_Native_File_Chooser_FLTK.cxx +++ b/src/Fl_Native_File_Chooser_FLTK.cxx @@ -30,6 +30,18 @@ #include <sys/stat.h> #include <string.h> +#if defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl_Native_File_Chooser" +int Fl_Native_File_Chooser::show() { return 0; } +void Fl_Native_File_Chooser::type(int t) { } +void Fl_Native_File_Chooser::title(const char *t) { } +void Fl_Native_File_Chooser::filter(const char *f) { } +void Fl_Native_File_Chooser::options(int val) { } +const char *Fl_Native_File_Chooser::filename() const { return 0; } +Fl_Native_File_Chooser::Fl_Native_File_Chooser(int) { } +Fl_Native_File_Chooser::~Fl_Native_File_Chooser() { } +#else + int Fl_Native_File_Chooser::have_looked_for_GTK_libs = 0; /** @@ -504,6 +516,8 @@ int Fl_FLTK_File_Chooser::exist_dialog() { return fl_choice("%s", fl_cancel, fl_ok, NULL, Fl_Native_File_Chooser::file_exists_message); } +#endif + // // End of "$Id$". // diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx index 27d744586..2a972856b 100644 --- a/src/Fl_Native_File_Chooser_GTK.cxx +++ b/src/Fl_Native_File_Chooser_GTK.cxx @@ -17,6 +17,9 @@ // #include <FL/x.H> + +#ifdef USE_X11 + #if HAVE_DLSYM && HAVE_DLFCN_H #include <dlfcn.h> // for dlopen et al #endif @@ -728,6 +731,8 @@ void Fl_GTK_File_Chooser::probe_for_GTK_libs(void) { #endif } // probe_for_GTK_libs +#endif + // // End of "$Id$". // diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index 2953727bf..a340048fe 100644 --- a/src/Fl_Pixmap.cxx +++ b/src/Fl_Pixmap.cxx @@ -202,6 +202,9 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP } //------------------------------------------------------------------------------ +#elif defined(FL_PORTING) +#pragma message "Implement Fl_XXX_Graphics_Driver methods here" +//------------------------------------------------------------------------------ #else // X11, Xlib //------------------------------------------------------------------------------ diff --git a/src/Fl_PostScript.cxx b/src/Fl_PostScript.cxx index de7de89c9..d2264a8c7 100644 --- a/src/Fl_PostScript.cxx +++ b/src/Fl_PostScript.cxx @@ -1553,7 +1553,11 @@ void Fl_PostScript_File_Device::end_job (void) #endif // FL_DOXYGEN -#if ! (defined(__APPLE__) || defined(WIN32) ) +#if defined(__APPLE__) +#elif defined(WIN32) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement postscript printing" +#else // X11 /** Starts a print job. */ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) { enum Fl_Paged_Device::Page_Format format; diff --git a/src/Fl_Printer.cxx b/src/Fl_Printer.cxx index e04c3b97e..aece33443 100644 --- a/src/Fl_Printer.cxx +++ b/src/Fl_Printer.cxx @@ -73,7 +73,10 @@ const char *Fl_Printer::class_id = "Fl_Printer"; #if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN) const char *Fl_System_Printer::class_id = Fl_Printer::class_id; #endif -#if !( defined(__APPLE__) || defined(WIN32) ) +#if defined(__APPLE__) || defined(WIN32) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement the printer device specifics" +#else const char *Fl_PostScript_Printer::class_id = Fl_Printer::class_id; #endif @@ -98,6 +101,9 @@ void Fl_System_Printer::origin(int *x, int *y) Fl_Printer::Fl_Printer(void) { #if defined(WIN32) || defined(__APPLE__) printer = new Fl_System_Printer(); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement the printer device specifics" + printer = new Fl_XXX_Printer(); #else printer = new Fl_PostScript_Printer(); #endif diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index 5b4cadb19..c8db04ab8 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -232,6 +232,8 @@ Fl_Widget::draw_focus(Fl_Boxtype B, int X, int Y, int W, int H) const { for (yy = 0; yy < H; yy ++, i ++) if (i & 1) fl_point(X + W, Y + yy); for (xx = W; xx > 0; xx --, i ++) if (i & 1) fl_point(X + xx, Y + H); for (yy = H; yy > 0; yy --, i ++) if (i & 1) fl_point(X, Y + yy); +#elif defined(FL_PORTING) +# pragma message "handle focus drawing" #else # error unsupported platform #endif // WIN32 diff --git a/src/Fl_Window_fullscreen.cxx b/src/Fl_Window_fullscreen.cxx index 79f9d002a..fa1d267dc 100644 --- a/src/Fl_Window_fullscreen.cxx +++ b/src/Fl_Window_fullscreen.cxx @@ -60,6 +60,8 @@ void Fl_Window::border(int b) { // for full fullscreen we have to make the window topmost as well #elif defined(__APPLE_QUARTZ__) // warning: not implemented in Quartz/Carbon +#elif defined(FL_PORTING) +# pragma message "handle window border setting" #else # error unsupported platform #endif diff --git a/src/Fl_Window_shape.cxx b/src/Fl_Window_shape.cxx index ff36eac13..da9423841 100644 --- a/src/Fl_Window_shape.cxx +++ b/src/Fl_Window_shape.cxx @@ -136,6 +136,10 @@ static HRGN bitmap2region(Fl_Image* image) { return hRgn; } +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement window masks" + #else #ifndef FL_DOXYGEN @@ -359,10 +363,10 @@ void Fl_Window::draw() { SetWindowRgn(fl_xid(this), region, TRUE); // the system deletes the region when it's no longer needed delete temp; } -#elif !(defined(__APPLE__) || defined(WIN32)) +#elif defined(USE_X11) if (( shape_data_->lw_ != w() || shape_data_->lh_ != h() ) && shape_data_->shape_) { - // size of window has changed since last time - combine_mask(); + // size of window has changed since last time + combine_mask(); } # endif } diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx index 1fec33b69..a013f1706 100644 --- a/src/Fl_arg.cxx +++ b/src/Fl_arg.cxx @@ -34,7 +34,7 @@ #else #endif -#if defined(WIN32) || defined(__APPLE__) +#if defined(WIN32) || defined(__APPLE__) || defined(FL_PORTING) int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*); # define NoValue 0x0000 # define XValue 0x0001 @@ -301,7 +301,11 @@ void Fl_Window::show(int argc, char **argv) { Fl::get_system_colors(); -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: Parse additional default settings" +#else // X11 // Get defaults for drag-n-drop and focus... const char *key = 0, *val; @@ -361,7 +365,11 @@ void Fl_Window::show(int argc, char **argv) { // Show the window AFTER we have set the colors and scheme. show(); -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: Parse additional default settings" +#else // X11 // set the command string, used by state-saving window managers: int j; int n=0; for (j=0; j<argc; j++) n += strlen(argv[j])+1; @@ -544,6 +552,10 @@ int XParseGeometry(const char* string, int* x, int* y, return (mask); } +#elif defined(FL_PORTING) + +int XParseGeometry(const char* string, int* x, int* y, unsigned int* width, unsigned int* height) { return 0; } + #endif // ifdef WIN32 // diff --git a/src/Fl_compose.cxx b/src/Fl_compose.cxx index b10b0b72f..3bb0c1ac7 100644 --- a/src/Fl_compose.cxx +++ b/src/Fl_compose.cxx @@ -21,12 +21,6 @@ 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> @@ -37,7 +31,10 @@ int Fl_X::next_marked_length = 0; #endif #endif -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement keyboard composing in the code below" +#else // X11 extern XIC fl_xim_ic; #endif @@ -146,7 +143,10 @@ void Fl::insertion_point_location(int x, int y, int height) { void Fl::compose_reset() { Fl::compose_state = 0; -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: compose reset extra functions" +#else if (fl_xim_ic) XmbResetIC(fl_xim_ic); #endif } diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index 2c628f88b..da8d1b1b8 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -117,6 +117,9 @@ int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) { 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) { @@ -203,6 +206,7 @@ void Fl::get_system_colors() #elif defined(FL_PORTING) # pragma message "FL_PORTING: implement code to find the current desktop color scheme" +void Fl::get_system_colors() { } #else // --- X11 --- @@ -296,7 +300,10 @@ static Fl_Pixmap tile(tile_xpm); int Fl::scheme(const char *s) { if (!s) { if ((s = getenv("FLTK_SCHEME")) == NULL) { -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement Fl::scheme" +#else const char* key = 0; if (Fl::first_window()) key = Fl::first_window()->xclass(); if (!key) key = "fltk"; diff --git a/src/Fl_grab.cxx b/src/Fl_grab.cxx index 9b0446d74..35d69205a 100644 --- a/src/Fl_grab.cxx +++ b/src/Fl_grab.cxx @@ -30,21 +30,20 @@ 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 // see where and how this is used. extern HWND fl_capture; -#endif -#ifdef __APPLE__ +#elif defined(__APPLE__) extern void *fl_capture; + +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: tell a window to grab all following events" + +#else // X11 + #endif void Fl::grab(Fl_Window* win) { @@ -65,6 +64,8 @@ void Fl::grab(Fl_Window* win) { #elif defined(__APPLE__) fl_capture = Fl_X::i(first_window())->xid; Fl_X::i(first_window())->set_key_window(); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement event grabbing" #else Window xid = fullscreen_win ? fl_xid(fullscreen_win) : fl_xid(first_window()); XGrabPointer(fl_display, @@ -93,6 +94,8 @@ void Fl::grab(Fl_Window* win) { ReleaseCapture(); #elif defined(__APPLE__) fl_capture = 0; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement event grabbing" #else // We must keep the grab in the non-EWMH fullscreen case if (!fullscreen_win || Fl_X::ewmh_supported()) { diff --git a/src/Fl_porting.cxx b/src/Fl_porting.cxx new file mode 100644 index 000000000..e4ebd722c --- /dev/null +++ b/src/Fl_porting.cxx @@ -0,0 +1,361 @@ +// +// "$Id$" +// +// core code stubs for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2015 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +#ifndef FL_DOXYGEN +#include <FL/Fl.H> +#include <FL/fl_utf8.h> +#include <FL/Fl_Window.H> +#include <FL/fl_draw.H> +#include <FL/Enumerations.H> +#include <FL/Fl_Tooltip.H> +#include <FL/Fl_Paged_Device.H> +#include "flstring.h" +#include "Fl_Font.H" +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <time.h> +#include <signal.h> + +extern unsigned int fl_codepage; + +Fl_Fontdesc* fl_fonts = NULL; + +void *fl_gc = NULL; + +Window fl_window = NULL; + +void fl_reset_spot() +{ +# pragma message "FL_PORTING: implement fl_reset_spot" +} + +void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) +{ +# pragma message "FL_PORTING: implement fl_set_spot" +} + +void fl_set_status(int x, int y, int w, int h) +{ +# pragma message "FL_PORTING: implement fl_set_status" +} + +void Fl::add_fd(int n, int events, void (*cb)(FL_SOCKET, void*), void *v) { +# pragma message "FL_PORTING: implement Fl::add_fd" +} + +void Fl::add_fd(int fd, void (*cb)(FL_SOCKET, void*), void* v) { +# pragma message "FL_PORTING: implement Fl::add_fd" +} + +void Fl::remove_fd(int n, int events) { +# pragma message "FL_PORTING: implement Fl::remove_fd" +} + +void Fl::remove_fd(int n) { +# pragma message "FL_PORTING: implement Fl::remove_fd" +} + +static void nothing() {} +void (*fl_lock_function)() = nothing; +void (*fl_unlock_function)() = nothing; + +//void* Fl::thread_message() { +//# pragma message "FL_PORTING: implement Fl::thread_message" +//} + +int fl_wait(double time_to_wait) { +# pragma message "FL_PORTING: implement fl_wait" + Fl::flush(); + return 0; +} + +int fl_ready() { +# pragma message "FL_PORTING: implement fl_ready" + return 0; +} + +void fl_open_display() { +# pragma message "FL_PORTING: implement fl_open_display()" +} + +void Fl::enable_im() { +# pragma message "FL_PORTING: implement Fl::enable_im" +} + +void Fl::disable_im() { +# pragma message "FL_PORTING: implement Fl::disable_im" +} + +int Fl::x() +{ +# pragma message "FL_PORTING: implement Fl::x" + return 0; +} + +int Fl::y() +{ +# pragma message "FL_PORTING: implement Fl::y" + return 0; +} + +int Fl::h() +{ +# pragma message "FL_PORTING: implement Fl::h" + return 600; +} + +int Fl::w() +{ +# pragma message "FL_PORTING: implement Fl::w" + return 800; +} + +char *fl_selection_buffer[2]; +int fl_selection_length[2]; +int fl_selection_buffer_length[2]; +char fl_i_own_selection[2]; + +void fl_update_clipboard(void) { +# pragma message "FL_PORTING: implement fl_update_clipboard" +} + +// call this when you create a selection: +void Fl::copy(const char *stuff, int len, int clipboard, const char *type) { +# pragma message "FL_PORTING: implement Fl::copy" +} + +// Call this when a "paste" operation happens: +void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) { +# pragma message "FL_PORTING: implement Fl::paste" +} + +int Fl::clipboard_contains(const char *type) +{ +# pragma message "FL_PORTING: implement Fl::clipboard_contains" + return 0; +} + +void fl_get_codepage() +{ +# pragma message "FL_PORTING: implement fl_get_codepage" +} + +int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { +# pragma message "FL_PORTING: don't ask. We do't know either..." + return 0; +} + +void Fl_Window::resize(int X,int Y,int W,int H) { +# pragma message "FL_PORTING: implement Fl_Window::resize" +} + +//void Fl_X::make_fullscreen(int X, int Y, int W, int H) { +//# pragma message "FL_PORTING: implement Fl_X::make_fullscreen" +//} + +void Fl_Window::fullscreen_x() { +# pragma message "FL_PORTING: implement Fl_Window::fullscreen_x" +} + +void Fl_Window::fullscreen_off_x(int X, int Y, int W, int H) { +# pragma message "FL_PORTING: implement Fl_Window::fullscreen_off_x" +} + +void fl_fix_focus(); // in Fl.cxx + +char fl_show_iconic; +int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR + +Fl_X* Fl_X::make(Fl_Window* w) { +# pragma message "FL_PORTING: implement Fl_X::make" + return 0; +} + +void Fl::add_timeout(double time, Fl_Timeout_Handler cb, void* data) +{ +# pragma message "FL_PORTING: implement Fl::add_timeout" +} + +void Fl::repeat_timeout(double time, Fl_Timeout_Handler cb, void* data) +{ +# pragma message "FL_PORTING: implement Fl::repeat_timeout" +} + +int Fl::has_timeout(Fl_Timeout_Handler cb, void* data) +{ +# pragma message "FL_PORTING: implement Fl::has_timeout" + return 0; +} + +void Fl::remove_timeout(Fl_Timeout_Handler cb, void* data) +{ +# pragma message "FL_PORTING: implement Fl::remove_timeout" +} + +void Fl_Window::size_range_() { + size_range_set = 1; +} + +#include <FL/filename.H> // need so FL_EXPORT fl_filename_name works + +// returns pointer to the filename, or null if name ends with '/' +const char *fl_filename_name(const char *name) { +# pragma message "FL_PORTING: implement fl_filename_name" + return 0; +} + +void Fl_Window::label(const char *name,const char *iname) { +# pragma message "FL_PORTING: implement Fl_Window::label" +} + +void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) { +# pragma message "FL_PORTING: implement Fl_X::set_defult_icons" +} + +void Fl_X::set_icons() { +# pragma message "FL_PORTING: implement Fl_X::set_icons" +} + +int Fl_X::set_cursor(Fl_Cursor c) { +# pragma message "FL_PORTING: implement Fl_X::set_cursor" + return 1; +} + +int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { +# pragma message "FL_PORTING: implement Fl_X::set_cursor" + return 1; +} + +void Fl_Window::show() { +# pragma message "FL_PORTING: implement Fl_Window::show" +} + +Fl_Window *Fl_Window::current_; + +void Fl_Window::make_current() { +# pragma message "FL_PORTING: implement Fl_Window::make_current" +} + +void fl_free_fonts(void) +{ +# pragma message "FL_PORTING: implement fl_free_fonts" +} + + +//Fl_Region XRectangleRegion(int x, int y, int w, int h) { +//} + +FL_EXPORT Window fl_xid_(const Fl_Window *w) { + Fl_X *temp = Fl_X::i(w); + return temp ? temp->xid : 0; +} + +int Fl_Window::decorated_w() +{ + return w(); +} + +int Fl_Window::decorated_h() +{ + return h(); +} + +void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset) +{ +# pragma message "FL_PORTING: implement Fl_Paged_Device::print_window" +} + +//void Fl_Paged_Device::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset, Fl_Surface_Device *toset) +//{ +//} + +Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data) +{ +# pragma message "FL_PORTING: implement fl_create_bitmask" + return 0; +} + +//Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data) +//{ +//# pragma message "FL_PORTING: implement fl_create_alphamask" +// return 0; +//} + +void fl_delete_bitmask(Fl_Bitmask bm) +{ +# pragma message "FL_PORTING: implement fl_delete_bitmask" +} + +Fl_Offscreen fl_create_offscreen(int w, int h) +{ +# pragma message "FL_PORTING: implement fl_create_offscreen" + return 0; +} + +//void fl_copy_offscreen(int x,int y,int w,int h, Fl_Offscreen gWorld, int srcx,int srcy) +//{ +//# pragma message "FL_PORTING: implement fl_copy_offscreen" +//} + +void fl_delete_offscreen(Fl_Offscreen gWorld) +{ +# pragma message "FL_PORTING: implement fl_delete_offscreen" +} + +void fl_begin_offscreen(Fl_Offscreen gWorld) +{ +# pragma message "FL_PORTING: implement fl_begin_offscreen" +} + +void fl_end_offscreen() +{ +# pragma message "FL_PORTING: implement fl_end_offscreen" +} + +void fl_clipboard_notify_change() { +# pragma message "FL_PORTING: implement fl_clipboard_notify_change" +} + +Fl_Font_Descriptor::~Fl_Font_Descriptor() +{ +# pragma message "FL_PORTING: implement Fl_Font_Descriptor::~Fl_Font_Descriptor" +} + +int Fl::dnd() +{ +# pragma message "FL_PORTING: implement Fl::dnd" + return 0; +} + +void Fl::get_mouse(int &x, int &y) +{ +# pragma message "FL_PORTING: implement Fl::get_mouse" + x = 0; y = 0; +} + +void Fl_X::flush() +{ +# pragma message "FL_PORTING: implement Fl_X::flush" +} + +#endif // FL_DOXYGEN + +// +// End of "$Id$". +// diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 5422735b5..f860f9b71 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -22,6 +22,7 @@ //# include "Fl_mac.cxx" // now Fl_cocoa.mm #elif defined(FL_PORTING) # pragma message "FL_PORTING: implement the FLTK core in its own file" +# include "Fl_porting.cxx" #elif !defined(FL_DOXYGEN) # define CONSOLIDATE_MOTION 1 diff --git a/src/filename_list.cxx b/src/filename_list.cxx index 926a28d6b..920d8b0e6 100644 --- a/src/filename_list.cxx +++ b/src/filename_list.cxx @@ -121,6 +121,9 @@ int fl_filename_list(const char *d, dirent ***list, # else int n = scandir(dirloc, list, 0, (int(*)(const void*,const void*))sort); # endif +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: defien scandir" + int n = 0; #else // The vast majority of UNIX systems want the sort function to have this // prototype, most likely so that it can be passed to qsort without any diff --git a/src/fl_arci.cxx b/src/fl_arci.cxx index ac3b839fb..90ec5010d 100644 --- a/src/fl_arci.cxx +++ b/src/fl_arci.cxx @@ -68,8 +68,9 @@ 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 +#elif defined(FL_PORTING) # pragma message "FL_PORTING: implement arc drawing" +#else # error unsupported platform #endif } @@ -114,8 +115,9 @@ 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 +#elif defined(FL_PORTING) # pragma message "FL_PORTING: implement pie drawing (mmmh, apple pie)" +#else # error unsupported platform #endif } diff --git a/src/fl_color.cxx b/src/fl_color.cxx index 38e09242e..9723e2b38 100644 --- a/src/fl_color.cxx +++ b/src/fl_color.cxx @@ -29,6 +29,7 @@ # 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" +# include "fl_color_porting.cxx" #else // Also code to look at the X visual and figure out the best way to turn diff --git a/src/fl_color_porting.cxx b/src/fl_color_porting.cxx new file mode 100644 index 000000000..8dc6b850f --- /dev/null +++ b/src/fl_color_porting.cxx @@ -0,0 +1,50 @@ +// +// "$Id$" +// +// MacOS color functions for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2010 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +// The fltk "colormap". This allows ui colors to be stored in 8-bit +// locations, and provides a level of indirection so that global color +// changes can be made. Not to be confused with the X colormap, which +// I try to hide completely. + +// matt: Neither Quartz nor Quickdraw support colormaps in this implementation +// matt: Quartz support done + +#include <config.h> +#include <FL/Fl.H> +#include <FL/x.H> +#include <FL/fl_draw.H> + +static unsigned fl_cmap[256] = { +#include "fl_cmap.h" // this is a file produced by "cmap.cxx": +}; + +//void Fl_XXX_Graphics_Driver::color(Fl_Color i) { +//} + +//void Fl_XXX_Graphics_Driver::color(uchar r, uchar g, uchar b) { +//} + +void Fl::set_color(Fl_Color i, unsigned c) { + if (fl_cmap[i] != c) { + fl_cmap[i] = c; + } +} + +// +// End of "$Id$". +// diff --git a/src/fl_draw_image.cxx b/src/fl_draw_image.cxx index 7312061c5..70718e657 100644 --- a/src/fl_draw_image.cxx +++ b/src/fl_draw_image.cxx @@ -32,6 +32,8 @@ # include "fl_draw_image_mac.cxx" #elif defined(FL_PORTING) # pragma message "FL_PORTING: implement image drawing in its own file" +# include <FL/x.H> +void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { } #else // A list of assumptions made about the X display: diff --git a/src/fl_font.cxx b/src/fl_font.cxx index 4e6fb4de6..a2e5675cb 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -57,7 +57,10 @@ # include "fl_font_x.cxx" #endif // WIN32 -#if ! (defined(WIN32) || defined(__APPLE__)) +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you need the XFontStruct" +#else XFontStruct *fl_X_core_font() { return fl_xfont.value(); diff --git a/src/fl_line_style.cxx b/src/fl_line_style.cxx index 14965e4fd..aae740e4f 100644 --- a/src/fl_line_style.cxx +++ b/src/fl_line_style.cxx @@ -154,8 +154,9 @@ void Fl_Graphics_Driver::line_style(int style, int width, char* dashes) { fl_quartz_line_pattern_size = 0; } fl_quartz_restore_line_style_(); -#else +#elif defined(FL_PORTING) # pragma message "FL_PORTING: implement line styles here" +#else # error unsupported platform #endif } diff --git a/src/fl_read_image.cxx b/src/fl_read_image.cxx index f42fc6804..d968e4c13 100644 --- a/src/fl_read_image.cxx +++ b/src/fl_read_image.cxx @@ -28,6 +28,7 @@ #if defined(WIN32) || defined(__APPLE__) #elif defined(FL_PORTING) # pragma message "FL_PORTING: implement code to read RGB data from screen" +static uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha) { } #else #endif @@ -175,6 +176,9 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate #ifdef WIN32 # include "fl_read_image_win32.cxx" // gives the WIN32 version of read_win_rectangle() +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: create your own version of fl_read_image.cxx" +# include "fl_read_image_porting.cxx" #else # include <X11/Xutil.h> # ifdef __sgi diff --git a/src/fl_read_image_porting.cxx b/src/fl_read_image_porting.cxx new file mode 100644 index 000000000..2b5278ecb --- /dev/null +++ b/src/fl_read_image_porting.cxx @@ -0,0 +1,33 @@ +// +// "$Id$" +// +// WIN32 image reading routines for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2010 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +#include <config.h> + +// +// 'fl_read_image()' - Read an image from the current window or off-screen buffer. +// + +//uchar *fl_read_image(uchar *p, int x, int y, int w, int h, int alpha) +//{ +// return 0; +//} + + +// +// End of "$Id$". +// diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index 034615d44..9c789e54b 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -178,6 +178,8 @@ void Fl_Graphics_Driver::rect(int x, int y, int w, int h) { CGRect rect = CGRectMake(x, y, w-1, h-1); CGContextStrokeRect(fl_gc, rect); if ( (!USINGQUARTZPRINTER) && fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement rect" #else # error unsupported platform #endif @@ -196,6 +198,8 @@ void Fl_Graphics_Driver::rectf(int x, int y, int w, int h) { #elif defined(__APPLE_QUARTZ__) CGRect rect = CGRectMake(x - 0.5, y - 0.5, w , h); CGContextFillRect(fl_gc, rect); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement rectf" #else # error unsupported platform #endif @@ -220,6 +224,8 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1) { CGContextFillRect(fl_gc, CGRectMake(x1-0.5 , y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement xyline" #else # error unsupported platform #endif @@ -248,6 +254,8 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1, int y2) { CGContextFillRect(fl_gc, CGRectMake(x1 - fl_quartz_line_width_/2, y2-0.5, fl_quartz_line_width_, 1)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement xyline" #else #error unsupported platform #endif @@ -279,6 +287,8 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) { CGContextFillRect(fl_gc, CGRectMake(x3-0.5, y2 - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement xyline" #else # error unsupported platform #endif @@ -301,6 +311,8 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1) { CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y1-0.5, fl_quartz_line_width_, 1)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement yxline" #else # error unsupported platform #endif @@ -329,6 +341,8 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1, int x2) { CGContextFillRect(fl_gc, CGRectMake(x2-0.5, y1 - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement yxline" #else # error unsupported platform #endif @@ -360,6 +374,8 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3) { CGContextFillRect(fl_gc, CGRectMake(x2 - fl_quartz_line_width_/2, y3-0.5, fl_quartz_line_width_, 1)); } if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement yxline" #else # error unsupported platform #endif @@ -380,6 +396,8 @@ void Fl_Graphics_Driver::line(int x, int y, int x1, int y1) { CGContextAddLineToPoint(fl_gc, x1, y1); CGContextStrokePath(fl_gc); if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement line" #else # error unsupported platform #endif @@ -406,6 +424,8 @@ void Fl_Graphics_Driver::line(int x, int y, int x1, int y1, int x2, int y2) { CGContextAddLineToPoint(fl_gc, x2, y2); CGContextStrokePath(fl_gc); if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement line" #else # error unsupported platform #endif @@ -432,6 +452,8 @@ void Fl_Graphics_Driver::loop(int x, int y, int x1, int y1, int x2, int y2) { CGContextClosePath(fl_gc); CGContextStrokePath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement loop" #else # error unsupported platform #endif @@ -461,6 +483,8 @@ void Fl_Graphics_Driver::loop(int x, int y, int x1, int y1, int x2, int y2, int CGContextClosePath(fl_gc); CGContextStrokePath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement loop" #else # error unsupported platform #endif @@ -486,6 +510,8 @@ void Fl_Graphics_Driver::polygon(int x, int y, int x1, int y1, int x2, int y2) { CGContextClosePath(fl_gc); CGContextFillPath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement polygon" #else # error unsupported platform #endif @@ -513,6 +539,8 @@ void Fl_Graphics_Driver::polygon(int x, int y, int x1, int y1, int x2, int y2, i CGContextClosePath(fl_gc); CGContextFillPath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement polygon" #else # error unsupported platform #endif @@ -525,6 +553,8 @@ void Fl_Graphics_Driver::point(int x, int y) { SetPixel(fl_gc, x, y, fl_RGB()); #elif defined(__APPLE_QUARTZ__) CGContextFillRect(fl_gc, CGRectMake(x - 0.5, y - 0.5, 1, 1) ); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement point" #else # error unsupported platform #endif @@ -532,7 +562,11 @@ void Fl_Graphics_Driver::point(int x, int y) { //////////////////////////////////////////////////////////////// -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement region stuff" +#else // Missing X call: (is this the fastest way to init a 1-rectangle region?) // MSWindows equivalent exists, implemented inline in win32.H Fl_Region XRectangleRegion(int x, int y, int w, int h) { @@ -562,6 +596,8 @@ void Fl_Graphics_Driver::restore_clip() { CGContextClipToRects(fl_gc, r->rects, r->count); } } +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement restore_clip" #else # error unsupported platform #endif @@ -594,6 +630,8 @@ void Fl_Graphics_Driver::push_clip(int x, int y, int w, int h) { #elif defined(__APPLE_QUARTZ__) XDestroyRegion(r); r = Fl_X::intersect_region_and_rect(current, x,y,w,h); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement push_clip" #else # error unsupported platform #endif @@ -605,6 +643,8 @@ void Fl_Graphics_Driver::push_clip(int x, int y, int w, int h) { r = CreateRectRgn(0,0,0,0); #elif defined(__APPLE_QUARTZ__) r = XRectangleRegion(0,0,0,0); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement push_clip" #else # error unsupported platform #endif @@ -655,6 +695,8 @@ int Fl_Graphics_Driver::not_clipped(int x, int y, int w, int h) { if (!CGRectIsEmpty(test)) return 1; } return 0; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement not_clipped" #else # error unsupported platform #endif @@ -730,6 +772,8 @@ int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int H = int(u.size.height + 0.5); if(CGRectIsEmpty(u)) W = H = 0; return ! CGRectEqualToRect(arg, u); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement clip_box" #else # error unsupported platform #endif diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx index 3203e2c60..538c7b28c 100644 --- a/src/fl_scroll_area.cxx +++ b/src/fl_scroll_area.cxx @@ -150,8 +150,9 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy, Fl_X::q_end_image(); CFRelease(img); } -#else +#elif defined(FL_PORTING) # pragma message "FL_PORTING: implement scrolling of the screen contents" +#else # error unsupported platform #endif if (dx) draw_area(data, clip_x, dest_y, clip_w, src_h); diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx index 865f8f00d..8931b9a5e 100644 --- a/src/fl_set_font.cxx +++ b/src/fl_set_font.cxx @@ -50,7 +50,7 @@ void Fl::set_font(Fl_Font fnum, const char* name) { for (; i < table_size; i++) { fl_fonts[i].fontname[0] = 0; fl_fonts[i].name = 0; -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(USE_X11) fl_fonts[i].xlist = 0; fl_fonts[i].n = 0; #endif // !WIN32 && !__APPLE__ @@ -59,7 +59,7 @@ void Fl::set_font(Fl_Font fnum, const char* name) { Fl_Fontdesc* s = fl_fonts+fnum; if (s->name) { if (!strcmp(s->name, name)) {s->name = name; return;} -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(USE_X11) if (s->xlist && s->n >= 0) XFreeFontNames(s->xlist); #endif for (Fl_Font_Descriptor* f = s->first; f;) { @@ -69,7 +69,7 @@ void Fl::set_font(Fl_Font fnum, const char* name) { } s->name = name; s->fontname[0] = 0; -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(USE_X11) s->xlist = 0; #endif s->first = 0; diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index dc346c46f..7cf12dd97 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -243,6 +243,8 @@ const char* fl_shortcut_label(unsigned int shortcut, const char **eom) { } *p = 0; return buf; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement fl_shortcut_label" #else const char* q; if (key == FL_Enter || key == '\r') q="Enter"; // don't use Xlib's "Return": diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index e1375d84f..9ddc73dd0 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -62,6 +62,14 @@ extern "C" { unsigned short XUtf8IsNonSpacing(unsigned int ucs); } +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement utf8 tools." +extern "C" { + int XUtf8Tolower(int ucs); + unsigned short XUtf8IsNonSpacing(unsigned int ucs); +} + #else // X-windows platform # include "Xutf8.h" @@ -623,6 +631,11 @@ int fl_chmod(const char* f, int mode) { wbuf[wn] = 0; return _wchmod(wbuf, mode); +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement utf8 version of chmod." + return -1; + #else // other platforms return chmod(f, mode); @@ -653,6 +666,11 @@ int fl_access(const char* f, int mode) { wbuf[wn] = 0; return _waccess(wbuf, mode); +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement utf8 version of access." + return -1; + #else // other platforms return access(f, mode); @@ -683,6 +701,11 @@ int fl_stat(const char* f, struct stat *b) { wbuf[wn] = 0; return _wstat(wbuf, (struct _stat*)b); +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement utf8 version of stat." + return -1; + #else // other platforms return stat(f, b); @@ -782,6 +805,11 @@ int fl_mkdir(const char* f, int mode) { wbuf[wn] = 0; return _wmkdir(wbuf); +#elif defined(FL_PORTING) + +# pragma message "FL_PORTING: implement utf8 version of mkdir." + return -1; + #else // other platforms return mkdir(f, mode); diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx index c44178eba..1f7f6b9e0 100644 --- a/src/fl_vertex.cxx +++ b/src/fl_vertex.cxx @@ -131,6 +131,8 @@ void Fl_Graphics_Driver::end_points() { CGContextStrokePath(fl_gc); } if (fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement end_points" #else # error unsupported platform #endif @@ -153,6 +155,8 @@ void Fl_Graphics_Driver::end_line() { CGContextAddLineToPoint(fl_gc, p[i].x, p[i].y); CGContextStrokePath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement end_line" #else # error unsupported platform #endif @@ -190,6 +194,8 @@ void Fl_Graphics_Driver::end_polygon() { CGContextClosePath(fl_gc); CGContextFillPath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement end_polygon" #else # error unsupported platform #endif @@ -238,6 +244,8 @@ void Fl_Graphics_Driver::end_complex_polygon() { CGContextClosePath(fl_gc); CGContextFillPath(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement end_complex_polygon" #else # error unsupported platform #endif @@ -273,6 +281,8 @@ void Fl_Graphics_Driver::circle(double x, double y,double r) { CGContextAddArc(fl_gc, xt, yt, (w+h)*0.25f, 0, 2.0f*M_PI, 0); (what == POLYGON ? CGContextFillPath : CGContextStrokePath)(fl_gc); CGContextSetShouldAntialias(fl_gc, false); +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement circle" #else # error unsupported platform #endif diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index 2d501e741..d8500ac75 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -38,8 +38,11 @@ #include "Fl_Font.H" #include <FL/fl_utf8.h> -#if !defined(WIN32) && !defined(__APPLE__) -#include "Xutf8.h" +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h? It's written for X11." +#else +# include "Xutf8.h" #endif #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4 diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx index 3cf2be42b..45a2a07e5 100644 --- a/src/screen_xywh.cxx +++ b/src/screen_xywh.cxx @@ -145,6 +145,7 @@ static void screen_init() { #elif defined(FL_PORTING) # pragma message "FL_PORTING: return various information about the screens in the system" +static void screen_init() { } #else @@ -298,6 +299,9 @@ void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int n) { Y = screens[n].y; W = screens[n].width; H = screens[n].height; +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement screen_xywh" + X = 0; Y = 0; W = 800; H = 600; #else if (num_screens > 0) { X = screens[n].x_org; @@ -394,6 +398,8 @@ void Fl::screen_dpi(float &h, float &v, int n) h = dpi_h[n]; v = dpi_v[n]; } +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: implement screen_dpi" #else if (n >= 0 && n < num_screens) { h = dpi[n][0]; diff --git a/src/xutf8/is_right2left.c b/src/xutf8/is_right2left.c index 19685ad5c..193820ee6 100644 --- a/src/xutf8/is_right2left.c +++ b/src/xutf8/is_right2left.c @@ -24,7 +24,10 @@ * This file is required on all platforms for utf8 support */ -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) || defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h? It's written for X11." +#else # include "../Xutf8.h" #endif /* !defined(WIN32) && !defined(__APPLE__) */ diff --git a/src/xutf8/keysym2Ucs.c b/src/xutf8/keysym2Ucs.c index d01a3a751..1629d0934 100644 --- a/src/xutf8/keysym2Ucs.c +++ b/src/xutf8/keysym2Ucs.c @@ -16,7 +16,11 @@ #define KEYSYM2UCS_INCLUDED -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h?" +#else #include "../Xutf8.h" #include "imKStoUCS.c" diff --git a/src/xutf8/utf8Input.c b/src/xutf8/utf8Input.c index 5682ac7b6..7e21e3f55 100644 --- a/src/xutf8/utf8Input.c +++ b/src/xutf8/utf8Input.c @@ -14,7 +14,11 @@ * http://www.fltk.org/str.php */ -#if !defined(WIN32) && !defined(__APPLE__) +#if defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h?" +#else #include <config.h> #include "../Xutf8.h" diff --git a/src/xutf8/utf8Utils.c b/src/xutf8/utf8Utils.c index 17d49d34c..7c921906b 100644 --- a/src/xutf8/utf8Utils.c +++ b/src/xutf8/utf8Utils.c @@ -24,7 +24,11 @@ * Unicode to UTF-8 conversion functions. */ -#if !defined(WIN32) && !defined(__APPLE__) +#elif defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h?" +#else #include "../Xutf8.h" diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c index 32619fe0a..13e515f10 100644 --- a/src/xutf8/utf8Wrap.c +++ b/src/xutf8/utf8Wrap.c @@ -23,7 +23,11 @@ /* * X11 UTF-8 text drawing functions. */ -#if !defined(WIN32) && !defined(__APPLE__) +#elif defined(WIN32) +#elif defined(__APPLE__) +#elif defined(FL_PORTING) +# pragma message "FL_PORTING: do you want to include Xutf8.h?" +#else #include "../Xutf8.h" #include <X11/Xlib.h> |
