summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-10 00:46:12 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-10 00:46:12 +0000
commitc0cbf0fbde0ac33d3743a6d50bf0fa9f6664a008 (patch)
tree8fb9b3e1db8bfef8052deb549af986023fc86915
parentdc2fb581b76ea84ebd70a7ced1291dd26b40fc71 (diff)
Android: crude graphics clipping
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_Gl_Window.H5
-rw-r--r--FL/Fl_Rect.H12
-rw-r--r--FL/Fl_Window.H3
-rw-r--r--FL/fl_draw.H2
-rw-r--r--FL/platform_types.h14
-rw-r--r--ide/AndroidStudio3/app/app.iml4
-rw-r--r--ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx16
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.H72
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.cxx23
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx263
-rw-r--r--src/drivers/Android/README.txt12
12 files changed, 355 insertions, 72 deletions
diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H
index 0c483e59e..ee34fad70 100644
--- a/FL/Fl_Gl_Window.H
+++ b/FL/Fl_Gl_Window.H
@@ -45,6 +45,11 @@ class Fl_Gl_Window_Driver;
Even though Fl_Gl_Window is derived from Fl_Group,
it is not useful to add other FLTK Widgets as children,
unless those widgets are modified to draw using OpenGL calls.
+
+ Note: FLTK 1.4 introduces a Driver system for graphic calls. It is now possible
+ to add a selection of widgets to an OpenGL window. The widgets will draw on top
+ of any OpenGL rendering. The number of supported widgets will increase as the
+ driver development improves.
*/
class FL_EXPORT Fl_Gl_Window : public Fl_Window {
friend class Fl_Gl_Window_Driver;
diff --git a/FL/Fl_Rect.H b/FL/Fl_Rect.H
index 7e7d376e0..307410ef7 100644
--- a/FL/Fl_Rect.H
+++ b/FL/Fl_Rect.H
@@ -60,6 +60,18 @@ public:
Fl_Rect (const Fl_Widget* const widget)
: x_(widget->x()), y_(widget->y()), w_(widget->w()), h_(widget->h()) {}
+ /** Return 1 if the rectangle is empty, width or height are 0 */
+ int is_empty() { return (w_==0)||(h_==0); }
+
+ /** Set the position and size */
+ void set(int x, int y, int w, int h) { x_=x; y_=y; w_=w; h_=h; }
+
+ /** return 0 if the rectangles are different, or 1 if they are the same */
+ int equals(int x, int y, int w, int h) { return ( (x_==x) && (y_==y) && (w_==w) && (h_==h) ); }
+
+ /** Set the position and size to zero, making this rect empty */
+ void clear() { x_ = y_ = w_ = h_ = 0; }
+
int x() const { return x_; } ///< gets the x coordinate (left edge)
int y() const { return y_; } ///< gets the y coordinate (top edge)
int w() const { return w_; } ///< gets the width
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index 3ad0d4081..f05281671 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -69,6 +69,9 @@ private:
int fullscreen_screen_left;
int fullscreen_screen_right;
+ // TODO: it would make sense to merge the use of Fl_X and Fl_Window_Driver, maybe simply by
+ // TODO: deriving Fl_Window_Driver from Fl_X. However, there are a lot of historic kldges for
+ // TODO: some platforms around Fl_X.
Fl_X *i; // points at the system-specific stuff, but exists only after the window is mapped
Fl_Window_Driver *pWindowDriver; // points at the system-specific stuff at window creation time
diff --git a/FL/fl_draw.H b/FL/fl_draw.H
index 46a60fb14..c7f3dd8bb 100644
--- a/FL/fl_draw.H
+++ b/FL/fl_draw.H
@@ -122,7 +122,7 @@ inline int fl_not_clipped(int x, int y, int w, int h) {return fl_graphics_driver
\param[out] X,Y,W,H position and size of resulting bounding box.
\returns Non-zero if the resulting rectangle is different to the original.
*/
-inline int fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H)
+inline int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H)
{return fl_graphics_driver->clip_box(x,y,w,h,X,Y,W,H); }
/** Undoes any clobbering of clip done by your program */
inline void fl_restore_clip() { fl_graphics_driver->restore_clip(); }
diff --git a/FL/platform_types.h b/FL/platform_types.h
index 226ce5958..286fc68d1 100644
--- a/FL/platform_types.h
+++ b/FL/platform_types.h
@@ -112,6 +112,20 @@ typedef struct HGLRC__ *GLContext;
#include <sys/stat.h>
struct dirent {char d_name[1];};
+#elif defined(__ANDROID__)
+
+// see: src/driver/Android/Fl_Android_Graphics_Driver_region.cxx
+typedef struct Fl_Clip_Rect *Fl_Region;
+
+// TODO: the types below have not yet been ported
+typedef unsigned long Fl_Offscreen;
+typedef unsigned long Fl_Bitmask;
+typedef int FL_SOCKET;
+typedef struct __GLXcontextRec *GLContext;
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h>
+
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: define OS-dependent types"
typedef void* Fl_Offscreen;
diff --git a/ide/AndroidStudio3/app/app.iml b/ide/AndroidStudio3/app/app.iml
index ffb02d88c..ed9347e99 100644
--- a/ide/AndroidStudio3/app/app.iml
+++ b/ide/AndroidStudio3/app/app.iml
@@ -98,17 +98,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/cmake" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
diff --git a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx
index 911683944..582319020 100644
--- a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx
+++ b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx
@@ -19,13 +19,25 @@
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Enumerations.H>
+#include <FL/fl_draw.H>
Fl_Window *win;
Fl_Button *btn;
+class MyButton : public Fl_Button
+{
+public:
+ MyButton(int x, int y, int w, int h, const char *l) : Fl_Button(x, y, w, h, l) { }
+ void draw() {
+ fl_push_clip(x(), y(), w()/2, h()/2);
+ Fl_Button::draw();
+ fl_pop_clip();
+ }
+};
+
int h(void*, void*)
{
- Fl_Android_Application::log_w("App global even %p", Fl::event());
+ Fl_Android_Application::log_w("App global event %p", Fl::event());
return 0;
}
@@ -33,7 +45,7 @@ int main(int argc, char **argv)
{
Fl::add_system_handler(h, 0);
win = new Fl_Window(10, 10, 600, 400, "Hallo");
- btn = new Fl_Button(190, 200, 280, 35, "Hello, Android!");
+ btn = new MyButton(190, 200, 280, 35, "Hello, Android!");
btn->color(FL_LIGHT2);
win->show(argc, argv);
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f8e7159b4..072fe0604 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -303,6 +303,7 @@ elseif (ANDROID)
drivers/Android/Fl_Android_Window_Driver.cxx
drivers/Android/Fl_Android_Image_Surface_Driver.cxx
drivers/Android/Fl_Android_Graphics_Driver.cxx
+ drivers/Android/Fl_Android_Graphics_Driver_region.cxx
)
set (DRIVER_HEADER_FILES
drivers/Android/Fl_Android_Application.H
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H
index 210190376..a55e39400 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.H
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H
@@ -26,66 +26,24 @@
#define FL_ANDROID_GRAPHICS_DRIVER_H
#include <FL/Fl_Graphics_Driver.H>
+#include <FL/Fl_Rect.H>
#include <limits.h>
-#if 0
-// clipping
-// 1: rect
-// Draw only the part of any element that fits inside the rect
-// 2: region
-// A rect that contains the entire region
-// A sorted list of rows that contains fitting parts of the region
-// A sorted list of rects for each row
-
-class AFl_Rect
-{
- int pX1, pY1, pX2, pY2;
-public:
- const int int_max = INT_MAX;
- const int int_min = INT_MIN;
- AFl_Rect(int x1, y1, x2, y2) : pX1(x1), pY1(y1), pX2(x2), pY2(y2) { }
- AFl_Rect() : pX1(int_min), pY1(int_min), pX2(int_max), pY2(int_max) { }
- void x1(int x) { pX1 = x; }
- void y1(int y) { pY1 = y; }
- void x2(int x) { pX2 = x; }
- void y2(int y) { pY2 = y; }
- void w(int w) { pX2 = x1+w; }
- void h(int h) { pY2 = y1+w; }
- int x1() { return pX1; }
- int y1() { return pY1; }
- int x2() { return pX2; }
- int y2() { return pY2; }
- int w() { return pX2-pX1; }
- int h() { return pY2-pY1; }
-};
-class AFl_Row
+struct Fl_Clip_Rect
{
- int nRect, NRect;
- AFl_Rect *pRect;
- AFl_rect pBounds;
-public:
- AFl_Row(int y1, int y2) : nRect(0), NRect(0), pRect(0), pY1(y1), pY2(y2) { }
- ~AFl_Row() { /* TODO: delete all rects */ }
- void y1(int y) { pY1 = y; }
- void y2(int y) { pY2 = y; }
- AFl_Rect *first(int &i) { i=0; return (pRect && nRect>i) ? nRect[i] : 0L; }
- AFl_Rect *next(int &i) { i++; return (pRect && nRect>i) ? nRect[i] : 0L; }
- void add(AFl_Rect *r) { /* TODO: implement! */ }
- void subtract(AFl_Rect *r) { /* TODO: implement! */ }
- void clear() { /* TODO: implement! */ }
+ Fl_Clip_Rect() : pRect() {}
+ Fl_Clip_Rect(int x, int y, int w, int h) : pRect(x, y, w, h) {}
+ int x() { return pRect.x(); }
+ int y() { return pRect.y(); }
+ int w() { return pRect.w(); }
+ int h() { return pRect.h(); }
+ int intersect_with(Fl_Clip_Rect *r);
+ static int min(int a, int b) { return (a<b) ? a : b; }
+ static int max(int a, int b) { return (a>b) ? a : b; }
+ Fl_Rect pRect;
};
-class AFl_Region
-{
- int nRow, NRow;
- AFl_Row *pRow;
- AFl_rect pBounds;
-public:
- AFl_Region() : nRow(0), NRow(0), pRow(0) { }
- ~AFl_Region() { /* TODO: delete all rows */ }
-}
-#endif
/**
\brief The Windows-specific graphics driver class.
@@ -164,6 +122,7 @@ protected:
void focus_rect(int x, int y, int w, int h);
#endif
void rectf_unscaled(float x, float y, float w, float h);
+ void rectf_unclipped(float x, float y, float w, float h);
#if 0
virtual void line_unscaled(float x, float y, float x1, float y1);
virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2);
@@ -175,6 +134,7 @@ protected:
virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2);
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
+#endif
// --- clipping
void push_clip(int x, int y, int w, int h);
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
@@ -182,6 +142,10 @@ protected:
void push_no_clip();
void pop_clip();
void restore_clip();
+ void clip_region(Fl_Region r);
+ Fl_Region clip_region();
+ static Fl_Clip_Rect pClipRect;
+#if 0
virtual Fl_Region scale_clip(float f);
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
void begin_complex_polygon();
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
index c9780c8d8..1df52462a 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
@@ -1,7 +1,7 @@
//
// "$Id$"
//
-// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
+// Graphics routines for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2018 by Bill Spitzak and others.
//
@@ -20,18 +20,11 @@
#include "../../config_lib.h"
#include "Fl_Android_Application.H"
#include "Fl_Android_Graphics_Driver.H"
+#include "Fl_Android_Screen_Driver.H"
#include <FL/Fl.H>
#include <FL/platform.H>
#include <errno.h>
-#include "Fl_Android_Screen_Driver.H"
-#include <android/log.h>
-
-#define LOG_TAG "FLTK"
-#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
-#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
-#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
-
/*
* By linking this module, the following static method will instantiate the
@@ -60,8 +53,16 @@ static uint16_t make565(Fl_Color crgba)
((crgba >>11) & 0x001f) );
}
-
void Fl_Android_Graphics_Driver::rectf_unscaled(float x, float y, float w, float h) {
+ Fl_Android_Application::log_w("rectf %g %g %g %g", x, y, w, h);
+ Fl_Clip_Rect r(x, y, w, h);
+ if (r.intersect_with(&pClipRect)) {
+ rectf_unclipped(r.x(), r.y(), r.w(), r.h());
+ }
+}
+
+void Fl_Android_Graphics_Driver::rectf_unclipped(float x, float y, float w, float h) {
+ Fl_Android_Application::log_w("rectf unclipped %g %g %g %g", x, y, w, h);
if (w<=0 || h<=0) return;
// TODO: clip the rectangle to the window outline
@@ -147,7 +148,7 @@ if (once==0) {
once = 1;
FILE *f = fopen("/system/fonts/DroidSans.ttf", "rb");
if (f==NULL) {
- LOGE("ERROR reading font %d!", errno);
+ Fl_Android_Application::log_e("ERROR reading font %d!", errno);
return 0;
}
fread(ttf_buffer, 1, 1<<25, f);
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
new file mode 100644
index 000000000..107a6e708
--- /dev/null
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
@@ -0,0 +1,263 @@
+//
+// "$Id$"
+//
+// Clipping region routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2018 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_Android_Graphics_Driver.H"
+#include "Fl_Android_Application.H"
+#include <FL/platform.H>
+
+
+Fl_Clip_Rect Fl_Android_Graphics_Driver::pClipRect;
+
+
+// return 0 for empty, 1 for same, 2 if intersecting
+int Fl_Clip_Rect::intersect_with(Fl_Clip_Rect *a)
+{
+ if (pRect.is_empty()) {
+ return 0;
+ }
+ if (a->pRect.is_empty()) {
+ pRect.clear();
+ return 0;
+ }
+ int x = max(pRect.x(), a->pRect.x());
+ int y = max(pRect.y(), a->pRect.y());
+ int r = min(pRect.r(), a->pRect.r());
+ int b = min(pRect.b(), a->pRect.b());
+ int w = r-x;
+ int h = b-y;
+ if (pRect.equals(x, y, w, h)) {
+ return 1;
+ }
+ pRect.set(x, y, w, h);
+ if ( (pRect.w()<=0) || (pRect.h()<=0) ) {
+ pRect.clear();
+ return 0;
+ }
+ return 2;
+}
+
+
+
+void Fl_Android_Graphics_Driver::clip_region(Fl_Region r)
+{
+ Fl_Region oldr = rstack[rstackptr];
+ if (oldr)
+ ::free(oldr);
+ rstack[rstackptr] = r;
+ restore_clip();
+}
+
+Fl_Region Fl_Android_Graphics_Driver::clip_region()
+{
+ return rstack[rstackptr];
+}
+
+void Fl_Android_Graphics_Driver::restore_clip()
+{
+ fl_clip_state_number++;
+ Fl_Window *win = Fl_Window::current();
+ Fl_Clip_Rect a(0, 0, win->w(), win->h());
+
+ Fl_Region b = rstack[rstackptr];
+ if (b) {
+ // FIXME: scaling!
+ a.intersect_with(b);
+ }
+ pClipRect = a;
+}
+
+void Fl_Android_Graphics_Driver::push_clip(int x, int y, int w, int h)
+{
+ Fl_Region r;
+ if (w > 0 && h > 0) {
+ r = new Fl_Clip_Rect(x,y,w,h);
+ Fl_Region current = rstack[rstackptr];
+ if (current) {
+ r->intersect_with(current);
+ }
+ } else { // make empty clip region:
+ r = new Fl_Clip_Rect();
+ }
+ if (rstackptr < region_stack_max) rstack[++rstackptr] = r;
+ else Fl::warning("Fl_Android_Graphics_Driver::push_clip: clip stack overflow!\n");
+ restore_clip();
+}
+
+void Fl_Android_Graphics_Driver::push_no_clip()
+{
+ if (rstackptr < region_stack_max) rstack[++rstackptr] = 0;
+ else Fl::warning("Fl_Android_Graphics_Driver::push_no_clip: clip stack overflow!\n");
+ restore_clip();
+}
+
+void Fl_Android_Graphics_Driver::pop_clip()
+{
+ if (rstackptr > 0) {
+ Fl_Region oldr = rstack[rstackptr--];
+ if (oldr)
+ ::free(oldr);
+ } else Fl::warning("Fl_Android_Graphics_Driver::pop_clip: clip stack underflow!\n");
+ restore_clip();
+}
+
+/*
+ Intersects the rectangle with the current clip region and returns the
+ bounding box of the result.
+
+ Returns non-zero if the resulting rectangle is different to the original.
+ This can be used to limit the necessary drawing to a rectangle.
+ \p W and \p H are set to zero if the rectangle is completely outside the region.
+ \param[in] x,y,w,h position and size of rectangle
+ \param[out] X,Y,W,H position and size of resulting bounding box.
+ \returns Non-zero if the resulting rectangle is different to the original.
+ */
+int Fl_Android_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H)
+{
+ Fl_Region r = rstack[rstackptr];
+ if (!r) {
+ X = x; Y = y; W = w; H = h;
+ return 0;
+ }
+
+ Fl_Clip_Rect a(x, y, w, h);
+ int ret = a.intersect_with(r); // return 0 for empty, 1 for same, 2 if intersecting
+ X = a.x();
+ Y = a.y();
+ W = a.w();
+ H = a.h();
+
+ return (ret!=1);
+}
+
+/*
+ Does the rectangle intersect the current clip region?
+ \param[in] x,y,w,h position and size of rectangle
+ \returns non-zero if any of the rectangle intersects the current clip
+ region. If this returns 0 you don't have to draw the object.
+
+ \note
+ Under X this returns 2 if the rectangle is partially clipped,
+ and 1 if it is entirely inside the clip region.
+ */
+int Fl_Android_Graphics_Driver::not_clipped(int x, int y, int w, int h) {
+ if (x+w <= 0 || y+h <= 0) return 0;
+ Fl_Region r = rstack[rstackptr];
+ if (!r) return 1;
+
+ Fl_Clip_Rect a(x, y, w, h); // return 0 for empty, 1 for same, 2 if intersecting
+ return a.intersect_with(r);
+}
+
+#if 0
+
+// --- clipping
+
+int Fl_GDI_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
+ X = x; Y = y; W = w; H = h;
+ Fl_Region r = rstack[rstackptr];
+ if (!r) return 0;
+ // The win32 API makes no distinction between partial and complete
+ // intersection, so we have to check for partial intersection ourselves.
+ // However, given that the regions may be composite, we have to do
+ // some voodoo stuff...
+ Fl_Region rr = XRectangleRegion(x,y,w,h);
+ Fl_Region temp = CreateRectRgn(0,0,0,0);
+ int ret;
+ if (CombineRgn(temp, rr, r, RGN_AND) == NULLREGION) { // disjoint
+ W = H = 0;
+ ret = 2;
+ } else if (EqualRgn(temp, rr)) { // complete
+ ret = 0;
+ } else { // partial intersection
+ RECT rect;
+ GetRgnBox(temp, &rect);
+ if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) { // if print context, convert coords from device to logical
+ POINT pt[2] = { {rect.left, rect.top}, {rect.right, rect.bottom} };
+ DPtoLP(gc_, pt, 2);
+ X = pt[0].x; Y = pt[0].y; W = pt[1].x - X; H = pt[1].y - Y;
+ }
+ else {
+ X = rect.left; Y = rect.top; W = rect.right - X; H = rect.bottom - Y;
+ }
+ ret = 1;
+ }
+ DeleteObject(temp);
+ DeleteObject(rr);
+ return ret;
+}
+
+int Fl_GDI_Graphics_Driver::not_clipped(int x, int y, int w, int h) {
+ if (x+w <= 0 || y+h <= 0) return 0;
+ Fl_Region r = rstack[rstackptr];
+ if (!r) return 1;
+ RECT rect;
+ if (Fl_Surface_Device::surface() != Fl_Display_Device::display_device()) { // in case of print context, convert coords from logical to device
+ POINT pt[2] = { {x, y}, {x + w, y + h} };
+ LPtoDP(gc_, pt, 2);
+ rect.left = pt[0].x; rect.top = pt[0].y; rect.right = pt[1].x; rect.bottom = pt[1].y;
+ } else {
+ rect.left = x; rect.top = y; rect.right = x+w; rect.bottom = y+h;
+ }
+ return RectInRegion(r,&rect);
+}
+
+
+#endif
+
+
+/*
+ - Pushes an empty clip region onto the stack so nothing will be clipped.
+virtual void push_no_clip() {}
+ - Intersects the current clip region with a rectangle and pushes this new region onto the stack.
+virtual void push_clip(int x, int y, int w, int h) {}
+ - Restores the previous clip region.
+virtual void pop_clip() {}
+ - Does the rectangle intersect the current clip region? 0=no, 1=all, 2=partially
+virtual int not_clipped(int x, int y, int w, int h) {return 1;}
+ - Intersects the rectangle with the current clip region and returns the bounding box of the result.
+ Returns 1 if rect changed, W and H are 0 if there is no rect
+virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {return 0;}
+ - Undoes any clobbering of clip done by your program
+virtual void restore_clip();
+
+virtual Fl_Region clip_region(); // has default implementation
+virtual void clip_region(Fl_Region r); // has default implementation
+
+ fl_push_clip(x,y,w,h) -> driver
+ fl_pop_clip() -> driver
+ fl_push_no_clip() -> driver
+ fl_not_clipped(int x, int y, int w, int h) -> driver
+ fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H) -> driver
+ fl_restore_clip() -> driver
+
+ fl_clip_region(Fl_Region r) -> driver
+ fl_clip_region() -> driver
+
+virtual Fl_Region scale_clip(float f) { return 0; }
+void unscale_clip(Fl_Region r);
+
+
+ */
+
+
+
+//
+// End of "$Id$".
+//
diff --git a/src/drivers/Android/README.txt b/src/drivers/Android/README.txt
new file mode 100644
index 000000000..650c07f68
--- /dev/null
+++ b/src/drivers/Android/README.txt
@@ -0,0 +1,12 @@
+
+
+WonkoBook:Android matt$ svn ps svn:keywords "author date id revision" Fl_Android_Application.*
+property 'svn:keywords' set on 'Fl_Android_Application.cpp'
+property 'svn:keywords' set on 'Fl_Android_Application.h'
+WonkoBook:Android matt$ svn pg svn:eol-style Fl_Font.H
+native
+WonkoBook:Android matt$ svn ps svn:eol-style "native" Fl_Android_Application.*
+property 'svn:eol-style' set on 'Fl_Android_Application.cpp'
+property 'svn:eol-style' set on 'Fl_Android_Application.h'
+
+