Author: toshok
Date: 2008-02-05 14:26:18 -0500 (Tue, 05 Feb 2008)
New Revision: 94929
Modified:
trunk/moon/plugin/ChangeLog
trunk/moon/plugin/plugin-debug.cpp
trunk/moon/plugin/plugin.cpp
trunk/moon/plugin/plugin.h
Log:
2008-02-05 Chris Toshok <[EMAIL PROTECTED]>
* plugin.h, plugin.cpp: add a label to the properties dialog that
shows the fps message.
* plugin-debug.cpp (selection_changed): invalidate a large enough
rectangle so that the selection disappears.
Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2008-02-05 19:19:35 UTC (rev 94928)
+++ trunk/moon/plugin/ChangeLog 2008-02-05 19:26:18 UTC (rev 94929)
@@ -1,5 +1,13 @@
2008-02-05 Chris Toshok <[EMAIL PROTECTED]>
+ * plugin.h, plugin.cpp: add a label to the properties dialog that
+ shows the fps message.
+
+ * plugin-debug.cpp (selection_changed): invalidate a large enough
+ rectangle so that the selection disappears.
+
+2008-02-05 Chris Toshok <[EMAIL PROTECTED]>
+
* Makefile.am (libmoonplugin_la_SOURCES): add plugin-debug.h/cpp
* plugin-debug.h, plugin.cpp: for now, just a gtk treeview with a
Modified: trunk/moon/plugin/plugin-debug.cpp
===================================================================
--- trunk/moon/plugin/plugin-debug.cpp 2008-02-05 19:19:35 UTC (rev 94928)
+++ trunk/moon/plugin/plugin-debug.cpp 2008-02-05 19:26:18 UTC (rev 94929)
@@ -41,8 +41,9 @@
UIElement *el;
if (plugin->surface->debug_selected_element) {
- plugin->surface->debug_selected_element->Invalidate ();
- plugin->surface->debug_selected_element->unref ();
+ UIElement *el = plugin->surface->debug_selected_element;
+ el->Invalidate (el->GetSubtreeBounds().GrowBy(1).RoundOut());
+ el->unref ();
plugin->surface->debug_selected_element = NULL;
}
@@ -58,7 +59,7 @@
if (el) {
printf ("%p selected, name = %s, type = %s\n", el,
el->GetName(), el->GetTypeName());
- el->Invalidate ();
+ el->Invalidate (el->GetSubtreeBounds().GrowBy(1).RoundOut());
el->ref ();
plugin->surface->debug_selected_element = el;
}
Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp 2008-02-05 19:19:35 UTC (rev 94928)
+++ trunk/moon/plugin/plugin.cpp 2008-02-05 19:26:18 UTC (rev 94929)
@@ -196,6 +196,13 @@
}
void
+PluginInstance::properties_dialog_response (GtkWidget *dialog, int response,
PluginInstance *plugin)
+{
+ plugin->properties_fps_label = NULL;
+ gtk_widget_destroy (dialog);
+}
+
+void
PluginInstance::Properties ()
{
GtkWidget *dialog, *table, *checkbox;
@@ -214,7 +221,7 @@
gtk_box_pack_start (vbox, title ("Properties"), FALSE, FALSE, 0);
gtk_box_pack_start (vbox, gtk_hseparator_new (), FALSE, FALSE, 8);
- table = gtk_table_new (9, 2, TRUE);
+ table = gtk_table_new (11, 2, TRUE);
gtk_box_pack_start (vbox, table, TRUE, TRUE, 0);
table_add (table, "Source:", 0, row++);
@@ -234,6 +241,11 @@
table_add (table, xaml_loader == NULL ? "(Unknown)" :
(xaml_loader->IsManaged () ? "1.1 (XAML + Managed Code)" : "1.0 (Pure XAML)"),
1, row++);
table_add (table, windowless ? "yes" : "no", 1, row++);
+ row++;
+ properties_fps_label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (properties_fps_label), 0.0, 0.5);
+ gtk_table_attach (GTK_TABLE(table), properties_fps_label, 0, 2, row,
row+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) 0, 4, 0);
+
// Runtime debug options
gtk_box_pack_start (vbox, title ("Runtime Debug Options"), FALSE,
FALSE, 0);
gtk_box_pack_start (vbox, gtk_hseparator_new (), FALSE, FALSE, 8);
@@ -257,8 +269,8 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
moonlight_flags & RUNTIME_INIT_SHOW_FPS);
g_signal_connect (checkbox, "toggled", G_CALLBACK (show_fps), NULL);
gtk_box_pack_start (vbox, checkbox, FALSE, FALSE, 0);
-
- g_signal_connect_swapped (dialog, "response", G_CALLBACK
(gtk_widget_destroy), dialog);
+
+ g_signal_connect (dialog, "response", G_CALLBACK
(properties_dialog_response), this);
gtk_widget_show_all (dialog);
}
@@ -268,6 +280,8 @@
this->instance = instance;
this->window = NULL;
+ this->properties_fps_label = NULL;
+
this->rootobject = NULL;
this->container = NULL;
@@ -467,6 +481,11 @@
nframes, nsecs, nframes / nsecs);
NPN_Status (plugin->instance, msg);
+
+ if (plugin->properties_fps_label) {
+ gtk_label_set_text (GTK_LABEL (plugin->properties_fps_label),
msg);
+ }
+
g_free (msg);
}
Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h 2008-02-05 19:19:35 UTC (rev 94928)
+++ trunk/moon/plugin/plugin.h 2008-02-05 19:26:18 UTC (rev 94929)
@@ -42,6 +42,8 @@
bool windowless;
+ GtkWidget *properties_fps_label;
+
//
// The XAML loader, contains a handle to a MonoObject *
//
@@ -63,7 +65,8 @@
void SetPageURL ();
static void ReportFPS (Surface *surface, int nframes, float nsecs, void
*user_data);
-
+ static void properties_dialog_response (GtkWidget *dialog, int
response, PluginInstance *plugin);
+
public:
PluginInstance (NPP instance, uint16_t mode);
~PluginInstance ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches