summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx12
-rw-r--r--src/Fl_Screen_Driver.cxx4
-rw-r--r--src/Fl_cocoa.mm12
-rw-r--r--src/Fl_win32.cxx10
-rw-r--r--src/Fl_x.cxx7
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H1
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.H2
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H4
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.H4
11 files changed, 42 insertions, 16 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index bdd68d9f9..9a4dda794 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1920,6 +1920,18 @@ int Fl::get_key(int k) {
return system_driver()->get_key(k);
}
+void Fl::get_mouse(int &x, int &y) {
+ Fl::screen_driver()->get_mouse(x, y);
+}
+
+const char * fl_filename_name(const char *name) {
+ return Fl::system_driver()->filename_name(name);
+}
+
+void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
+ Fl::system_driver()->copy(stuff, len, clipboard, type);
+}
+
//
// End of "$Id$".
//
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index bba7d8cf7..1b4a3be1f 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -53,7 +53,7 @@ int Fl_Screen_Driver::visual(int) {
void Fl_Screen_Driver::screen_xywh(int &X, int &Y, int &W, int &H)
{
int x, y;
- Fl::get_mouse(x, y);
+ get_mouse(x, y);
screen_xywh(X, Y, W, H, x, y);
}
@@ -67,7 +67,7 @@ void Fl_Screen_Driver::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int m
void Fl_Screen_Driver::screen_work_area(int &X, int &Y, int &W, int &H)
{
int x, y;
- Fl::get_mouse(x, y);
+ get_mouse(x, y);
screen_work_area(X, Y, W, H, x, y);
}
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 9720977e3..dfc28741f 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1920,7 +1920,7 @@ void Fl_Cocoa_Screen_Driver::screen_work_area(int &X, int &Y, int &W, int &H, in
/*
* get the current mouse pointer world coordinates
*/
-void Fl::get_mouse(int &x, int &y)
+void Fl_Cocoa_Screen_Driver::get_mouse(int &x, int &y)
{
fl_open_display();
NSPoint pt = [NSEvent mouseLocation];
@@ -3114,7 +3114,7 @@ void Fl_Cocoa_Window_Driver::wait_for_expose()
/*
* returns pointer to the filename, or null if name ends with ':'
*/
-const char *fl_filename_name( const char *name )
+const char *Fl_Darwin_System_Driver::filename_name( const char *name )
{
const char *p, *q;
if (!name) return (0);
@@ -3379,7 +3379,7 @@ static void resize_selection_buffer(int len, int clipboard) {
* len: size of selected data
* type: always "plain/text" for now
*/
-void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
+void Fl_Darwin_System_Driver::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
if (clipboard >= 2)
clipboard = 1; // Only on X11 do multiple clipboards make sense.
@@ -4268,7 +4268,7 @@ int Fl_Cocoa_Window_Driver::decorated_h()
}
// clip the graphics context to rounded corners
-void Fl_X::clip_to_rounded_corners(CGContextRef gc, int w, int h) {
+static void clip_to_rounded_corners(CGContextRef gc, int w, int h) {
const CGFloat radius = 5;
CGContextMoveToPoint(gc, 0, 0);
CGContextAddLineToPoint(gc, 0, h - radius);
@@ -4294,7 +4294,7 @@ void Fl_Cocoa_Window_Driver::draw_layer_to_context(CALayer *layer, CGContextRef
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
CGContextSaveGState(gc);
- Fl_X::clip_to_rounded_corners(gc, w, h);
+ clip_to_rounded_corners(gc, w, h);
CGContextSetRGBFillColor(gc, .79, .79, .79, 1.); // equiv. to FL_DARK1
CGContextFillRect(gc, CGRectMake(0, 0, w, h));
CGContextSetShouldAntialias(gc, true);
@@ -4322,7 +4322,7 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top,
} else {
CGImageRef img = Fl_X::CGImage_from_window_rect(pWindow, 0, -htop, w(), htop);
CGContextSaveGState(auxgc);
- Fl_X::clip_to_rounded_corners(auxgc, w(), htop);
+ clip_to_rounded_corners(auxgc, w(), htop);
CGContextDrawImage(auxgc, CGRectMake(0, 0, w(), htop), img);
CGContextRestoreGState(auxgc);
CFRelease(img);
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 9a2e8ffb0..974d2e22d 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -55,6 +55,7 @@ void fl_cleanup_dc_list(void);
#include <FL/Fl_Graphics_Driver.H> // for fl_graphics_driver
#include "drivers/WinAPI/Fl_WinAPI_Window_Driver.H"
#include "drivers/WinAPI/Fl_WinAPI_System_Driver.H"
+#include "drivers/WinAPI/Fl_WinAPI_Screen_Driver.H"
#include <FL/fl_utf8.h>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
@@ -573,7 +574,7 @@ void Fl::disable_im() {
////////////////////////////////////////////////////////////////
-void Fl::get_mouse(int &x, int &y) {
+void Fl_WinAPI_Screen_Driver::get_mouse(int &x, int &y) {
POINT p;
GetCursorPos(&p);
x = p.x;
@@ -666,7 +667,7 @@ void fl_update_clipboard(void) {
}
// call this when you create a selection:
-void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
+void Fl_WinAPI_System_Driver::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
if (clipboard >= 2)
clipboard = 1; // Only on X11 do multiple clipboards make sense.
@@ -1928,12 +1929,11 @@ void Fl_X::set_minmax(LPMINMAXINFO minmax)
}
}
-////////////////////////////////////////////////////////////////
-#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) {
+const char *Fl_WinAPI_System_Driver::filename_name(const char *name) {
const char *p,*q;
if (!name) return (0);
q = name;
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 387459f6b..3c7245efc 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -39,6 +39,7 @@
# include "flstring.h"
# include "drivers/X11/Fl_X11_Screen_Driver.H"
# include "drivers/X11/Fl_X11_Window_Driver.H"
+# include "drivers/X11/Fl_X11_System_Driver.H"
# include <unistd.h>
# include <time.h>
# include <sys/time.h>
@@ -787,7 +788,7 @@ void fl_close_display() {
}
-void Fl::get_mouse(int &xx, int &yy) {
+void Fl_X11_Screen_Driver::get_mouse(int &xx, int &yy) {
fl_open_display();
Window root = RootWindow(fl_display, fl_screen);
Window c; int mx,my,cx,cy; unsigned int mask;
@@ -940,7 +941,7 @@ static int get_xwinprop(Window wnd, Atom prop, long max_length,
////////////////////////////////////////////////////////////////
// Code for copying to clipboard and DnD out of the program:
-void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
+void Fl_X11_System_Driver::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
if (clipboard >= 2) {
@@ -2844,7 +2845,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
////////////////////////////////////////////////////////////////
// returns pointer to the filename, or null if name ends with '/'
-const char *fl_filename_name(const char *name) {
+const char *Fl_X11_System_Driver::filename_name(const char *name) {
const char *p,*q;
if (!name) return (0);
for (p=q=name; *p;) if (*p++ == '/') q = p;
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
index 23e123e9c..b64cf91b2 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
@@ -90,6 +90,7 @@ public:
virtual int compose(int &del);
virtual uchar *read_image(uchar *p, int x, int y, int w, int h, int alpha);
virtual int input_widget_handle_key(int key, unsigned mods, unsigned shift, Fl_Input *input);
+ virtual void get_mouse(int &x, int &y);
};
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
index 7a7651898..9f9f7f5b0 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
@@ -68,6 +68,8 @@ public:
virtual Fl_Pixmap *tree_closepixmap();
static const char * const tree_close_xpm_darwin[]; // used by tree_closepixmap()
virtual int tree_connector_style();
+ virtual const char *filename_name(const char *buf);
+ virtual void copy(const char *stuff, int len, int clipboard, const char *type);
};
#endif // FL_DARWIN_SYSTEM_DRIVER_H
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
index a8c530fbe..b24045433 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H
@@ -72,6 +72,7 @@ public:
virtual int dnd(int unused);
virtual int compose(int &del);
virtual uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha);
+ virtual void get_mouse(int &x, int &y);
};
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index 67c2e8b73..d544b239c 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -102,6 +102,10 @@ public:
virtual int backslash_as_slash() {return 1;}
virtual int colon_is_drive() {return 1;}
virtual int case_insensitive_filenames() {return 1;}
+ // this one is implemented in Fl_win32.cxx
+ virtual const char *filename_name(const char *buf);
+ // this one is in Fl_win32.cxx
+ virtual void copy(const char *stuff, int len, int clipboard, const char *type);
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H
index f639fd6cb..72f4358b2 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.H
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.H
@@ -78,6 +78,7 @@ public:
virtual void compose_reset();
virtual int text_display_can_leak();
virtual uchar *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha);
+ virtual void get_mouse(int &x, int &y);
};
diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H
index dc97c5f99..b6e87922d 100644
--- a/src/drivers/X11/Fl_X11_System_Driver.H
+++ b/src/drivers/X11/Fl_X11_System_Driver.H
@@ -45,6 +45,10 @@ public:
virtual int utf8locale();
// this one is in Fl_own_colormap.cxx
virtual void own_colormap();
+ // this one is in Fl_x.cxx
+ virtual const char *filename_name(const char *buf);
+ // this one is in Fl_x.cxx
+ virtual void copy(const char *stuff, int len, int clipboard, const char *type);
};
#endif /* FL_X11_SYSTEM_DRIVER_H */