Author: toshok
Date: 2008-02-05 13:16:24 -0500 (Tue, 05 Feb 2008)
New Revision: 94914

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/runtime.cpp
   trunk/moon/src/runtime.h
Log:
2008-02-05  Chris Toshok  <[EMAIL PROTECTED]>

        * runtime.h, runtime.cpp: add support for a "selected" element
        when in debug mode.  Also, make use of the Region methods instead
        of using region->gdkregion, which is private now.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2008-02-05 18:15:31 UTC (rev 94913)
+++ trunk/moon/src/ChangeLog    2008-02-05 18:16:24 UTC (rev 94914)
@@ -1,5 +1,11 @@
 2008-02-05  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * runtime.h, runtime.cpp: add support for a "selected" element
+       when in debug mode.  Also, make use of the Region methods instead
+       of using region->gdkregion, which is private now.
+
+2008-02-05  Chris Toshok  <[EMAIL PROTECTED]>
+
        * region.h, region.cpp (class Region): add Offset().
 
 2008-02-05  Sebastien Pouliot  <[EMAIL PROTECTED]>

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2008-02-05 18:15:31 UTC (rev 94913)
+++ trunk/moon/src/runtime.cpp  2008-02-05 18:16:24 UTC (rev 94914)
@@ -197,6 +197,10 @@
        emittingMouseEvent = false;
        pendingCapture = NULL;
        pendingReleaseCapture = false;
+
+#ifdef DEBUG
+       debug_selected_element = NULL;
+#endif
 }
 
 Surface::~Surface ()
@@ -453,7 +457,7 @@
        bool did_front_to_back = false;
 
        List *render_list = new List ();
-       Region *copy = new Region (region->gdkregion);
+       Region *copy = new Region (region);
 
        if (moonlight_flags & RUNTIME_INIT_RENDER_FRONT_TO_BACK) {
                if (full_screen_message)
@@ -495,7 +499,7 @@
                delete render_list;
                delete copy;
        }
-       
+
        if (!did_front_to_back) {
                toplevel->DoRender (ctx, region);
 
@@ -508,6 +512,23 @@
        printf ("UIElements rendered front-to-back: %d\n", 
uielements_rendered_front_to_back);
        printf ("UIElements rendered back-to-front: %d\n", 
uielements_rendered_back_to_front);
 #endif
+
+#ifdef DEBUG
+               if (debug_selected_element) {
+                       Rect bounds = 
debug_selected_element->GetSubtreeBounds();
+//                     printf ("debug_selected_element is %s\n", 
debug_selected_element->GetName());
+//                     printf ("bounds is %g %g %g %g\n", bounds.x, bounds.y, 
bounds.w, bounds.h);
+                       cairo_save (ctx);
+                       //RenderClipPath (ctx);
+                       cairo_new_path (ctx);
+                       cairo_identity_matrix (ctx);
+                       cairo_set_source_rgba (ctx, 1.0, 0.5, 0.2, 1.0);
+                       cairo_set_line_width (ctx, 1);
+                       cairo_rectangle (ctx, bounds.x, bounds.y, bounds.w, 
bounds.h);
+                       cairo_stroke (ctx);
+                       cairo_restore (ctx);
+               }
+#endif
 }
 
 //
@@ -898,7 +919,7 @@
        GdkPixmap *pixmap = gdk_pixmap_new (widget->window, MAX 
(event->area.width, 1), MAX (event->area.height, 1), -1);
        cairo_t *ctx = runtime_cairo_create (pixmap);
        Region *region = new Region (event->region);
-       gdk_region_offset (region->gdkregion, -widget->allocation.x, 
-widget->allocation.y);
+       region->Offset (-widget->allocation.x, -widget->allocation.y);
 
        cairo_surface_set_device_offset (cairo_get_target (ctx),
                                         widget->allocation.x - event->area.x, 

Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h    2008-02-05 18:15:31 UTC (rev 94913)
+++ trunk/moon/src/runtime.h    2008-02-05 18:16:24 UTC (rev 94914)
@@ -28,6 +28,7 @@
 #include "list.h"
 #include "downloader.h"
 
+
 #define FRONT_TO_BACK_STATS 0
 
 #define TIMERS 0
@@ -144,7 +145,11 @@
        int uielements_rendered_front_to_back;
        int uielements_rendered_back_to_front;
 #endif
-       
+
+#ifdef DEBUG
+       UIElement *debug_selected_element;
+#endif
+
 private:
        gpointer downloader_context;
        

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to