mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 06:14:28 +08:00
Driver-based Fl_Double_Window implementation - continued.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11304 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#define Fl_Double_Window_H
|
#define Fl_Double_Window_H
|
||||||
|
|
||||||
#include "Fl_Window.H"
|
#include "Fl_Window.H"
|
||||||
|
class Fl_Overlay_Window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The Fl_Double_Window provides a double-buffered window.
|
The Fl_Double_Window provides a double-buffered window.
|
||||||
@@ -44,8 +45,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
Return non-null if this is an Fl_Overlay_Window object.
|
Return non-null if this is an Fl_Overlay_Window object.
|
||||||
*/
|
*/
|
||||||
virtual Fl_Double_Window *as_overlay_window() {return NULL; }
|
virtual Fl_Overlay_Window *as_overlay_window() {return NULL; }
|
||||||
public:
|
virtual Fl_Double_Window *as_double_window() {return this; }
|
||||||
void show();
|
void show();
|
||||||
void show(int a, char **b) {Fl_Window::show(a,b);}
|
void show(int a, char **b) {Fl_Window::show(a,b);}
|
||||||
void flush();
|
void flush();
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ protected:
|
|||||||
Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0);
|
Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0);
|
||||||
public:
|
public:
|
||||||
void show(int a, char **b) {Fl_Double_Window::show(a,b);}
|
void show(int a, char **b) {Fl_Double_Window::show(a,b);}
|
||||||
virtual Fl_Double_Window *as_overlay_window() {return this; }
|
virtual Fl_Overlay_Window *as_overlay_window() {return this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+5
-1
@@ -37,7 +37,7 @@ class Fl_X;
|
|||||||
class Fl_Window_Driver;
|
class Fl_Window_Driver;
|
||||||
class Fl_RGB_Image;
|
class Fl_RGB_Image;
|
||||||
class Fl_Shared_Image;
|
class Fl_Shared_Image;
|
||||||
|
class Fl_Double_Window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This widget produces an actual window. This can either be a main
|
This widget produces an actual window. This can either be a main
|
||||||
@@ -637,6 +637,10 @@ public:
|
|||||||
void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
|
void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
|
||||||
Fl_Window_Driver *driver() { return i; }
|
Fl_Window_Driver *driver() { return i; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return non-null if this is an Fl_Overlay_Window object.
|
||||||
|
*/
|
||||||
|
virtual Fl_Double_Window *as_double_window() {return NULL; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,9 +22,21 @@
|
|||||||
#include <FL/Fl_Double_Window.H>
|
#include <FL/Fl_Double_Window.H>
|
||||||
#include <FL/fl_draw.H>
|
#include <FL/fl_draw.H>
|
||||||
|
|
||||||
|
// class used for Fl_Double_Window but not for Fl_Overlay_Window
|
||||||
|
class Fl_Cocoa_Double_Window_Driver : public Fl_Cocoa_Window_Driver {
|
||||||
|
public:
|
||||||
|
Fl_Cocoa_Double_Window_Driver(Fl_Window *w) : Fl_Cocoa_Window_Driver(w) {}
|
||||||
|
int double_flush(int eraseoverlay) {
|
||||||
|
draw();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
|
Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
|
||||||
{
|
{
|
||||||
|
if (w->as_double_window() && !w->as_double_window()->as_overlay_window())
|
||||||
|
return new Fl_Cocoa_Double_Window_Driver(w);
|
||||||
|
else
|
||||||
return new Fl_Cocoa_Window_Driver(w);
|
return new Fl_Cocoa_Window_Driver(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,16 +55,6 @@ void Fl_Cocoa_Window_Driver::take_focus()
|
|||||||
set_key_window();
|
set_key_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl_Cocoa_Window_Driver::double_flush(int eraseoverlay) {
|
|
||||||
if ( ((Fl_Double_Window*)w)->as_overlay_window() ) {
|
|
||||||
Fl_Window_Driver::double_flush(eraseoverlay);
|
|
||||||
} else {
|
|
||||||
draw();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class FL_EXPORT Fl_Cocoa_Window_Driver : public Fl_Window_Driver
|
|||||||
public:
|
public:
|
||||||
Fl_Cocoa_Window_Driver(Fl_Window*);
|
Fl_Cocoa_Window_Driver(Fl_Window*);
|
||||||
virtual void take_focus();
|
virtual void take_focus();
|
||||||
int double_flush(int eraseoverlay);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user