Code

dumps the graph to cout in dot format
[inkscape.git] / src / event-context.cpp
index 8291d79a469c6f2aed64d86f80bedfb947525574..54b683bf4094536ae6c62d7f3ea44bc236c0ff21 100644 (file)
@@ -174,35 +174,18 @@ sp_event_context_update_cursor(SPEventContext *ec)
     if (w->window) {
         /* fixme: */
         if (ec->cursor_shape) {
-            GdkDisplay *display=gdk_display_get_default();
-            if (
-                    gdk_display_supports_cursor_alpha(display) & 
-                    gdk_display_supports_cursor_color(display)
-               )
-            {
-                GdkPixbuf *pixbuf =NULL;
-                pixbuf=gdk_pixbuf_new_from_xpm_data((const char**)ec->cursor_shape);
-                if (pixbuf !=NULL) { 
-                ec->cursor = gdk_cursor_new_from_pixbuf(display,pixbuf,
-                        ec->hot_x,
-                        ec->hot_y); 
-                }
-            }
-            else 
-            {
-                    GdkBitmap *bitmap = NULL;
-                GdkBitmap *mask = NULL;
-                sp_cursor_bitmap_and_mask_from_xpm(&bitmap, &mask, ec->cursor_shape);
-                if ((bitmap != NULL) && (mask != NULL)) {
-                    if (ec->cursor)
-                        gdk_cursor_unref (ec->cursor);
-                    ec->cursor = gdk_cursor_new_from_pixmap(bitmap, mask,
-                            &w->style->black, 
-                            &w->style->white,
-                            ec->hot_x, ec->hot_y);
-                    g_object_unref (bitmap);
-                    g_object_unref (mask);
-                }
+            GdkBitmap *bitmap = NULL;
+            GdkBitmap *mask = NULL;
+            sp_cursor_bitmap_and_mask_from_xpm(&bitmap, &mask, ec->cursor_shape);
+            if ((bitmap != NULL) && (mask != NULL)) {
+                if (ec->cursor)
+                    gdk_cursor_unref (ec->cursor);
+                ec->cursor = gdk_cursor_new_from_pixmap(bitmap, mask,
+                                                        &w->style->black, 
+                                                        &w->style->white,
+                                                        ec->hot_x, ec->hot_y);
+                g_object_unref (bitmap);
+                g_object_unref (mask);
             }
         }
         gdk_window_set_cursor(w->window, ec->cursor);
@@ -363,7 +346,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context,
         case GDK_BUTTON_PRESS:
 
             // save drag origin
-            xp = (gint) event->button.x; 
+            xp = (gint) event->button.x;
             yp = (gint) event->button.y;
             within_tolerance = true;
 
@@ -539,7 +522,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context,
                         ret = TRUE;
                     }
                     break;
-                case GDK_Left: // Ctrl Left 
+                case GDK_Left: // Ctrl Left
                 case GDK_KP_Left:
                 case GDK_KP_4:
                     if (MOD__CTRL_ONLY) {
@@ -587,7 +570,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context,
                     if (MOD__SHIFT_ONLY) {
                         sp_event_root_menu_popup(desktop, NULL, event);
                         ret= TRUE;
-                    } 
+                    }
                     break;
                 case GDK_space:
                     sp_toggle_selector(desktop);
@@ -622,13 +605,13 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context,
             } else if (event->scroll.state & GDK_CONTROL_MASK) {
                 double rel_zoom;
                 switch (event->scroll.direction) {
-                    case GDK_SCROLL_UP:   
+                    case GDK_SCROLL_UP:
                         rel_zoom = zoom_inc;
                         break;
-                    case GDK_SCROLL_DOWN: 
+                    case GDK_SCROLL_DOWN:
                         rel_zoom = 1 / zoom_inc;
                         break;
-                    default:              
+                    default:
                         rel_zoom = 0.0;
                         break;
                 }
@@ -931,7 +914,7 @@ sp_event_show_modifier_tip(Inkscape::MessageContext *message_context,
                 || (keyval == GDK_Meta_L) 
                 || (keyval == GDK_Meta_R));
 
-    gchar *tip = g_strdup_printf("%s%s%s%s%s", 
+    gchar *tip = g_strdup_printf("%s%s%s%s%s",
                                  ( ctrl ? ctrl_tip : "" ),
                                  ( ctrl && (shift || alt) ? "; " : "" ),
                                  ( shift ? shift_tip : "" ),
@@ -953,7 +936,7 @@ sp_event_show_modifier_tip(Inkscape::MessageContext *message_context,
  * work regardless of layouts (e.g., in Cyrillic).
  */
 guint
-get_group0_keyval(GdkEventKey *event) 
+get_group0_keyval(GdkEventKey *event)
 {
     guint keyval = 0;
     gdk_keymap_translate_keyboard_state(