2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1999-06-18 03:13:08 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2001-04-24 00:58:18 +08:00
|
|
|
* gimpcontext.c
|
|
|
|
* Copyright (C) 1999-2001 Michael Natterer
|
1999-10-19 23:52:32 +08:00
|
|
|
*
|
1999-06-18 03:13:08 +08:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
#include <glib-object.h>
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2005-01-22 08:42:40 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
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-01-24 02:49:44 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core-types.h"
|
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimp.h"
|
2007-11-17 02:19:30 +08:00
|
|
|
#include "gimp-utils.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gimpbrush.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "gimpbuffer.h"
|
2001-02-06 01:48:50 +08:00
|
|
|
#include "gimpcontainer.h"
|
1999-06-18 03:13:08 +08:00
|
|
|
#include "gimpcontext.h"
|
2001-02-14 03:53:07 +08:00
|
|
|
#include "gimpdatafactory.h"
|
2001-10-23 01:27:46 +08:00
|
|
|
#include "gimpimagefile.h"
|
2001-02-11 03:35:29 +08:00
|
|
|
#include "gimpgradient.h"
|
2001-02-07 23:01:52 +08:00
|
|
|
#include "gimpimage.h"
|
2001-01-10 08:36:54 +08:00
|
|
|
#include "gimpmarshal.h"
|
2005-12-28 02:57:01 +08:00
|
|
|
#include "gimppaintinfo.h"
|
2001-02-12 00:14:25 +08:00
|
|
|
#include "gimppalette.h"
|
2001-02-05 01:34:30 +08:00
|
|
|
#include "gimppattern.h"
|
2003-04-06 03:56:38 +08:00
|
|
|
#include "gimptemplate.h"
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "gimptoolinfo.h"
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
#include "text/gimpfont.h"
|
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
#include "gimp-intl.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
typedef void (* GimpContextCopyPropFunc) (GimpContext *src,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *dest);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
#define context_find_defined(context,prop) \
|
|
|
|
while (!(((context)->defined_props) & (1 << (prop))) && (context)->parent) \
|
|
|
|
(context) = (context)->parent
|
1999-06-19 02:29:27 +08:00
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
/* local function prototypes */
|
1999-11-14 18:50:19 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
static void gimp_context_config_iface_init (GimpConfigInterface *iface);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
static GObject * gimp_context_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params);
|
|
|
|
static void gimp_context_dispose (GObject *object);
|
|
|
|
static void gimp_context_finalize (GObject *object);
|
|
|
|
static void gimp_context_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_context_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2004-03-12 02:47:37 +08:00
|
|
|
static gint64 gimp_context_get_memsize (GimpObject *object,
|
|
|
|
gint64 *gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
static gboolean gimp_context_serialize (GimpConfig *config,
|
2003-03-06 04:21:50 +08:00
|
|
|
GimpConfigWriter *writer,
|
|
|
|
gpointer data);
|
2003-10-11 22:30:18 +08:00
|
|
|
static gboolean gimp_context_serialize_property (GimpConfig *config,
|
2003-03-06 04:21:50 +08:00
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpConfigWriter *writer);
|
2003-10-11 22:30:18 +08:00
|
|
|
static gboolean gimp_context_deserialize_property (GimpConfig *config,
|
2003-03-06 04:21:50 +08:00
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GScanner *scanner,
|
|
|
|
GTokenType *expected);
|
2002-05-22 21:19:19 +08:00
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
/* image */
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_image_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context);
|
1999-10-19 23:52:32 +08:00
|
|
|
static void gimp_context_real_set_image (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImage *image);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* display */
|
2002-05-10 21:09:19 +08:00
|
|
|
static void gimp_context_display_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
gpointer display,
|
|
|
|
GimpContext *context);
|
1999-11-14 18:50:19 +08:00
|
|
|
static void gimp_context_real_set_display (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gpointer display);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* tool */
|
2001-02-21 20:18:09 +08:00
|
|
|
static void gimp_context_tool_dirty (GimpToolInfo *tool_info,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-21 20:18:09 +08:00
|
|
|
static void gimp_context_tool_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpToolInfo *tool_info,
|
|
|
|
GimpContext *context);
|
2001-02-21 20:18:09 +08:00
|
|
|
static void gimp_context_tool_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
1999-11-14 18:50:19 +08:00
|
|
|
static void gimp_context_real_set_tool (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpToolInfo *tool_info);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
/* paint info */
|
|
|
|
static void gimp_context_paint_info_dirty (GimpPaintInfo *paint_info,
|
|
|
|
GimpContext *context);
|
|
|
|
static void gimp_context_paint_info_removed (GimpContainer *container,
|
|
|
|
GimpPaintInfo *paint_info,
|
|
|
|
GimpContext *context);
|
|
|
|
static void gimp_context_paint_info_list_thaw(GimpContainer *container,
|
|
|
|
GimpContext *context);
|
|
|
|
static void gimp_context_real_set_paint_info (GimpContext *context,
|
|
|
|
GimpPaintInfo *paint_info);
|
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
/* foreground */
|
|
|
|
static void gimp_context_real_set_foreground (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* background */
|
|
|
|
static void gimp_context_real_set_background (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* opacity */
|
|
|
|
static void gimp_context_real_set_opacity (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gdouble opacity);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* paint mode */
|
|
|
|
static void gimp_context_real_set_paint_mode (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpLayerModeEffects paint_mode);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* brush */
|
2001-02-05 01:34:30 +08:00
|
|
|
static void gimp_context_brush_dirty (GimpBrush *brush,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-05 01:34:30 +08:00
|
|
|
static void gimp_context_brush_removed (GimpContainer *brush_list,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBrush *brush,
|
|
|
|
GimpContext *context);
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_brush_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
1999-11-14 18:50:19 +08:00
|
|
|
static void gimp_context_real_set_brush (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBrush *brush);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* pattern */
|
2001-02-05 01:34:30 +08:00
|
|
|
static void gimp_context_pattern_dirty (GimpPattern *pattern,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-21 20:18:09 +08:00
|
|
|
static void gimp_context_pattern_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPattern *pattern,
|
|
|
|
GimpContext *context);
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_pattern_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
1999-11-14 18:50:19 +08:00
|
|
|
static void gimp_context_real_set_pattern (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPattern *pattern);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
|
|
|
/* gradient */
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_gradient_dirty (GimpGradient *gradient,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_gradient_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpGradient *gradient,
|
|
|
|
GimpContext *context);
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_gradient_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
1999-11-14 18:50:19 +08:00
|
|
|
static void gimp_context_real_set_gradient (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpGradient *gradient);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2001-02-12 00:14:25 +08:00
|
|
|
/* palette */
|
|
|
|
static void gimp_context_palette_dirty (GimpPalette *palette,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-21 20:18:09 +08:00
|
|
|
static void gimp_context_palette_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPalette *palatte,
|
|
|
|
GimpContext *context);
|
2001-02-12 11:27:28 +08:00
|
|
|
static void gimp_context_palette_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-02-12 00:14:25 +08:00
|
|
|
static void gimp_context_real_set_palette (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPalette *palatte);
|
2001-02-12 00:14:25 +08:00
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
/* font */
|
|
|
|
static void gimp_context_font_dirty (GimpFont *font,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2003-03-26 06:06:03 +08:00
|
|
|
static void gimp_context_font_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpFont *font,
|
|
|
|
GimpContext *context);
|
2003-03-26 06:06:03 +08:00
|
|
|
static void gimp_context_font_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2003-03-26 06:06:03 +08:00
|
|
|
static void gimp_context_real_set_font (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpFont *font);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
/* buffer */
|
|
|
|
static void gimp_context_buffer_dirty (GimpBuffer *buffer,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-06-26 20:09:43 +08:00
|
|
|
static void gimp_context_buffer_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBuffer *buffer,
|
|
|
|
GimpContext *context);
|
2001-06-26 20:09:43 +08:00
|
|
|
static void gimp_context_buffer_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-06-26 20:09:43 +08:00
|
|
|
static void gimp_context_real_set_buffer (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBuffer *buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2001-10-23 01:27:46 +08:00
|
|
|
/* imagefile */
|
|
|
|
static void gimp_context_imagefile_dirty (GimpImagefile *imagefile,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-10-23 01:27:46 +08:00
|
|
|
static void gimp_context_imagefile_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImagefile *imagefile,
|
|
|
|
GimpContext *context);
|
2001-10-23 01:27:46 +08:00
|
|
|
static void gimp_context_imagefile_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2001-10-23 01:27:46 +08:00
|
|
|
static void gimp_context_real_set_imagefile (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImagefile *imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2003-04-06 03:56:38 +08:00
|
|
|
/* template */
|
|
|
|
static void gimp_context_template_dirty (GimpTemplate *template,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2003-04-06 03:56:38 +08:00
|
|
|
static void gimp_context_template_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpTemplate *template,
|
|
|
|
GimpContext *context);
|
2003-04-06 03:56:38 +08:00
|
|
|
static void gimp_context_template_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context);
|
2003-04-06 03:56:38 +08:00
|
|
|
static void gimp_context_real_set_template (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpTemplate *template);
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/* utilities */
|
|
|
|
static gpointer gimp_context_find_object (GimpContext *context,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *object_name,
|
|
|
|
gpointer standard_object);
|
|
|
|
|
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
/* properties & signals */
|
1999-11-14 18:50:19 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
enum
|
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONTEXT_PROP_0,
|
|
|
|
GIMP_CONTEXT_PROP_GIMP
|
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
/* remaining values are in core-types.h */
|
1999-06-20 21:53:15 +08:00
|
|
|
};
|
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
enum
|
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
DUMMY_0,
|
|
|
|
DUMMY_1,
|
2001-02-07 23:01:52 +08:00
|
|
|
IMAGE_CHANGED,
|
|
|
|
DISPLAY_CHANGED,
|
|
|
|
TOOL_CHANGED,
|
2005-12-28 02:57:01 +08:00
|
|
|
PAINT_INFO_CHANGED,
|
2001-02-07 23:01:52 +08:00
|
|
|
FOREGROUND_CHANGED,
|
|
|
|
BACKGROUND_CHANGED,
|
|
|
|
OPACITY_CHANGED,
|
|
|
|
PAINT_MODE_CHANGED,
|
|
|
|
BRUSH_CHANGED,
|
|
|
|
PATTERN_CHANGED,
|
|
|
|
GRADIENT_CHANGED,
|
2001-02-12 00:14:25 +08:00
|
|
|
PALETTE_CHANGED,
|
2003-03-26 06:06:03 +08:00
|
|
|
FONT_CHANGED,
|
2001-06-26 20:09:43 +08:00
|
|
|
BUFFER_CHANGED,
|
2001-10-23 01:27:46 +08:00
|
|
|
IMAGEFILE_CHANGED,
|
2003-04-06 03:56:38 +08:00
|
|
|
TEMPLATE_CHANGED,
|
2001-02-07 23:01:52 +08:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2006-04-18 18:08:10 +08:00
|
|
|
static const gchar * const gimp_context_prop_names[] =
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
NULL, /* PROP_0 */
|
|
|
|
"gimp",
|
2001-08-12 03:53:35 +08:00
|
|
|
"image",
|
|
|
|
"display",
|
|
|
|
"tool",
|
2005-12-28 02:57:01 +08:00
|
|
|
"paint-info",
|
2001-08-12 03:53:35 +08:00
|
|
|
"foreground",
|
|
|
|
"background",
|
|
|
|
"opacity",
|
2003-02-10 01:32:52 +08:00
|
|
|
"paint-mode",
|
2001-08-12 03:53:35 +08:00
|
|
|
"brush",
|
|
|
|
"pattern",
|
|
|
|
"gradient",
|
|
|
|
"palette",
|
2003-03-26 06:06:03 +08:00
|
|
|
"font",
|
2001-10-23 01:27:46 +08:00
|
|
|
"buffer",
|
2003-04-06 03:56:38 +08:00
|
|
|
"imagefile",
|
|
|
|
"template"
|
1999-10-19 23:52:32 +08:00
|
|
|
};
|
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
static GType gimp_context_prop_types[] =
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
G_TYPE_NONE, /* PROP_0 */
|
|
|
|
G_TYPE_NONE, /* PROP_GIMP */
|
2001-02-07 23:01:52 +08:00
|
|
|
0,
|
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
|
|
|
G_TYPE_NONE,
|
2001-02-21 20:18:09 +08:00
|
|
|
0,
|
2005-12-28 02:57:01 +08:00
|
|
|
0,
|
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
|
|
|
G_TYPE_NONE,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
G_TYPE_NONE,
|
2001-02-07 23:01:52 +08:00
|
|
|
0,
|
|
|
|
0,
|
2001-02-12 00:14:25 +08:00
|
|
|
0,
|
2001-06-26 20:09:43 +08:00
|
|
|
0,
|
2001-10-23 01:27:46 +08:00
|
|
|
0,
|
2003-03-26 06:06:03 +08:00
|
|
|
0,
|
2003-04-06 03:56:38 +08:00
|
|
|
0,
|
2001-02-11 03:35:29 +08:00
|
|
|
0
|
1999-10-27 02:27:27 +08:00
|
|
|
};
|
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GimpContext, gimp_context, GIMP_TYPE_OBJECT,
|
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
|
2006-05-15 17:46:31 +08:00
|
|
|
gimp_context_config_iface_init))
|
2005-12-11 03:24:36 +08:00
|
|
|
|
|
|
|
#define parent_class gimp_context_parent_class
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
static guint gimp_context_signals[LAST_SIGNAL] = { 0 };
|
1999-06-18 03:13:08 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
static GimpToolInfo *standard_tool_info = NULL;
|
|
|
|
static GimpPaintInfo *standard_paint_info = NULL;
|
|
|
|
static GimpBrush *standard_brush = NULL;
|
|
|
|
static GimpPattern *standard_pattern = NULL;
|
|
|
|
static GimpGradient *standard_gradient = NULL;
|
|
|
|
static GimpPalette *standard_palette = NULL;
|
|
|
|
static GimpFont *standard_font = NULL;
|
2003-02-10 01:32:52 +08:00
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
static void
|
|
|
|
gimp_context_class_init (GimpContextClass *klass)
|
|
|
|
{
|
2004-07-04 04:27:28 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
|
2002-05-21 23:01:57 +08:00
|
|
|
GimpRGB black;
|
|
|
|
GimpRGB white;
|
|
|
|
|
|
|
|
gimp_rgba_set (&black, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
|
|
|
|
gimp_rgba_set (&white, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_signals[IMAGE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("image-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, image_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_IMAGE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
gimp_context_signals[DISPLAY_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("display-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, display_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_OBJECT);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
gimp_context_signals[TOOL_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("tool-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, tool_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_TOOL_INFO);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
gimp_context_signals[PAINT_INFO_CHANGED] =
|
|
|
|
g_signal_new ("paint-info-changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, paint_info_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_PAINT_INFO);
|
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_signals[FOREGROUND_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("foreground-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, foreground_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2004-07-27 03:56:47 +08:00
|
|
|
GIMP_TYPE_RGB | G_SIGNAL_TYPE_STATIC_SCOPE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
gimp_context_signals[BACKGROUND_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("background-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, background_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__BOXED,
|
|
|
|
G_TYPE_NONE, 1,
|
2004-07-27 03:56:47 +08:00
|
|
|
GIMP_TYPE_RGB | G_SIGNAL_TYPE_STATIC_SCOPE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
gimp_context_signals[OPACITY_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("opacity-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, opacity_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__DOUBLE,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_DOUBLE);
|
1999-06-18 03:13:08 +08:00
|
|
|
|
|
|
|
gimp_context_signals[PAINT_MODE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("paint-mode-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, paint_mode_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__ENUM,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_LAYER_MODE_EFFECTS);
|
1999-06-18 03:13:08 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_signals[BRUSH_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("brush-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, brush_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_BRUSH);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_signals[PATTERN_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("pattern-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, pattern_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_PATTERN);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
gimp_context_signals[GRADIENT_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("gradient-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, gradient_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_GRADIENT);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2001-02-12 00:14:25 +08:00
|
|
|
gimp_context_signals[PALETTE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("palette-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, palette_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_PALETTE);
|
2001-02-12 00:14:25 +08:00
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
gimp_context_signals[FONT_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("font-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, font_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_FONT);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
gimp_context_signals[BUFFER_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("buffer-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, buffer_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_BUFFER);
|
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-10-23 01:27:46 +08:00
|
|
|
gimp_context_signals[IMAGEFILE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("imagefile-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, imagefile_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_IMAGEFILE);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2003-04-06 03:56:38 +08:00
|
|
|
gimp_context_signals[TEMPLATE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("template-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpContextClass, template_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_TEMPLATE);
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
object_class->constructor = gimp_context_constructor;
|
2002-01-31 00:14:26 +08:00
|
|
|
object_class->set_property = gimp_context_set_property;
|
|
|
|
object_class->get_property = gimp_context_get_property;
|
|
|
|
object_class->dispose = gimp_context_dispose;
|
|
|
|
object_class->finalize = gimp_context_finalize;
|
|
|
|
|
|
|
|
gimp_object_class->get_memsize = gimp_context_get_memsize;
|
|
|
|
|
|
|
|
klass->image_changed = NULL;
|
|
|
|
klass->display_changed = NULL;
|
|
|
|
klass->tool_changed = NULL;
|
2005-12-28 02:57:01 +08:00
|
|
|
klass->paint_info_changed = NULL;
|
2002-01-31 00:14:26 +08:00
|
|
|
klass->foreground_changed = NULL;
|
|
|
|
klass->background_changed = NULL;
|
|
|
|
klass->opacity_changed = NULL;
|
|
|
|
klass->paint_mode_changed = NULL;
|
|
|
|
klass->brush_changed = NULL;
|
|
|
|
klass->pattern_changed = NULL;
|
|
|
|
klass->gradient_changed = NULL;
|
|
|
|
klass->palette_changed = NULL;
|
2003-03-26 06:06:03 +08:00
|
|
|
klass->font_changed = NULL;
|
2002-01-31 00:14:26 +08:00
|
|
|
klass->buffer_changed = NULL;
|
|
|
|
klass->imagefile_changed = NULL;
|
2003-04-06 03:56:38 +08:00
|
|
|
klass->template_changed = NULL;
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_IMAGE] = GIMP_TYPE_IMAGE;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_TOOL] = GIMP_TYPE_TOOL_INFO;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_PAINT_INFO] = GIMP_TYPE_PAINT_INFO;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_BRUSH] = GIMP_TYPE_BRUSH;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_PATTERN] = GIMP_TYPE_PATTERN;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_GRADIENT] = GIMP_TYPE_GRADIENT;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_PALETTE] = GIMP_TYPE_PALETTE;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_FONT] = GIMP_TYPE_FONT;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_BUFFER] = GIMP_TYPE_BUFFER;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_IMAGEFILE] = GIMP_TYPE_IMAGEFILE;
|
|
|
|
gimp_context_prop_types[GIMP_CONTEXT_PROP_TEMPLATE] = GIMP_TYPE_TEMPLATE;
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_GIMP,
|
2001-12-08 01:39:51 +08:00
|
|
|
g_param_spec_object ("gimp",
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_GIMP,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2001-12-08 01:39:51 +08:00
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_IMAGE,
|
|
|
|
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_IMAGE],
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_IMAGE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_DISPLAY,
|
|
|
|
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_DISPLAY],
|
2002-05-10 21:09:19 +08:00
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_OBJECT,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_TOOL,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_TOOL], NULL,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_TOOL_INFO,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_PAINT_INFO,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_PAINT_INFO], NULL,
|
|
|
|
GIMP_TYPE_PAINT_INFO,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2005-12-28 02:57:01 +08:00
|
|
|
|
2004-07-27 03:56:47 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_RGB (object_class, GIMP_CONTEXT_PROP_FOREGROUND,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_FOREGROUND],
|
2006-04-28 03:26:40 +08:00
|
|
|
NULL,
|
|
|
|
FALSE, &black,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2004-07-27 03:56:47 +08:00
|
|
|
|
|
|
|
GIMP_CONFIG_INSTALL_PROP_RGB (object_class, GIMP_CONTEXT_PROP_BACKGROUND,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_BACKGROUND],
|
2006-04-28 03:26:40 +08:00
|
|
|
NULL,
|
|
|
|
FALSE, &white,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, GIMP_CONTEXT_PROP_OPACITY,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_OPACITY],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-05-22 01:33:04 +08:00
|
|
|
GIMP_OPACITY_TRANSPARENT,
|
|
|
|
GIMP_OPACITY_OPAQUE,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_OPACITY_OPAQUE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, GIMP_CONTEXT_PROP_PAINT_MODE,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_PAINT_MODE],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-05-22 01:33:04 +08:00
|
|
|
GIMP_TYPE_LAYER_MODE_EFFECTS,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_NORMAL_MODE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_BRUSH,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_BRUSH],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_BRUSH,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_PATTERN,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_PATTERN],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_PATTERN,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_GRADIENT,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_GRADIENT],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_GRADIENT,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_PALETTE,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_PALETTE],
|
2002-11-28 23:19:19 +08:00
|
|
|
NULL,
|
2002-11-21 03:09:40 +08:00
|
|
|
GIMP_TYPE_PALETTE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_FONT,
|
|
|
|
gimp_context_prop_names[GIMP_CONTEXT_PROP_FONT],
|
|
|
|
NULL,
|
|
|
|
GIMP_TYPE_FONT,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_STATIC_STRINGS);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_BUFFER,
|
2004-07-04 04:27:28 +08:00
|
|
|
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_BUFFER],
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_BUFFER,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_IMAGEFILE,
|
2004-07-04 04:27:28 +08:00
|
|
|
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_IMAGEFILE],
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_IMAGEFILE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2003-04-06 03:56:38 +08:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class, GIMP_CONTEXT_PROP_TEMPLATE,
|
2004-07-04 04:27:28 +08:00
|
|
|
g_param_spec_object (gimp_context_prop_names[GIMP_CONTEXT_PROP_TEMPLATE],
|
|
|
|
NULL, NULL,
|
|
|
|
GIMP_TYPE_TEMPLATE,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE));
|
1999-06-18 03:13:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_init (GimpContext *context)
|
|
|
|
{
|
2004-07-04 04:27:28 +08:00
|
|
|
context->gimp = NULL;
|
2004-01-30 00:34:41 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->parent = NULL;
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->defined_props = GIMP_CONTEXT_ALL_PROPS_MASK;
|
|
|
|
context->serialize_props = GIMP_CONTEXT_ALL_PROPS_MASK;
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->image = NULL;
|
|
|
|
context->display = NULL;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->tool_info = NULL;
|
|
|
|
context->tool_name = NULL;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
context->paint_info = NULL;
|
|
|
|
context->paint_name = NULL;
|
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->brush = NULL;
|
|
|
|
context->brush_name = NULL;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->pattern = NULL;
|
|
|
|
context->pattern_name = NULL;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->gradient = NULL;
|
|
|
|
context->gradient_name = NULL;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->palette = NULL;
|
|
|
|
context->palette_name = NULL;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->font = NULL;
|
|
|
|
context->font_name = NULL;
|
2001-02-12 00:14:25 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->buffer = NULL;
|
|
|
|
context->buffer_name = NULL;
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->imagefile = NULL;
|
|
|
|
context->imagefile_name = NULL;
|
2004-01-30 00:34:41 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
context->template = NULL;
|
|
|
|
context->template_name = NULL;
|
1999-06-18 03:13:08 +08:00
|
|
|
}
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
static void
|
2005-12-11 03:24:36 +08:00
|
|
|
gimp_context_config_iface_init (GimpConfigInterface *iface)
|
2002-05-22 21:19:19 +08:00
|
|
|
{
|
2005-12-11 03:24:36 +08:00
|
|
|
iface->serialize = gimp_context_serialize;
|
|
|
|
iface->serialize_property = gimp_context_serialize_property;
|
|
|
|
iface->deserialize_property = gimp_context_deserialize_property;
|
2002-05-22 21:19:19 +08:00
|
|
|
}
|
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
static GObject *
|
|
|
|
gimp_context_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
|
|
|
{
|
|
|
|
GObject *object;
|
|
|
|
Gimp *gimp;
|
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
|
|
|
|
|
|
|
gimp = GIMP_CONTEXT (object)->gimp;
|
|
|
|
|
|
|
|
g_assert (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2003-10-15 00:40:02 +08:00
|
|
|
gimp->context_list = g_list_prepend (gimp->context_list, object);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->images, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_image_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->displays, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_display_removed),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->tool_info_list, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_tool_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->tool_info_list, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_tool_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
g_signal_connect_object (gimp->paint_info_list, "remove",
|
|
|
|
G_CALLBACK (gimp_context_paint_info_removed),
|
|
|
|
object, 0);
|
|
|
|
g_signal_connect_object (gimp->paint_info_list, "thaw",
|
|
|
|
G_CALLBACK (gimp_context_paint_info_list_thaw),
|
|
|
|
object, 0);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->brush_factory->container, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_brush_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->brush_factory->container, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_brush_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->pattern_factory->container, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_pattern_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->pattern_factory->container, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_pattern_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->gradient_factory->container, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_gradient_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->gradient_factory->container, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_gradient_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->palette_factory->container, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_palette_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->palette_factory->container, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_palette_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
g_signal_connect_object (gimp->fonts, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_font_removed),
|
|
|
|
object, 0);
|
2003-03-26 06:06:03 +08:00
|
|
|
g_signal_connect_object (gimp->fonts, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_font_list_thaw),
|
|
|
|
object, 0);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->named_buffers, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_buffer_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->named_buffers, "thaw",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_buffer_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->documents, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_imagefile_removed),
|
|
|
|
object, 0);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect_object (gimp->documents, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_imagefile_list_thaw),
|
|
|
|
object, 0);
|
2002-05-29 00:41:56 +08:00
|
|
|
|
2003-04-06 03:56:38 +08:00
|
|
|
g_signal_connect_object (gimp->templates, "remove",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_template_removed),
|
|
|
|
object, 0);
|
2003-04-06 03:56:38 +08:00
|
|
|
g_signal_connect_object (gimp->templates, "thaw",
|
2003-10-15 00:40:02 +08:00
|
|
|
G_CALLBACK (gimp_context_template_list_thaw),
|
|
|
|
object, 0);
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2002-05-29 00:41:56 +08:00
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
static void
|
|
|
|
gimp_context_dispose (GObject *object)
|
|
|
|
{
|
2003-10-15 00:40:02 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
|
|
|
if (context->gimp)
|
|
|
|
{
|
|
|
|
context->gimp->context_list = g_list_remove (context->gimp->context_list,
|
|
|
|
context);
|
|
|
|
context->gimp = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
static void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_finalize (GObject *object)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-10-15 00:40:02 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2003-11-19 09:02:19 +08:00
|
|
|
context->parent = NULL;
|
2001-04-24 00:58:18 +08:00
|
|
|
context->image = NULL;
|
|
|
|
context->display = NULL;
|
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
if (context->tool_info)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->tool_info);
|
2001-04-24 00:58:18 +08:00
|
|
|
context->tool_info = NULL;
|
|
|
|
}
|
2001-02-21 20:18:09 +08:00
|
|
|
if (context->tool_name)
|
|
|
|
{
|
|
|
|
g_free (context->tool_name);
|
|
|
|
context->tool_name = NULL;
|
|
|
|
}
|
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
if (context->paint_info)
|
|
|
|
{
|
|
|
|
g_object_unref (context->paint_info);
|
|
|
|
context->paint_info = NULL;
|
|
|
|
}
|
|
|
|
if (context->paint_name)
|
|
|
|
{
|
|
|
|
g_free (context->paint_name);
|
|
|
|
context->paint_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
if (context->brush)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->brush);
|
2001-04-24 00:58:18 +08:00
|
|
|
context->brush = NULL;
|
|
|
|
}
|
2001-02-07 23:01:52 +08:00
|
|
|
if (context->brush_name)
|
|
|
|
{
|
|
|
|
g_free (context->brush_name);
|
|
|
|
context->brush_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (context->pattern)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->pattern);
|
2001-04-24 00:58:18 +08:00
|
|
|
context->pattern = NULL;
|
|
|
|
}
|
2001-02-07 23:01:52 +08:00
|
|
|
if (context->pattern_name)
|
|
|
|
{
|
|
|
|
g_free (context->pattern_name);
|
|
|
|
context->pattern_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
if (context->gradient)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->gradient);
|
2001-04-24 00:58:18 +08:00
|
|
|
context->gradient = NULL;
|
|
|
|
}
|
2001-02-07 23:01:52 +08:00
|
|
|
if (context->gradient_name)
|
|
|
|
{
|
|
|
|
g_free (context->gradient_name);
|
|
|
|
context->gradient_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-02-12 00:14:25 +08:00
|
|
|
if (context->palette)
|
2001-04-24 00:58:18 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->palette);
|
2001-04-24 00:58:18 +08:00
|
|
|
context->palette = NULL;
|
|
|
|
}
|
2001-02-12 00:14:25 +08:00
|
|
|
if (context->palette_name)
|
|
|
|
{
|
|
|
|
g_free (context->palette_name);
|
|
|
|
context->palette_name = NULL;
|
|
|
|
}
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
if (context->font)
|
|
|
|
{
|
|
|
|
g_object_unref (context->font);
|
|
|
|
context->font = NULL;
|
|
|
|
}
|
|
|
|
if (context->font_name)
|
|
|
|
{
|
|
|
|
g_free (context->font_name);
|
|
|
|
context->font_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
if (context->buffer)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
context->buffer = NULL;
|
|
|
|
}
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->buffer_name)
|
|
|
|
{
|
|
|
|
g_free (context->buffer_name);
|
|
|
|
context->buffer_name = NULL;
|
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2001-10-23 01:27:46 +08:00
|
|
|
if (context->imagefile)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
context->imagefile = NULL;
|
|
|
|
}
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->imagefile_name)
|
|
|
|
{
|
|
|
|
g_free (context->imagefile_name);
|
|
|
|
context->imagefile_name = NULL;
|
|
|
|
}
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2003-04-06 03:56:38 +08:00
|
|
|
if (context->template)
|
|
|
|
{
|
|
|
|
g_object_unref (context->template);
|
|
|
|
context->template = NULL;
|
|
|
|
}
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->template_name)
|
|
|
|
{
|
|
|
|
g_free (context->template_name);
|
|
|
|
context->template_name = NULL;
|
|
|
|
}
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-02-07 23:01:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_set_property (GObject *object,
|
2004-07-04 04:27:28 +08:00
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-10-15 00:40:02 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
switch (property_id)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_GIMP:
|
2001-12-08 01:39:51 +08:00
|
|
|
context->gimp = g_value_get_object (value);
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_IMAGE:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_image (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_DISPLAY:
|
2002-05-10 21:09:19 +08:00
|
|
|
gimp_context_set_display (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TOOL:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_tool (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2005-12-28 02:57:01 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_INFO:
|
|
|
|
gimp_context_set_paint_info (context, g_value_get_object (value));
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FOREGROUND:
|
2002-05-21 23:01:57 +08:00
|
|
|
gimp_context_set_foreground (context, g_value_get_boxed (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BACKGROUND:
|
2002-05-21 23:01:57 +08:00
|
|
|
gimp_context_set_background (context, g_value_get_boxed (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_OPACITY:
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_set_opacity (context, g_value_get_double (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_MODE:
|
2002-05-21 23:01:57 +08:00
|
|
|
gimp_context_set_paint_mode (context, g_value_get_enum (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BRUSH:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_brush (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PATTERN:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_pattern (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_GRADIENT:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_gradient (context, g_value_get_object (value));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PALETTE:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_palette (context, g_value_get_object (value));
|
2001-02-12 00:14:25 +08:00
|
|
|
break;
|
2003-03-26 06:06:03 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FONT:
|
|
|
|
gimp_context_set_font (context, g_value_get_object (value));
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BUFFER:
|
2001-08-12 05:10:44 +08:00
|
|
|
gimp_context_set_buffer (context, g_value_get_object (value));
|
2001-06-26 20:09:43 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_IMAGEFILE:
|
2001-10-23 01:27:46 +08:00
|
|
|
gimp_context_set_imagefile (context, g_value_get_object (value));
|
|
|
|
break;
|
2003-04-06 03:56:38 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TEMPLATE:
|
|
|
|
gimp_context_set_template (context, g_value_get_object (value));
|
|
|
|
break;
|
2001-02-07 23:01:52 +08:00
|
|
|
default:
|
2001-08-12 03:53:35 +08:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_get_property (GObject *object,
|
2004-07-04 04:27:28 +08:00
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-10-15 00:40:02 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
switch (property_id)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_GIMP:
|
2001-12-08 01:39:51 +08:00
|
|
|
g_value_set_object (value, context->gimp);
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_IMAGE:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_image (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_DISPLAY:
|
2002-05-10 21:09:19 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_display (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TOOL:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_tool (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2005-12-28 02:57:01 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_INFO:
|
|
|
|
g_value_set_object (value, gimp_context_get_paint_info (context));
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FOREGROUND:
|
2002-05-21 23:01:57 +08:00
|
|
|
{
|
|
|
|
GimpRGB color;
|
|
|
|
|
|
|
|
gimp_context_get_foreground (context, &color);
|
|
|
|
g_value_set_boxed (value, &color);
|
|
|
|
}
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BACKGROUND:
|
2002-05-21 23:01:57 +08:00
|
|
|
{
|
|
|
|
GimpRGB color;
|
|
|
|
|
|
|
|
gimp_context_get_background (context, &color);
|
|
|
|
g_value_set_boxed (value, &color);
|
|
|
|
}
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_OPACITY:
|
2001-08-12 03:53:35 +08:00
|
|
|
g_value_set_double (value, gimp_context_get_opacity (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_MODE:
|
2002-05-21 23:01:57 +08:00
|
|
|
g_value_set_enum (value, gimp_context_get_paint_mode (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BRUSH:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_brush (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PATTERN:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_pattern (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_GRADIENT:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_gradient (context));
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PALETTE:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_palette (context));
|
2001-02-12 00:14:25 +08:00
|
|
|
break;
|
2003-03-26 06:06:03 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FONT:
|
|
|
|
g_value_set_object (value, gimp_context_get_font (context));
|
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BUFFER:
|
2001-08-12 05:10:44 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_buffer (context));
|
2001-06-26 20:09:43 +08:00
|
|
|
break;
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_IMAGEFILE:
|
2001-10-23 01:27:46 +08:00
|
|
|
g_value_set_object (value, gimp_context_get_imagefile (context));
|
|
|
|
break;
|
2003-04-06 03:56:38 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TEMPLATE:
|
|
|
|
g_value_set_object (value, gimp_context_get_template (context));
|
|
|
|
break;
|
2001-02-07 23:01:52 +08:00
|
|
|
default:
|
2001-08-12 03:53:35 +08:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
2001-02-07 23:01:52 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
static gint64
|
2003-08-25 18:49:33 +08:00
|
|
|
gimp_context_get_memsize (GimpObject *object,
|
2003-11-17 01:51:36 +08:00
|
|
|
gint64 *gui_size)
|
2002-01-31 00:14:26 +08:00
|
|
|
{
|
2003-10-15 00:40:02 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2003-11-17 01:51:36 +08:00
|
|
|
gint64 memsize = 0;
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2007-11-17 02:19:30 +08:00
|
|
|
memsize += gimp_string_get_memsize (context->tool_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->paint_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->brush_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->pattern_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->palette_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->font_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->buffer_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->imagefile_name);
|
|
|
|
memsize += gimp_string_get_memsize (context->template_name);
|
2004-01-30 00:34:41 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
|
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
}
|
|
|
|
|
2003-02-28 21:58:19 +08:00
|
|
|
static gboolean
|
2003-10-11 22:30:18 +08:00
|
|
|
gimp_context_serialize (GimpConfig *config,
|
2003-03-06 04:21:50 +08:00
|
|
|
GimpConfigWriter *writer,
|
|
|
|
gpointer data)
|
2003-02-28 21:58:19 +08:00
|
|
|
{
|
2003-10-11 22:30:18 +08:00
|
|
|
return gimp_config_serialize_changed_properties (config, writer);
|
2003-02-28 21:58:19 +08:00
|
|
|
}
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
static gboolean
|
2003-10-11 22:30:18 +08:00
|
|
|
gimp_context_serialize_property (GimpConfig *config,
|
2003-03-06 04:21:50 +08:00
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpConfigWriter *writer)
|
2002-05-22 21:19:19 +08:00
|
|
|
{
|
2004-03-12 03:13:49 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (config);
|
2002-05-22 21:19:19 +08:00
|
|
|
GimpObject *serialize_obj;
|
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
/* serialize nothing if the property is not in serialize_props */
|
|
|
|
if (! ((1 << property_id) & context->serialize_props))
|
2003-02-10 01:32:52 +08:00
|
|
|
return TRUE;
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
switch (property_id)
|
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TOOL:
|
2005-12-28 02:57:01 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_INFO:
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BRUSH:
|
|
|
|
case GIMP_CONTEXT_PROP_PATTERN:
|
|
|
|
case GIMP_CONTEXT_PROP_GRADIENT:
|
|
|
|
case GIMP_CONTEXT_PROP_PALETTE:
|
2003-03-26 06:06:03 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FONT:
|
2003-03-10 23:48:16 +08:00
|
|
|
serialize_obj = g_value_get_object (value);
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2003-04-13 03:06:25 +08:00
|
|
|
gimp_config_writer_open (writer, pspec->name);
|
|
|
|
|
2002-05-24 10:53:20 +08:00
|
|
|
if (serialize_obj)
|
2003-04-13 20:27:44 +08:00
|
|
|
gimp_config_writer_string (writer, gimp_object_get_name (serialize_obj));
|
2002-05-24 10:53:20 +08:00
|
|
|
else
|
2003-04-13 20:27:44 +08:00
|
|
|
gimp_config_writer_print (writer, "NULL", 4);
|
2002-05-22 21:19:19 +08:00
|
|
|
|
2003-04-13 03:06:25 +08:00
|
|
|
gimp_config_writer_close (writer);
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2003-10-11 22:30:18 +08:00
|
|
|
gimp_context_deserialize_property (GimpConfig *object,
|
2002-05-22 21:19:19 +08:00
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GScanner *scanner,
|
|
|
|
GTokenType *expected)
|
|
|
|
{
|
2004-03-12 03:13:49 +08:00
|
|
|
GimpContext *context = GIMP_CONTEXT (object);
|
2002-05-22 21:19:19 +08:00
|
|
|
GimpContainer *container;
|
2002-05-27 22:04:21 +08:00
|
|
|
GimpObject *current;
|
|
|
|
gchar **name_loc;
|
|
|
|
gboolean no_data = FALSE;
|
2002-05-22 21:19:19 +08:00
|
|
|
gchar *object_name;
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TOOL:
|
2002-05-22 21:19:19 +08:00
|
|
|
container = context->gimp->tool_info_list;
|
2002-05-27 22:04:21 +08:00
|
|
|
current = (GimpObject *) context->tool_info;
|
|
|
|
name_loc = &context->tool_name;
|
|
|
|
no_data = TRUE;
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_INFO:
|
|
|
|
container = context->gimp->paint_info_list;
|
|
|
|
current = (GimpObject *) context->paint_info;
|
|
|
|
name_loc = &context->paint_name;
|
|
|
|
no_data = TRUE;
|
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BRUSH:
|
2002-05-22 21:19:19 +08:00
|
|
|
container = context->gimp->brush_factory->container;
|
2002-05-27 22:04:21 +08:00
|
|
|
current = (GimpObject *) context->brush;
|
|
|
|
name_loc = &context->brush_name;
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PATTERN:
|
2002-05-22 21:19:19 +08:00
|
|
|
container = context->gimp->pattern_factory->container;
|
2002-05-27 22:04:21 +08:00
|
|
|
current = (GimpObject *) context->pattern;
|
|
|
|
name_loc = &context->pattern_name;
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_GRADIENT:
|
2002-05-22 21:19:19 +08:00
|
|
|
container = context->gimp->gradient_factory->container;
|
2002-05-27 22:04:21 +08:00
|
|
|
current = (GimpObject *) context->gradient;
|
|
|
|
name_loc = &context->gradient_name;
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PALETTE:
|
2002-05-22 21:19:19 +08:00
|
|
|
container = context->gimp->palette_factory->container;
|
2002-05-27 22:04:21 +08:00
|
|
|
current = (GimpObject *) context->palette;
|
|
|
|
name_loc = &context->palette_name;
|
2002-05-22 21:19:19 +08:00
|
|
|
break;
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FONT:
|
|
|
|
container = context->gimp->fonts;
|
|
|
|
current = (GimpObject *) context->font;
|
|
|
|
name_loc = &context->font_name;
|
|
|
|
break;
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-05-27 22:04:21 +08:00
|
|
|
if (! no_data)
|
|
|
|
no_data = context->gimp->no_data;
|
|
|
|
|
2002-05-24 10:53:20 +08:00
|
|
|
if (gimp_scanner_parse_identifier (scanner, "NULL"))
|
|
|
|
{
|
|
|
|
g_value_set_object (value, NULL);
|
|
|
|
}
|
|
|
|
else if (gimp_scanner_parse_string (scanner, &object_name))
|
2002-05-22 21:19:19 +08:00
|
|
|
{
|
|
|
|
GimpObject *deserialize_obj;
|
|
|
|
|
2003-04-13 20:27:44 +08:00
|
|
|
if (! object_name)
|
|
|
|
object_name = g_strdup ("");
|
|
|
|
|
2002-05-22 21:19:19 +08:00
|
|
|
deserialize_obj = gimp_container_get_child_by_name (container,
|
|
|
|
object_name);
|
|
|
|
|
|
|
|
if (! deserialize_obj)
|
|
|
|
{
|
2002-05-27 22:04:21 +08:00
|
|
|
if (no_data)
|
2002-05-22 21:19:19 +08:00
|
|
|
{
|
2002-05-27 22:04:21 +08:00
|
|
|
g_free (*name_loc);
|
|
|
|
*name_loc = g_strdup (object_name);
|
2002-05-22 21:19:19 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-05-27 22:04:21 +08:00
|
|
|
deserialize_obj = current;
|
2002-05-22 21:19:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_set_object (value, deserialize_obj);
|
2003-04-13 20:27:44 +08:00
|
|
|
|
|
|
|
g_free (object_name);
|
2002-05-22 21:19:19 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*expected = G_TOKEN_STRING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-01-31 00:14:26 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* public functions ********************************************************/
|
1999-06-19 02:29:27 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
GimpContext *
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp_context_new (Gimp *gimp,
|
2004-07-04 04:27:28 +08:00
|
|
|
const gchar *name,
|
|
|
|
GimpContext *template)
|
1999-06-18 03:13:08 +08:00
|
|
|
{
|
|
|
|
GimpContext *context;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
2001-07-07 20:17:23 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2001-08-10 22:41:39 +08:00
|
|
|
g_return_val_if_fail (! template || GIMP_IS_CONTEXT (template), NULL);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
context = g_object_new (GIMP_TYPE_CONTEXT,
|
|
|
|
"name", name,
|
|
|
|
"gimp", gimp,
|
|
|
|
NULL);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
|
|
|
if (template)
|
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
context->defined_props = template->defined_props;
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_copy_properties (template, context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GIMP_CONTEXT_ALL_PROPS_MASK);
|
1999-06-19 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
return context;
|
|
|
|
}
|
|
|
|
|
1999-06-20 04:20:59 +08:00
|
|
|
GimpContext *
|
2001-01-14 11:55:56 +08:00
|
|
|
gimp_context_get_parent (const GimpContext *context)
|
1999-06-20 04:20:59 +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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
1999-06-20 04:20:59 +08:00
|
|
|
|
|
|
|
return context->parent;
|
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
static void
|
|
|
|
gimp_context_parent_notify (GimpContext *parent,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
/* copy from parent if the changed property is undefined */
|
|
|
|
if (! ((1 << pspec->param_id) & context->defined_props))
|
|
|
|
gimp_context_copy_property (parent, context, pspec->param_id);
|
|
|
|
}
|
|
|
|
|
1999-06-20 04:20:59 +08:00
|
|
|
void
|
|
|
|
gimp_context_set_parent (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *parent)
|
1999-06-20 04:20:59 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
g_return_if_fail (parent == NULL || GIMP_IS_CONTEXT (parent));
|
|
|
|
g_return_if_fail (parent == NULL || parent->parent != context);
|
2001-08-12 23:39:23 +08:00
|
|
|
g_return_if_fail (context != parent);
|
1999-06-20 04:20:59 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
if (context->parent == parent)
|
1999-11-14 18:50:19 +08:00
|
|
|
return;
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
if (context->parent)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (context->parent,
|
|
|
|
gimp_context_parent_notify,
|
|
|
|
context);
|
|
|
|
}
|
1999-10-19 23:52:32 +08:00
|
|
|
|
1999-06-20 04:20:59 +08:00
|
|
|
context->parent = parent;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
if (parent)
|
|
|
|
{
|
|
|
|
/* copy all undefined properties from the new parent */
|
|
|
|
gimp_context_copy_properties (parent, context,
|
|
|
|
~context->defined_props &
|
|
|
|
GIMP_CONTEXT_ALL_PROPS_MASK);
|
1999-06-20 04:20:59 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_signal_connect_object (parent, "notify",
|
|
|
|
G_CALLBACK (gimp_context_parent_notify),
|
|
|
|
context,
|
|
|
|
0);
|
|
|
|
}
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
/* define / undefinine context properties */
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_define_property (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContextPropType prop,
|
|
|
|
gboolean defined)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropMask mask;
|
1999-10-19 23:52:32 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
g_return_if_fail ((prop >= GIMP_CONTEXT_FIRST_PROP) &&
|
|
|
|
(prop <= GIMP_CONTEXT_LAST_PROP));
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
mask = (1 << prop);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
if (defined)
|
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
if (! (context->defined_props & mask))
|
2004-07-04 04:27:28 +08:00
|
|
|
{
|
|
|
|
context->defined_props |= mask;
|
|
|
|
}
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
if (context->defined_props & mask)
|
2004-07-04 04:27:28 +08:00
|
|
|
{
|
|
|
|
context->defined_props &= ~mask;
|
2003-02-10 01:32:52 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
if (context->parent)
|
2003-02-10 01:32:52 +08:00
|
|
|
gimp_context_copy_property (context->parent, context, prop);
|
2004-07-04 04:27:28 +08:00
|
|
|
}
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_property_defined (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContextPropType prop)
|
1999-10-19 23:52:32 +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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
return (context->defined_props & (1 << prop)) ? TRUE : FALSE;
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_define_properties (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContextPropMask prop_mask,
|
|
|
|
gboolean defined)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType prop;
|
1999-10-19 23:52:32 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
for (prop = GIMP_CONTEXT_FIRST_PROP; prop <= GIMP_CONTEXT_LAST_PROP; prop++)
|
|
|
|
if ((1 << prop) & prop_mask)
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_define_property (context, prop, defined);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
|
2004-07-04 04:27:28 +08:00
|
|
|
/* specify which context properties will be serialized */
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_serialize_properties (GimpContext *context,
|
|
|
|
GimpContextPropMask props_mask)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
context->serialize_props = props_mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpContextPropMask
|
|
|
|
gimp_context_get_serialize_properties (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), 0);
|
|
|
|
|
|
|
|
return context->serialize_props;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
/* copying context properties */
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_copy_property (GimpContext *src,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *dest,
|
|
|
|
GimpContextPropType prop)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
gpointer object = NULL;
|
|
|
|
gpointer standard_object = NULL;
|
|
|
|
gchar *src_name = NULL;
|
|
|
|
gchar **dest_name_loc = 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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (src));
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (dest));
|
2003-02-10 01:32:52 +08:00
|
|
|
g_return_if_fail ((prop >= GIMP_CONTEXT_FIRST_PROP) &&
|
|
|
|
(prop <= GIMP_CONTEXT_LAST_PROP));
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
switch (prop)
|
|
|
|
{
|
|
|
|
case GIMP_CONTEXT_PROP_IMAGE:
|
|
|
|
gimp_context_real_set_image (dest, src->image);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_DISPLAY:
|
|
|
|
gimp_context_real_set_display (dest, src->display);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_TOOL:
|
|
|
|
gimp_context_real_set_tool (dest, src->tool_info);
|
|
|
|
object = src->tool_info;
|
|
|
|
standard_object = standard_tool_info;
|
|
|
|
src_name = src->tool_name;
|
|
|
|
dest_name_loc = &dest->tool_name;
|
|
|
|
break;
|
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
case GIMP_CONTEXT_PROP_PAINT_INFO:
|
|
|
|
gimp_context_real_set_paint_info (dest, src->paint_info);
|
|
|
|
object = src->paint_info;
|
|
|
|
standard_object = standard_paint_info;
|
|
|
|
src_name = src->paint_name;
|
|
|
|
dest_name_loc = &dest->paint_name;
|
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FOREGROUND:
|
|
|
|
gimp_context_real_set_foreground (dest, &src->foreground);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_BACKGROUND:
|
|
|
|
gimp_context_real_set_background (dest, &src->background);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_OPACITY:
|
|
|
|
gimp_context_real_set_opacity (dest, src->opacity);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_PAINT_MODE:
|
|
|
|
gimp_context_real_set_paint_mode (dest, src->paint_mode);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_BRUSH:
|
|
|
|
gimp_context_real_set_brush (dest, src->brush);
|
|
|
|
object = src->brush;
|
|
|
|
standard_object = standard_brush;
|
|
|
|
src_name = src->brush_name;
|
|
|
|
dest_name_loc = &dest->brush_name;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_PATTERN:
|
|
|
|
gimp_context_real_set_pattern (dest, src->pattern);
|
|
|
|
object = src->pattern;
|
|
|
|
standard_object = standard_pattern;
|
|
|
|
src_name = src->pattern_name;
|
|
|
|
dest_name_loc = &dest->pattern_name;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_GRADIENT:
|
|
|
|
gimp_context_real_set_gradient (dest, src->gradient);
|
|
|
|
object = src->gradient;
|
|
|
|
standard_object = standard_gradient;
|
|
|
|
src_name = src->gradient_name;
|
|
|
|
dest_name_loc = &dest->gradient_name;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_PALETTE:
|
|
|
|
gimp_context_real_set_palette (dest, src->palette);
|
|
|
|
object = src->palette;
|
|
|
|
standard_object = standard_palette;
|
|
|
|
src_name = src->palette_name;
|
|
|
|
dest_name_loc = &dest->palette_name;
|
|
|
|
break;
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
case GIMP_CONTEXT_PROP_FONT:
|
|
|
|
gimp_context_real_set_font (dest, src->font);
|
|
|
|
object = src->font;
|
|
|
|
standard_object = standard_font;
|
|
|
|
src_name = src->font_name;
|
|
|
|
dest_name_loc = &dest->font_name;
|
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
case GIMP_CONTEXT_PROP_BUFFER:
|
|
|
|
gimp_context_real_set_buffer (dest, src->buffer);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_CONTEXT_PROP_IMAGEFILE:
|
|
|
|
gimp_context_real_set_imagefile (dest, src->imagefile);
|
|
|
|
break;
|
|
|
|
|
2003-04-06 03:56:38 +08:00
|
|
|
case GIMP_CONTEXT_PROP_TEMPLATE:
|
|
|
|
gimp_context_real_set_template (dest, src->template);
|
|
|
|
break;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_name && dest_name_loc)
|
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
if (! object || (standard_object && object == standard_object))
|
2003-02-10 01:32:52 +08:00
|
|
|
{
|
|
|
|
g_free (*dest_name_loc);
|
|
|
|
*dest_name_loc = g_strdup (src_name);
|
|
|
|
}
|
|
|
|
}
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_context_copy_properties (GimpContext *src,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *dest,
|
|
|
|
GimpContextPropMask prop_mask)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType prop;
|
1999-10-19 23:52:32 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (src));
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (dest));
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
for (prop = GIMP_CONTEXT_FIRST_PROP; prop <= GIMP_CONTEXT_LAST_PROP; prop++)
|
|
|
|
if ((1 << prop) & prop_mask)
|
|
|
|
gimp_context_copy_property (src, dest, prop);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute access functions */
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2001-02-07 23:01:52 +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
|
|
|
/* manipulate by GType *****************************************************/
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType
|
|
|
|
gimp_context_type_to_property (GType type)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
GimpContextPropType prop;
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
for (prop = GIMP_CONTEXT_FIRST_PROP; prop <= GIMP_CONTEXT_LAST_PROP; prop++)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
if (g_type_is_a (type, gimp_context_prop_types[prop]))
|
2004-07-04 04:27:28 +08:00
|
|
|
return prop;
|
2001-02-07 23:01:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2003-04-10 18:34:56 +08:00
|
|
|
const gchar *
|
|
|
|
gimp_context_type_to_prop_name (GType type)
|
|
|
|
{
|
|
|
|
GimpContextPropType prop;
|
|
|
|
|
|
|
|
for (prop = GIMP_CONTEXT_FIRST_PROP; prop <= GIMP_CONTEXT_LAST_PROP; prop++)
|
|
|
|
{
|
|
|
|
if (g_type_is_a (type, gimp_context_prop_types[prop]))
|
2004-07-04 04:27:28 +08:00
|
|
|
return gimp_context_prop_names[prop];
|
2003-04-10 18:34:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
const gchar *
|
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
|
|
|
gimp_context_type_to_signal_name (GType type)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
GimpContextPropType prop;
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
for (prop = GIMP_CONTEXT_FIRST_PROP; prop <= GIMP_CONTEXT_LAST_PROP; prop++)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2003-02-10 01:32:52 +08:00
|
|
|
if (g_type_is_a (type, gimp_context_prop_types[prop]))
|
2004-07-04 04:27:28 +08:00
|
|
|
return g_signal_name (gimp_context_signals[prop]);
|
2001-02-07 23:01:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpObject *
|
|
|
|
gimp_context_get_by_type (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GType type)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType prop;
|
|
|
|
GimpObject *object = NULL;
|
2001-02-07 23:01:52 +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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2001-08-12 23:39:23 +08:00
|
|
|
g_return_val_if_fail ((prop = gimp_context_type_to_property (type)) != -1,
|
2004-07-04 04:27:28 +08:00
|
|
|
NULL);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_get (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_prop_names[prop], &object,
|
|
|
|
NULL);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2002-05-13 22:28:49 +08:00
|
|
|
/* g_object_get() refs the object, this function however is a getter,
|
|
|
|
* which usually doesn't ref it's return value
|
|
|
|
*/
|
|
|
|
if (object)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (object);
|
2002-05-13 22:28:49 +08:00
|
|
|
|
2001-02-07 23:01:52 +08:00
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_by_type (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GType type,
|
|
|
|
GimpObject *object)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType prop;
|
2001-02-07 23:01:52 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-08-12 03:53:35 +08:00
|
|
|
g_return_if_fail ((prop = gimp_context_type_to_property (type)) != -1);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_set (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_prop_names[prop], object,
|
|
|
|
NULL);
|
2001-02-07 23:01:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_changed_by_type (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GType type)
|
2001-02-07 23:01:52 +08:00
|
|
|
{
|
2001-08-12 03:53:35 +08:00
|
|
|
GimpContextPropType prop;
|
|
|
|
GimpObject *object;
|
2001-02-07 23:01:52 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-08-12 03:53:35 +08:00
|
|
|
g_return_if_fail ((prop = gimp_context_type_to_property (type)) != -1);
|
2001-02-07 23:01:52 +08:00
|
|
|
|
|
|
|
object = gimp_context_get_by_type (context, type);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[prop], 0,
|
|
|
|
object);
|
2001-02-07 23:01:52 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* image *******************************************************************/
|
|
|
|
|
|
|
|
GimpImage *
|
|
|
|
gimp_context_get_image (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
return context->image;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_image (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImage *image)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_IMAGE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
gimp_context_real_set_image (context, image);
|
|
|
|
}
|
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_image_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[IMAGE_CHANGED], 0,
|
|
|
|
context->image);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
/* handle disappearing images */
|
|
|
|
static void
|
2001-02-04 22:10:03 +08:00
|
|
|
gimp_context_image_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImage *image,
|
|
|
|
GimpContext *context)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
|
|
|
if (context->image == image)
|
|
|
|
gimp_context_real_set_image (context, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_image (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpImage *image)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->image == image)
|
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
context->image = image;
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "image");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_image_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* display *****************************************************************/
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
gpointer
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_get_display (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
return context->display;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_display (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gpointer display)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_DISPLAY);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_display (context, display);
|
|
|
|
}
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_display_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[DISPLAY_CHANGED], 0,
|
|
|
|
context->display);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
2002-05-10 21:09:19 +08:00
|
|
|
/* handle disappearing displays */
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2002-05-10 21:09:19 +08:00
|
|
|
gimp_context_display_removed (GimpContainer *container,
|
|
|
|
gpointer display,
|
|
|
|
GimpContext *context)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2002-05-10 21:09:19 +08:00
|
|
|
if (context->display == display)
|
|
|
|
gimp_context_real_set_display (context, NULL);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_display (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gpointer display)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->display == display)
|
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
context->display = display;
|
|
|
|
|
|
|
|
if (context->display)
|
2001-08-14 22:53:55 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2002-05-10 21:09:19 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_object_get (display, "image", &image, NULL);
|
2001-08-14 22:53:55 +08:00
|
|
|
|
2008-03-23 21:27:51 +08:00
|
|
|
gimp_context_real_set_image (context, image);
|
2001-08-14 22:53:55 +08:00
|
|
|
|
2008-03-23 21:27:51 +08:00
|
|
|
if (image)
|
|
|
|
g_object_unref (image);
|
2001-08-14 22:53:55 +08:00
|
|
|
}
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "display");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_display_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* tool ********************************************************************/
|
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
GimpToolInfo *
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_get_tool (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
return context->tool_info;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_context_set_tool (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpToolInfo *tool_info)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-08-12 23:39:23 +08:00
|
|
|
g_return_if_fail (! tool_info || GIMP_IS_TOOL_INFO (tool_info));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_TOOL);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_context_real_set_tool (context, tool_info);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_tool_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[TOOL_CHANGED], 0,
|
|
|
|
context->tool_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active tool was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_tool_dirty (GimpToolInfo *tool_info,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-21 20:18:09 +08:00
|
|
|
{
|
|
|
|
g_free (context->tool_name);
|
|
|
|
context->tool_name = g_strdup (GIMP_OBJECT (tool_info)->name);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
/* the global tool list is there again after refresh */
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_context_tool_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-02-21 20:18:09 +08:00
|
|
|
GimpToolInfo *tool_info;
|
|
|
|
|
|
|
|
if (! context->tool_name)
|
2006-05-24 23:04:45 +08:00
|
|
|
context->tool_name = g_strdup ("gimp-paintbrush-tool");
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
tool_info = gimp_context_find_object (context, container,
|
|
|
|
context->tool_name,
|
|
|
|
gimp_tool_info_get_standard (context->gimp));
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_tool (context, tool_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active tool disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_tool_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpToolInfo *tool_info,
|
|
|
|
GimpContext *context)
|
2001-02-21 20:18:09 +08:00
|
|
|
{
|
|
|
|
if (tool_info == context->tool_info)
|
|
|
|
{
|
|
|
|
context->tool_info = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (tool_info,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_tool_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (tool_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_tool_list_thaw (container, context);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_tool (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpToolInfo *tool_info)
|
2001-02-21 20:18:09 +08:00
|
|
|
{
|
|
|
|
if (! standard_tool_info)
|
2001-08-17 22:27:31 +08:00
|
|
|
standard_tool_info = gimp_tool_info_get_standard (context->gimp);
|
2001-02-21 20:18:09 +08:00
|
|
|
|
|
|
|
if (context->tool_info == tool_info)
|
1999-11-14 18:50:19 +08:00
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-02-24 05:32:47 +08:00
|
|
|
if (context->tool_name && tool_info != standard_tool_info)
|
2001-02-21 20:18:09 +08:00
|
|
|
{
|
|
|
|
g_free (context->tool_name);
|
|
|
|
context->tool_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old tool's signals */
|
|
|
|
if (context->tool_info)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->tool_info,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_tool_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->tool_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context->tool_info = tool_info;
|
|
|
|
|
|
|
|
if (tool_info)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (tool_info);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (tool_info, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_tool_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2001-02-24 05:32:47 +08:00
|
|
|
if (tool_info != standard_tool_info)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->tool_name = g_strdup (GIMP_OBJECT (tool_info)->name);
|
2005-12-28 02:57:01 +08:00
|
|
|
|
|
|
|
if (tool_info->paint_info)
|
|
|
|
gimp_context_real_set_paint_info (context, tool_info->paint_info);
|
2001-02-21 20:18:09 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "tool");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_tool_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2005-12-28 02:57:01 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* paint info **************************************************************/
|
|
|
|
|
|
|
|
GimpPaintInfo *
|
|
|
|
gimp_context_get_paint_info (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return context->paint_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_paint_info (GimpContext *context,
|
|
|
|
GimpPaintInfo *paint_info)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
g_return_if_fail (! paint_info || GIMP_IS_PAINT_INFO (paint_info));
|
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_PAINT_INFO);
|
|
|
|
|
|
|
|
gimp_context_real_set_paint_info (context, paint_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_paint_info_changed (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
g_signal_emit (context,
|
|
|
|
gimp_context_signals[PAINT_INFO_CHANGED], 0,
|
|
|
|
context->paint_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the active paint info was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_paint_info_dirty (GimpPaintInfo *paint_info,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
g_free (context->paint_name);
|
|
|
|
context->paint_name = g_strdup (GIMP_OBJECT (paint_info)->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the global paint info list is there again after refresh */
|
|
|
|
static void
|
|
|
|
gimp_context_paint_info_list_thaw (GimpContainer *container,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpPaintInfo *paint_info;
|
|
|
|
|
|
|
|
if (! context->paint_name)
|
|
|
|
context->paint_name = g_strdup ("GimpPaintbrush");
|
|
|
|
|
|
|
|
paint_info = gimp_context_find_object (context, container,
|
|
|
|
context->paint_name,
|
|
|
|
gimp_paint_info_get_standard (context->gimp));
|
|
|
|
|
|
|
|
gimp_context_real_set_paint_info (context, paint_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the active paint info disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_paint_info_removed (GimpContainer *container,
|
|
|
|
GimpPaintInfo *paint_info,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
if (paint_info == context->paint_info)
|
|
|
|
{
|
|
|
|
context->paint_info = NULL;
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (paint_info,
|
|
|
|
gimp_context_paint_info_dirty,
|
|
|
|
context);
|
|
|
|
g_object_unref (paint_info);
|
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
|
|
|
gimp_context_paint_info_list_thaw (container, context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_paint_info (GimpContext *context,
|
|
|
|
GimpPaintInfo *paint_info)
|
|
|
|
{
|
|
|
|
if (! standard_paint_info)
|
|
|
|
standard_paint_info = gimp_paint_info_get_standard (context->gimp);
|
|
|
|
|
|
|
|
if (context->paint_info == paint_info)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->paint_name && paint_info != standard_paint_info)
|
|
|
|
{
|
|
|
|
g_free (context->paint_name);
|
|
|
|
context->paint_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old paint info's signals */
|
|
|
|
if (context->paint_info)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (context->paint_info,
|
|
|
|
gimp_context_paint_info_dirty,
|
|
|
|
context);
|
|
|
|
g_object_unref (context->paint_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
context->paint_info = paint_info;
|
|
|
|
|
|
|
|
if (paint_info)
|
|
|
|
{
|
|
|
|
g_object_ref (paint_info);
|
|
|
|
|
|
|
|
g_signal_connect_object (paint_info, "name-changed",
|
|
|
|
G_CALLBACK (gimp_context_paint_info_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
|
|
|
|
|
|
|
if (paint_info != standard_paint_info)
|
|
|
|
context->paint_name = g_strdup (GIMP_OBJECT (paint_info)->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (context), "paint-info");
|
|
|
|
gimp_context_paint_info_changed (context);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* foreground color ********************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_get_foreground (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpRGB *color)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-01-15 09:48:53 +08:00
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
*color = context->foreground;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-01-20 23:37:26 +08:00
|
|
|
gimp_context_set_foreground (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-01-15 09:48:53 +08:00
|
|
|
g_return_if_fail (color != NULL);
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
|
2001-01-15 09:48:53 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_foreground (context, color);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_foreground_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[FOREGROUND_CHANGED], 0,
|
|
|
|
&context->foreground);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-01-20 23:37:26 +08:00
|
|
|
gimp_context_real_set_foreground (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-01-15 09:48:53 +08:00
|
|
|
if (gimp_rgba_distance (&context->foreground, color) < 0.0001)
|
1999-11-14 18:50:19 +08:00
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
context->foreground = *color;
|
2003-08-29 00:39:43 +08:00
|
|
|
gimp_rgb_set_alpha (&context->foreground, GIMP_OPACITY_OPAQUE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "foreground");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_foreground_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* background color ********************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_get_background (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpRGB *color)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
*color = context->background;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
2001-01-11 06:49:45 +08:00
|
|
|
void
|
2001-01-20 23:37:26 +08:00
|
|
|
gimp_context_set_background (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-01-15 09:48:53 +08:00
|
|
|
g_return_if_fail (color != NULL);
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_BACKGROUND);
|
2001-01-15 09:48:53 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_background (context, color);
|
1999-10-19 23:52:32 +08:00
|
|
|
}
|
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_background_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[BACKGROUND_CHANGED], 0,
|
|
|
|
&context->background);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-01-20 23:37:26 +08:00
|
|
|
gimp_context_real_set_background (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
const GimpRGB *color)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-01-15 09:48:53 +08:00
|
|
|
if (gimp_rgba_distance (&context->background, color) < 0.0001)
|
1999-11-14 18:50:19 +08:00
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
context->background = *color;
|
2003-08-29 00:39:43 +08:00
|
|
|
gimp_rgb_set_alpha (&context->background, GIMP_OPACITY_OPAQUE);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "background");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_background_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* color utility functions *************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_default_colors (GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpContext *bg_context;
|
2001-01-15 09:48:53 +08:00
|
|
|
GimpRGB fg;
|
|
|
|
GimpRGB bg;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2002-11-18 04:51:03 +08:00
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
bg_context = context;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
|
|
|
|
context_find_defined (bg_context, GIMP_CONTEXT_PROP_BACKGROUND);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2002-03-04 01:38:12 +08:00
|
|
|
gimp_rgba_set (&fg, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
|
|
|
|
gimp_rgba_set (&bg, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
|
2001-01-15 09:48:53 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_foreground (context, &fg);
|
|
|
|
gimp_context_real_set_background (bg_context, &bg);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_swap_colors (GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpContext *bg_context;
|
2001-01-15 09:48:53 +08:00
|
|
|
GimpRGB fg;
|
|
|
|
GimpRGB bg;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2002-11-18 04:51:03 +08:00
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
bg_context = context;
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
|
|
|
|
context_find_defined (bg_context, GIMP_CONTEXT_PROP_BACKGROUND);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
gimp_context_get_foreground (context, &fg);
|
|
|
|
gimp_context_get_background (bg_context, &bg);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
gimp_context_real_set_foreground (context, &bg);
|
|
|
|
gimp_context_real_set_background (bg_context, &fg);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* opacity *****************************************************************/
|
1999-06-19 02:29:27 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
gdouble
|
|
|
|
gimp_context_get_opacity (GimpContext *context)
|
|
|
|
{
|
2002-03-04 01:38:12 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_OPACITY_OPAQUE);
|
1999-06-18 03:13:08 +08:00
|
|
|
|
|
|
|
return context->opacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_opacity (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gdouble opacity)
|
1999-06-18 03:13:08 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_OPACITY);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_opacity (context, opacity);
|
|
|
|
}
|
1999-06-18 03:13:08 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_opacity_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[OPACITY_CHANGED], 0,
|
|
|
|
context->opacity);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
|
|
|
gimp_context_real_set_opacity (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gdouble opacity)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->opacity == opacity)
|
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
context->opacity = opacity;
|
2003-02-10 01:32:52 +08:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (context), "opacity");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_opacity_changed (context);
|
1999-06-18 03:13:08 +08:00
|
|
|
}
|
|
|
|
|
1999-06-19 02:29:27 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* paint mode **************************************************************/
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2001-12-09 07:12:59 +08:00
|
|
|
GimpLayerModeEffects
|
1999-06-18 03:13:08 +08:00
|
|
|
gimp_context_get_paint_mode (GimpContext *context)
|
|
|
|
{
|
2001-12-09 07:12:59 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_NORMAL_MODE);
|
1999-06-18 03:13:08 +08:00
|
|
|
|
|
|
|
return context->paint_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-12-09 07:12:59 +08:00
|
|
|
gimp_context_set_paint_mode (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpLayerModeEffects paint_mode)
|
1999-06-18 03:13:08 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_PAINT_MODE);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_paint_mode (context, paint_mode);
|
|
|
|
}
|
1999-06-18 03:13:08 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_paint_mode_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-02-24 05:32:47 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[PAINT_MODE_CHANGED], 0,
|
|
|
|
context->paint_mode);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-12-09 07:12:59 +08:00
|
|
|
gimp_context_real_set_paint_mode (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpLayerModeEffects paint_mode)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->paint_mode == paint_mode)
|
|
|
|
return;
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
1999-06-18 03:13:08 +08:00
|
|
|
context->paint_mode = paint_mode;
|
2003-02-10 01:32:52 +08:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (context), "paint-mode");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_paint_mode_changed (context);
|
1999-06-18 03:13:08 +08:00
|
|
|
}
|
1999-06-19 02:29:27 +08:00
|
|
|
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* brush *******************************************************************/
|
1999-06-19 02:29:27 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
GimpBrush *
|
|
|
|
gimp_context_get_brush (GimpContext *context)
|
1999-06-19 02:29: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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
return context->brush;
|
1999-06-19 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_set_brush (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBrush *brush)
|
1999-06-19 02:29: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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-08-12 23:39:23 +08:00
|
|
|
g_return_if_fail (! brush || GIMP_IS_BRUSH (brush));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_BRUSH);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_brush (context, brush);
|
|
|
|
}
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_brush_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[BRUSH_CHANGED], 0,
|
|
|
|
context->brush);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* the active brush was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_brush_dirty (GimpBrush *brush,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
g_free (context->brush_name);
|
2001-01-14 11:55:56 +08:00
|
|
|
context->brush_name = g_strdup (GIMP_OBJECT (brush)->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
/* the global brush list is there again after refresh */
|
|
|
|
static void
|
|
|
|
gimp_context_brush_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-12 11:27:28 +08:00
|
|
|
{
|
|
|
|
GimpBrush *brush;
|
|
|
|
|
|
|
|
if (! context->brush_name)
|
2001-07-11 20:39:49 +08:00
|
|
|
context->brush_name = g_strdup (context->gimp->config->default_brush);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
brush = gimp_context_find_object (context, container,
|
|
|
|
context->brush_name,
|
|
|
|
gimp_brush_get_standard ());
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_brush (context, brush);
|
2001-02-12 11:27:28 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* the active brush disappeared */
|
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_brush_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBrush *brush,
|
|
|
|
GimpContext *context)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
if (brush == context->brush)
|
|
|
|
{
|
|
|
|
context->brush = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (brush,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_brush_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (brush);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_brush_list_thaw (container, context);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
|
|
|
gimp_context_real_set_brush (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBrush *brush)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (! standard_brush)
|
2001-02-14 22:57:14 +08:00
|
|
|
standard_brush = GIMP_BRUSH (gimp_brush_get_standard ());
|
1999-06-20 21:53:15 +08:00
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->brush == brush)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->brush_name && brush != standard_brush)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
g_free (context->brush_name);
|
|
|
|
context->brush_name = NULL;
|
|
|
|
}
|
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
/* disconnect from the old brush's signals */
|
1999-10-27 02:27:27 +08:00
|
|
|
if (context->brush)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->brush,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_brush_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->brush);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
context->brush = brush;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
if (brush)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (brush);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (brush, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_brush_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
if (brush != standard_brush)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->brush_name = g_strdup (GIMP_OBJECT (brush)->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "brush");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_brush_changed (context);
|
1999-06-19 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* pattern *****************************************************************/
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
GimpPattern *
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_get_pattern (GimpContext *context)
|
1999-06-19 02:29: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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
1999-06-19 02:29:27 +08:00
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
return context->pattern;
|
1999-06-19 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_set_pattern (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPattern *pattern)
|
1999-06-19 02:29: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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_PATTERN);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_pattern (context, pattern);
|
|
|
|
}
|
1999-06-19 02:29:27 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_pattern_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[PATTERN_CHANGED], 0,
|
|
|
|
context->pattern);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
/* the active pattern was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_pattern_dirty (GimpPattern *pattern,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-05 01:34:30 +08:00
|
|
|
{
|
|
|
|
g_free (context->pattern_name);
|
|
|
|
context->pattern_name = g_strdup (GIMP_OBJECT (pattern)->name);
|
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
/* the global pattern list is there again after refresh */
|
|
|
|
static void
|
|
|
|
gimp_context_pattern_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-12 11:27:28 +08:00
|
|
|
{
|
|
|
|
GimpPattern *pattern;
|
|
|
|
|
|
|
|
if (! context->pattern_name)
|
2001-07-11 20:39:49 +08:00
|
|
|
context->pattern_name = g_strdup (context->gimp->config->default_pattern);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
pattern = gimp_context_find_object (context, container,
|
|
|
|
context->pattern_name,
|
|
|
|
gimp_pattern_get_standard ());
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_pattern (context, pattern);
|
2001-02-12 11:27:28 +08:00
|
|
|
}
|
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
/* the active pattern disappeared */
|
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_pattern_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPattern *pattern,
|
|
|
|
GimpContext *context)
|
2001-02-05 01:34:30 +08:00
|
|
|
{
|
|
|
|
if (pattern == context->pattern)
|
|
|
|
{
|
|
|
|
context->pattern = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (pattern,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_pattern_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (pattern);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_pattern_list_thaw (container, context);
|
2001-02-05 01:34:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
|
|
|
gimp_context_real_set_pattern (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPattern *pattern)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
1999-11-14 18:50:19 +08:00
|
|
|
if (! standard_pattern)
|
2001-02-14 22:57:14 +08:00
|
|
|
standard_pattern = GIMP_PATTERN (gimp_pattern_get_standard ());
|
1999-06-20 21:53:15 +08:00
|
|
|
|
1999-11-14 18:50:19 +08:00
|
|
|
if (context->pattern == pattern)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->pattern_name && pattern != standard_pattern)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
g_free (context->pattern_name);
|
|
|
|
context->pattern_name = NULL;
|
|
|
|
}
|
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
/* disconnect from the old pattern's signals */
|
|
|
|
if (context->pattern)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->pattern,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_pattern_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->pattern);
|
2001-02-05 01:34:30 +08:00
|
|
|
}
|
|
|
|
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
context->pattern = pattern;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
if (pattern)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (pattern);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (pattern, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_pattern_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2001-02-05 01:34:30 +08:00
|
|
|
|
|
|
|
if (pattern != standard_pattern)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->pattern_name = g_strdup (GIMP_OBJECT (pattern)->name);
|
2001-02-05 01:34:30 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "pattern");
|
2000-02-23 01:06:44 +08:00
|
|
|
gimp_context_pattern_changed (context);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
}
|
1999-06-20 21:53:15 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
/* gradient ****************************************************************/
|
|
|
|
|
2001-02-11 03:35:29 +08:00
|
|
|
GimpGradient *
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
gimp_context_get_gradient (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +08:00
|
|
|
|
|
|
|
return context->gradient;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-02-11 03:35:29 +08:00
|
|
|
gimp_context_set_gradient (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpGradient *gradient)
|
added the possibility to store the current tool, FG/BG color, brush,
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
1999-10-17 20:28:38 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_GRADIENT);
|
1999-10-19 23:52:32 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_gradient (context, gradient);
|
|
|
|
}
|
1999-06-20 21:53:15 +08:00
|
|
|
|
2000-02-23 01:06:44 +08:00
|
|
|
void
|
|
|
|
gimp_context_gradient_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2000-02-23 01:06:44 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[GRADIENT_CHANGED], 0,
|
|
|
|
context->gradient);
|
2000-02-23 01:06:44 +08:00
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
/* the active gradient was modified */
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_gradient_dirty (GimpGradient *gradient,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
1999-10-19 23:52:32 +08:00
|
|
|
{
|
2001-02-12 11:27:28 +08:00
|
|
|
g_free (context->gradient_name);
|
|
|
|
context->gradient_name = g_strdup (GIMP_OBJECT (gradient)->name);
|
1999-06-19 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
/* the global gradient list is there again after refresh */
|
1999-10-19 23:52:32 +08:00
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_gradient_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-02-11 03:35:29 +08:00
|
|
|
GimpGradient *gradient;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
if (! context->gradient_name)
|
2001-07-11 20:39:49 +08:00
|
|
|
context->gradient_name = g_strdup (context->gimp->config->default_gradient);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gradient = gimp_context_find_object (context, container,
|
|
|
|
context->gradient_name,
|
|
|
|
gimp_gradient_get_standard ());
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_gradient (context, gradient);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
/* the active gradient disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_gradient_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpGradient *gradient,
|
|
|
|
GimpContext *context)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-02-12 11:27:28 +08:00
|
|
|
if (gradient == context->gradient)
|
|
|
|
{
|
|
|
|
context->gradient = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (gradient,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_gradient_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gradient);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_gradient_list_thaw (container, context);
|
2001-02-12 11:27:28 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_real_set_gradient (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpGradient *gradient)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-02-12 11:27:28 +08:00
|
|
|
if (! standard_gradient)
|
2001-02-14 22:57:14 +08:00
|
|
|
standard_gradient = GIMP_GRADIENT (gimp_gradient_get_standard ());
|
2001-02-12 11:27:28 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (context->gradient == gradient)
|
2001-02-12 11:27:28 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->gradient_name && gradient != standard_gradient)
|
|
|
|
{
|
|
|
|
g_free (context->gradient_name);
|
|
|
|
context->gradient_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old gradient's signals */
|
|
|
|
if (context->gradient)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->gradient,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_gradient_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->gradient);
|
2001-02-12 11:27:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context->gradient = gradient;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
if (gradient)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (gradient);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (gradient, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_gradient_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
1999-11-14 18:50:19 +08:00
|
|
|
|
2001-02-12 11:27:28 +08:00
|
|
|
if (gradient != standard_gradient)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->gradient_name = g_strdup (GIMP_OBJECT (gradient)->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "gradient");
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_gradient_changed (context);
|
|
|
|
}
|
2001-01-12 07:36:59 +08:00
|
|
|
|
2001-02-12 00:14:25 +08:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* palette *****************************************************************/
|
|
|
|
|
|
|
|
GimpPalette *
|
|
|
|
gimp_context_get_palette (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2001-02-12 00:14:25 +08:00
|
|
|
|
|
|
|
return context->palette;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_palette (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPalette *palette)
|
2001-02-12 00:14:25 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_PALETTE);
|
2001-02-12 00:14:25 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_palette (context, palette);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_palette_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-02-12 00:14:25 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[PALETTE_CHANGED], 0,
|
|
|
|
context->palette);
|
2001-02-12 00:14:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active palette was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_palette_dirty (GimpPalette *palette,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-12 00:14:25 +08:00
|
|
|
{
|
|
|
|
g_free (context->palette_name);
|
|
|
|
context->palette_name = g_strdup (GIMP_OBJECT (palette)->name);
|
|
|
|
}
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/* the global palette list is there again after refresh */
|
2001-02-12 11:27:28 +08:00
|
|
|
static void
|
|
|
|
gimp_context_palette_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-02-12 11:27:28 +08:00
|
|
|
{
|
|
|
|
GimpPalette *palette;
|
|
|
|
|
|
|
|
if (! context->palette_name)
|
2001-07-11 20:39:49 +08:00
|
|
|
context->palette_name = g_strdup (context->gimp->config->default_palette);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
palette = gimp_context_find_object (context, container,
|
|
|
|
context->palette_name,
|
|
|
|
gimp_palette_get_standard ());
|
2001-02-12 11:27:28 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_palette (context, palette);
|
2001-02-12 11:27:28 +08:00
|
|
|
}
|
|
|
|
|
2001-02-12 00:14:25 +08:00
|
|
|
/* the active palette disappeared */
|
|
|
|
static void
|
2001-02-12 11:27:28 +08:00
|
|
|
gimp_context_palette_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPalette *palette,
|
|
|
|
GimpContext *context)
|
2001-02-12 00:14:25 +08:00
|
|
|
{
|
|
|
|
if (palette == context->palette)
|
|
|
|
{
|
|
|
|
context->palette = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (palette,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_palette_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (palette);
|
2001-02-12 11:27:28 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_palette_list_thaw (container, context);
|
2001-02-12 00:14:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_palette (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpPalette *palette)
|
2001-02-12 00:14:25 +08:00
|
|
|
{
|
|
|
|
if (! standard_palette)
|
2001-02-14 22:57:14 +08:00
|
|
|
standard_palette = GIMP_PALETTE (gimp_palette_get_standard ());
|
2001-02-12 00:14:25 +08:00
|
|
|
|
|
|
|
if (context->palette == palette)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->palette_name && palette != standard_palette)
|
|
|
|
{
|
|
|
|
g_free (context->palette_name);
|
|
|
|
context->palette_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old palette's signals */
|
|
|
|
if (context->palette)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->palette,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_palette_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->palette);
|
2001-02-12 00:14:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context->palette = palette;
|
|
|
|
|
|
|
|
if (palette)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (palette);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (palette, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_palette_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2001-02-12 00:14:25 +08:00
|
|
|
|
|
|
|
if (palette != standard_palette)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->palette_name = g_strdup (GIMP_OBJECT (palette)->name);
|
2001-02-12 00:14:25 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "palette");
|
2001-02-12 00:14:25 +08:00
|
|
|
gimp_context_palette_changed (context);
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* font *****************************************************************/
|
|
|
|
|
|
|
|
GimpFont *
|
|
|
|
gimp_context_get_font (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return context->font;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_font (GimpContext *context,
|
|
|
|
GimpFont *font)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_FONT);
|
|
|
|
|
|
|
|
gimp_context_real_set_font (context, font);
|
|
|
|
}
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
const gchar *
|
|
|
|
gimp_context_get_font_name (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return (context->font ?
|
|
|
|
gimp_object_get_name (GIMP_OBJECT (context->font)) : NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_font_name (GimpContext *context,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
GimpObject *font;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
font = gimp_container_get_child_by_name (context->gimp->fonts, name);
|
|
|
|
|
|
|
|
gimp_context_set_font (context, GIMP_FONT (font));
|
|
|
|
}
|
|
|
|
|
2003-03-26 06:06:03 +08:00
|
|
|
void
|
|
|
|
gimp_context_font_changed (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[FONT_CHANGED], 0,
|
|
|
|
context->font);
|
2003-03-26 06:06:03 +08:00
|
|
|
}
|
|
|
|
|
2004-03-12 02:47:37 +08:00
|
|
|
/* the active font was modified */
|
2003-03-26 06:06:03 +08:00
|
|
|
static void
|
|
|
|
gimp_context_font_dirty (GimpFont *font,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
g_free (context->font_name);
|
|
|
|
context->font_name = g_strdup (GIMP_OBJECT (font)->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the global font list is there again after refresh */
|
|
|
|
static void
|
|
|
|
gimp_context_font_list_thaw (GimpContainer *container,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
GimpFont *font;
|
|
|
|
|
|
|
|
if (! context->font_name)
|
|
|
|
context->font_name = g_strdup (context->gimp->config->default_font);
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
font = gimp_context_find_object (context, container,
|
|
|
|
context->font_name,
|
|
|
|
gimp_font_get_standard ());
|
2003-03-26 06:06:03 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_font (context, font);
|
2003-03-26 06:06:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active font disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_font_removed (GimpContainer *container,
|
|
|
|
GimpFont *font,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
if (font == context->font)
|
|
|
|
{
|
|
|
|
context->font = NULL;
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (font,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_font_dirty,
|
|
|
|
context);
|
2003-03-26 06:06:03 +08:00
|
|
|
g_object_unref (font);
|
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_font_list_thaw (container, context);
|
2003-03-26 06:06:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_font (GimpContext *context,
|
|
|
|
GimpFont *font)
|
|
|
|
{
|
|
|
|
if (! standard_font)
|
|
|
|
standard_font = GIMP_FONT (gimp_font_get_standard ());
|
|
|
|
|
|
|
|
if (context->font == font)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (context->font_name && font != standard_font)
|
|
|
|
{
|
|
|
|
g_free (context->font_name);
|
|
|
|
context->font_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old font's signals */
|
|
|
|
if (context->font)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (context->font,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_font_dirty,
|
|
|
|
context);
|
2003-03-26 06:06:03 +08:00
|
|
|
g_object_unref (context->font);
|
|
|
|
}
|
|
|
|
|
|
|
|
context->font = font;
|
|
|
|
|
|
|
|
if (font)
|
|
|
|
{
|
|
|
|
g_object_ref (font);
|
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (font, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_font_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2003-03-26 06:06:03 +08:00
|
|
|
|
|
|
|
if (font != standard_font)
|
2004-07-04 04:27:28 +08:00
|
|
|
context->font_name = g_strdup (GIMP_OBJECT (font)->name);
|
2003-03-26 06:06:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (context), "font");
|
|
|
|
gimp_context_font_changed (context);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* buffer ******************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
static GimpBuffer *standard_buffer = NULL;
|
|
|
|
*/
|
|
|
|
|
|
|
|
GimpBuffer *
|
|
|
|
gimp_context_get_buffer (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
return context->buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_buffer (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBuffer *buffer)
|
2001-06-26 20:09:43 +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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_BUFFER);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_buffer (context, buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_buffer_changed (GimpContext *context)
|
|
|
|
{
|
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
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[BUFFER_CHANGED], 0,
|
|
|
|
context->buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active buffer was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_buffer_dirty (GimpBuffer *buffer,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
|
|
|
g_free (context->buffer_name);
|
|
|
|
context->buffer_name = g_strdup (GIMP_OBJECT (buffer)->name);
|
|
|
|
}
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/* the global buffer list is there again after refresh */
|
2001-06-26 20:09:43 +08:00
|
|
|
static void
|
|
|
|
gimp_context_buffer_list_thaw (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpContext *context)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
|
|
|
GimpBuffer *buffer;
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/*
|
2001-06-26 20:09:43 +08:00
|
|
|
if (! context->buffer_name)
|
2001-07-11 20:39:49 +08:00
|
|
|
context->buffer_name = g_strdup (context->gimp->config->default_buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
*/
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
buffer = gimp_context_find_object (context, container,
|
|
|
|
context->buffer_name,
|
|
|
|
NULL /* gimp_buffer_get_standard () */);
|
|
|
|
|
|
|
|
if (buffer)
|
2003-02-10 01:32:52 +08:00
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_buffer (context, buffer);
|
2003-02-10 01:32:52 +08:00
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
else
|
2003-02-10 01:32:52 +08:00
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "buffer");
|
|
|
|
gimp_context_buffer_changed (context);
|
2003-02-10 01:32:52 +08:00
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active buffer disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_buffer_removed (GimpContainer *container,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBuffer *buffer,
|
|
|
|
GimpContext *context)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
|
|
|
if (buffer == context->buffer)
|
|
|
|
{
|
|
|
|
context->buffer = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (buffer,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_buffer_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_buffer_list_thaw (container, context);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_buffer (GimpContext *context,
|
2004-07-04 04:27:28 +08:00
|
|
|
GimpBuffer *buffer)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
if (! standard_buffer)
|
|
|
|
standard_buffer = GIMP_BUFFER (gimp_buffer_get_standard ());
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (context->buffer == buffer)
|
|
|
|
return;
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->buffer_name /* && buffer != standard_buffer */)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
|
|
|
g_free (context->buffer_name);
|
|
|
|
context->buffer_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old buffer's signals */
|
|
|
|
if (context->buffer)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->buffer,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_buffer_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->buffer);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context->buffer = buffer;
|
|
|
|
|
|
|
|
if (buffer)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (buffer);
|
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
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (buffer, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_buffer_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
if (buffer != standard_buffer)
|
|
|
|
*/
|
2004-01-30 00:34:41 +08:00
|
|
|
context->buffer_name = g_strdup (GIMP_OBJECT (buffer)->name);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "buffer");
|
2001-06-26 20:09:43 +08:00
|
|
|
gimp_context_buffer_changed (context);
|
|
|
|
}
|
|
|
|
|
2001-10-23 01:27:46 +08:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* imagefile ***************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
static GimpImagefile *standard_imagefile = NULL;
|
|
|
|
*/
|
|
|
|
|
|
|
|
GimpImagefile *
|
|
|
|
gimp_context_get_imagefile (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return context->imagefile;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_imagefile (GimpContext *context,
|
|
|
|
GimpImagefile *imagefile)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
2003-02-10 01:32:52 +08:00
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_IMAGEFILE);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
|
|
|
gimp_context_real_set_imagefile (context, imagefile);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_imagefile_changed (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[IMAGEFILE_CHANGED], 0,
|
|
|
|
context->imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active imagefile was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_imagefile_dirty (GimpImagefile *imagefile,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
g_free (context->imagefile_name);
|
|
|
|
context->imagefile_name = g_strdup (GIMP_OBJECT (imagefile)->name);
|
|
|
|
}
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/* the global imagefile list is there again after refresh */
|
2001-10-23 01:27:46 +08:00
|
|
|
static void
|
|
|
|
gimp_context_imagefile_list_thaw (GimpContainer *container,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
GimpImagefile *imagefile;
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/*
|
2001-10-23 01:27:46 +08:00
|
|
|
if (! context->imagefile_name)
|
|
|
|
context->imagefile_name = g_strdup (context->gimp->config->default_imagefile);
|
|
|
|
*/
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
imagefile = gimp_context_find_object (context, container,
|
|
|
|
context->imagefile_name,
|
|
|
|
NULL /* gimp_imagefile_get_standard () */);
|
|
|
|
|
|
|
|
if (imagefile)
|
2003-02-10 01:32:52 +08:00
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_imagefile (context, imagefile);
|
2003-02-10 01:32:52 +08:00
|
|
|
}
|
2001-10-23 01:27:46 +08:00
|
|
|
else
|
2003-02-10 01:32:52 +08:00
|
|
|
{
|
|
|
|
g_object_notify (G_OBJECT (context), "imagefile");
|
|
|
|
gimp_context_imagefile_changed (context);
|
|
|
|
}
|
2001-10-23 01:27:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active imagefile disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_imagefile_removed (GimpContainer *container,
|
|
|
|
GimpImagefile *imagefile,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
if (imagefile == context->imagefile)
|
|
|
|
{
|
|
|
|
context->imagefile = NULL;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (imagefile,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_imagefile_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_imagefile_list_thaw (container, context);
|
2001-10-23 01:27:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_imagefile (GimpContext *context,
|
|
|
|
GimpImagefile *imagefile)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
if (! standard_imagefile)
|
|
|
|
standard_imagefile = GIMP_IMAGEFILE (gimp_imagefile_get_standard ());
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (context->imagefile == imagefile)
|
|
|
|
return;
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->imagefile_name /* && imagefile != standard_imagefile */)
|
2001-10-23 01:27:46 +08:00
|
|
|
{
|
|
|
|
g_free (context->imagefile_name);
|
|
|
|
context->imagefile_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old imagefile's signals */
|
|
|
|
if (context->imagefile)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (context->imagefile,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_imagefile_dirty,
|
|
|
|
context);
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (context->imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
context->imagefile = imagefile;
|
|
|
|
|
|
|
|
if (imagefile)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (imagefile);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (imagefile, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_imagefile_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2001-10-23 01:27:46 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
if (imagefile != standard_imagefile)
|
|
|
|
*/
|
2004-01-30 00:34:41 +08:00
|
|
|
context->imagefile_name = g_strdup (GIMP_OBJECT (imagefile)->name);
|
2001-10-23 01:27:46 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 01:32:52 +08:00
|
|
|
g_object_notify (G_OBJECT (context), "imagefile");
|
2001-10-23 01:27:46 +08:00
|
|
|
gimp_context_imagefile_changed (context);
|
|
|
|
}
|
2003-04-06 03:56:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* template ***************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
static GimpTemplate *standard_template = NULL;
|
|
|
|
*/
|
|
|
|
|
|
|
|
GimpTemplate *
|
|
|
|
gimp_context_get_template (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return context->template;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_set_template (GimpContext *context,
|
|
|
|
GimpTemplate *template)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
context_find_defined (context, GIMP_CONTEXT_PROP_TEMPLATE);
|
|
|
|
|
|
|
|
gimp_context_real_set_template (context, template);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_context_template_changed (GimpContext *context)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
|
|
|
|
|
|
|
g_signal_emit (context,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_signals[TEMPLATE_CHANGED], 0,
|
|
|
|
context->template);
|
2003-04-06 03:56:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* the active template was modified */
|
|
|
|
static void
|
|
|
|
gimp_context_template_dirty (GimpTemplate *template,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
g_free (context->template_name);
|
|
|
|
context->template_name = g_strdup (GIMP_OBJECT (template)->name);
|
|
|
|
}
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/* the global template list is there again after refresh */
|
2003-04-06 03:56:38 +08:00
|
|
|
static void
|
|
|
|
gimp_context_template_list_thaw (GimpContainer *container,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
GimpTemplate *template;
|
2003-04-06 03:56:38 +08:00
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
/*
|
2003-04-06 03:56:38 +08:00
|
|
|
if (! context->template_name)
|
|
|
|
context->template_name = g_strdup (context->gimp->config->default_template);
|
|
|
|
*/
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
template = gimp_context_find_object (context, container,
|
|
|
|
context->template_name,
|
|
|
|
NULL /* gimp_template_get_standard () */);
|
|
|
|
|
|
|
|
if (template)
|
2003-04-06 03:56:38 +08:00
|
|
|
{
|
2004-01-30 00:34:41 +08:00
|
|
|
gimp_context_real_set_template (context, template);
|
2003-04-06 03:56:38 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_object_notify (G_OBJECT (context), "template");
|
|
|
|
gimp_context_template_changed (context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the active template disappeared */
|
|
|
|
static void
|
|
|
|
gimp_context_template_removed (GimpContainer *container,
|
|
|
|
GimpTemplate *template,
|
|
|
|
GimpContext *context)
|
|
|
|
{
|
|
|
|
if (template == context->template)
|
|
|
|
{
|
|
|
|
context->template = NULL;
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (template,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_template_dirty,
|
|
|
|
context);
|
2003-04-06 03:56:38 +08:00
|
|
|
g_object_unref (template);
|
|
|
|
|
|
|
|
if (! gimp_container_frozen (container))
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_template_list_thaw (container, context);
|
2003-04-06 03:56:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_context_real_set_template (GimpContext *context,
|
|
|
|
GimpTemplate *template)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
if (! standard_template)
|
|
|
|
standard_template = GIMP_TEMPLATE (gimp_template_get_standard ());
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (context->template == template)
|
|
|
|
return;
|
|
|
|
|
2004-01-30 00:34:41 +08:00
|
|
|
if (context->template_name /* && template != standard_template */)
|
2003-04-06 03:56:38 +08:00
|
|
|
{
|
|
|
|
g_free (context->template_name);
|
|
|
|
context->template_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* disconnect from the old template's signals */
|
|
|
|
if (context->template)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_by_func (context->template,
|
2004-07-04 04:27:28 +08:00
|
|
|
gimp_context_template_dirty,
|
|
|
|
context);
|
2003-04-06 03:56:38 +08:00
|
|
|
g_object_unref (context->template);
|
|
|
|
}
|
|
|
|
|
|
|
|
context->template = template;
|
|
|
|
|
|
|
|
if (template)
|
|
|
|
{
|
|
|
|
g_object_ref (template);
|
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect_object (template, "name-changed",
|
2004-07-04 04:27:28 +08:00
|
|
|
G_CALLBACK (gimp_context_template_dirty),
|
|
|
|
context,
|
|
|
|
0);
|
2003-04-06 03:56:38 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
if (template != standard_template)
|
|
|
|
*/
|
2004-01-30 00:34:41 +08:00
|
|
|
context->template_name = g_strdup (GIMP_OBJECT (template)->name);
|
2003-04-06 03:56:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (context), "template");
|
|
|
|
gimp_context_template_changed (context);
|
|
|
|
}
|
2004-01-30 00:34:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* utility functions *******************************************************/
|
|
|
|
|
|
|
|
static gpointer
|
|
|
|
gimp_context_find_object (GimpContext *context,
|
|
|
|
GimpContainer *container,
|
|
|
|
const gchar *object_name,
|
|
|
|
gpointer standard_object)
|
|
|
|
{
|
|
|
|
GimpObject *object = NULL;
|
|
|
|
|
|
|
|
if (object_name)
|
|
|
|
object = gimp_container_get_child_by_name (container, object_name);
|
|
|
|
|
2005-04-13 05:36:54 +08:00
|
|
|
if (! object && ! gimp_container_is_empty (container))
|
2004-01-30 00:34:41 +08:00
|
|
|
object = gimp_container_get_child_by_index (container, 0);
|
|
|
|
|
|
|
|
if (! object)
|
|
|
|
object = standard_object;
|
|
|
|
|
|
|
|
return object;
|
|
|
|
}
|