summaryrefslogtreecommitdiffstats
path: root/src/widgets/desktop-widget.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-12-17 04:12:30 +0000
committerJon A. Cruz <jon@joncruz.org>2010-12-17 04:12:30 +0000
commit5982a91e8e0aea5871c36350b888693340e54c9d (patch)
treeb40d59bdbb0cc44eafb1bd14a8fa0570506e7abc /src/widgets/desktop-widget.cpp
parentTranslations. po files update; fix Ahmaric header. (diff)
downloadinkscape-5982a91e8e0aea5871c36350b888693340e54c9d.tar.gz
inkscape-5982a91e8e0aea5871c36350b888693340e54c9d.zip
Simple first pass for rough timing
(bzr r9955.1.1)
Diffstat (limited to 'src/widgets/desktop-widget.cpp')
-rw-r--r--src/widgets/desktop-widget.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 7a3e337de..57e58cd5e 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -121,6 +121,30 @@ static void sp_dtw_sticky_zoom_toggled (GtkMenuItem *item, gpointer data);
SPViewWidgetClass *dtw_parent_class;
+static GTimer *baseTimer = 0;
+static bool timeReported = false;
+
+static void timeGoing(gchar const* id)
+{
+ if ( !baseTimer ) {
+ g_message("Starting time at point [%s]", id);
+ baseTimer = g_timer_new();
+ }
+}
+
+static void checkTime(gchar const* msg)
+{
+ if ( baseTimer && !timeReported ) {
+ timeReported = true;
+ g_timer_stop(baseTimer);
+ gulong msCount = 0;
+ gdouble secs = g_timer_elapsed( baseTimer, &msCount );
+ g_message("Time ended at %2.3f with [%s]", secs, msg);
+ }
+}
+
+
+
class CMSPrefWatcher {
public:
CMSPrefWatcher() :
@@ -250,6 +274,7 @@ GType SPDesktopWidget::getType(void)
{
static GtkType type = 0;
if (!type) {
+ timeGoing("SPDesktopWidget::getType");
GTypeInfo info = {
sizeof(SPDesktopWidgetClass),
0, // base_init
@@ -273,6 +298,7 @@ GType SPDesktopWidget::getType(void)
static void
sp_desktop_widget_class_init (SPDesktopWidgetClass *klass)
{
+ timeGoing("sp_desktop_widget_class_init");
dtw_parent_class = (SPViewWidgetClass*)gtk_type_class (SP_TYPE_VIEW_WIDGET);
GtkObjectClass *object_class = (GtkObjectClass *) klass;
@@ -289,6 +315,7 @@ sp_desktop_widget_class_init (SPDesktopWidgetClass *klass)
*/
void SPDesktopWidget::init( SPDesktopWidget *dtw )
{
+ timeGoing("SPDesktopWidget::init");
GtkWidget *widget;
GtkWidget *tbl;
GtkWidget *canvas_tbl;
@@ -564,6 +591,28 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
gtk_widget_show_all (dtw->vbox);
gtk_widget_grab_focus (GTK_WIDGET(dtw->canvas));
+
+ {
+ g_message("FIRE UP");
+
+ gtk_widget_add_events( eventbox, GDK_STRUCTURE_MASK );
+
+ gboolean fooMap(GtkWidget *widget, GdkEvent *event, gpointer userData);
+ g_signal_connect( G_OBJECT(eventbox), "map-event", G_CALLBACK(fooMap), dtw );
+
+ void fooReal(GtkWidget *widget, gpointer userData);
+ g_signal_connect( G_OBJECT(eventbox), "map-event", G_CALLBACK(fooReal), dtw );
+ }
+}
+
+gboolean fooMap(GtkWidget *widget, GdkEvent *event, gpointer userData) {
+ checkTime( "MAP");
+ return FALSE;
+}
+
+void fooReal(GtkWidget *widget, gpointer userData)
+{
+ checkTime("REALIZE");
}
/**