pass expose events like i was before. cleanups in rendering to not render areas anymo...
authorDana Jansens <danakj@orodu.net>
Wed, 28 May 2003 02:30:39 +0000 (02:30 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 28 May 2003 02:30:39 +0000 (02:30 +0000)
openbox/event.c
render2/paint.c
render2/planar.c
render2/planar.h
render2/render.h
render2/surface.c
render2/test.c

index 0d15711f16a3f3ede141106e948402c268c12c09..736cdd8f88c0ceaff176dffe9c2241d3469b1b74 100644 (file)
@@ -136,7 +136,7 @@ void event_loop()
 
         /* we don't use exposes but the render lib wants them all! */
         if (ob_state != State_Exiting && e.type == Expose)
-            RrExpose(ob_render_inst, &e);
+            RrExpose(ob_render_inst, &e.xexpose);
 
 #ifdef USE_LIBSN
         sn_display_process_event(ob_sn_display, &e);
index 2037e99a1012ae24d4b62ebfcc65668800931375..7b00f59b808b728691ad3b1e5a0bf6a818aa830b 100644 (file)
@@ -21,35 +21,25 @@ struct ExposeArea {
             a->y = MIN(a->y, y)
 
 
-void RrExpose(struct RrInstance *inst, XEvent *e)
+void RrExpose(struct RrInstance *inst, XExposeEvent *e)
 {
     XEvent e2;
-    GSList *tops = NULL, *it, *n;
     struct RrSurface *sur;
+    Window win;
 
-    e2 = *e;
-    if ((sur = RrInstaceLookupSurface(inst, e2.xexpose.window))) {
-        while (XCheckTypedWindowEvent(RrDisplay(inst), Expose,
-                                      e->xexpose.window, &e2));
-        while (sur->parent &&
-               RrSurfaceType(sur->parent) != RR_SURFACE_NONE) {
+    win = e->window;
+
+    if ((sur = RrInstaceLookupSurface(inst, win))) {
+        while (XCheckTypedWindowEvent(RrDisplay(inst), Expose, win, &e2));
+        while (sur->parent && RrSurfaceType(sur->parent) != RR_SURFACE_NONE)
             sur = sur->parent;
-        }
         RrPaint(sur);
-    } else {
-        RrDebug("Unable to find surface for window 0x%lx\n",
-                e2.xexpose.window);
-    }
+    } else
+        RrDebug("Unable to find surface for window 0x%lx\n", win);
 }
 
 /*! Paints the surface, and all its children */
 void RrPaint(struct RrSurface *sur)
-{
-    RrPaintArea(sur, 0, 0, RrSurfaceWidth(sur), RrSurfaceHeight(sur));
-}
-
-/*! Paints the surface, and all its children, but only in the given area. */
-void RrPaintArea(struct RrSurface *sur, int x, int y, int w, int h)
 {
     struct RrInstance *inst;
     struct RrSurface *p;
@@ -97,7 +87,7 @@ void RrPaintArea(struct RrSurface *sur, int x, int y, int w, int h)
 
     switch (RrSurfaceType(sur)) {
     case RR_SURFACE_PLANAR:
-        RrPlanarPaint(sur, surx + x, sury + y, w, h);
+        RrPlanarPaint(sur, surx, sury);
         break;
     case RR_SURFACE_NONPLANAR:
         assert(0);
index 945427c9067eea4ff3637480c4852358fd8861bb..62684e47da1105dbff3b42c76692b30f95613f7a 100644 (file)
@@ -63,7 +63,7 @@ static void copy_parent(struct RrSurface *sur)
     }
 }
 
-void RrPlanarPaint(struct RrSurface *sur, int x, int y, int w, int h)
+void RrPlanarPaint(struct RrSurface *sur, int absx, int absy)
 {   
     struct RrColor *pri, *sec, avg;
     int x, y, w, h;
index c22c2386b19522d21f01e14f24bd2046ee2d8e10..c394c98e915be339e150133ba1916594ad7c51ad 100644 (file)
@@ -14,7 +14,7 @@ struct RrPlanarSurface {
 #define RrPlanarPrimaryColor(sur) ((sur)->data.planar.primary)
 #define RrPlanarSecondaryColor(sur) ((sur)->data.planar.secondary)
 
-void RrPlanarPaint(struct RrSurface *sur, int x, int y, int w, int h);
+void RrPlanarPaint(struct RrSurface *sur, int absx, int absy);
 
 void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h);
 
index 08c60b7d8624c96fe6fb68b30a543a3aa9e9cc37..5e218b8ed1e2f24115458d1aca6a65e076a9d49f 100644 (file)
@@ -112,6 +112,12 @@ void RrSurfaceSetArea(struct RrSurface *sur,
                       int y,
                       int w,
                       int h);
+void RrSurfaceSetPos(struct RrSurface *sur,
+                     int x,
+                     int y);
+void RrSurfaceSetSize(struct RrSurface *sur,
+                      int w,
+                      int h);
 
 Window RrSurfaceWindow(struct RrSurface *sur);
 
@@ -190,12 +196,7 @@ void RrTextureSetNone(struct RrSurface *sur,
 
 /*! Paints the surface, and all its children */
 void RrPaint(struct RrSurface *sur);
-/*! Paints the surface, and all its children, but only in the given area. */
-void RrPaintArea(struct RrSurface *sur,
-                 int x,
-                 int y,
-                 int w,
-                 int h);
-void RrExpose(struct RrInstance *inst, XEvent *e);
+
+void RrExpose(struct RrInstance *inst, XExposeEvent *e);
 
 #endif
index a824313017ec0f71f81fa0ec585b032fae9943b8..b4e03370b42e2149d3d556129e3c98640e7cc939 100644 (file)
@@ -170,6 +170,20 @@ void RrSurfaceFree(struct RrSurface *sur)
     }
 }
 
+void RrSurfaceSetPos(struct RrSurface *sur,
+                     int x,
+                     int y)
+{
+    RrSurfaceSetArea(sur, x, y, sur->w, sur->h);
+}
+
+void RrSurfaceSetSize(struct RrSurface *sur,
+                      int w,
+                      int h)
+{
+    RrSurfaceSetArea(sur, sur->x, sur->y, w, h);
+}
+
 void RrSurfaceSetArea(struct RrSurface *sur,
                       int x,
                       int y,
index 8001ab8fabb0c565023b3a084a5478ff311bcdc2..27934d09d52ee9da1cc709bcd5127b5466a28b5c 100644 (file)
@@ -85,16 +85,13 @@ int main()
                 /* fall through ... */
             } else {
                 while (XCheckTypedWindowEvent(display, win, Expose, &report));
-                RrPaintArea(sur, report.xexpose.x, report.xexpose.y,
-                            report.xexpose.width, report.xexpose.height);
+                RrPaint(sur);
                 break;
             }
         case ConfigureNotify:
             while (XCheckTypedWindowEvent(display, win, ConfigureNotify,
                                           &report));
-            RrSurfaceSetArea(sur,
-                             report.xconfigure.x,
-                             report.xconfigure.y,
+            RrSurfaceSetSize(sur,
                              report.xconfigure.width,
                              report.xconfigure.height);
             break;