mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 06:14:28 +08:00
Move platform-dependent implementations of Fl::clipboard_contains() to the Fl_System_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -198,6 +198,8 @@ public:
|
|||||||
virtual void copy(const char *stuff, int len, int clipboard, const char *type) {}
|
virtual void copy(const char *stuff, int len, int clipboard, const char *type) {}
|
||||||
// implement to support paste-from-clipboard
|
// implement to support paste-from-clipboard
|
||||||
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type) {}
|
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type) {}
|
||||||
|
// implement to support paste-from-clipboard
|
||||||
|
virtual int clipboard_contains(const char *type) {return 0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FL_SYSTEM_DRIVER_H
|
#endif // FL_SYSTEM_DRIVER_H
|
||||||
|
|||||||
@@ -1938,6 +1938,11 @@ void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
|
|||||||
Fl::system_driver()->copy(stuff, len, clipboard, type);
|
Fl::system_driver()->copy(stuff, len, clipboard, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Fl::clipboard_contains(const char *type)
|
||||||
|
{
|
||||||
|
return Fl::system_driver()->clipboard_contains(type);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
+1
-1
@@ -3510,7 +3510,7 @@ void Fl_Darwin_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch
|
|||||||
receiver.handle(FL_PASTE);
|
receiver.handle(FL_PASTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl::clipboard_contains(const char *type) {
|
int Fl_Darwin_System_Driver::clipboard_contains(const char *type) {
|
||||||
NSString *found = nil;
|
NSString *found = nil;
|
||||||
if (strcmp(type, Fl::clipboard_plain_text) == 0) {
|
if (strcmp(type, Fl::clipboard_plain_text) == 0) {
|
||||||
found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:UTF8_pasteboard_type, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
|
found = [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:UTF8_pasteboard_type, @"public.utf16-plain-text", @"com.apple.traditional-mac-plain-text", nil]];
|
||||||
|
|||||||
+1
-1
@@ -822,7 +822,7 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl::clipboard_contains(const char *type)
|
int Fl_WinAPI_System_Driver::clipboard_contains(const char *type)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
if (!OpenClipboard(NULL)) return 0;
|
if (!OpenClipboard(NULL)) return 0;
|
||||||
|
|||||||
+1
-1
@@ -828,7 +828,7 @@ void Fl_X11_System_Driver::paste(Fl_Widget &receiver, int clipboard, const char
|
|||||||
fl_xid(Fl::first_window()), fl_event_time);
|
fl_xid(Fl::first_window()), fl_event_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl::clipboard_contains(const char *type)
|
int Fl_X11_System_Driver::clipboard_contains(const char *type)
|
||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event;
|
||||||
Atom actual; int format; unsigned long count, remaining, i = 0;
|
Atom actual; int format; unsigned long count, remaining, i = 0;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public:
|
|||||||
virtual const char *filename_name(const char *buf);
|
virtual const char *filename_name(const char *buf);
|
||||||
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
||||||
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
||||||
|
virtual int clipboard_contains(const char *type);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FL_DARWIN_SYSTEM_DRIVER_H
|
#endif // FL_DARWIN_SYSTEM_DRIVER_H
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ public:
|
|||||||
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
||||||
// this one is implemented in Fl_win32.cxx
|
// this one is implemented in Fl_win32.cxx
|
||||||
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
||||||
|
// this one is implemented in Fl_win32.cxx
|
||||||
|
virtual int clipboard_contains(const char *type);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FL_WINAPI_SYSTEM_DRIVER_H
|
#endif // FL_WINAPI_SYSTEM_DRIVER_H
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public:
|
|||||||
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
virtual void copy(const char *stuff, int len, int clipboard, const char *type);
|
||||||
// this one is in Fl_x.cxx
|
// this one is in Fl_x.cxx
|
||||||
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
|
||||||
|
// this one is in Fl_x.cxx
|
||||||
|
virtual int clipboard_contains(const char *type);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FL_X11_SYSTEM_DRIVER_H */
|
#endif /* FL_X11_SYSTEM_DRIVER_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user