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
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <FL/Fl_Copy_Surface.H>
|
|
|
|
|
2018-05-24 16:08:55 +03:00
|
|
|
/** the constructor
|
|
|
|
\param w, h Width and height of the drawing surface in FLTK units */
|
2016-03-01 20:20:25 +03:00
|
|
|
Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Widget_Surface(NULL) {
|
2016-03-19 21:14:58 +03:00
|
|
|
platform_surface = Fl_Copy_Surface_Driver::newCopySurfaceDriver(w, h);
|
2016-04-27 19:42:20 +03:00
|
|
|
if (platform_surface) driver(platform_surface->driver());
|
2015-11-24 17:26:52 +03:00
|
|
|
}
|
|
|
|
|
2018-05-24 16:08:55 +03:00
|
|
|
/** the destructor */
|
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-04-27 19:42:20 +03:00
|
|
|
void Fl_Copy_Surface::origin(int *x, int *y) {
|
|
|
|
if (platform_surface) platform_surface->origin(x, y);
|
|
|
|
}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
void Fl_Copy_Surface::set_current() {
|
|
|
|
if (platform_surface) platform_surface->set_current();
|
|
|
|
}
|
2016-02-26 15:51:47 +03:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
void Fl_Copy_Surface::translate(int x, int y) {
|
|
|
|
if (platform_surface) platform_surface->translate(x, y);
|
|
|
|
}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
void Fl_Copy_Surface::untranslate() {
|
|
|
|
if (platform_surface) platform_surface->untranslate();
|
|
|
|
}
|
2016-02-26 15:51:47 +03:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
int Fl_Copy_Surface::w() {return platform_surface ? platform_surface->width : 0;}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
int Fl_Copy_Surface::h() {return platform_surface ? platform_surface->height : 0;}
|
2014-05-23 20:47:21 +04:00
|
|
|
|
2016-04-27 19:42:20 +03:00
|
|
|
int Fl_Copy_Surface::printable_rect(int *w, int *h) {
|
|
|
|
if (platform_surface)
|
|
|
|
return platform_surface->printable_rect(w, h);
|
|
|
|
else {
|
|
|
|
*w = *h = 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2016-03-02 15:36:37 +03:00
|
|
|
|
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
|
|
|
//
|