virtualized Fl_Graphics_Driver::global_gc(), a function that should probably not exeist.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2016-04-17 14:45:25 +00:00
parent cc57af841a
commit 9ae4a99081
13 changed files with 44 additions and 80 deletions

View File

@ -249,7 +249,7 @@ public:
protected:
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
void global_gc(void);
virtual void global_gc();
};
#endif // FL_GRAPHICS_DRIVER_H

View File

@ -79,6 +79,11 @@ void Fl_Graphics_Driver::reset_spot()
// nothing to do
}
void Fl_Graphics_Driver::global_gc()
{
// nothing to do
}
//
// End of "$Id$".
//

View File

@ -318,10 +318,6 @@ void fl_end_offscreen()
# pragma message "FL_PORTING: implement fl_end_offscreen"
}
void fl_clipboard_notify_change() {
# pragma message "FL_PORTING: implement fl_clipboard_notify_change"
}
Fl_Font_Descriptor::~Fl_Font_Descriptor()
{
# pragma message "FL_PORTING: implement Fl_Font_Descriptor::~Fl_Font_Descriptor"

View File

@ -129,6 +129,8 @@ protected:
void color(uchar r, uchar g, uchar b);
void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win);
void reset_spot();
protected:
void global_gc();
};

View File

@ -23,17 +23,6 @@
#include <FL/x.H>
/* Reference to the current device context
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
HDC fl_gc = 0;
void Fl_Graphics_Driver::global_gc()
{
fl_gc = (HDC)gc();
}
/*
* By linking this module, the following static method will instantiate the
* MSWindows GDI Graphics driver as the main display driver.
@ -52,6 +41,17 @@ typedef BOOL (WINAPI* fl_alpha_blend_func)
static fl_alpha_blend_func fl_alpha_blend = NULL;
static FL_BLENDFUNCTION blendfunc = { 0, 0, 255, 1};
/* Reference to the current device context
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
HDC fl_gc = 0;
void Fl_GDI_Graphics_Driver::global_gc()
{
fl_gc = (HDC)gc();
}
/*
* This function checks if the version of MSWindows that we
* curently run on supports alpha blending for bitmap transfers

View File

@ -210,7 +210,6 @@ class Fl_Pico_Graphics_Driver : public Fl_Graphics_Driver {
// // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
// virtual void transformed_vertex0(COORD_T x, COORD_T y);
// virtual void fixloop();
// void global_gc(void);
};
#endif // FL_PICO_GRAPHICS_DRIVER_H

View File

@ -463,7 +463,6 @@ Fl_Fontdesc* fl_fonts = NULL;
void fl_set_spot(int, int, int, int, int, int, Fl_Window*) { }
void fl_reset_spot() { }
const char *fl_filename_name(char const*) { return 0; }
void fl_clipboard_notify_change() { }
//Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() { return 0; }
//Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() { return 0; }

View File

@ -39,7 +39,6 @@ protected:
// CGContextRef gc_;
public:
// virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
// virtual void gc(void *ctxt) {if (ctxt != gc_) global_gc(); gc_ = (CGContextRef)ctxt; }
// virtual void *gc() {return gc_;}
// char can_do_alpha_blending();
//

View File

@ -142,41 +142,10 @@ double Fl_PicoSDL_Screen_Driver::wait(double time_to_wait)
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Graphics_Driver.H>
/*
* The following code should not be here!
* All this must be refactored into the driver system!
*/
/*
The following symbols are not found if we naively compile the core modules and
no specific platform implementations. This list is a hint at all the functions
and methods that probably need to be refactored into the driver system.
Undefined symbols for architecture x86_64:
*/
#if !defined(FL_DOXYGEN) // FIXME silence Doxygen warnings
//const char *fl_filename_name(char const*) { return 0; }
void fl_clipboard_notify_change() { }
//Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() { return 0; }
//Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() { return 0; }
void Fl_Graphics_Driver::global_gc() { }
//int Fl::dnd() { return 0; }
//void Fl::copy(char const*, int, int, char const*) { }
//void Fl::paste(Fl_Widget&, int, char const*) { }
//void Fl::get_mouse(int&, int&) { }
void Fl::set_color(Fl_Color, unsigned int) { }
int Fl_X::set_cursor(Fl_Cursor) { return 0; }
int Fl_X::set_cursor(Fl_RGB_Image const*, int, int) { return 0; }
//void Fl_Window::size_range_() { }
//void Fl_Window::fullscreen_x() { }
//void Fl_Window::fullscreen_off_x(int, int, int, int) { }
Window fl_xid(const Fl_Window* w)
{
Fl_X *temp = Fl_X::i(w);
@ -188,15 +157,9 @@ Fl_X* Fl_X::make(Fl_Window *w)
return w->driver()->makeWindow();
}
//void Fl_Window::label(char const*, char const*) { }
//void Fl_Window::resize(int, int, int, int) { }
//Fl_Window *Fl_Window::current_;
char fl_show_iconic;
Window fl_window;
//void Fl_Image_Surface::translate(int x, int y) { }
//void Fl_Image_Surface::untranslate() { }
//void Fl::add_fd(int, void (*)(int, void*), void*)
void Fl::add_fd(int, Fl_FD_Handler, void*)
{
}
@ -210,9 +173,6 @@ void Fl_X::flush()
w->flush();
}
#endif // !defined(FL_DOXYGEN) // FIXME silence Doxygen warnings
//
// End of "$Id: Fl_PicoSDL_Screen_Driver.cxx 11253 2016-03-01 00:54:21Z matt $".
//

