2010-03-18 18:29:18 +03:00
|
|
|
//
|
|
|
|
// "$Id$"
|
|
|
|
//
|
2010-03-25 16:59:00 +03:00
|
|
|
// implementation of Fl_Device class for the Fast Light Tool Kit (FLTK).
|
2010-03-18 18:29:18 +03:00
|
|
|
//
|
2016-02-18 19:21:51 +03:00
|
|
|
// Copyright 2010-2016 by Bill Spitzak and others.
|
2010-03-18 18:29:18 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +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
|
2010-03-18 18:29:18 +03:00
|
|
|
//
|
|
|
|
// Please report all bugs and problems to:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
|
|
|
//
|
2010-03-14 21:07:24 +03:00
|
|
|
|
|
|
|
#include <FL/Fl.H>
|
2016-01-31 14:47:49 +03:00
|
|
|
#include "config_lib.h"
|
2010-03-14 21:07:24 +03:00
|
|
|
#include <FL/Fl_Device.H>
|
2016-02-09 21:25:02 +03:00
|
|
|
#include <FL/Fl_Graphics_Driver.H>
|
|
|
|
|
|
|
|
/* Attempt at an inheritance diagram.
|
|
|
|
|
2016-02-25 20:56:48 +03:00
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
+- Fl_Surface_Device: any kind of surface that we can draw onto -> uses an Fl_Graphics_Driver
|
|
|
|
|
|
|
|
|
+- Fl_Display_Device: some kind of video device
|
|
|
|
+- Fl_Copy_Surface: create an image for dnd or copy/paste
|
|
|
|
+- Fl_Image_Surface: create an RGB Image
|
|
|
|
+- Fl_Paged_Device: output to a printer or similar
|
|
|
|
|
|
|
|
|
+- Fl_..._Surface_: platform specific driver
|
|
|
|
+- Fl_Printer: user can instantiate this to gain access to a printer
|
|
|
|
+- Fl_System_Printer:
|
|
|
|
+- Fl_PostScript_File_Device
|
|
|
|
|
|
|
|
|
+- Fl_PostScript_Printer
|
2016-02-25 20:56:48 +03:00
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
+- Fl_Graphics_Driver
|
|
|
|
|
|
|
|
|
+- Fl_..._Graphics_Driver: platform specific graphics driver
|
|
|
|
|
|
|
|
TODO:
|
|
|
|
Window Device to handle creation of surfaces and manage events
|
|
|
|
System Device to handle file system acces, standard dialogs, etc.
|
|
|
|
|
|
|
|
*/
|
2010-03-14 21:07:24 +03:00
|
|
|
|
2016-02-09 15:33:49 +03:00
|
|
|
bool Fl_Display_Device::high_res_window_ = false;
|
2010-03-14 21:07:24 +03:00
|
|
|
|
|
|
|
|
2015-03-24 17:20:38 +03:00
|
|
|
/** \brief Make this surface the current drawing surface.
|
|
|
|
This surface will receive all future graphics requests. */
|
2010-05-27 21:20:18 +04:00
|
|
|
void Fl_Surface_Device::set_current(void)
|
2010-03-14 21:07:24 +03:00
|
|
|
{
|
2010-07-01 17:21:32 +04:00
|
|
|
fl_graphics_driver = _driver;
|
2011-02-02 15:42:47 +03:00
|
|
|
_surface = this;
|
2016-02-18 19:21:51 +03:00
|
|
|
_driver->global_gc();
|
2010-03-14 21:07:24 +03:00
|
|
|
}
|
2010-03-18 18:29:18 +03:00
|
|
|
|
2012-03-18 22:48:29 +04:00
|
|
|
Fl_Surface_Device* Fl_Surface_Device::_surface; // the current target surface of graphics operations
|
|
|
|
|
2016-02-02 02:06:14 +03:00
|
|
|
|
2016-03-03 03:07:17 +03:00
|
|
|
Fl_Surface_Device::~Fl_Surface_Device()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-29 01:02:48 +03:00
|
|
|
/** A constructor that sets the graphics driver used by the display */
|
|
|
|
Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(graphics_driver) {
|
2015-12-15 11:31:20 +03:00
|
|
|
this->set_current();
|
2011-03-01 14:58:36 +03:00
|
|
|
};
|
|
|
|
|
2011-02-18 16:39:48 +03:00
|
|
|
|
2015-04-29 01:02:48 +03:00
|
|
|
/** Returns the platform display device. */
|
|
|
|
Fl_Display_Device *Fl_Display_Device::display_device() {
|
2016-02-09 15:33:49 +03:00
|
|
|
static Fl_Display_Device *display = new Fl_Display_Device(Fl_Graphics_Driver::newMainGraphicsDriver());
|
2015-04-29 01:02:48 +03:00
|
|
|
return display;
|
|
|
|
};
|
|
|
|
|
2015-12-16 10:18:34 +03:00
|
|
|
|
|
|
|
Fl_Surface_Device *Fl_Surface_Device::default_surface()
|
|
|
|
{
|
|
|
|
return Fl_Display_Device::display_device();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-18 19:21:51 +03:00
|
|
|
Fl_Display_Device *Fl_Display_Device::_display;
|
2015-04-29 01:02:48 +03:00
|
|
|
|
2016-02-09 21:25:02 +03:00
|
|
|
|
2010-03-18 18:29:18 +03:00
|
|
|
//
|
|
|
|
// End of "$Id$".
|
|
|
|
//
|