2014-05-23 20:47:21 +04:00
|
|
|
//
|
2014-05-24 20:13:06 +04:00
|
|
|
// "$Id$"
|
2014-05-23 20:47:21 +04:00
|
|
|
//
|
|
|
|
// Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2016-01-31 07:33:54 +03:00
|
|
|
// Copyright 1998-2016 by Bill Spitzak and others.
|
2014-05-23 20:47:21 +04:00
|
|
|
//
|
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/COPYING.php
|
|
|
|
//
|
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
|
|
|
//
|
|
|
|
|
2016-01-31 14:47:49 +03:00
|
|
|
#include "config_lib.h"
|
2014-05-23 20:47:21 +04:00
|
|
|
#include <FL/Fl_Copy_Surface.H>
|
|
|
|
|
2016-03-04 20:47:29 +03:00
|
|
|
#ifdef FL_CFG_GFX_QUARTZ
|
2016-03-01 20:20:25 +03:00
|
|
|
#include <src/drivers/Quartz/Fl_Quartz_Copy_Surface.H>
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-04 20:47:29 +03:00
|
|
|
#elif defined(FL_CFG_GFX_GDI)
|
2016-03-01 20:20:25 +03:00
|
|
|
#include <src/drivers/GDI/Fl_GDI_Copy_Surface.H>
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-04 20:47:29 +03:00
|
|
|
#elif defined(USE_SDL)
|
2016-03-07 00:33:07 +03:00
|
|
|
#include <src/drivers/SDL/Fl_SDL_Copy_Surface.H>
|
2016-03-04 20:47:29 +03:00
|
|
|
|
2016-03-04 19:44:23 +03:00
|
|
|
#elif defined(FL_PORTING)
|
2016-03-01 20:20:25 +03:00
|
|
|
# pragma message "FL_PORTING: implement class Fl_Copy_Surface::Helper for your platform"
|
|
|
|
|
2016-03-02 15:36:37 +03:00
|
|
|
class Fl_Copy_Surface::Helper : public Fl_Widget_Surface { // class model
|
2016-03-01 20:20:25 +03:00
|
|
|
friend class Fl_Copy_Surface;
|
|
|
|
private:
|
|
|
|
int width;
|
|
|
|
int height;
|
2016-03-02 15:36:37 +03:00
|
|
|
Helper(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {} // to implement
|
|
|
|
~Helper() {} // to implement
|
|
|
|
void set_current(){} // to implement
|
|
|
|
void translate(int x, int y) {} // to implement
|
|
|
|
void untranslate() {} // to implement
|
2016-03-01 20:20:25 +03:00
|
|
|
int w() {return width;}
|
|
|
|
int h() {return height;}
|
2016-03-02 15:36:37 +03:00
|
|
|
int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
|
2016-03-01 20:20:25 +03:00
|
|
|
};
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-04 20:47:29 +03:00
|
|
|
#elif defined(FL_CFG_GFX_XLIB)
|
2016-03-01 20:20:25 +03:00
|
|
|
#include <src/drivers/Xlib/Fl_Xlib_Copy_Surface.H>
|
2014-05-23 20:47:21 +04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2016-03-02 00:28:13 +03:00
|
|
|
/** the constructor */
|
2016-03-01 20:20:25 +03:00
|
|
|
Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Widget_Surface(NULL) {
|
2016-03-03 22:25:10 +03:00
|
|
|
platform_surface = new Helper(w, h);
|
2016-03-01 20:20:25 +03:00
|
|
|
driver(platform_surface->driver());
|
2015-11-24 17:26:52 +03:00
|
|
|
}
|
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
Fl_Copy_Surface::~Fl_Copy_Surface() { delete platform_surface; }
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-02 15:36:37 +03:00
|
|
|
void Fl_Copy_Surface::origin(int x, int y) {platform_surface->origin(x, y);}
|
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
void Fl_Copy_Surface::origin(int *x, int *y) {platform_surface->origin(x, y);}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
void Fl_Copy_Surface::set_current() {platform_surface->set_current();}
|
2016-02-26 15:51:47 +03:00
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
void Fl_Copy_Surface::translate(int x, int y) {platform_surface->translate(x, y);}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
void Fl_Copy_Surface::untranslate() {platform_surface->untranslate();}
|
2016-02-26 15:51:47 +03:00
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
int Fl_Copy_Surface::w() {return platform_surface->w();}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-01 20:20:25 +03:00
|
|
|
int Fl_Copy_Surface::h() {return platform_surface->h();}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-03-02 15:36:37 +03:00
|
|
|
int Fl_Copy_Surface::printable_rect(int *w, int *h) {return platform_surface->printable_rect(w, h);}
|
|
|
|
|
2014-05-23 20:47:21 +04:00
|
|
|
//
|
2014-05-24 20:13:06 +04:00
|
|
|
// End of "$Id$".
|
2014-05-23 20:47:21 +04:00
|
|
|
//
|