2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1998-06-06 12:06:56 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1998-06-06 12:06:56 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1998-06-06 12:06:56 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1998-06-06 12:06:56 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2012-03-18 04:59:10 +08:00
|
|
|
#include <gegl.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"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.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"
|
2014-07-02 01:54:50 +08:00
|
|
|
#include "core/gimperror.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#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
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "gimpdeviceinfo.h"
|
2011-02-28 19:57:15 +08:00
|
|
|
#include "gimpdevicemanager.h"
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "gimpdevices.h"
|
2001-04-11 09:13:53 +08:00
|
|
|
|
2004-07-22 00:11:31 +08:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
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
|
|
|
|
2011-02-28 19:57:15 +08:00
|
|
|
static gboolean devicerc_deleted = FALSE;
|
2010-12-06 17:18:32 +08:00
|
|
|
|
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
|
|
|
|
2003-11-14 20:38:01 +08:00
|
|
|
void
|
2011-02-28 19:57:15 +08:00
|
|
|
gimp_devices_init (Gimp *gimp)
|
2001-12-08 01:39:51 +08:00
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
2001-12-02 05:02:34 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2011-02-28 21:37:00 +08:00
|
|
|
|
|
|
|
manager = g_object_get_data (G_OBJECT (gimp), GIMP_DEVICE_MANAGER_DATA_KEY);
|
|
|
|
|
|
|
|
g_return_if_fail (manager == NULL);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2011-02-28 19:57:15 +08:00
|
|
|
manager = gimp_device_manager_new (gimp);
|
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,
|
2011-02-28 19:57:15 +08:00
|
|
|
(GDestroyNotify) g_object_unref);
|
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
|
|
|
{
|
2005-11-28 01:20:40 +08:00
|
|
|
GimpDeviceManager *manager;
|
|
|
|
|
2001-11-18 00:32:34 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2005-11-28 01:20:40 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = gimp_devices_get_manager (gimp);
|
2005-11-28 01:20:40 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_MANAGER (manager));
|
2005-11-28 01:20:40 +08:00
|
|
|
|
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
|
|
|
GimpContext *user_context;
|
2011-02-28 21:37:00 +08:00
|
|
|
GimpDeviceInfo *current_device;
|
2005-09-04 18:44:04 +08:00
|
|
|
GList *list;
|
2014-07-02 01:54:50 +08:00
|
|
|
GFile *file;
|
2002-05-24 10:53:20 +08:00
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = gimp_devices_get_manager (gimp);
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_MANAGER (manager));
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2005-09-04 18:44:04 +08:00
|
|
|
user_context = gimp_get_user_context (gimp);
|
|
|
|
|
2016-05-01 21:22:44 +08:00
|
|
|
for (list = GIMP_LIST (manager)->queue->head;
|
2005-09-04 18:44:04 +08:00
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpDeviceInfo *device_info = list->data;
|
|
|
|
|
|
|
|
gimp_context_copy_properties (user_context, GIMP_CONTEXT (device_info),
|
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
2012-11-23 08:17:52 +08:00
|
|
|
|
|
|
|
gimp_device_info_set_default_tool (device_info);
|
2005-09-04 18:44:04 +08:00
|
|
|
}
|
|
|
|
|
2014-07-28 08:04:01 +08:00
|
|
|
file = gimp_directory_file ("devicerc", NULL);
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2005-11-07 06:01:25 +08:00
|
|
|
if (gimp->be_verbose)
|
2014-07-02 01:54:50 +08:00
|
|
|
g_print ("Parsing '%s'\n", gimp_file_get_utf8_name (file));
|
2005-11-07 06:01:25 +08:00
|
|
|
|
2014-07-02 01:54:50 +08:00
|
|
|
if (! gimp_config_deserialize_gfile (GIMP_CONFIG (manager),
|
|
|
|
file,
|
|
|
|
gimp,
|
|
|
|
&error))
|
2002-05-27 22:04:21 +08:00
|
|
|
{
|
2002-05-29 02:49:45 +08:00
|
|
|
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
2008-11-04 20:33:09 +08:00
|
|
|
gimp_message_literal (gimp, NULL, GIMP_MESSAGE_ERROR, 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
|
|
|
}
|
|
|
|
|
2014-07-02 01:54:50 +08:00
|
|
|
g_object_unref (file);
|
2002-05-27 22:04:21 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
current_device = gimp_device_manager_get_current_device (manager);
|
|
|
|
|
|
|
|
gimp_context_copy_properties (GIMP_CONTEXT (current_device), user_context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
2011-02-28 21:37:00 +08:00
|
|
|
gimp_context_set_parent (GIMP_CONTEXT (current_device), user_context);
|
2002-05-24 10:53:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-07-22 00:11:31 +08:00
|
|
|
gimp_devices_save (Gimp *gimp,
|
|
|
|
gboolean always_save)
|
2002-05-24 10:53:20 +08:00
|
|
|
{
|
|
|
|
GimpDeviceManager *manager;
|
2014-07-02 01:54:50 +08:00
|
|
|
GFile *file;
|
2002-05-24 10:53:20 +08:00
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = gimp_devices_get_manager (gimp);
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_MANAGER (manager));
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2011-02-28 19:57:15 +08:00
|
|
|
if (devicerc_deleted && ! always_save)
|
2004-07-22 00:11:31 +08:00
|
|
|
return;
|
|
|
|
|
2014-07-28 08:04:01 +08:00
|
|
|
file = gimp_directory_file ("devicerc", NULL);
|
2002-05-24 10:53:20 +08:00
|
|
|
|
2005-11-07 06:01:25 +08:00
|
|
|
if (gimp->be_verbose)
|
2014-07-02 01:54:50 +08:00
|
|
|
g_print ("Writing '%s'\n", gimp_file_get_utf8_name (file));
|
|
|
|
|
|
|
|
if (! gimp_config_serialize_to_gfile (GIMP_CONFIG (manager),
|
|
|
|
file,
|
|
|
|
"GIMP devicerc",
|
|
|
|
"end of devicerc",
|
|
|
|
NULL,
|
|
|
|
&error))
|
2002-05-24 10:53:20 +08:00
|
|
|
{
|
2008-11-04 20:33:09 +08:00
|
|
|
gimp_message_literal (gimp, NULL, GIMP_MESSAGE_ERROR, error->message);
|
2002-05-29 02:49:45 +08:00
|
|
|
g_error_free (error);
|
2002-05-24 10:53:20 +08:00
|
|
|
}
|
|
|
|
|
2014-07-02 01:54:50 +08:00
|
|
|
g_object_unref (file);
|
2004-07-22 00:11:31 +08:00
|
|
|
|
2011-02-28 19:57:15 +08:00
|
|
|
devicerc_deleted = FALSE;
|
2002-05-24 10:53:20 +08:00
|
|
|
}
|
|
|
|
|
2004-07-22 00:11:31 +08:00
|
|
|
gboolean
|
|
|
|
gimp_devices_clear (Gimp *gimp,
|
|
|
|
GError **error)
|
2003-10-26 22:01:33 +08:00
|
|
|
{
|
2004-07-22 00:11:31 +08:00
|
|
|
GimpDeviceManager *manager;
|
2014-07-02 01:54:50 +08:00
|
|
|
GFile *file;
|
|
|
|
GError *my_error = NULL;
|
|
|
|
gboolean success = TRUE;
|
2004-07-22 00:11:31 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = gimp_devices_get_manager (gimp);
|
2004-07-22 00:11:31 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DEVICE_MANAGER (manager), FALSE);
|
2004-07-22 00:11:31 +08:00
|
|
|
|
2014-07-28 08:04:01 +08:00
|
|
|
file = gimp_directory_file ("devicerc", NULL);
|
2004-07-22 00:11:31 +08:00
|
|
|
|
2014-07-02 01:54:50 +08:00
|
|
|
if (! g_file_delete (file, NULL, &my_error) &&
|
|
|
|
my_error->code != G_IO_ERROR_NOT_FOUND)
|
2004-07-22 00:11:31 +08:00
|
|
|
{
|
|
|
|
success = FALSE;
|
2014-07-02 01:54:50 +08:00
|
|
|
|
|
|
|
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
|
|
|
_("Deleting \"%s\" failed: %s"),
|
|
|
|
gimp_file_get_utf8_name (file), my_error->message);
|
2004-07-22 00:11:31 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-02-28 19:57:15 +08:00
|
|
|
devicerc_deleted = TRUE;
|
2004-07-22 00:11:31 +08:00
|
|
|
}
|
|
|
|
|
2014-07-02 01:54:50 +08:00
|
|
|
g_clear_error (&my_error);
|
|
|
|
g_object_unref (file);
|
2003-10-26 22:01:33 +08:00
|
|
|
|
2004-07-22 00:11:31 +08:00
|
|
|
return success;
|
2003-10-26 22:01:33 +08:00
|
|
|
}
|
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
GimpDeviceManager *
|
|
|
|
gimp_devices_get_manager (Gimp *gimp)
|
2001-12-08 01:39:51 +08:00
|
|
|
{
|
|
|
|
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
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = g_object_get_data (G_OBJECT (gimp), GIMP_DEVICE_MANAGER_DATA_KEY);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DEVICE_MANAGER (manager), NULL);
|
1998-08-01 06:44:26 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
return manager;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2010-12-20 04:23:54 +08:00
|
|
|
void
|
|
|
|
gimp_devices_add_widget (Gimp *gimp,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
|
|
|
|
|
|
|
|
g_signal_connect (widget, "motion-notify-event",
|
|
|
|
G_CALLBACK (gimp_devices_check_callback),
|
|
|
|
gimp);
|
|
|
|
}
|
|
|
|
|
2010-12-06 17:23:15 +08:00
|
|
|
gboolean
|
|
|
|
gimp_devices_check_callback (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
|
2010-12-20 04:23:54 +08:00
|
|
|
if (! gimp->busy)
|
|
|
|
gimp_devices_check_change (gimp, event);
|
2010-12-06 17:23:15 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
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;
|
2010-02-16 20:00:46 +08:00
|
|
|
GimpDeviceInfo *device_info;
|
2004-07-11 11:01:05 +08:00
|
|
|
GtkWidget *source;
|
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);
|
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
manager = gimp_devices_get_manager (gimp);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2011-02-28 21:37:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DEVICE_MANAGER (manager), FALSE);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2004-07-11 11:01:05 +08:00
|
|
|
/* It is possible that the event was propagated from a widget that does not
|
|
|
|
want extension events and therefore always sends core pointer events.
|
|
|
|
This can cause a false switch to the core pointer device. */
|
|
|
|
|
|
|
|
source = gtk_get_event_widget (event);
|
|
|
|
|
|
|
|
if (source &&
|
|
|
|
gtk_widget_get_extension_events (source) == GDK_EXTENSION_EVENTS_NONE)
|
|
|
|
return 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:
|
2011-02-28 19:57:15 +08:00
|
|
|
device = gimp_device_manager_get_current_device (manager)->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
|
|
|
|
2010-02-16 20:00:46 +08:00
|
|
|
device_info = gimp_device_info_get_by_device (device);
|
|
|
|
|
2011-02-28 19:57:15 +08:00
|
|
|
if (device_info != gimp_device_manager_get_current_device (manager))
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2011-02-28 19:57:15 +08:00
|
|
|
gimp_device_manager_set_current_device (manager, device_info);
|
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
|
|
|
}
|