[gimp/gtk3-port: 215/215] foo



commit 28eb1ebaeec670f5eaad620ac8c0733feda7f891
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 3 15:50:07 2011 +0100

    foo

 app/display/gimpstatusbar.c         |    2 +
 app/tools/gimppainttool.c           |    4 +++
 app/widgets/gimpcontainertreeview.c |   14 ++++++++++-
 app/widgets/gimpdeviceinfo-coords.c |   46 ++++++++++++++++++++++++++++-------
 app/widgets/gimpdevices.c           |   42 +++++++++++--------------------
 app/widgets/gimpdockbook.c          |    7 ++++-
 app/widgets/gimptoolbox.c           |   35 ++++----------------------
 app/widgets/gimpwidgets-utils.c     |    3 +-
 libgimp/gimpui.c                    |    6 +++-
 libgimpwidgets/gimpcolornotebook.c  |    2 +
 plug-ins/Makefile.am                |   12 ++++----
 plug-ins/common/Makefile.am         |   12 ++++----
 12 files changed, 102 insertions(+), 83 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 97f6169..2c9cc37 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -231,8 +231,10 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
                           statusbar);
 
   statusbar->progressbar = g_object_new (GTK_TYPE_PROGRESS_BAR,
+#if 0
                                          "text-xalign", 0.0,
                                          "text-yalign", 0.5,
+#endif
                                          "ellipsize",   PANGO_ELLIPSIZE_END,
                                          NULL);
   gtk_box_pack_start (GTK_BOX (hbox), statusbar->progressbar, TRUE, TRUE, 0);
diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c
index e846594..ad237e6 100644
--- a/app/tools/gimppainttool.c
+++ b/app/tools/gimppainttool.c
@@ -483,6 +483,8 @@ gimp_paint_tool_modifier_key (GimpTool        *tool,
               if (gimp_draw_tool_is_active (draw_tool))
                 gimp_draw_tool_stop (draw_tool);
 
+              g_printerr ("%s: enabling color tool\n", G_STRFUNC);
+
               gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
                                       GIMP_COLOR_OPTIONS (info->tool_options));
 
@@ -509,6 +511,8 @@ gimp_paint_tool_modifier_key (GimpTool        *tool,
         {
           if (gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool)))
             {
+              g_printerr ("%s: disabling color tool\n", G_STRFUNC);
+
               gimp_tool_pop_status (tool, display);
               gimp_color_tool_disable (GIMP_COLOR_TOOL (tool));
             }
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 8a505e7..ff60e63 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -882,6 +882,8 @@ gimp_container_tree_view_button_press (GtkWidget             *widget,
       gboolean                  handled = TRUE;
       gboolean                  multisel_mode;
 
+      g_printerr ("click on path\n");
+
       multisel_mode = (gtk_tree_selection_get_mode (tree_view->priv->selection)
                        == GTK_SELECTION_MULTIPLE);
 
@@ -923,12 +925,16 @@ gimp_container_tree_view_button_press (GtkWidget             *widget,
               gtk_tree_path_free (path);
               g_object_unref (renderer);
 
+              g_printerr ("didn't click on any cell\n");
+
               return FALSE;
             }
 
           g_list_free (cells);
         }
 
+      g_printerr ("click on a cell\n");
+
       toggled_cell = (GimpCellRendererToggle *)
         gimp_container_tree_view_find_click_cell (widget,
                                                   tree_view->priv->toggle_cells,
@@ -961,6 +967,8 @@ gimp_container_tree_view_button_press (GtkWidget             *widget,
                 {
                   gchar *path_str = gtk_tree_path_to_string (path);
 
+                  g_printerr ("click NOT on a toggle\n");
+
                   handled = FALSE;
 
                   if (clicked_cell)
@@ -1003,13 +1011,17 @@ gimp_container_tree_view_button_press (GtkWidget             *widget,
 
                       if (toggled_cell)
                         {
+                          g_printerr ("click on a toggle\n");
+
                           gimp_cell_renderer_toggle_clicked (toggled_cell,
                                                              path_str,
                                                              bevent->state);
                         }
                       else if (clicked_cell)
                         {
-                          gimp_cell_renderer_viewable_clicked (clicked_cell,
+                          g_printerr ("click on a viewable\n");
+
+                         gimp_cell_renderer_viewable_clicked (clicked_cell,
                                                                path_str,
                                                                bevent->state);
                         }
diff --git a/app/widgets/gimpdeviceinfo-coords.c b/app/widgets/gimpdeviceinfo-coords.c
index 3861b21..fefbc2c 100644
--- a/app/widgets/gimpdeviceinfo-coords.c
+++ b/app/widgets/gimpdeviceinfo-coords.c
@@ -86,16 +86,20 @@ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
                                     GdkWindow      *window,
                                     GimpCoords     *coords)
 {
-  gdouble axes[GDK_AXIS_LAST];
+  GdkDevice *device = info->device;
+  gdouble    axes[GDK_AXIS_LAST];
+
+  if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE)
+    device = gdk_device_get_associated_device (device);
 
   *coords = default_coords;
 
-  gdk_device_get_state (info->device, window, axes, NULL);
+  gdk_device_get_state (device, window, axes, NULL);
 
-  gdk_device_get_axis (info->device, axes, GDK_AXIS_X, &coords->x);
-  gdk_device_get_axis (info->device, axes, GDK_AXIS_Y, &coords->y);
+  gdk_device_get_axis (device, axes, GDK_AXIS_X, &coords->x);
+  gdk_device_get_axis (device, axes, GDK_AXIS_Y, &coords->y);
 
-  if (gdk_device_get_axis (info->device,
+  if (gdk_device_get_axis (device,
                            axes, GDK_AXIS_PRESSURE, &coords->pressure))
     {
       coords->pressure = gimp_device_info_map_axis (info,
@@ -103,7 +107,7 @@ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
                                                     coords->pressure);
     }
 
-  if (gdk_device_get_axis (info->device,
+  if (gdk_device_get_axis (device,
                            axes, GDK_AXIS_XTILT, &coords->xtilt))
     {
       coords->xtilt = gimp_device_info_map_axis (info,
@@ -111,7 +115,7 @@ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
                                                  coords->xtilt);
     }
 
-  if (gdk_device_get_axis (info->device,
+  if (gdk_device_get_axis (device,
                            axes, GDK_AXIS_YTILT, &coords->ytilt))
     {
       coords->ytilt = gimp_device_info_map_axis (info,
@@ -119,7 +123,7 @@ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
                                                  coords->ytilt);
     }
 
-  if (gdk_device_get_axis (info->device,
+  if (gdk_device_get_axis (device,
                            axes, GDK_AXIS_WHEEL, &coords->wheel))
     {
       coords->wheel = gimp_device_info_map_axis (info,
@@ -191,5 +195,29 @@ gimp_device_info_get_device_state (GimpDeviceInfo  *info,
                                    GdkWindow       *window,
                                    GdkModifierType *state)
 {
-  gdk_device_get_state (info->device, window, NULL, state);
+  GdkDevice *device = info->device;
+
+  switch (gdk_device_get_device_type (device))
+    {
+    case GDK_DEVICE_TYPE_SLAVE:
+      device = gdk_device_get_associated_device (device);
+      break;
+
+    case GDK_DEVICE_TYPE_FLOATING:
+      {
+        GdkDisplay       *display = gdk_device_get_display (device);
+        GdkDeviceManager *manager = gdk_display_get_device_manager (display);
+
+        device = gdk_device_manager_get_client_pointer (manager);
+      }
+      break;
+
+    default:
+      break;
+    }
+
+  if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
+    device = gdk_device_get_associated_device (device);
+
+  gdk_device_get_state (device, window, NULL, state);
 }
diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c
index 526f443..c0fff83 100644
--- a/app/widgets/gimpdevices.c
+++ b/app/widgets/gimpdevices.c
@@ -354,36 +354,24 @@ gimp_devices_check_change (Gimp     *gimp,
 
   g_return_val_if_fail (manager != NULL, FALSE);
 
-  switch (event->type)
-    {
-    case GDK_MOTION_NOTIFY:
-      device = ((GdkEventMotion *) event)->device;
-      break;
-
-    case GDK_BUTTON_PRESS:
-    case GDK_2BUTTON_PRESS:
-    case GDK_3BUTTON_PRESS:
-    case GDK_BUTTON_RELEASE:
-      device = ((GdkEventButton *) event)->device;
-      break;
-
-    case GDK_PROXIMITY_IN:
-    case GDK_PROXIMITY_OUT:
-      device = ((GdkEventProximity *) event)->device;
-      break;
-
-    case GDK_SCROLL:
-      device = ((GdkEventScroll *) event)->device;
-      break;
-
-    default:
-      device = manager->current_device->device;
-      break;
-    }
+  device = gdk_event_get_source_device (event);
+
+  if (! device)
+    device = manager->current_device->device;
 
   device_info = gimp_device_info_get_by_device (device);
 
-  if (device_info != manager->current_device)
+  if (! device_info)
+    {
+      device = gdk_event_get_device (event);
+
+      if (! device)
+        device = manager->current_device->device;
+
+      device_info = gimp_device_info_get_by_device (device);
+    }
+
+  if (device_info && device_info != manager->current_device)
     {
       gimp_devices_select_device (manager, device_info);
       return TRUE;
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index 8f1c397..737e6ae 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -22,6 +22,7 @@
 
 #include <string.h>
 
+#undef GTK_DISABLE_DEPRECATED
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -366,9 +367,11 @@ gimp_dockbook_style_set (GtkWidget *widget,
                         "tab-border", &tab_border,
                         NULL);
 
+#if 0
   g_object_set (widget,
                 "tab-border", tab_border,
                 NULL);
+#endif
 
   gimp_dockbook_recreate_tab_widgets (GIMP_DOCKBOOK (widget),
                                       FALSE /*only_auto*/);
@@ -780,7 +783,7 @@ gimp_dockbook_update_automatic_tab_style (GimpDockbook *dockbook)
   GimpTabStyle  tab_style           = 0;
   int           i                   = 0;
   gint          available_space     = 0;
-  guint         tab_hborder         = 0;
+  guint         tab_hborder         = 2;
   gint          xthickness          = 0;
   gint          tab_curvature       = 0;
   gint          focus_width         = 0;
@@ -790,9 +793,11 @@ gimp_dockbook_update_automatic_tab_style (GimpDockbook *dockbook)
   gint          action_widget_size  = 0;
 
   xthickness = gtk_widget_get_style (widget)->xthickness;
+#if 0
   g_object_get (widget,
                 "tab-hborder", &tab_hborder,
                 NULL);
+#endif
   gtk_widget_style_get (widget,
                         "tab-curvature",    &tab_curvature,
                         "focus-line-width", &focus_width,
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index fc0e1c7..3bdc3b2 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -212,13 +212,9 @@ gimp_toolbox_init (GimpToolbox *toolbox)
 static void
 gimp_toolbox_constructed (GObject *object)
 {
-  GimpToolbox      *toolbox = GIMP_TOOLBOX (object);
-  GimpGuiConfig    *config;
-  GtkWidget        *main_vbox;
-  GdkDisplay       *display;
-  GdkDeviceManager *manager;
-  GList            *devices;
-  GList            *list;
+  GimpToolbox   *toolbox = GIMP_TOOLBOX (object);
+  GimpGuiConfig *config;
+  GtkWidget     *main_vbox;
 
   g_assert (GIMP_IS_CONTEXT (toolbox->p->context));
   g_assert (GIMP_IS_UI_MANAGER (toolbox->p->ui_manager));
@@ -286,29 +282,8 @@ gimp_toolbox_constructed (GObject *object)
                       FALSE, FALSE, 0);
   gtk_widget_show (toolbox->p->area_box);
 
-  /* We need to know when the current device changes, so we can update
-   * the correct tool - to do this we connect to motion events.
-   * We can't just use EXTENSION_EVENTS_CURSOR though, since that
-   * would get us extension events for the mouse pointer, and our
-   * device would change to that and not change back. So we check
-   * manually that all devices have a cursor, before establishing the check.
-   */
-  display = gtk_widget_get_display (GTK_WIDGET (toolbox));
-  manager = gdk_display_get_device_manager (display);
-
-  devices = gdk_device_manager_list_devices (manager, GDK_DEVICE_TYPE_MASTER);
-
-  for (list = devices; list; list = g_list_next (list))
-    if (! gdk_device_get_has_cursor (list->data))
-      break;
-
-  g_list_free (devices);
-
-  if (! list)  /* all devices have cursor */
-    {
-      gtk_widget_add_events (GTK_WIDGET (toolbox), GDK_POINTER_MOTION_MASK);
-      gimp_devices_add_widget (toolbox->p->context->gimp, GTK_WIDGET (toolbox));
-    }
+  gtk_widget_add_events (GTK_WIDGET (toolbox), GDK_POINTER_MOTION_MASK);
+  gimp_devices_add_widget (toolbox->p->context->gimp, GTK_WIDGET (toolbox));
 
   toolbox->p->color_area = toolbox_create_color_area (toolbox,
                                                       toolbox->p->context);
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index b8d54e5..6c8b1f8 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -878,7 +878,8 @@ gimp_window_set_transient_for (GtkWindow *window,
    * a run-time check of GTK+ version. Remember to change also the
    * function with the same name in libgimp/gimpui.c
    */
-#ifndef GDK_WINDOWING_WIN32
+#if 0
+  //#ifndef GDK_WINDOWING_WIN32
   GdkWindow *parent;
 
   parent = gdk_window_foreign_new_for_display (gdk_display_get_default (),
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 7dfcf1d..10ad490 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -170,7 +170,8 @@ gimp_ui_init (const gchar *prog_name,
 GdkWindow *
 gimp_ui_get_display_window (guint32 gdisp_ID)
 {
-#ifndef GDK_NATIVE_WINDOW_POINTER
+#if 0
+  //#ifndef GDK_NATIVE_WINDOW_POINTER
   GdkNativeWindow  window;
 
   g_return_val_if_fail (gimp_ui_initialized, NULL);
@@ -203,7 +204,8 @@ gimp_ui_get_display_window (guint32 gdisp_ID)
 GdkWindow *
 gimp_ui_get_progress_window (void)
 {
-#ifndef GDK_NATIVE_WINDOW_POINTER
+#if 0
+  // #ifndef GDK_NATIVE_WINDOW_POINTER
   GdkNativeWindow  window;
 
   g_return_val_if_fail (gimp_ui_initialized, NULL);
diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c
index 5c31fd2..370035a 100644
--- a/libgimpwidgets/gimpcolornotebook.c
+++ b/libgimpwidgets/gimpcolornotebook.c
@@ -219,9 +219,11 @@ gimp_color_notebook_style_updated (GtkWidget *widget)
                         "tab-icon_size", &icon_size,
                         NULL);
 
+#if 0
   g_object_set (private->notebook,
                 "tab-border", tab_border,
                 NULL);
+#endif
 
   for (list = private->selectors; list; list = g_list_next (list))
     {
diff --git a/plug-ins/Makefile.am b/plug-ins/Makefile.am
index 9f256ca..eedf3a5 100644
--- a/plug-ins/Makefile.am
+++ b/plug-ins/Makefile.am
@@ -54,7 +54,7 @@ endif
 
 SUBDIRS = \
 	$(script_fu)		\
-	$(pygimp)		\
+##	$(pygimp)		\
 	color-rotate		\
 	file-bmp		\
 	file-faxg3		\
@@ -68,15 +68,15 @@ SUBDIRS = \
 	$(file_xjt)		\
 	flame			\
 	fractal-explorer	\
-	gfig			\
-	gimpressionist		\
+##	gfig			\
+##	gimpressionist		\
 	gradient-flare		\
 	help			\
 	$(help_browser)		\
-	ifs-compose		\
-	imagemap		\
+##	ifs-compose		\
+##	imagemap		\
 	lighting		\
-	map-object		\
+##	map-object		\
 	maze			\
 	$(metadata)		\
 	pagecurl		\
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index bb8d0d2..975c5a3 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -46,7 +46,7 @@ libexec_PROGRAMS = \
 	alien-map \
 	align-layers \
 	animation-optimize \
-	animation-play \
+##	animation-play \
 	antialias \
 	apply-canvas \
 	blinds \
@@ -75,7 +75,7 @@ libexec_PROGRAMS = \
 	crop-auto \
 	crop-zealous \
 	cubism \
-	curve-bend \
+##	curve-bend \
 	decompose \
 	deinterlace \
 	depth-merge \
@@ -99,7 +99,7 @@ libexec_PROGRAMS = \
 	file-gbr \
 	file-gif-load \
 	file-gif-save \
-	file-gih \
+##	file-gih \
 	file-glob \
 	file-header \
 	file-html-table \
@@ -112,7 +112,7 @@ libexec_PROGRAMS = \
 	file-pix \
 	$(FILE_PNG) \
 	file-pnm \
-	file-ps \
+##	file-ps \
 	$(FILE_PSP) \
 	file-raw \
 	file-sunras \
@@ -126,7 +126,7 @@ libexec_PROGRAMS = \
 	$(FILE_XPM) \
 	file-xwd \
 	film \
-	filter-pack \
+##	filter-pack \
 	fractal-trace \
 	gradient-map \
 	grid \
@@ -162,7 +162,7 @@ libexec_PROGRAMS = \
 	ripple \
 	rotate \
 	sample-colorize \
-	$(SCREENSHOT) \
+##	$(SCREENSHOT) \
 	semi-flatten \
 	sharpen \
 	shift \



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