Continue removing platform-dependent code from the Fl.H header file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11483 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
059664e7d4
commit
3ca402b609
15
FL/Fl.H
15
FL/Fl.H
@ -908,21 +908,6 @@ int main() {
|
||||
*/
|
||||
static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
|
||||
|
||||
#if defined(__APPLE__) // PORTME: Fl_Surface_Driver ? - additional functions
|
||||
// not needed
|
||||
// Fl_Copy_Surface::complete_copy_pdf_and_tiff()
|
||||
#elif defined(WIN32)
|
||||
// not needed
|
||||
// Fl_Copy_Surface::~Fl_Copy_Surface()
|
||||
#elif defined(FL_DOXYGEN)
|
||||
// don't show in documentation
|
||||
#elif defined(FL_PORTING)
|
||||
# pragma message "FL_PORTING: do you need to implement copy_image() ?"
|
||||
// not implemented by default
|
||||
#else
|
||||
// takes a raw RGB image and puts it in the copy/paset buffer
|
||||
static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // X11 platform dependent
|
||||
#endif
|
||||
/**
|
||||
Pastes the data from the selection buffer (\p source is 0) or the clipboard
|
||||
(\p source is 1) into \p receiver. If \p source is 1,
|
||||
|
||||
1
FL/x.H
1
FL/x.H
@ -140,6 +140,7 @@ public:
|
||||
static int ewmh_supported();
|
||||
static int xrender_supported();
|
||||
static void activate_window(Window w);
|
||||
static void copy_image(const unsigned char* data, int W, int H, int destination = 0);
|
||||
};
|
||||
|
||||
extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid()
|
||||
|
||||
@ -1021,14 +1021,14 @@ static unsigned char *create_bmp(const unsigned char *data, int W, int H, int *r
|
||||
return b;
|
||||
}
|
||||
|
||||
void Fl::copy_image(const unsigned char *data, int W, int H, int clipboard){
|
||||
if(!data || W<=0 || H<=0) return;
|
||||
// takes a raw RGB image and puts it in the copy/paste buffer
|
||||
void Fl_X::copy_image(const unsigned char *data, int W, int H, int clipboard){
|
||||
if (!data || W <= 0 || H <= 0) return;
|
||||
delete[] fl_selection_buffer[clipboard];
|
||||
fl_selection_buffer[clipboard] = (char *) create_bmp(data,W,H,&fl_selection_length[clipboard]);
|
||||
fl_selection_buffer_length[clipboard] = fl_selection_length[clipboard];
|
||||
fl_i_own_selection[clipboard] = 1;
|
||||
fl_selection_type[clipboard] = Fl::clipboard_image;
|
||||
|
||||
Atom property = clipboard ? CLIPBOARD : XA_PRIMARY;
|
||||
XSetSelectionOwner(fl_display, property, fl_message_window, fl_event_time);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ Fl_Xlib_Copy_Surface_Driver::~Fl_Xlib_Copy_Surface_Driver() {
|
||||
unsigned char *data = fl_read_image(NULL,0,0,width,height,0);
|
||||
fl_window = oldwindow;
|
||||
_ss->set_current();
|
||||
Fl::copy_image(data,width,height,1);
|
||||
Fl_X::copy_image(data,width,height,1);
|
||||
delete[] data;
|
||||
fl_delete_offscreen(xid);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user