summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1998-10-15 14:06:16 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1998-10-15 14:06:16 +0000
commit45bb73a9bf4692c68294be12a2e25a39ca3a307b (patch)
tree97b86255a274ec6415738788c180d5528f0948d1 /FL
parent8b880adac62b6724c36405b173286362c386c227 (diff)
Commited WIN32 patches from Bill Spitzak and Gustavo Hime.
git-svn-id: file:///fltk/svn/fltk/trunk@11 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Double_Window.H2
-rw-r--r--FL/Fl_Window.H1
-rw-r--r--FL/win32.H25
-rw-r--r--FL/x.H10
4 files changed, 21 insertions, 17 deletions
diff --git a/FL/Fl_Double_Window.H b/FL/Fl_Double_Window.H
index ba7a42d90..a60e76518 100644
--- a/FL/Fl_Double_Window.H
+++ b/FL/Fl_Double_Window.H
@@ -6,8 +6,6 @@
#include "Fl_Window.H"
class Fl_Double_Window : public Fl_Window {
-protected:
- void _flush(int); // used by Fl_Overlay_Window
public:
void show();
void show(int a, char **b) {Fl_Window::show(a,b);}
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index 43cb0e5f8..b365f67cf 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -74,7 +74,6 @@ public:
void fullscreen();
void fullscreen_off(int,int,int,int);
void iconize();
- void expose(uchar flags,int X,int Y,int W,int H);
int x_root() const ;
int y_root() const ;
diff --git a/FL/win32.H b/FL/win32.H
index d3faa2a05..93f307668 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -23,7 +23,13 @@ inline Region XRectangleRegion(int x, int y, int w, int h) {
return CreateRectRgn(x,y,x+w,y+h);
}
inline void XDestroyRegion(Region r) {DeleteObject(r);}
-
+inline void XClipBox(Region r,XRectangle* rect) {
+ RECT win_rect; GetRgnBox(r,&win_rect);
+ rect->x=win_rect.left;
+ rect->y=win_rect.top;
+ rect->width=win_rect.right-win_rect.left;
+ rect->height=win_rect.bottom-win_rect.top;
+}
#define XDestroyWindow(a,b) DestroyWindow(b)
#define XMapWindow(a,b) ShowWindow(b, SW_RESTORE)
#define XUnmapWindow(a,b) ShowWindow(b, SW_HIDE)
@@ -67,7 +73,6 @@ HBRUSH fl_brush(); // allocates a brush if necessary
extern HINSTANCE fl_display;
extern Window fl_window;
extern HDC fl_gc;
-extern HDC window_dc; // for double-buffered windows
extern HPALETTE fl_palette; // non-zero only on 8-bit displays!
extern HDC fl_GetDC(Window);
extern MSG fl_msg;
@@ -75,15 +80,13 @@ extern MSG fl_msg;
// off-screen pixmaps: create, destroy, draw into, copy to window
#define Fl_Offscreen HBITMAP
#define fl_create_offscreen(w, h) CreateCompatibleBitmap(fl_gc, w, h)
-extern void fl_switch_offscreen(HBITMAP);
-inline void fl_begin_offscreen(HBITMAP b) {
- window_dc = fl_gc; fl_switch_offscreen(b);
-}
-inline void fl_end_offscreen() {
- fl_gc = window_dc;
-}
-void fl_make_current(HBITMAP bitmap);
+extern HDC fl_makeDC(HBITMAP);
+#define fl_begin_offscreen(b) \
+ HDC _sgc=fl_gc; Window _sw=fl_window; fl_gc=fl_makeDC(b); fl_window=b;
+
+#define fl_end_offscreen() \
+ ReleaseDC(fl_window,fl_gc); fl_window=_sw; fl_gc = _sgc
+
void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy);
#define fl_delete_offscreen(bitmap) DeleteObject(bitmap);
-
diff --git a/FL/x.H b/FL/x.H
index 39d1e7bb3..3e6c2c01f 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -47,9 +47,13 @@ extern ulong fl_event_time;
// off-screen pixmaps: create, destroy, draw into, copy to window:
#define Fl_Offscreen ulong
#define fl_create_offscreen(w,h) \
-XCreatePixmap(fl_display, fl_window, w, h, fl_visual->depth)
-#define fl_begin_offscreen(pixmap) Window _sw=fl_window;fl_window=pixmap;fl_push_no_clip()
-#define fl_end_offscreen() fl_pop_clip();fl_window = _sw
+ XCreatePixmap(fl_display, fl_window, w, h, fl_visual->depth)
+// begin/end are macros that save the old state in local variables:
+#define fl_begin_offscreen(pixmap) \
+ Window _sw=fl_window; fl_window=pixmap; fl_push_no_clip()
+#define fl_end_offscreen() \
+ fl_pop_clip(); fl_window = _sw
+
#define fl_copy_offscreen(x,y,w,h,pixmap,srcx,srcy) \
XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y)
#define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)