Author: fejj
Date: 2007-12-03 12:25:12 -0500 (Mon, 03 Dec 2007)
New Revision: 90561

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/clock.cpp
   trunk/moon/src/mplayer.cpp
   trunk/moon/src/runtime.cpp
   trunk/moon/src/runtime.h
   trunk/moon/src/uielement.cpp
Log:
2007-12-03  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * runtime.cpp: Added clipping/bounding-box override values.

        * uielement.cpp (DoRender): Changed optional bounding-box/clipping
        debugging drawing based on runtime settable bitflags.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/ChangeLog    2007-12-03 17:25:12 UTC (rev 90561)
@@ -1,3 +1,10 @@
+2007-12-03  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * runtime.cpp: Added clipping/bounding-box override values.
+
+       * uielement.cpp (DoRender): Changed optional bounding-box/clipping
+       debugging drawing based on runtime settable bitflags.
+
 2007-12-03  Larry Ewing  <[EMAIL PROTECTED]>
 
        * uielement.cpp: Clean up the debug rendering code for bounding

Modified: trunk/moon/src/clock.cpp
===================================================================
--- trunk/moon/src/clock.cpp    2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/clock.cpp    2007-12-03 17:25:12 UTC (rev 90561)
@@ -196,7 +196,7 @@
     flags (TimeManagerOp (TIME_MANAGER_UPDATE_CLOCKS | TIME_MANAGER_RENDER | 
TIME_MANAGER_TICK_CALL /*| TIME_MANAGER_UPDATE_INPUT*/)),
     tick_calls (NULL)
 {
-       if (moonlight_flags & RUNTIME_INIT_TIMESOURCE_MANUAL)
+       if (moonlight_flags & RUNTIME_INIT_MANUAL_TIMESOURCE)
                source = new ManualTimeSource();
        else
                source = new SystemTimeSource();

Modified: trunk/moon/src/mplayer.cpp
===================================================================
--- trunk/moon/src/mplayer.cpp  2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/mplayer.cpp  2007-12-03 17:25:12 UTC (rev 90561)
@@ -397,7 +397,7 @@
        //AVFormatContext_dump (av_ctx);
        
        // Prepare audio playback
-       if ((moonlight_flags & RUNTIME_INIT_AUDIO_DISABLE) == 0 && audio->pcm 
== NULL && audio->stream_id != -1) {
+       if (!(moonlight_flags & RUNTIME_INIT_DISABLE_AUDIO) && audio->pcm == 
NULL && audio->stream_id != -1) {
                if (snd_pcm_open (&audio->pcm, "default", 
SND_PCM_STREAM_PLAYBACK, 0) != 0) {
                        fprintf (stderr, "cannot open audio device: %s\n", 
strerror (errno));
                        audio->pcm = NULL;

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/runtime.cpp  2007-12-03 17:25:12 UTC (rev 90561)
@@ -71,14 +71,18 @@
        guint32 flag;
        bool set;
 } overrides[] = {
-       { "text=pango",        RUNTIME_INIT_PANGO_TEXT_LAYOUT, true  },
-       { "text=silverlight",  RUNTIME_INIT_PANGO_TEXT_LAYOUT, false },
-       { "codecs=microsoft",  RUNTIME_INIT_MICROSOFT_CODECS,  true  },
-       { "codecs=ffmpeg",     RUNTIME_INIT_MICROSOFT_CODECS,  false },
-       { "timesource=manual", RUNTIME_INIT_TIMESOURCE_MANUAL, true },
-       { "timesource=system", RUNTIME_INIT_TIMESOURCE_MANUAL, false },
-       { "show=expose",       RUNTIME_INIT_SHOW_EXPOSE,       true },
-       { "show=nothing",      RUNTIME_INIT_SHOW_EXPOSE,       false },
+       { "text=pango",        RUNTIME_INIT_PANGO_TEXT_LAYOUT,     true  },
+       { "text=silverlight",  RUNTIME_INIT_PANGO_TEXT_LAYOUT,     false },
+       { "codecs=microsoft",  RUNTIME_INIT_MICROSOFT_CODECS,      true  },
+       { "codecs=ffmpeg",     RUNTIME_INIT_MICROSOFT_CODECS,      false },
+       { "timesource=manual", RUNTIME_INIT_MANUAL_TIMESOURCE,     true  },
+       { "timesource=system", RUNTIME_INIT_MANUAL_TIMESOURCE,     false },
+       { "expose=show",       RUNTIME_INIT_SHOW_EXPOSE,           true  },
+       { "expose=hide",       RUNTIME_INIT_SHOW_EXPOSE,           false },
+       { "clipping=show",     RUNTIME_INIT_SHOW_CLIPPING,         true  },
+       { "clipping=hide",     RUNTIME_INIT_SHOW_CLIPPING,         false },
+       { "bbox=show",         RUNTIME_INIT_SHOW_BOUNDING_BOXES,   true  },
+       { "bbox=hide",         RUNTIME_INIT_SHOW_BOUNDING_BOXES,   false },
 };
 
 #define RENDER_EXPOSE (moonlight_flags & RUNTIME_INIT_SHOW_EXPOSE)

Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h    2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/runtime.h    2007-12-03 17:25:12 UTC (rev 90561)
@@ -37,11 +37,13 @@
 #endif
 
 enum RuntimeInitFlags {
-       RUNTIME_INIT_PANGO_TEXT_LAYOUT = 0x1,
-       RUNTIME_INIT_MICROSOFT_CODECS  = 0x2,
-       RUNTIME_INIT_TIMESOURCE_MANUAL = 0x4,
-       RUNTIME_INIT_AUDIO_DISABLE     = 0x8,
-       RUNTIME_INIT_SHOW_EXPOSE       = 1 << 4
+       RUNTIME_INIT_PANGO_TEXT_LAYOUT     = 1 << 0,
+       RUNTIME_INIT_MICROSOFT_CODECS      = 1 << 1,
+       RUNTIME_INIT_MANUAL_TIMESOURCE     = 1 << 2,
+       RUNTIME_INIT_DISABLE_AUDIO         = 1 << 3,
+       RUNTIME_INIT_SHOW_EXPOSE           = 1 << 4,
+       RUNTIME_INIT_SHOW_CLIPPING         = 1 << 5,
+       RUNTIME_INIT_SHOW_BOUNDING_BOXES   = 1 << 6,
 };
 
 #define RUNTIME_INIT_DESKTOP (RUNTIME_INIT_PANGO_TEXT_LAYOUT)

Modified: trunk/moon/src/uielement.cpp
===================================================================
--- trunk/moon/src/uielement.cpp        2007-12-03 17:09:35 UTC (rev 90560)
+++ trunk/moon/src/uielement.cpp        2007-12-03 17:25:12 UTC (rev 90561)
@@ -21,10 +21,12 @@
 #include "geometry.h"
 #include "dirty.h"
 
-//#define SHOW_BOUNDING_BOXES 1
-//#define SHOW_CLIP_REGIONS 1
+
 //#define DEBUG_INVALIDATE 0
 
+extern guint32 moonlight_flags;
+
+
 int UIElement::LoadedEvent = -1;
 int UIElement::MotionEvent = -1;
 int UIElement::ButtonPressEvent = -1;
@@ -561,33 +563,34 @@
        }
 
        ENDTIMER (UIElement_render, Type::Find (GetObjectType())->name);
-
-#if SHOW_CLIP_REGIONS
-       cairo_save (cr);
-       cairo_new_path (cr);
-       cairo_set_matrix (cr, &absolute_xform);
-       cairo_set_line_width (cr, 1);
-
-       Value *value = GetValue (UIElement::ClipProperty);
-       if (value) {
-               Geometry *geometry = value->AsGeometry ();
-               geometry->Draw (NULL, cr);
-               cairo_set_source_rgba (cr, 0.0, 1.0, 1.0, 1.0);
+       
+       if (moonlight_flags & RUNTIME_INIT_SHOW_CLIPPING) {
+               cairo_save (cr);
+               cairo_new_path (cr);
+               cairo_set_matrix (cr, &absolute_xform);
+               cairo_set_line_width (cr, 1);
+               
+               Value *value = GetValue (UIElement::ClipProperty);
+               if (value) {
+                       Geometry *geometry = value->AsGeometry ();
+                       geometry->Draw (NULL, cr);
+                       cairo_set_source_rgba (cr, 0.0, 1.0, 1.0, 1.0);
+                       cairo_stroke (cr);
+               }
+               
+               cairo_restore (cr);
+       }
+       
+       if (moonlight_flags & RUNTIME_INIT_SHOW_BOUNDING_BOXES) {
+               cairo_save (cr);
+               //RenderClipPath (cr);
+               cairo_identity_matrix (cr);
+               cairo_set_source_rgba (cr, 1.0, 0.5, 0.2, 1.0);
+               cairo_set_line_width (cr, 1);
+               cairo_rectangle (cr, bounds.x + .5, bounds.y + .5, bounds.w - 
.5, bounds.h - .5);
                cairo_stroke (cr);
+               cairo_restore (cr);
        }
-       cairo_restore (cr);
-#endif
-
-#if SHOW_BOUNDING_BOXES
-       cairo_save (cr);
-       //RenderClipPath (cr);
-       cairo_identity_matrix (cr);
-       cairo_set_source_rgba (cr, 1.0, 0.5, 0.2, 1.0);
-       cairo_set_line_width (cr, 1);
-       cairo_rectangle (cr, bounds.x + .5, bounds.y + .5, bounds.w - .5, 
bounds.h - .5);
-       cairo_stroke (cr);
-       cairo_restore (cr);
-#endif
 }
 
 void

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

Reply via email to