View File

@ -123,6 +123,8 @@ protected:
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
protected:
virtual void global_gc();
};
extern float fl_quartz_line_width_;

View File

@ -21,17 +21,6 @@
#include "Fl_Quartz_Graphics_Driver.H"
#include <FL/x.H>
/* Reference to the current CGContext
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
CGContextRef fl_gc = 0;
void Fl_Graphics_Driver::global_gc()
{
fl_gc = (CGContextRef)gc();
}
/*
* By linking this module, the following static method will instantiate the
* OS X Quartz Graphics driver as the main display driver.
@ -51,6 +40,17 @@ static void bmProviderRelease (void *src, const void *data, size_t size) {
if(count == 1) free((void*)data);
}
/* Reference to the current CGContext
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
CGContextRef fl_gc = 0;
void Fl_Quartz_Graphics_Driver::global_gc()
{
fl_gc = (CGContextRef)gc();
}
void Fl_Quartz_Graphics_Driver::copy_offscreen(int x,int y,int w,int h,Fl_Offscreen osrc,int srcx,int srcy) {
CGContextRef src = (CGContextRef)osrc;
void *data = CGBitmapContextGetData(src);

View File

@ -131,6 +131,8 @@ protected:
virtual float scale_bitmap_for_PostScript();
virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win);
virtual void reset_spot();
protected:
virtual void global_gc();
};

View File

@ -28,16 +28,6 @@
#include <X11/extensions/Xrender.h>
#endif
/* Reference to the current graphics context
For back-compatibility only. The preferred procedure to get this pointer is
Fl_Surface_Device::surface()->driver()->gc().
*/
GC fl_gc = 0;
void Fl_Graphics_Driver::global_gc()
{
}
/*
* By linking this module, the following static method will instantiate the
@ -50,6 +40,16 @@ Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
GC Fl_Xlib_Graphics_Driver::gc_ = NULL;
/* Reference to the current graphics context
For back-compatibility only. The preferred procedure to get this pointer is
Fl_Surface_Device::surface()->driver()->gc().
*/
GC fl_gc = 0;
void Fl_Xlib_Graphics_Driver::global_gc()
{
}
Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
mask_bitmap_ = NULL;
p_size = 0;