Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
@ -1798,7 +1798,7 @@ int Fl_Window::handle(int ev)
@@ -1798,7 +1798,7 @@ int Fl_Window::handle(int ev)
}
#if defined(USE_X11) || defined(WIN32)
XUnmapWindow(fl_display,fl_xid(this));
#elif defined(__APPLE_QUARTZ__)
#elif defined(__APPLE_QUARTZ__)// PORTME: platform window unmapping, again
i->unmap();
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: code to hide a window from screen"
@ -1966,7 +1966,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
@@ -1966,7 +1966,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
Fl_RegionR=XRectangleRegion(X,Y,W,H);
CombineRgn(i->region,i->region,R,RGN_OR);
XDestroyRegion(R);
#elif defined(__APPLE_QUARTZ__)
#elif defined(__APPLE_QUARTZ__)// PORTME: platform damage region
CGRectarg=fl_cgrectmake_cocoa(X,Y,W,H);
intj;// don't add a rectangle totally inside the Fl_Region
/** Copies a window and its borders and title bar to the clipboard.
@ -232,7 +232,7 @@ void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int del
@@ -232,7 +232,7 @@ void Fl_Copy_Surface::draw_decorated_window(Fl_Window* win, int delta_x, int del
@ -59,7 +59,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@@ -59,7 +59,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@ -81,14 +81,14 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@@ -81,14 +81,14 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@ -97,7 +97,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@@ -97,7 +97,7 @@ static Fl_RGB_Image* capture_gl_rectangle(Fl_Gl_Window *glw, int x, int y, int w
@ -122,7 +122,7 @@ class menuwindow : public Fl_Menu_Window {
@@ -122,7 +122,7 @@ class menuwindow : public Fl_Menu_Window {
public:
menutitle*title;
inthandle(int);
#if defined (__APPLE__) || defined (USE_X11)
#if defined (__APPLE__) || defined (USE_X11)// PORTME: menubar
intearly_hide_handle(int);
#endif
intitemheight;// zero == menubar
@ -653,7 +653,7 @@ static int backward(int menu) { // previous item in menu menu if possible
@@ -653,7 +653,7 @@ static int backward(int menu) { // previous item in menu menu if possible
}
intmenuwindow::handle(inte){
#if defined (__APPLE__) || defined (USE_X11)
#if defined (__APPLE__) || defined (USE_X11)// PORTME: menubar
// This off-route takes care of the "detached menu" bug on OS X.
// Apple event handler requires that we hide all menu windows right
// now, so that Carbon can continue undisturbed with handling window
@ -746,7 +746,7 @@ int menuwindow::early_hide_handle(int e) {
@@ -746,7 +746,7 @@ int menuwindow::early_hide_handle(int e) {
@ -141,7 +141,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
@@ -141,7 +141,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
@ -1664,7 +1664,7 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
@@ -1664,7 +1664,7 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
#ifdef __APPLE__// PORTME: platform character composition
staticintinsertion_point_x=0;
staticintinsertion_point_y=0;
staticintinsertion_point_height=0;
@ -132,7 +132,7 @@ void Fl::insertion_point_location(int x, int y, int height) {
@@ -132,7 +132,7 @@ void Fl::insertion_point_location(int x, int y, int height) {
insertion_point_y=y;
insertion_point_height=height;
}
#endif // __APPLE__
#endif // __APPLE__ // PORTME: platform character composition
@ -143,7 +143,7 @@ void Fl::insertion_point_location(int x, int y, int height) {
@@ -143,7 +143,7 @@ void Fl::insertion_point_location(int x, int y, int height) {
voidFl::compose_reset()
{
Fl::compose_state=0;
#if defined(WIN32) || defined(__APPLE__)
#if defined(WIN32) || defined(__APPLE__)// PORTME: platform character composition
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: compose reset extra functions"
# pragma message "FL_PORTING: implement platform specific about pixmap drawing here"
#else
@ -256,7 +256,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
@@ -256,7 +256,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
}
// FIXME: Hack until fl_draw_image() supports alpha properly
@ -264,7 +264,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
@@ -264,7 +264,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
@ -289,7 +289,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
@@ -289,7 +289,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
#if defined(WIN32) || defined(__APPLE__)// PORTME: platform font stuff
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you need the XFontStruct ?"
#else
@ -64,7 +64,7 @@ void fl_text_extents(const char *c, int &dx, int &dy, int &w, int &h) {
@@ -64,7 +64,7 @@ void fl_text_extents(const char *c, int &dx, int &dy, int &w, int &h) {
voidfl_draw(constchar*str,intl,floatx,floaty){
#ifdef __APPLE__
#ifdef __APPLE__// PORTME: platform alternative API
@ -638,7 +638,7 @@ static uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha
@@ -638,7 +638,7 @@ static uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha
@ -141,7 +141,7 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
@@ -141,7 +141,7 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
// Great, we can do an accelerated scroll instead of re-rendering