--- /z/gimp-painter--2.6.6.orig/app/config/gimpguiconfig.c 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/config/gimpguiconfig.c 2009-06-16 02:25:02 +0900 @@ -84,6 +84,8 @@ PROP_DOCK_WINDOW_HINT, PROP_TRANSIENT_DOCKS, PROP_CURSOR_FORMAT, + PROP_SYSTEM_COORDS_STYLUS, + PROP_SYSTEM_COORDS_PUCK, /* ignored, only for backward compatibility: */ PROP_INFO_WINDOW_PER_DISPLAY, @@ -273,6 +275,16 @@ GIMP_TYPE_CURSOR_FORMAT, GIMP_CURSOR_FORMAT_PIXBUF, GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SYSTEM_COORDS_STYLUS, + "system-coords-stylus", + SYSTEM_COORDS_STYLUS_BLURB, + FALSE, + GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SYSTEM_COORDS_PUCK, + "system-coords-puck", + SYSTEM_COORDS_PUCK_BLURB, + FALSE, + GIMP_PARAM_STATIC_STRINGS); /* only for backward compatibility: */ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INFO_WINDOW_PER_DISPLAY, @@ -423,6 +435,12 @@ case PROP_CURSOR_FORMAT: gui_config->cursor_format = g_value_get_enum (value); break; + case PROP_SYSTEM_COORDS_STYLUS: + gui_config->system_coords_stylus = g_value_get_boolean (value); + break; + case PROP_SYSTEM_COORDS_PUCK: + gui_config->system_coords_puck = g_value_get_boolean (value); + break; case PROP_INFO_WINDOW_PER_DISPLAY: case PROP_SHOW_TOOL_TIPS: @@ -542,6 +560,12 @@ case PROP_CURSOR_FORMAT: g_value_set_enum (value, gui_config->cursor_format); break; + case PROP_SYSTEM_COORDS_STYLUS: + g_value_set_boolean (value, gui_config->system_coords_stylus); + break; + case PROP_SYSTEM_COORDS_PUCK: + g_value_set_boolean (value, gui_config->system_coords_puck); + break; case PROP_INFO_WINDOW_PER_DISPLAY: case PROP_SHOW_TOOL_TIPS: --- /z/gimp-painter--2.6.6.orig/app/config/gimpguiconfig.h 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/config/gimpguiconfig.h 2009-06-16 02:34:32 +0900 @@ -72,6 +72,8 @@ GimpWindowHint dock_window_hint; gboolean transient_docks; GimpCursorFormat cursor_format; + gboolean system_coords_stylus; + gboolean system_coords_puck; gint last_tip; /* saved in sessionrc */ }; --- /z/gimp-painter--2.6.6.orig/app/config/gimprc-blurbs.h 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/config/gimprc-blurbs.h 2009-06-16 02:32:26 +0900 @@ -450,5 +450,11 @@ #define ZOOM_QUALITY_BLURB \ "There's a tradeoff between speed and quality of the zoomed-out display." +#define SYSTEM_COORDS_STYLUS_BLURB \ +"Try to turn on when the cursor position is not correctly with stylus pen." + +#define SYSTEM_COORDS_PUCK_BLURB \ +"Try to turn on when the cursor position is not correctly with tablet mouse." + #endif /* __GIMP_RC_BLURBS_H__ */ --- /z/gimp-painter--2.6.6.orig/app/dialogs/about-dialog.c 2009-03-21 01:51:02 +0900 +++ gimp-painter--2.6.6/app/dialogs/about-dialog.c 2009-06-17 23:31:40 +0900 @@ -609,7 +609,7 @@ gtk_widget_show (label); #endif - label = gtk_label_new (_("gimp-painter- (release 20090321)")); + label = gtk_label_new (_("gimp-painter- (release 20090618)")); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (vbox), label, 2); gtk_widget_show (label); --- /z/gimp-painter--2.6.6.orig/app/dialogs/preferences-dialog.c 2009-03-17 10:42:37 +0900 +++ gimp-painter--2.6.6/app/dialogs/preferences-dialog.c 2009-06-16 23:51:05 +0900 @@ -2593,6 +2593,18 @@ g_object_set_data (G_OBJECT (button), "clear-button", button2); + /* Device coords */ + vbox2 = prefs_frame_new (_("Use system coords"), + GTK_CONTAINER (vbox), FALSE); + + prefs_check_button_add (object, "system-coords-stylus", + _("_Stylus and Eraser"), + GTK_BOX (vbox2)); + + prefs_check_button_add (object, "system-coords-puck", + _("_Mouse and Lens Cursor"), + GTK_BOX (vbox2)); + /****************************/ /* Additional Controllers */ --- /z/gimp-painter--2.6.6.orig/app/display/gimpdisplay.c 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/display/gimpdisplay.c 2009-06-16 04:59:10 +0900 @@ -26,6 +26,7 @@ #include "tools/tools-types.h" #include "config/gimpdisplayconfig.h" +#include "config/gimpguiconfig.h" #include "core/gimp.h" #include "core/gimparea.h" @@ -187,6 +188,7 @@ case PROP_GIMP: display->gimp = g_value_get_object (value); /* don't ref the gimp */ display->config = GIMP_DISPLAY_CONFIG (display->gimp->config); + display->gui_config = GIMP_GUI_CONFIG (display->gimp->config); break; case PROP_IMAGE: --- /z/gimp-painter--2.6.6.orig/app/display/gimpdisplay.h 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/display/gimpdisplay.h 2009-06-16 04:52:32 +0900 @@ -41,6 +41,7 @@ Gimp *gimp; /* global gimp instance */ GimpDisplayConfig *config; + GimpGuiConfig *gui_config; GimpImage *image; /* pointer to the associated image */ gint instance; /* the instance # of this display as */ --- /z/gimp-painter--2.6.6.orig/app/display/gimpdisplayshell-coords.c 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/display/gimpdisplayshell-coords.c 2009-06-18 00:05:37 +0900 @@ -24,6 +24,9 @@ #include "display-types.h" +#include "config/gimpguiconfig.h" + +#include "gimpdisplay.h" #include "gimpdisplayshell.h" #include "gimpdisplayshell-coords.h" @@ -40,7 +43,22 @@ { if (gdk_event_get_axis (event, GDK_AXIS_X, &coords->x)) { - gdk_event_get_axis (event, GDK_AXIS_Y, &coords->y); + GimpGuiConfig *gui_config = shell->display->gui_config; + + if ((gui_config->system_coords_stylus && + (device->source == GDK_SOURCE_PEN || device->source == GDK_SOURCE_ERASER))|| + (gui_config->system_coords_puck && device->source == GDK_SOURCE_CURSOR)) + { + GdkDevice *core_pointer = gdk_device_get_core_pointer (); + gdouble axes[GDK_AXIS_LAST]; + + gdk_device_get_state (core_pointer, shell->canvas->window, axes, NULL); + + gdk_device_get_axis (core_pointer, axes, GDK_AXIS_X, &coords->x); + gdk_device_get_axis (core_pointer, axes, GDK_AXIS_Y, &coords->y); + } + else + gdk_event_get_axis (event, GDK_AXIS_Y, &coords->y); /* CLAMP() the return value of each *_get_axis() call to be safe * against buggy XInput drivers. Provide default values if the @@ -86,8 +104,18 @@ { gdouble axes[GDK_AXIS_LAST]; + GimpGuiConfig *gui_config = shell->display->gui_config; + gdk_device_get_state (device, shell->canvas->window, axes, NULL); + if ((gui_config->system_coords_stylus && + (device->source == GDK_SOURCE_PEN || device->source == GDK_SOURCE_ERASER))|| + (gui_config->system_coords_puck && device->source == GDK_SOURCE_CURSOR)) + { + gdk_device_get_state (gdk_device_get_core_pointer (), + shell->canvas->window, axes, NULL); + } + gdk_device_get_axis (device, axes, GDK_AXIS_X, &coords->x); gdk_device_get_axis (device, axes, GDK_AXIS_Y, &coords->y); --- /z/gimp-painter--2.6.6.orig/app/display/gimpdisplayshell.c 2009-03-17 10:43:33 +0900 +++ gimp-painter--2.6.6/app/display/gimpdisplayshell.c 2009-06-18 00:28:50 +0900 @@ -33,6 +33,7 @@ #include "config/gimpcoreconfig.h" #include "config/gimpdisplayconfig.h" +#include "config/gimpguiconfig.h" #include "core/gimp.h" #include "core/gimpchannel.h" @@ -142,6 +143,9 @@ (GimpColorManaged *managed, gsize *len); +static gboolean gimp_display_shell_motion_notify (GimpDisplayShell *shell, + GdkEventMotion *event); + G_DEFINE_TYPE_WITH_CODE (GimpDisplayShell, gimp_display_shell, GIMP_TYPE_WINDOW, G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS, @@ -1044,6 +1048,11 @@ gimp_display_shell_dnd_init (shell); gimp_display_shell_selection_init (shell); + /* Modify the x-y coords of motion event before invoking rulers' + default handler */ + g_signal_connect_swapped (shell->canvas, "motion-notify-event", + G_CALLBACK (gimp_display_shell_motion_notify), + shell); /* the horizontal ruler */ shell->hrule = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_events (GTK_WIDGET (shell->hrule), @@ -1055,6 +1064,9 @@ g_signal_connect (shell->hrule, "button-press-event", G_CALLBACK (gimp_display_shell_hruler_button_press), shell); + g_signal_connect_swapped (shell->hrule, "motion-notify-event", + G_CALLBACK (gimp_display_shell_motion_notify), + shell); gimp_help_set_help_data (shell->hrule, NULL, GIMP_HELP_IMAGE_WINDOW_RULER); @@ -1069,6 +1081,9 @@ g_signal_connect (shell->vrule, "button-press-event", G_CALLBACK (gimp_display_shell_vruler_button_press), shell); + g_signal_connect_swapped (shell->vrule, "motion-notify-event", + G_CALLBACK (gimp_display_shell_motion_notify), + shell); gimp_help_set_help_data (shell->vrule, NULL, GIMP_HELP_IMAGE_WINDOW_RULER); @@ -2044,3 +2059,28 @@ gimp_display_shell_expose_full (shell); } + + +static gboolean +gimp_display_shell_motion_notify (GimpDisplayShell *shell, + GdkEventMotion *event) +{ + GimpGuiConfig *gui_config = shell->display->gui_config; + GdkDevice *device = event->device; + + if ((gui_config->system_coords_stylus && + (device->source == GDK_SOURCE_PEN || device->source == GDK_SOURCE_ERASER))|| + (gui_config->system_coords_puck && device->source == GDK_SOURCE_CURSOR)) + { + GdkDevice *core_pointer = gdk_device_get_core_pointer (); + gdouble axes[GDK_AXIS_LAST]; + + gdk_device_get_state (core_pointer, shell->canvas->window, axes, NULL); + + gdk_device_get_axis (core_pointer, axes, GDK_AXIS_X, &event->x); + gdk_device_get_axis (core_pointer, axes, GDK_AXIS_Y, &event->y); + } + + return FALSE; +} + --- /z/gimp-painter--2.6.6.orig/app/tools/gimpmixbrushtool.c 2009-03-17 10:42:37 +0900 +++ gimp-painter--2.6.6/app/tools/gimpmixbrushtool.c 2009-06-13 22:34:34 +0900 @@ -89,6 +89,7 @@ GtkWidget *mixbrush_vbox; GtkWidget *mixbrush_button; GtkWidget *mixbrush_frame; + GtkObject *adj; /* Texture configurations */ { @@ -227,11 +228,12 @@ gtk_widget_show_all (expander); } - gimp_prop_scale_entry_new (config, "main-color-rate", - GTK_TABLE (table), 0, 3, - _("Rate:"), - 0.01, 0.1, 2, - FALSE, 0.0, 1.0); + adj = gimp_prop_scale_entry_new (config, "main-color-rate", + GTK_TABLE (table), 0, 3, + _("Rate:"), + 0.01, 0.1, 3, + FALSE, 0.0, 1.0); + gimp_scale_entry_set_logarithmic (adj, TRUE); { GtkWidget *expander = gtk_expander_new (_("Pressure")); --- /z/gimp-painter--2.6.6.orig/app/widgets/gimpdeviceinfo.c 2008-11-21 07:43:04 +0900 +++ gimp-painter--2.6.6/app/widgets/gimpdeviceinfo.c 2009-06-16 01:28:34 +0900 @@ -428,6 +428,18 @@ device_info->num_keys = device->num_keys; device_info->keys = NULL; +#ifdef G_OS_WIN32 + //g_printerr ("- - - ->> device name : %s\n", device->name); + { + gchar *name = g_ascii_strdown (device->name, -1); + + if (g_strrstr (name, "puck")) + gdk_device_set_source (device, GDK_SOURCE_CURSOR); + + g_free (name); + } +#endif + return device_info; }