summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-04-14 21:29:02 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-04-14 21:29:02 +0000
commit130a0ef8daa24bf1b14392615e067940f6c5d035 (patch)
tree4f63959ff503f1bc399e102fe4d64eeca0b1eabf /src/drivers
parent03e87bb2704155bd45b1eb9f8207ff660bea16d1 (diff)
PicoSDL fixes - not working!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11607 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx13
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx26
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx37
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H2
-rw-r--r--src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx25
5 files changed, 82 insertions, 21 deletions
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx
index 87ffb2a0e..16e845cd2 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_Graphics_Driver.cxx
@@ -20,11 +20,24 @@
#include "../../config_lib.h"
#include "Fl_PicoSDL_Graphics_Driver.h"
+#include "Fl_PicoSDL_Screen_Driver.H"
+#include <FL/x.H>
+#include <FL/Fl_Window_Driver.H>
+
#include <FL/Fl.H>
#define __APPLE__
#include <SDL2/SDL.h>
#undef __APPLE__
+extern Window fl_window;
+
+
+void Fl_Graphics_Driver::XDestroyRegion(void*) { }
+//void Fl_Graphics_Driver::clip_region(void*) { }
+Fl_Region Fl_Graphics_Driver::XRectangleRegion(int, int, int, int) { }
+void Fl_Graphics_Driver::add_rectangle_to_region(void*, int, int, int, int) { }
+
+
/*
* By linking this module, the following static method will instantiate the
* PicoSDL Graphics driver as the main display driver.
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
index 13ebe0ef0..5cfea208a 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
@@ -155,7 +155,7 @@ 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; }
+//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&) { }
@@ -165,16 +165,10 @@ int Fl_X::set_cursor(Fl_RGB_Image const*, int, int) { return 0; }
void Fl_X::set_default_icons(Fl_RGB_Image const**, int) { }
void Fl_X::set_icons() { }
-void Fl_Window::size_range_() { }
-void Fl_Window::fullscreen_x() { }
+//void Fl_Window::size_range_() { }
+//void Fl_Window::fullscreen_x() { }
-void Fl_Window::make_current()
-{
- fl_window = i->xid;
- current_ = this;
-}
-
-void Fl_Window::fullscreen_off_x(int, int, int, int) { }
+//void Fl_Window::fullscreen_off_x(int, int, int, int) { }
Window fl_xid(const Fl_Window* w)
{
@@ -182,20 +176,14 @@ Window fl_xid(const Fl_Window* w)
return temp ? temp->xid : 0;
}
-void Fl_Window::show() {
- if (!shown()) {
- Fl_X::make(this);
- }
-}
-
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_;
+//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) { }
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx
index 8b1378917..7b3b9e4fb 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_System_Driver.cxx
@@ -1 +1,38 @@
+//
+// "$Id: Fl_PicoSDL_System_Driver.cxx 11241 2016-02-27 13:52:27Z manolo $"
+//
+// System routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2016 by Bill Spitzak and others.
+//
+// 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 "../../config_lib.h"
+#include "../../FL/Fl_System_Driver.H"
+//#include "Fl_PicoSDL_System_Driver.h"
+
+
+/*
+ * By linking this module, the following static method will instantiate the
+ * PicoSDL Graphics driver as the main display driver.
+ */
+Fl_System_Driver *Fl_System_Driver::newSystemDriver()
+{
+ return new Fl_System_Driver();
+// return new Fl_PicoSDL_System_Driver();
+}
+
+
+//
+// End of "$Id: Fl_PicoSDL_System_Driver.cxx 11241 2016-02-27 13:52:27Z manolo $".
+//
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H
index 3f787eee3..aee0af6d7 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.H
@@ -39,7 +39,9 @@ public:
Fl_PicoSDL_Window_Driver(Fl_Window *win);
virtual ~Fl_PicoSDL_Window_Driver();
+ virtual void show();
virtual Fl_X *makeWindow();
+ virtual void make_current();
// --- window management
virtual void flush_single();
diff --git a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
index c18ac639a..765db4d7a 100644
--- a/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
+++ b/src/drivers/PicoSDL/Fl_PicoSDL_Window_Driver.cxx
@@ -24,6 +24,13 @@
#include <FL/Fl.H>
#include <FL/Fl_WIndow.H>
+void Fl_Window_Driver::default_icons(Fl_RGB_Image const**, int) { }
+
+const char *fl_local_alt = "alt";
+const char *fl_local_ctrl = "ctrl";
+const char *fl_local_meta = "meta";
+const char *fl_local_shift = "shift";
+
Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *win)
{
@@ -50,7 +57,7 @@ Fl_X *Fl_PicoSDL_Window_Driver::makeWindow()
return 0L;
}
Window parent;
- if (parent()) {
+ if (this->parent()) {
parent = fl_xid(pWindow->window());
} else {
parent = 0;
@@ -62,7 +69,7 @@ Fl_X *Fl_PicoSDL_Window_Driver::makeWindow()
if (!pWindow->force_position()) {
pNativeWindow = SDL_CreateWindow(pWindow->label(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w(), h(), 0);
} else {
- pNativeWindow = SDL_CreateWindow(pWindow->label(), x(), y(), w(), h(), 0);
+ pNativeWindow = SDL_CreateWindow(pWindow->label(), pWindow->x(), pWindow->y(), pWindow->w(), pWindow->h(), 0);
}
x->xid = SDL_CreateRenderer(pNativeWindow, -1, SDL_RENDERER_ACCELERATED);
x->next = Fl_X::first;
@@ -94,6 +101,20 @@ void Fl_PicoSDL_Window_Driver::flush_single()
SDL_RenderPresent((SDL_Renderer*)i->xid);
}
+
+void Fl_PicoSDL_Window_Driver::make_current()
+{
+ fl_window = pWindow->i->xid;
+}
+
+void Fl_PicoSDL_Window_Driver::show() {
+ if (!shown()) {
+ makeWindow();
+ }
+}
+
+
+
//
// End of "$Id: Fl_PicoSDL_Window_Driver.cxx 11253 2016-03-01 00:54:21Z matt $".
// \ No newline at end of file