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"
|
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +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/gimpcontainer.h"
|
|
|
|
#include "core/gimpdatafactory.h"
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "core/gimpmarshal.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
#include "config/gimpconfig-params.h"
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#include "gimpdeviceinfo.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
#define GIMP_DEVICE_INFO_DATA_KEY "gimp-device-info"
|
1998-08-01 06:44:26 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
enum
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
CHANGED,
|
|
|
|
LAST_SIGNAL
|
1998-06-06 12:06:56 +08:00
|
|
|
};
|
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2002-05-27 22:04:21 +08:00
|
|
|
PROP_GIMP,
|
2002-05-24 21:07:12 +08:00
|
|
|
PROP_MODE,
|
|
|
|
PROP_AXES,
|
|
|
|
PROP_KEYS
|
|
|
|
};
|
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
/* local function prototypes */
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
static void gimp_device_info_class_init (GimpDeviceInfoClass *klass);
|
|
|
|
static void gimp_device_info_init (GimpDeviceInfo *device_info);
|
2001-02-11 03:35:29 +08:00
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
static void gimp_device_info_finalize (GObject *object);
|
|
|
|
static void gimp_device_info_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_device_info_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2001-02-11 03:35:29 +08:00
|
|
|
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static GimpContextClass *parent_class = NULL;
|
2001-02-11 03:35:29 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static guint device_info_signals[LAST_SIGNAL] = { 0 };
|
2001-02-11 03:35:29 +08:00
|
|
|
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GType
|
|
|
|
gimp_device_info_get_type (void)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
static GType device_info_type = 0;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (! device_info_type)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
static const GTypeInfo device_info_info =
|
|
|
|
{
|
|
|
|
sizeof (GimpDeviceInfoClass),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_device_info_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpDeviceInfo),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_device_info_init,
|
|
|
|
};
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info_type = g_type_register_static (GIMP_TYPE_CONTEXT,
|
|
|
|
"GimpDeviceInfo",
|
|
|
|
&device_info_info, 0);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
return device_info_type;
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static void
|
|
|
|
gimp_device_info_class_init (GimpDeviceInfoClass *klass)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GObjectClass *object_class;
|
2002-05-24 21:07:12 +08:00
|
|
|
GParamSpec *array_spec;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
1999-09-04 11:36:54 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info_signals[CHANGED] =
|
|
|
|
g_signal_new ("changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpDeviceInfoClass, changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-12-02 05:02:34 +08:00
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
object_class->finalize = gimp_device_info_finalize;
|
|
|
|
object_class->set_property = gimp_device_info_set_property;
|
|
|
|
object_class->get_property = gimp_device_info_get_property;
|
|
|
|
|
2002-05-27 22:04:21 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_GIMP,
|
|
|
|
g_param_spec_object ("gimp",
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_GIMP,
|
|
|
|
G_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MODE, "mode",
|
|
|
|
GDK_TYPE_INPUT_MODE,
|
|
|
|
GDK_MODE_DISABLED);
|
|
|
|
|
|
|
|
array_spec = g_param_spec_value_array ("axes",
|
|
|
|
NULL, NULL,
|
|
|
|
g_param_spec_enum ("axis",
|
|
|
|
NULL, NULL,
|
|
|
|
GDK_TYPE_AXIS_USE,
|
|
|
|
GDK_AXIS_IGNORE,
|
|
|
|
G_PARAM_READWRITE),
|
|
|
|
GIMP_CONFIG_PARAM_FLAGS);
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_AXES, array_spec);
|
|
|
|
|
|
|
|
array_spec = g_param_spec_value_array ("keys",
|
|
|
|
NULL, NULL,
|
|
|
|
g_param_spec_string ("key",
|
|
|
|
NULL, NULL,
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE),
|
|
|
|
GIMP_CONFIG_PARAM_FLAGS);
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_KEYS, array_spec);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
static void
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_device_info_init (GimpDeviceInfo *device_info)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->device = NULL;
|
|
|
|
device_info->mode = GDK_MODE_DISABLED;
|
|
|
|
device_info->num_axes = 0;
|
|
|
|
device_info->axes = NULL;
|
|
|
|
device_info->num_keys = 0;
|
|
|
|
device_info->keys = NULL;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static void
|
|
|
|
gimp_device_info_finalize (GObject *object)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *device_info;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info = GIMP_DEVICE_INFO (object);
|
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-12-08 01:39:51 +08:00
|
|
|
if (device_info->axes)
|
|
|
|
g_free (device_info->axes);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (device_info->keys)
|
|
|
|
g_free (device_info->keys);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
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
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
static void
|
|
|
|
gimp_device_info_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpDeviceInfo *device_info;
|
|
|
|
GdkDevice *device;
|
|
|
|
|
|
|
|
device_info = GIMP_DEVICE_INFO (object);
|
|
|
|
|
|
|
|
device = device_info->device;
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2002-05-27 22:04:21 +08:00
|
|
|
case PROP_GIMP:
|
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
context = GIMP_CONTEXT (device_info);
|
|
|
|
gimp = g_value_get_object (value);
|
|
|
|
|
|
|
|
/* we override GimpContext's "gimp" property, so we need to
|
|
|
|
* register the context just like GimpContext would do it.
|
|
|
|
*/
|
|
|
|
context->gimp = gimp;
|
|
|
|
gimp->context_list = g_list_prepend (gimp->context_list, context);
|
|
|
|
|
|
|
|
gimp_context_define_properties (context,
|
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK,
|
|
|
|
FALSE);
|
|
|
|
gimp_context_copy_properties (gimp_get_user_context (gimp),
|
|
|
|
context,
|
|
|
|
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
|
|
|
|
|
|
|
/* FIXME: this is ugly and needs to be done via "notify" once
|
|
|
|
* the contexts' properties are dynamic.
|
|
|
|
*/
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "foreground_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "background_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "tool_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "brush_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "pattern_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
g_signal_connect_swapped (G_OBJECT (context), "gradient_changed",
|
|
|
|
G_CALLBACK (gimp_device_info_changed),
|
|
|
|
device_info);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
case PROP_MODE:
|
|
|
|
if (device_info->device)
|
|
|
|
gdk_device_set_mode (device_info->device, g_value_get_enum (value));
|
|
|
|
else
|
|
|
|
device_info->mode = g_value_get_enum (value);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_AXES:
|
|
|
|
{
|
|
|
|
GValueArray *array;
|
|
|
|
|
|
|
|
array = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (array)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint n_device_values;
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
{
|
|
|
|
n_device_values = MIN (array->n_values, device->num_axes);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
n_device_values = array->n_values;
|
|
|
|
|
|
|
|
device_info->num_axes = n_device_values;
|
|
|
|
device_info->axes = g_new0 (GdkAxisUse, n_device_values);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_device_values; i++)
|
|
|
|
{
|
|
|
|
GdkAxisUse axis_use;
|
|
|
|
|
|
|
|
axis_use = g_value_get_enum (g_value_array_get_nth (array, i));
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
gdk_device_set_axis_use (device, i, axis_use);
|
|
|
|
else
|
|
|
|
device_info->axes[i] = axis_use;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_KEYS:
|
|
|
|
{
|
|
|
|
GValueArray *array;
|
|
|
|
|
|
|
|
array = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (array)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint n_device_values;
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
{
|
|
|
|
n_device_values = MIN (array->n_values, device->num_keys);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
n_device_values = array->n_values;
|
|
|
|
|
|
|
|
device_info->num_keys = n_device_values;
|
|
|
|
device_info->keys = g_new0 (GdkDeviceKey, n_device_values);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_device_values; i++)
|
|
|
|
{
|
|
|
|
const gchar *accel;
|
|
|
|
guint keyval;
|
|
|
|
GdkModifierType modifiers;
|
|
|
|
|
|
|
|
accel = g_value_get_string (g_value_array_get_nth (array, i));
|
|
|
|
|
|
|
|
gtk_accelerator_parse (accel, &keyval, &modifiers);
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
{
|
|
|
|
gdk_device_set_key (device, i, keyval, modifiers);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
device_info->keys[i].keyval = keyval;
|
|
|
|
device_info->keys[i].modifiers = modifiers;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_device_info_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GimpDeviceInfo *device_info;
|
|
|
|
GdkDevice *device;
|
|
|
|
|
|
|
|
device_info = GIMP_DEVICE_INFO (object);
|
|
|
|
|
|
|
|
device = device_info->device;
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2002-05-27 22:04:21 +08:00
|
|
|
case PROP_GIMP:
|
|
|
|
g_value_set_object (value, GIMP_CONTEXT (device_info)->gimp);
|
|
|
|
break;
|
|
|
|
|
2002-05-24 21:07:12 +08:00
|
|
|
case PROP_MODE:
|
|
|
|
if (device)
|
|
|
|
g_value_set_enum (value, device->mode);
|
|
|
|
else
|
|
|
|
g_value_set_enum (value, device_info->mode);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_AXES:
|
|
|
|
{
|
|
|
|
GValueArray *array;
|
|
|
|
GValue enum_value = { 0, };
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
array = g_value_array_new (6);
|
|
|
|
g_value_init (&enum_value, GDK_TYPE_AXIS_USE);
|
|
|
|
|
|
|
|
for (i = 0; i < (device ? device->num_axes : device_info->num_axes); i++)
|
|
|
|
{
|
|
|
|
g_value_set_enum (&enum_value,
|
|
|
|
device ?
|
|
|
|
device->axes[i].use : device_info->axes[i]);
|
|
|
|
g_value_array_append (array, &enum_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&enum_value);
|
|
|
|
|
|
|
|
g_value_set_boxed_take_ownership (value, array);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_KEYS:
|
|
|
|
{
|
|
|
|
GValueArray *array;
|
|
|
|
GValue string_value = { 0, };
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
array = g_value_array_new (32);
|
|
|
|
g_value_init (&string_value, G_TYPE_STRING);
|
|
|
|
|
|
|
|
for (i = 0; i < (device ? device->num_keys : device_info->num_keys); i++)
|
|
|
|
{
|
|
|
|
GdkModifierType modifiers = (device ? device->keys[i].modifiers :
|
|
|
|
device_info->keys[i].modifiers);
|
|
|
|
guint keyval = (device ? device->keys[i].keyval :
|
|
|
|
device_info->keys[i].keyval);
|
|
|
|
|
|
|
|
if (keyval)
|
|
|
|
{
|
|
|
|
/* FIXME: integrate this back with menus_install_accelerator */
|
|
|
|
gchar accel[64];
|
|
|
|
gchar t2[2];
|
|
|
|
gchar *escaped;
|
|
|
|
|
|
|
|
accel[0] = '\0';
|
|
|
|
if (modifiers & GDK_CONTROL_MASK)
|
|
|
|
strcat (accel, "<control>");
|
|
|
|
if (modifiers & GDK_SHIFT_MASK)
|
|
|
|
strcat (accel, "<shift>");
|
|
|
|
if (modifiers & GDK_MOD1_MASK)
|
|
|
|
strcat (accel, "<alt>");
|
|
|
|
|
|
|
|
t2[0] = keyval;
|
|
|
|
t2[1] = '\0';
|
|
|
|
strcat (accel, t2);
|
|
|
|
|
|
|
|
escaped = g_strescape (accel, NULL);
|
|
|
|
g_value_set_string (&string_value, escaped);
|
|
|
|
g_free (escaped);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_value_set_string (&string_value, "");
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_array_append (array, &string_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&string_value);
|
|
|
|
|
|
|
|
g_value_set_boxed_take_ownership (value, array);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *
|
|
|
|
gimp_device_info_new (Gimp *gimp,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
GimpDeviceInfo *device_info;
|
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);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
|
|
|
device_info = g_object_new (GIMP_TYPE_DEVICE_INFO,
|
|
|
|
"name", name,
|
|
|
|
"gimp", gimp,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return device_info;
|
1998-08-13 23:25:41 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *
|
|
|
|
gimp_device_info_set_from_device (GimpDeviceInfo *device_info,
|
|
|
|
GdkDevice *device)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DEVICE_INFO (device_info), NULL);
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
2001-11-18 00:32:34 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_object_set_data (G_OBJECT (device), GIMP_DEVICE_INFO_DATA_KEY, device_info);
|
1998-08-13 23:25:41 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->device = device;
|
1998-11-26 14:07:22 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->mode = device->mode;
|
1998-08-13 23:25:41 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->num_axes = device->num_axes;
|
|
|
|
device_info->axes = NULL;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->num_keys = device->num_keys;
|
|
|
|
device_info->keys = NULL;
|
2001-01-15 09:48:53 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
return device_info;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *
|
|
|
|
gimp_device_info_set_from_rc (GimpDeviceInfo *device_info,
|
|
|
|
GimpDeviceValues values,
|
|
|
|
GdkInputMode mode,
|
|
|
|
gint num_axes,
|
|
|
|
const GdkAxisUse *axes,
|
|
|
|
gint num_keys,
|
|
|
|
const GdkDeviceKey *keys,
|
|
|
|
const gchar *tool_name,
|
|
|
|
const GimpRGB *foreground,
|
|
|
|
const GimpRGB *background,
|
|
|
|
const gchar *brush_name,
|
|
|
|
const gchar *pattern_name,
|
|
|
|
const gchar *gradient_name)
|
2001-12-02 05:02:34 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpContext *context;
|
2001-12-02 05:02:34 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_DEVICE_INFO (device_info), NULL);
|
2001-12-02 05:02:34 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
context = GIMP_CONTEXT (device_info);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_MODE)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->mode = mode;
|
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-12-08 01:39:51 +08:00
|
|
|
if (device_info->device)
|
|
|
|
{
|
|
|
|
gdk_device_set_mode (device_info->device, mode);
|
|
|
|
}
|
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_AXES)
|
|
|
|
{
|
|
|
|
device_info->num_axes = num_axes;
|
|
|
|
device_info->axes = g_new (GdkAxisUse, num_axes);
|
|
|
|
memcpy (device_info->axes, axes, num_axes * sizeof (GdkAxisUse));
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (device_info->device && (num_axes >= device_info->device->num_axes))
|
|
|
|
{
|
|
|
|
gint i;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
for (i = 0; i < MIN (num_axes, device_info->device->num_axes); i++)
|
|
|
|
{
|
|
|
|
gdk_device_set_axis_use (device_info->device, i, axes[i]);
|
|
|
|
}
|
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
|
|
|
|
if (values & GIMP_DEVICE_VALUE_KEYS)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info->num_keys = num_keys;
|
|
|
|
device_info->keys = g_new (GdkDeviceKey, num_keys);
|
|
|
|
memcpy (device_info->keys, axes, num_keys * sizeof (GdkDeviceKey));
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (device_info->device && (num_keys >= device_info->device->num_keys))
|
|
|
|
{
|
|
|
|
gint i;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
for (i = 0; i < MIN (num_keys, device_info->device->num_keys); i++)
|
|
|
|
{
|
|
|
|
gdk_device_set_key (device_info->device, i,
|
|
|
|
keys[i].keyval,
|
|
|
|
keys[i].modifiers);
|
|
|
|
}
|
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_TOOL)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-02-21 20:18:09 +08:00
|
|
|
GimpToolInfo *tool_info;
|
|
|
|
|
|
|
|
tool_info = (GimpToolInfo *)
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_container_get_child_by_name (context->gimp->tool_info_list,
|
2001-02-21 20:18:09 +08:00
|
|
|
tool_name);
|
|
|
|
|
|
|
|
if (tool_info)
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_tool (context, tool_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_free (context->tool_name);
|
|
|
|
context->tool_name = g_strdup (tool_name);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_foreground (context, foreground);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_BACKGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_background (context, background);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
1998-08-01 06:44:26 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_BRUSH)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
GimpBrush *brush;
|
|
|
|
|
2001-02-06 01:48:50 +08:00
|
|
|
brush = (GimpBrush *)
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_container_get_child_by_name (context->gimp->brush_factory->container,
|
2001-02-06 01:48:50 +08:00
|
|
|
brush_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
if (brush)
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_brush (context, brush);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
else if (context->gimp->no_data)
|
1999-11-14 18:50:19 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_free (context->brush_name);
|
|
|
|
context->brush_name = g_strdup (brush_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_PATTERN)
|
1998-08-01 06:44:26 +08:00
|
|
|
{
|
2001-02-05 01:34:30 +08:00
|
|
|
GimpPattern *pattern;
|
1999-11-14 18:50:19 +08:00
|
|
|
|
2001-02-06 01:48:50 +08:00
|
|
|
pattern = (GimpPattern *)
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_container_get_child_by_name (context->gimp->pattern_factory->container,
|
2001-02-06 01:48:50 +08:00
|
|
|
pattern_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
if (pattern)
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_pattern (context, pattern);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
else if (context->gimp->no_data)
|
1999-11-14 18:50:19 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_free (context->pattern_name);
|
|
|
|
context->pattern_name = g_strdup (pattern_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
1998-08-01 06:44:26 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (values & GIMP_DEVICE_VALUE_GRADIENT)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-02-11 03:35:29 +08:00
|
|
|
GimpGradient *gradient;
|
1999-11-14 18:50:19 +08:00
|
|
|
|
2001-02-11 03:35:29 +08:00
|
|
|
gradient = (GimpGradient *)
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_container_get_child_by_name (context->gimp->gradient_factory->container,
|
2001-02-11 03:35:29 +08:00
|
|
|
gradient_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
if (gradient)
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_set_gradient (context, gradient);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
else if (context->gimp->no_data)
|
1999-11-14 18:50:19 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_free (context->gradient_name);
|
|
|
|
context->gradient_name = g_strdup (gradient_name);
|
1999-11-14 18:50:19 +08:00
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
|
|
|
|
return device_info;
|
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_device_info_changed (GimpDeviceInfo *device_info)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_INFO (device_info));
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_signal_emit (G_OBJECT (device_info), device_info_signals[CHANGED], 0);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
void
|
|
|
|
gimp_device_info_save (GimpDeviceInfo *device_info,
|
|
|
|
FILE *fp)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpContext *context;
|
|
|
|
GdkDevice *device;
|
|
|
|
gchar *mode = NULL;
|
|
|
|
gint i;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GIMP_IS_DEVICE_INFO (device_info));
|
|
|
|
g_return_if_fail (fp != 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
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
context = GIMP_CONTEXT (device_info);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device = device_info->device;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
fprintf (fp, "(device \"%s\"", GIMP_OBJECT (device_info)->name);
|
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
|
|
|
switch (device ? device->mode : device_info->mode)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
|
|
|
case GDK_MODE_DISABLED:
|
|
|
|
mode = "disabled";
|
|
|
|
break;
|
|
|
|
case GDK_MODE_SCREEN:
|
|
|
|
mode = "screen";
|
|
|
|
break;
|
|
|
|
case GDK_MODE_WINDOW:
|
|
|
|
mode = "window";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (mode %s)", mode);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (axes %d",
|
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 ? device->num_axes : device_info->num_axes);
|
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
|
|
|
for (i = 0; i < (device ? device->num_axes : device_info->num_axes); i++)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-03-31 00:39:14 +08:00
|
|
|
gchar *axis_type = NULL;
|
1999-10-27 02:27:27 +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
|
|
|
switch (device ? device->axes[i].use : device_info->axes[i])
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
|
|
|
case GDK_AXIS_IGNORE:
|
|
|
|
axis_type = "ignore";
|
|
|
|
break;
|
|
|
|
case GDK_AXIS_X:
|
|
|
|
axis_type = "x";
|
|
|
|
break;
|
|
|
|
case GDK_AXIS_Y:
|
|
|
|
axis_type = "y";
|
|
|
|
break;
|
|
|
|
case GDK_AXIS_PRESSURE:
|
|
|
|
axis_type = "pressure";
|
|
|
|
break;
|
|
|
|
case GDK_AXIS_XTILT:
|
|
|
|
axis_type = "xtilt";
|
|
|
|
break;
|
|
|
|
case GDK_AXIS_YTILT:
|
|
|
|
axis_type = "ytilt";
|
|
|
|
break;
|
2002-05-21 18:16:36 +08:00
|
|
|
case GDK_AXIS_WHEEL:
|
|
|
|
axis_type = "wheel";
|
|
|
|
break;
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
1999-09-28 01:58:10 +08:00
|
|
|
fprintf (fp, " %s",axis_type);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
1999-09-28 01:58:10 +08:00
|
|
|
fprintf (fp,")");
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (keys %d",
|
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 ? device->num_keys : device_info->num_keys);
|
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
|
|
|
for (i = 0; i < (device ? device->num_keys : device_info->num_keys); i++)
|
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
|
|
|
GdkModifierType modifiers = (device ? device->keys[i].modifiers :
|
|
|
|
device_info->keys[i].modifiers);
|
|
|
|
guint keyval = (device ? device->keys[i].keyval :
|
|
|
|
device_info->keys[i].keyval);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
if (keyval)
|
|
|
|
{
|
|
|
|
/* FIXME: integrate this back with menus_install_accelerator */
|
1999-10-27 02:27:27 +08:00
|
|
|
gchar accel[64];
|
|
|
|
gchar t2[2];
|
1998-06-06 12:06:56 +08:00
|
|
|
|
|
|
|
accel[0] = '\0';
|
|
|
|
if (modifiers & GDK_CONTROL_MASK)
|
|
|
|
strcat (accel, "<control>");
|
|
|
|
if (modifiers & GDK_SHIFT_MASK)
|
|
|
|
strcat (accel, "<shift>");
|
|
|
|
if (modifiers & GDK_MOD1_MASK)
|
|
|
|
strcat (accel, "<alt>");
|
2001-01-15 09:48:53 +08:00
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
t2[0] = keyval;
|
|
|
|
t2[1] = '\0';
|
|
|
|
strcat (accel, t2);
|
|
|
|
fprintf (fp, " \"%s\"",accel);
|
|
|
|
}
|
|
|
|
else
|
2001-12-08 01:39:51 +08:00
|
|
|
{
|
|
|
|
fprintf (fp, " \"\"");
|
|
|
|
}
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
fprintf (fp,")");
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (gimp_context_get_tool (context))
|
2001-02-21 20:18:09 +08:00
|
|
|
{
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (tool \"%s\")",
|
2001-12-08 01:39:51 +08:00
|
|
|
GIMP_OBJECT (gimp_context_get_tool (context))->name);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
{
|
2001-01-15 09:48:53 +08:00
|
|
|
GimpRGB color;
|
2001-10-29 20:51:21 +08:00
|
|
|
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
2001-01-15 09:48:53 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_get_foreground (context, &color);
|
2001-01-15 09:48:53 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
|
|
|
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
|
|
|
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
2001-10-29 20:51:21 +08:00
|
|
|
|
|
|
|
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
|
|
|
buf[0], buf[1], buf[2]);
|
2001-01-16 06:39:50 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_context_get_background (context, &color);
|
2001-01-16 06:39:50 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
|
|
|
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
|
|
|
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
2001-10-29 20:51:21 +08:00
|
|
|
|
|
|
|
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
|
|
|
buf[0], buf[1], buf[2]);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (gimp_context_get_brush (context))
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (brush \"%s\")",
|
2001-12-08 01:39:51 +08:00
|
|
|
GIMP_OBJECT (gimp_context_get_brush (context))->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (gimp_context_get_pattern (context))
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (pattern \"%s\")",
|
2001-12-08 01:39:51 +08:00
|
|
|
GIMP_OBJECT (gimp_context_get_pattern (context))->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (gimp_context_get_gradient (context))
|
1999-10-28 23:05:49 +08:00
|
|
|
{
|
2001-01-17 08:00:15 +08:00
|
|
|
fprintf (fp, "\n (gradient \"%s\")",
|
2001-12-08 01:39:51 +08:00
|
|
|
GIMP_OBJECT (gimp_context_get_gradient (context))->name);
|
1999-10-28 23:05:49 +08:00
|
|
|
}
|
|
|
|
|
1998-06-06 12:06:56 +08:00
|
|
|
fprintf(fp,")\n");
|
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *
|
|
|
|
gimp_device_info_get_by_device (GdkDevice *device)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
return g_object_get_data (G_OBJECT (device), GIMP_DEVICE_INFO_DATA_KEY);
|
1998-06-06 12:06:56 +08:00
|
|
|
}
|
|
|
|
|
1998-07-21 08:15:24 +08:00
|
|
|
void
|
2001-12-08 01:39:51 +08:00
|
|
|
gimp_device_info_changed_by_device (GdkDevice *device)
|
1998-06-06 12:06:56 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
GimpDeviceInfo *device_info;
|
1998-06-06 12:06:56 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
g_return_if_fail (GDK_IS_DEVICE (device));
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
device_info = g_object_get_data (G_OBJECT (device), GIMP_DEVICE_INFO_DATA_KEY);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
if (device_info)
|
|
|
|
gimp_device_info_changed (device_info);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|