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-01 20:20:25 +03:00
|
|
|
#ifdef __APPLE__
|
|
|
|
#include <src/drivers/Quartz/Fl_Quartz_Copy_Surface.H>
|
2014-05-23 20:47:21 +04:00
|
|
|
|
|
|
|
#elif defined(WIN32)
|
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-02 00:28:13 +03:00
|
|
|
#elif defined(FL_PORTING) && !defined(FL_DOXYGEN)
|
2016-03-01 20:20:25 +03:00
|
|
|
# pragma message "FL_PORTING: implement class Fl_Copy_Surface::Helper for your platform"
|
|
|
|
|
|
|
|
class Fl_Copy_Surface::Helper : public Fl_Widget_Surface { // model
|
|
|
|
friend class Fl_Copy_Surface;
|
|
|
|
private:
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
Helper(int w, int h) : Fl_Widget_Surface(NULL) {}
|
|
|
|
~Helper() {}
|
|
|
|
void set_current(){}
|
|
|
|
void translate(int x, int y) {}
|
|
|
|
void untranslate() {}
|
|
|
|
int w() {return width;}
|
|
|
|
int h() {return height;}
|
|
|
|
};
|
2014-05-23 20:47:21 +04:00
|
|
|
|
|
|
|
#else
|
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-01 20:20:25 +03:00
|
|
|
Fl_Copy_Surface::Helper *Fl_Copy_Surface::newPlatformSurface(int w, int h) {
|
|
|
|
return new Helper(w, h);
|
2014-05-23 20:47:21 +04:00
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
platform_surface = newPlatformSurface(w, h);
|
|
|
|
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-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
|
|
|
|
|
|
|
//
|
2014-05-24 20:13:06 +04:00
|
|
|
// End of "$Id$".
|
2014-05-23 20:47:21 +04:00
|
|
|
//
|