1998-06-06 12:06:56 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-24 02:49:44 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "widgets-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
#include "core/gimpgradient.h"
|
2002-05-24 10:53:20 +08:00
|
|
|
#include "core/gimplist.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimppattern.h"
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2002-05-24 10:53:20 +08:00
|
|
|
#include "config/gimpconfig.h"
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "gimpdeviceinfo.h"
|
|
|
|
#include "gimpdevices.h"
|
2001-04-11 09:13:53 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#define GIMP_DEVICE_MANAGER_DATA_KEY "gimp-device-manager"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
typedef struct _GimpDeviceManager GimpDeviceManager;
|
1998-08-01 06:44:26 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
struct _GimpDeviceManager
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2002-05-24 10:53:20 +08:00
|
|
|
GimpContainer *device_info_list;
|
2001-12-08 01:39:51 +08:00
|
|
|
GdkDevice *current_device;
|
|
|
|
GimpDeviceChangeNotify change_notify;
|
1998-06-06 12:06:56 +08:00
|
|
|
};
|
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
/* local function prototypes */
|
2001-02-11 03:35:29 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static GimpDeviceManager * gimp_device_manager_get (Gimp *gimp);
|
2001-02-11 03:35:29 +08:00
|
|
|
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
/* public functions */
|
2001-02-11 03:35:29 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
void
|
|
|
|
gimp_devices_init (Gimp *gimp,
|
|
|
|
GimpDeviceChangeNotify change_notify)
|
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
|
|
|
GdkDevice *device;
|
|
|
|
GimpDeviceInfo *device_info;
|
|
|
|
GList *list;
|
2001-12-02 05:02:34 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (gimp_device_manager_get (gimp) == NULL);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager = g_new0 (GimpDeviceManager, 1);
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (gimp),
|
|
|
|
GIMP_DEVICE_MANAGER_DATA_KEY, manager,
|
|
|
|
(GDestroyNotify) g_free);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2002-05-24 10:53:20 +08:00
|
|
|
manager->device_info_list = gimp_list_new (GIMP_TYPE_DEVICE_INFO,
|
|
|
|
GIMP_CONTAINER_POLICY_STRONG);
|
|
|
|
manager->current_device = gdk_device_get_core_pointer ();
|
|
|
|
manager->change_notify = change_notify;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
/* create device info structures for present devices */
|
|
|
|
for (list = gdk_devices_list (); list; list = g_list_next (list))
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
device = (GdkDevice *) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info = gimp_device_info_new (gimp, device->name);
|
2002-05-29 02:49:45 +08:00
|
|
|
gimp_container_add (manager->device_info_list,
|
|
|
|
GIMP_OBJECT (device_info));
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (device_info);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_device_info_set_from_device (device_info, device);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
void
|
|
|
|
gimp_devices_exit (Gimp *gimp)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceManager *manager;
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
2001-11-18 00:32:34 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager = gimp_device_manager_get (gimp);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (manager != NULL);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (manager->device_info_list);
|
2001-12-08 01:39:51 +08:00
|
|
|
g_object_set_data (G_OBJECT (gimp), GIMP_DEVICE_MANAGER_DATA_KEY, NULL);
|
1998-08-13 23:25:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_devices_restore (Gimp *gimp)
|
2002-05-24 10:53:20 +08:00
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
2002-05-27 22:04:21 +08:00
|
|
|
GimpDeviceInfo *device_info;
|
|
|
|
GimpContext *user_context;
|
2002-05-24 10:53:20 +08:00
|
|
|
gchar *filename;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
manager = gimp_device_manager_get (gimp);
|
|
|
|
|
|
|
|
g_return_if_fail (manager != NULL);
|
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
filename = gimp_personal_rc_file ("devicerc");
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2002-05-27 22:04:21 +08:00
|
|
|
if (! gimp_config_deserialize (G_OBJECT (manager->device_info_list),
|
|
|
|
filename,
|
|
|
|
gimp,
|
|
|
|
&error))
|
|
|
|
{
|
2002-05-29 02:49:45 +08:00
|
|
|
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
|
|
|
g_message (error->message);
|
2002-05-27 22:04:21 +08:00
|
|
|
|
2002-05-29 02:49:45 +08:00
|
|
|
g_error_free (error);
|
2002-05-29 00:41:56 +08:00
|
|
|
/* don't bail out here */
|
2002-05-27 22:04:21 +08:00
|
|
|
}
|
|
|
|
|
2002-05-24 10:53:20 +08:00
|
|
|
g_free (filename);
|
2002-05-27 22:04:21 +08:00
|
|
|
|
2002-06-08 04:23:33 +08:00
|
|
|
gimp_list_reverse (GIMP_LIST (manager->device_info_list));
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2002-05-27 22:04:21 +08:00
|
|
|
device_info = gimp_device_info_get_by_device (manager->current_device);
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_INFO (device_info));
|
|
|
|
|
|
|
|
user_context = gimp_get_user_context (gimp);
|
|
|
|
|
|
|
|
gimp_context_copy_properties (GIMP_CONTEXT (device_info), user_context,
|
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
|
|
|
gimp_context_set_parent (GIMP_CONTEXT (device_info), user_context);
|
2002-05-24 10:53:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-05-29 00:41:56 +08:00
|
|
|
gimp_devices_save (Gimp *gimp)
|
2002-05-24 10:53:20 +08:00
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
|
|
|
gchar *filename;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
manager = gimp_device_manager_get (gimp);
|
|
|
|
|
|
|
|
g_return_if_fail (manager != NULL);
|
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
filename = gimp_personal_rc_file ("devicerc");
|
2002-05-24 10:53:20 +08:00
|
|
|
|
|
|
|
if (! gimp_config_serialize (G_OBJECT (manager->device_info_list),
|
|
|
|
filename,
|
2002-05-29 00:41:56 +08:00
|
|
|
"# GIMP devicerc\n",
|
|
|
|
"# end devicerc",
|
2002-05-24 10:53:20 +08:00
|
|
|
NULL,
|
|
|
|
&error))
|
|
|
|
{
|
2002-05-29 02:49:45 +08:00
|
|
|
g_message (error->message);
|
|
|
|
g_error_free (error);
|
2002-05-24 10:53:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (filename);
|
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GdkDevice *
|
|
|
|
gimp_devices_get_current (Gimp *gimp)
|
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
1998-08-01 06:44:26 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager = gimp_device_manager_get (gimp);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_val_if_fail (manager != NULL, NULL);
|
1998-08-01 06:44:26 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
return manager->current_device;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
void
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_devices_select_device (Gimp *gimp,
|
|
|
|
GdkDevice *new_device)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceManager *manager;
|
|
|
|
GimpDeviceInfo *current_device_info;
|
|
|
|
GimpDeviceInfo *new_device_info;
|
|
|
|
GimpContext *user_context;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-02 05:02:34 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (GDK_IS_DEVICE (new_device));
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager = gimp_device_manager_get (gimp);
|
|
|
|
|
|
|
|
g_return_if_fail (manager != NULL);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
current_device_info = gimp_device_info_get_by_device (manager->current_device);
|
|
|
|
new_device_info = gimp_device_info_get_by_device (new_device);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_INFO (current_device_info));
|
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_INFO (new_device_info));
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_unset_parent (GIMP_CONTEXT (current_device_info));
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager->current_device = new_device;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
user_context = gimp_get_user_context (gimp);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_copy_properties (GIMP_CONTEXT (new_device_info), user_context,
|
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
|
|
|
gimp_context_set_parent (GIMP_CONTEXT (new_device_info), user_context);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (manager->change_notify)
|
|
|
|
manager->change_notify (gimp);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
gboolean
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_devices_check_change (Gimp *gimp,
|
|
|
|
GdkEvent *event)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceManager *manager;
|
|
|
|
GdkDevice *device;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-02 05:02:34 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
manager = gimp_device_manager_get (gimp);
|
|
|
|
|
|
|
|
g_return_val_if_fail (manager != NULL, FALSE);
|
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_MOTION_NOTIFY:
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
device = ((GdkEventMotion *) event)->device;
|
1998-06-06 12:06:56 +08:00
|
|
|
break;
|
2001-11-09 03:14:51 +08:00
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
case GDK_BUTTON_PRESS:
|
2001-11-09 03:14:51 +08:00
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
case GDK_3BUTTON_PRESS:
|
1998-06-06 12:06:56 +08:00
|
|
|
case GDK_BUTTON_RELEASE:
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
device = ((GdkEventButton *) event)->device;
|
1998-06-06 12:06:56 +08:00
|
|
|
break;
|
2001-11-09 03:14:51 +08:00
|
|
|
|
|
|
|
case GDK_PROXIMITY_IN:
|
1998-06-06 12:06:56 +08:00
|
|
|
case GDK_PROXIMITY_OUT:
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
device = ((GdkEventProximity *) event)->device;
|
1998-06-06 12:06:56 +08:00
|
|
|
break;
|
2001-11-09 03:14:51 +08:00
|
|
|
|
|
|
|
case GDK_SCROLL:
|
|
|
|
device = ((GdkEventScroll *) event)->device;
|
|
|
|
break;
|
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
default:
|
2001-12-08 01:39:51 +08:00
|
|
|
device = manager->current_device;
|
2001-11-09 03:14:51 +08:00
|
|
|
break;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (device != manager->current_device)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_devices_select_device (gimp, device);
|
1998-06-06 12:06:56 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
|
|
|
|
return FALSE;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
/* private functions */
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static GimpDeviceManager *
|
|
|
|
gimp_device_manager_get (Gimp *gimp)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
return g_object_get_data (G_OBJECT (gimp), GIMP_DEVICE_MANAGER_DATA_KEY);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|