gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/gtk.cpp gui/gtksup.h gui/gu...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog gui/gtk.cpp gui/gtksup.h gui/gu...
Date: Fri, 11 Apr 2008 10:05:08 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/11 10:05:08

Modified files:
        .              : ChangeLog 
        gui            : gtk.cpp gtksup.h gui.cpp gui.h 

Log message:
                * gui/gui.{cpp,h}: add flag for showing invalidated ranges for
                  runtime option. Enable show invalidated ranges by default, 
                  check runtime flag.
                * gui/gtk{sup.h,.cpp}: menu option to turn on showing 
invalidated
                  ranges.
        
        The pp has it; why shouldn't Gnash? 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6251&r2=1.6252
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.165&r2=1.166
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtksup.h?cvsroot=gnash&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.148&r2=1.149
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.83&r2=1.84

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6251
retrieving revision 1.6252
diff -u -b -r1.6251 -r1.6252
--- ChangeLog   11 Apr 2008 09:58:40 -0000      1.6251
+++ ChangeLog   11 Apr 2008 10:05:06 -0000      1.6252
@@ -1,3 +1,11 @@
+2008-04-11 Benjamin Wolsey <address@hidden>
+
+       * gui/gui.{cpp,h}: add flag for showing invalidated ranges for
+         runtime option. Enable show invalidated ranges by default, 
+         check runtime flag.
+       * gui/gtk{sup.h,.cpp}: menu option to turn on showing invalidated
+         ranges.
+
 2008-04-11 Sandro Santilli <address@hidden>
 
        * server/asobj/TextFormat.cpp: implement getter-setter for

Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -b -r1.165 -r1.166
--- gui/gtk.cpp 11 Apr 2008 07:27:45 -0000      1.165
+++ gui/gtk.cpp 11 Apr 2008 10:05:07 -0000      1.166
@@ -1657,6 +1657,15 @@
     gui->refreshView();
 }
 
+/// \brief Force redraw
+void
+GtkGui::menuitem_show_updated_regions_callback(GtkMenuItem* /*menuitem*/,
+                                gpointer data)
+{
+    Gui* gui = static_cast<Gui*>(data);
+    gui->showUpdatedRegions(! (gui->showUpdatedRegions()) );
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 ///                                                                         ///
@@ -1922,6 +1931,7 @@
 void
 GtkGui::createViewMenu(GtkWidget *obj)
 {
+
 //    GNASH_REPORT_FUNCTION;
     GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (_("_View"));
     gtk_widget_show (menuitem);
@@ -1957,6 +1967,19 @@
     gtk_widget_show(GTK_WIDGET(menuitem_fullscreen));
     g_signal_connect(GTK_OBJECT(menuitem_fullscreen), "activate",
                          G_CALLBACK(&menuitem_fullscreen_callback), this);
+
+    GtkCheckMenuItem *menuitem_show_updated_regions =
+        GTK_CHECK_MENU_ITEM(gtk_check_menu_item_new_with_label(_("Show updated 
ranges")));
+   
+    gtk_check_menu_item_set_active 
(GTK_CHECK_MENU_ITEM(menuitem_show_updated_regions),
+                                    showUpdatedRegions() );
+
+    gtk_menu_append(menu, GTK_WIDGET(menuitem_show_updated_regions));
+    gtk_widget_show(GTK_WIDGET(menuitem_show_updated_regions));
+    g_signal_connect(GTK_OBJECT(menuitem_show_updated_regions), "activate",
+                     G_CALLBACK(&menuitem_show_updated_regions_callback), 
this);
+
+
 }
 
 // Create a Control menu that can be used from the menu bar or the popup.

Index: gui/gtksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gtksup.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- gui/gtksup.h        9 Apr 2008 11:57:34 -0000       1.71
+++ gui/gtksup.h        11 Apr 2008 10:05:07 -0000      1.72
@@ -154,6 +154,8 @@
     /// Force redraw (Ctrl-L)
     static void menuitem_refresh_view_callback(GtkMenuItem *menuitem,
                                    gpointer instance);
+    static void menuitem_show_updated_regions_callback(GtkMenuItem *menuitem,
+                                   gpointer instance); 
  
     // GTK Event handlers
     static gboolean realize_event(GtkWidget *widget, GdkEvent *event,

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -b -r1.148 -r1.149
--- gui/gui.cpp 7 Apr 2008 21:44:56 -0000       1.148
+++ gui/gui.cpp 11 Apr 2008 10:05:08 -0000      1.149
@@ -52,7 +52,7 @@
 /// but in contrast to FORCE_REDRAW it won't re-render when no motion
 /// has been detected in the movie (for example when the movie is stopped).
 ///
-//#define ENABLE_REGION_UPDATES_DEBUGGING 1
+#define ENABLE_REGION_UPDATES_DEBUGGING 1
 
 /// Define this if you want to debug the *detection* of region updates only.
 /// This will disable region updates for the backend (GUI+renderer) completely 
@@ -66,7 +66,7 @@
 
 #ifdef ENABLE_REGION_UPDATES_DEBUGGING
 // a runtime check would make the { x; } block conditionally executed
-#define IF_DEBUG_REGION_UPDATES(x) { x; }
+#define IF_DEBUG_REGION_UPDATES(x) { if (_showUpdatedRegions) { x } }
 #else
 #define IF_DEBUG_REGION_UPDATES(x) 
 #endif
@@ -107,6 +107,7 @@
     ,_stage(0)
     ,_stopped(false)
     ,_started(false)
+    ,_showUpdatedRegions(false)
 #ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS 
     ,_xpointer(0)
     ,_ypointer(0)
@@ -145,6 +146,7 @@
     ,_stage(0)
     ,_stopped(false)
     ,_started(false)
+    ,_showUpdatedRegions(false)
 #ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS 
     ,_xpointer(0)
     ,_ypointer(0)
@@ -663,7 +665,7 @@
                if ( ! changed_ranges.isWorld() )
                {
                
-                       for (int rno=0; rno<changed_ranges.size(); rno++) {
+                       for (size_t rno = 0; rno < changed_ranges.size(); 
rno++) {
                        
                                geometry::Range2d<float> bounds = 
changed_ranges.getRange(rno);
 

Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- gui/gui.h   9 Apr 2008 11:57:34 -0000       1.83
+++ gui/gui.h   11 Apr 2008 10:05:08 -0000      1.84
@@ -281,6 +281,9 @@
     
     void setMaxAdvances(unsigned long ul) { if (ul > 0) _maxAdvances = ul; }
 
+    void showUpdatedRegions(bool x) { _showUpdatedRegions = x; }
+    bool showUpdatedRegions() { return _showUpdatedRegions; }
+
     /** @name Menu callbacks
      *  These callbacks will be called when a menu item is clicked.
      *  @{
@@ -437,6 +440,9 @@
     /// True if the application didn't start yet
     bool            _started;
     
+    /// If true, updated regions (invalidated ranges) are visibly outlined.
+    bool _showUpdatedRegions;
+    
 #ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS 
        int _xpointer;
        int _ypointer;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]