FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Copy_Surface.H
1//
2// Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17#ifndef Fl_Copy_Surface_H
18#define Fl_Copy_Surface_H
19
20#include <FL/Fl_Widget_Surface.H>
21
49 class FL_EXPORT Fl_Copy_Surface : public Fl_Widget_Surface {
50 private:
51 class Fl_Copy_Surface_Driver *platform_surface;
52 protected:
53 void translate(int x, int y) FL_OVERRIDE;
54 void untranslate() FL_OVERRIDE;
55 public:
56 Fl_Copy_Surface(int w, int h);
57 ~Fl_Copy_Surface();
58 void set_current() FL_OVERRIDE;
59 bool is_current() FL_OVERRIDE;
61 int w();
63 int h();
64 void origin(int *x, int *y) FL_OVERRIDE;
65 void origin(int x, int y) FL_OVERRIDE;
66 int printable_rect(int *w, int *h) FL_OVERRIDE;
67};
68
69
75
84 class Fl_Copy_Surface_Driver : public Fl_Widget_Surface {
85 friend class Fl_Copy_Surface;
86 protected:
87 int width;
88 int height;
89 Fl_Copy_Surface_Driver(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {}
90 virtual ~Fl_Copy_Surface_Driver() {}
91 void set_current() FL_OVERRIDE = 0;
92 void translate(int x, int y) FL_OVERRIDE = 0;
93 void untranslate() FL_OVERRIDE = 0;
94 int printable_rect(int *w, int *h) FL_OVERRIDE;
99 static Fl_Copy_Surface_Driver *newCopySurfaceDriver(int w, int h);
100};
101
106
107#endif // Fl_Copy_Surface_H
Fl_Copy_Surface
Supports copying of graphical data to the clipboard.
Definition Fl_Copy_Surface.H:49
Fl_Copy_Surface::h
int h()
Returns the pixel height of the copy surface.
Definition Fl_Copy_Surface.cxx:53
Fl_Copy_Surface::Fl_Copy_Surface
Fl_Copy_Surface(int w, int h)
the constructor
Definition Fl_Copy_Surface.cxx:21
Fl_Copy_Surface::w
int w()
Returns the pixel width of the copy surface.
Definition Fl_Copy_Surface.cxx:51
Fl_Surface_Device::is_current
virtual bool is_current()
Is this surface the current drawing surface?
Definition Fl_Device.cxx:103
Fl_Surface_Device::set_current
virtual void set_current(void)
Make this surface the current drawing surface.
Definition Fl_Device.cxx:91
Fl_Widget_Surface
A surface on which any FLTK widget can be drawn.
Definition Fl_Widget_Surface.H:25
Fl_Widget_Surface::printable_rect
virtual int printable_rect(int *w, int *h)
Computes the width and height of the drawable area of the drawing surface.
Definition Fl_Widget_Surface.cxx:190
Fl_Widget_Surface::Fl_Widget_Surface
Fl_Widget_Surface(Fl_Graphics_Driver *d)
The constructor.
Definition Fl_Widget_Surface.cxx:28
Fl_Widget_Surface::origin
virtual void origin(int x, int y)
Sets the position of the origin of graphics in the drawable part of the drawing surface.
Definition Fl_Widget_Surface.cxx:145
Fl_Widget_Surface::untranslate
virtual void untranslate()
Undoes the effect of a previous translate() call.
Definition Fl_Widget_Surface.cxx:121
Fl_Widget_Surface::translate
virtual void translate(int x, int y)
Translates the current graphics origin accounting for the current rotation.
Definition Fl_Widget_Surface.cxx:114
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46