mirror of https://github.com/GNOME/gimp.git
configure.in depend on glib >= 2.12.3.
2007-01-12 Sven Neumann <sven@gimp.org> * configure.in * app/sanity.c: depend on glib >= 2.12.3. * HACKING: updated branches. * libgimpwidgets/gimpintstore.c: added a construct-only property that allows to specify the GType of the user-data column. svn path=/trunk/; revision=21692
This commit is contained in:
parent
61cb2a152c
commit
5bf710beec
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2007-01-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in
|
||||
* app/sanity.c: depend on glib >= 2.12.3.
|
||||
|
||||
* HACKING: updated branches.
|
||||
|
||||
* libgimpwidgets/gimpintstore.c: added a construct-only property
|
||||
that allows to specify the GType of the user-data column.
|
||||
|
||||
2007-01-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpstrokeeditor.c: fixed memory management of dash
|
||||
|
|
8
HACKING
8
HACKING
|
@ -84,10 +84,10 @@ anonymous CVS server:
|
|||
The interesting modules and the suggested stable branches to use are:
|
||||
|
||||
* gimp
|
||||
* glib (glib-2-8)
|
||||
* atk (gnome-2-12)
|
||||
* pango (pango-1-10)
|
||||
* gtk+ (gtk-2-8)
|
||||
* glib (glib-2-12)
|
||||
* atk (gnome-2-16)
|
||||
* pango (pango-1-14)
|
||||
* gtk+ (gtk-2-10)
|
||||
* libart_lgpl
|
||||
* gtkhtml2
|
||||
* intltool
|
||||
|
|
|
@ -87,8 +87,8 @@ sanity_check_glib (void)
|
|||
const gchar *mismatch;
|
||||
|
||||
#define GLIB_REQUIRED_MAJOR 2
|
||||
#define GLIB_REQUIRED_MINOR 10
|
||||
#define GLIB_REQUIRED_MICRO 2
|
||||
#define GLIB_REQUIRED_MINOR 12
|
||||
#define GLIB_REQUIRED_MICRO 3
|
||||
|
||||
mismatch = glib_check_version (GLIB_REQUIRED_MAJOR,
|
||||
GLIB_REQUIRED_MINOR,
|
||||
|
|
|
@ -40,7 +40,7 @@ m4_define([gimp_stable],
|
|||
m4_define([gimp_full_name], [GNU Image Manipulation Program])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.10.2])
|
||||
m4_define([glib_required_version], [2.12.3])
|
||||
m4_define([gtk_required_version], [2.8.17])
|
||||
m4_define([gdk_pixbuf_required_version], [gtk_required_version])
|
||||
m4_define([pangoft2_required_version], [1.12.2])
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpintstore.c
|
||||
* Copyright (C) 2004 Sven Neumann <sven@gimp.org>
|
||||
* Copyright (C) 2004-2007 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -33,8 +33,34 @@
|
|||
#include "libgimp/libgimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_USER_DATA_TYPE
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GType user_data_type;
|
||||
} GimpIntStorePrivate;
|
||||
|
||||
|
||||
static GObject * gimp_int_store_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params);
|
||||
|
||||
static void gimp_int_store_tree_model_init (GtkTreeModelIface *iface);
|
||||
|
||||
static void gimp_int_store_finalize (GObject *object);
|
||||
static void gimp_int_store_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_int_store_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gimp_int_store_row_inserted (GtkTreeModel *model,
|
||||
GtkTreePath *path,
|
||||
GtkTreeIter *iter);
|
||||
|
@ -45,6 +71,9 @@ G_DEFINE_TYPE_WITH_CODE (GimpIntStore, gimp_int_store, GTK_TYPE_LIST_STORE,
|
|||
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
|
||||
gimp_int_store_tree_model_init))
|
||||
|
||||
#define GIMP_INT_STORE_GET_PRIVATE(obj) \
|
||||
G_TYPE_INSTANCE_GET_PRIVATE (obj, GIMP_TYPE_INT_STORE, GimpIntStorePrivate)
|
||||
|
||||
#define parent_class gimp_int_store_parent_class
|
||||
|
||||
static GtkTreeModelIface *parent_iface = NULL;
|
||||
|
@ -55,26 +84,67 @@ gimp_int_store_class_init (GimpIntStoreClass *klass)
|
|||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gimp_int_store_finalize;
|
||||
object_class->constructor = gimp_int_store_constructor;
|
||||
object_class->finalize = gimp_int_store_finalize;
|
||||
object_class->set_property = gimp_int_store_set_property;
|
||||
object_class->get_property = gimp_int_store_get_property;
|
||||
|
||||
/**
|
||||
* GimpIntStore:user-data-type:
|
||||
*
|
||||
* Allows to set the #GType for the GIMP_INT_STORE_USER_DATA column.
|
||||
*
|
||||
* You need to set this property when constructing the store if you want
|
||||
* to use the GIMP_INT_STORE_USER_DATA column and want to have the store
|
||||
* handle ref-counting of your user data.
|
||||
*
|
||||
* Since: GIMP 2.4
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_USER_DATA_TYPE,
|
||||
g_param_spec_gtype ("user-data-type",
|
||||
NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GimpIntStorePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_int_store_init (GimpIntStore *store)
|
||||
{
|
||||
GType types[GIMP_INT_STORE_NUM_COLUMNS];
|
||||
store->empty_iter = NULL;
|
||||
}
|
||||
|
||||
static GObject *
|
||||
gimp_int_store_constructor (GType type,
|
||||
guint n_params,
|
||||
GObjectConstructParam *params)
|
||||
{
|
||||
GObject *object;
|
||||
GimpIntStore *store;
|
||||
GimpIntStorePrivate *priv;
|
||||
GType types[GIMP_INT_STORE_NUM_COLUMNS];
|
||||
|
||||
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
||||
|
||||
store = GIMP_INT_STORE (object);
|
||||
priv = GIMP_INT_STORE_GET_PRIVATE (store);
|
||||
|
||||
types[GIMP_INT_STORE_VALUE] = G_TYPE_INT;
|
||||
types[GIMP_INT_STORE_LABEL] = G_TYPE_STRING;
|
||||
types[GIMP_INT_STORE_STOCK_ID] = G_TYPE_STRING;
|
||||
types[GIMP_INT_STORE_PIXBUF] = GDK_TYPE_PIXBUF;
|
||||
types[GIMP_INT_STORE_USER_DATA] = G_TYPE_POINTER;
|
||||
|
||||
store->empty_iter = NULL;
|
||||
types[GIMP_INT_STORE_USER_DATA] = (priv->user_data_type != G_TYPE_NONE ?
|
||||
priv->user_data_type : G_TYPE_POINTER);
|
||||
|
||||
gtk_list_store_set_column_types (GTK_LIST_STORE (store),
|
||||
GIMP_INT_STORE_NUM_COLUMNS, types);
|
||||
|
||||
gimp_int_store_add_empty (store);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -99,6 +169,44 @@ gimp_int_store_finalize (GObject *object)
|
|||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_int_store_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpIntStorePrivate *priv = GIMP_INT_STORE_GET_PRIVATE (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_USER_DATA_TYPE:
|
||||
priv->user_data_type = g_value_get_gtype (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_int_store_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpIntStorePrivate *priv = GIMP_INT_STORE_GET_PRIVATE (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_USER_DATA_TYPE:
|
||||
g_value_set_gtype (value, priv->user_data_type);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_int_store_row_inserted (GtkTreeModel *model,
|
||||
GtkTreePath *path,
|
||||
|
|
Loading…
Reference in New Issue