summaryrefslogtreecommitdiff
path: root/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-15 06:42:06 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-08-29 12:15:32 +0200
commitc720aae51515907ae82ee02df80bd084f291d4b1 (patch)
tree7fbf3569f35966891df68490b047b30c9ec20bcd /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
parent28981f6fd3971aaf7ff6527ee1cdeb9d886c4a4a (diff)
Make hybrid Wayland/X11 platform.
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
index a72fe9d8b..ea24eba34 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
@@ -194,7 +194,7 @@ int Fl_Xlib_Graphics_Driver::clip_rect(int &x, int &y, int &w, int &h) {
Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) {
XRectangle R;
- Fl_Region r = XCreateRegion(); // create an empty region
+ Region r = XCreateRegion(); // create an empty region
if (clip_rect(x, y, w, h)) // outside valid coordinate space
return r; // empty region
R.x = x; R.y = y; R.width = w; R.height = h;
@@ -203,7 +203,7 @@ Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h)
}
void Fl_Xlib_Graphics_Driver::XDestroyRegion(Fl_Region r) {
- ::XDestroyRegion(r);
+ ::XDestroyRegion((Region)r);
}
// --- line and polygon drawing
@@ -312,12 +312,12 @@ void Fl_Xlib_Graphics_Driver::draw_clipped_line(int x1, int y1, int x2, int y2)
// --- clipping
void Fl_Xlib_Graphics_Driver::push_clip(int x, int y, int w, int h) {
- Fl_Region r;
+ Region r;
if (w > 0 && h > 0) {
- r = XRectangleRegion(x, y, w, h); // does X coordinate clipping
- Fl_Region current = rstack[rstackptr];
+ r = (Region)XRectangleRegion(x, y, w, h); // does X coordinate clipping
+ Region current = (Region)rstack[rstackptr];
if (current) {
- Fl_Region temp = XCreateRegion();
+ Region temp = XCreateRegion();
XIntersectRegion(current, r, temp);
XDestroyRegion(r);
r = temp;
@@ -337,7 +337,7 @@ int Fl_Xlib_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y
W = H = 0;
return 2;
}
- Fl_Region r = rstack[rstackptr];
+ Region r = (Region)rstack[rstackptr];
if (!r) { // no clipping region
if (X != x || Y != y || W != w || H != h) // pre-clipped
return 1; // partially outside, region differs
@@ -352,8 +352,8 @@ int Fl_Xlib_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y
default: // partial:
break;
}
- Fl_Region rr = XRectangleRegion(X, Y, W, H);
- Fl_Region temp = XCreateRegion();
+ Region rr = (Region)XRectangleRegion(X, Y, W, H);
+ Region temp = XCreateRegion();
XIntersectRegion(r, rr, temp);
XRectangle rect;
XClipBox(temp, &rect);
@@ -365,7 +365,7 @@ int Fl_Xlib_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y
int Fl_Xlib_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];
+ Region r = (Region)rstack[rstackptr];
if (!r) return 1;
// get rid of coordinates outside the 16-bit range the X calls take.
if (clip_rect(x,y,w,h)) return 0; // clipped
@@ -375,10 +375,10 @@ int Fl_Xlib_Graphics_Driver::not_clipped(int x, int y, int w, int h) {
void Fl_Xlib_Graphics_Driver::restore_clip() {
fl_clip_state_number++;
if (gc_) {
- Region r = rstack[rstackptr];
+ Region r = (Region)rstack[rstackptr];
if (r) {
- Region r2 = scale_clip(scale());
- XSetRegion(fl_display, gc_, rstack[rstackptr]);
+ Region r2 = (Region)scale_clip(scale());
+ XSetRegion(fl_display, gc_, (Region)rstack[rstackptr]);
unscale_clip(r2);
}
else XSetClipMask(fl_display, gc_, 0);