mirror of https://github.com/GNOME/gimp.git
whitespace fix.
2005-06-03 Manish Singh <yosh@gimp.org> * libgimpcolor/gimprgb.h: whitespace fix. * libgimpwidgets/gimpchainbutton.h * libgimpwidgets/gimpwidgetsenums.[ch]: move GimpChainPosition to a registered enum, and register GimpSizeEntryUpdatePolicy as as well. * libgimp/gimpuitypes.h * libgimp/gimpdrawablecombobox.[ch]: turn these into GObjects with their own types. * libgimp/gimpimagecombobox.c: use G_DEFINE_TYPE.
This commit is contained in:
parent
b77ca997a7
commit
24b3e080f6
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2005-06-03 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* libgimpcolor/gimprgb.h: whitespace fix.
|
||||
|
||||
* libgimpwidgets/gimpchainbutton.h
|
||||
* libgimpwidgets/gimpwidgetsenums.[ch]: move GimpChainPosition
|
||||
to a registered enum, and register GimpSizeEntryUpdatePolicy as
|
||||
as well.
|
||||
|
||||
* libgimp/gimpuitypes.h
|
||||
* libgimp/gimpdrawablecombobox.[ch]: turn these into GObjects
|
||||
with their own types.
|
||||
|
||||
* libgimp/gimpimagecombobox.c: use G_DEFINE_TYPE.
|
||||
|
||||
2005-06-03 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* tools/pdbgen/enumcode.pl: make _gimp_enums_init public, so
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "gimp.h"
|
||||
|
||||
#include "gimpuitypes.h"
|
||||
#include "gimpdrawablecombobox.h"
|
||||
#include "gimppixbuf.h"
|
||||
|
||||
|
@ -38,7 +39,42 @@
|
|||
#define WIDTH_REQUEST 200
|
||||
|
||||
|
||||
static gint gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
typedef struct _GimpDrawableComboBoxClass GimpDrawableComboBoxClass;
|
||||
typedef struct _GimpChannelComboBoxClass GimpChannelComboBoxClass;
|
||||
typedef struct _GimpLayerComboBoxClass GimpLayerComboBoxClass;
|
||||
|
||||
struct _GimpDrawableComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpDrawableComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
struct _GimpChannelComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpChannelComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
struct _GimpLayerComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpLayerComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
static void gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
gint32 image,
|
||||
gint num_drawables,
|
||||
gint32 *drawables,
|
||||
|
@ -61,6 +97,31 @@ static const GtkTargetEntry targets[] =
|
|||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpDrawableComboBox,
|
||||
gimp_drawable_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_drawable_combo_box_class_init (GimpDrawableComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_drawable_combo_box_init (GimpDrawableComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 2,
|
||||
GDK_ACTION_COPY);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_combo_box_new:
|
||||
* @constraint: a #GimpDrawableConstraintFunc or %NULL
|
||||
|
@ -91,7 +152,7 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_DRAWABLE_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -125,18 +186,33 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpChannelComboBox,
|
||||
gimp_channel_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_channel_combo_box_class_init (GimpChannelComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_combo_box_init (GimpChannelComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 2,
|
||||
targets, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +238,7 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_CHANNEL_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -189,18 +265,33 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpLayerComboBox,
|
||||
gimp_layer_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_layer_combo_box_class_init (GimpLayerComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_combo_box_init (GimpLayerComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 1,
|
||||
targets + 1, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,7 +317,7 @@ gimp_layer_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_CHANNEL_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -253,21 +344,10 @@ gimp_layer_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets + 1, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
static gint
|
||||
static void
|
||||
gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
gint32 image,
|
||||
gint num_drawables,
|
||||
|
@ -276,7 +356,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
gpointer data)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gint added = 0;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < num_drawables; i++)
|
||||
|
@ -305,7 +384,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
GIMP_INT_STORE_LABEL, label,
|
||||
GIMP_INT_STORE_PIXBUF, thumb,
|
||||
-1);
|
||||
added++;
|
||||
|
||||
if (thumb)
|
||||
g_object_unref (thumb);
|
||||
|
@ -313,8 +391,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
g_free (label);
|
||||
}
|
||||
}
|
||||
|
||||
return added;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -29,11 +29,28 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#define GIMP_TYPE_DRAWABLE_COMBO_BOX (gimp_drawable_combo_box_get_type ())
|
||||
#define GIMP_DRAWABLE_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DRAWABLE_COMBO_BOX, GimpDrawableComboBox))
|
||||
#define GIMP_IS_DRAWABLE_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DRAWABLE_COMBO_BOX)
|
||||
|
||||
#define GIMP_TYPE_CHANNEL_COMBO_BOX (gimp_channel_combo_box_get_type ())
|
||||
#define GIMP_CHANNEL_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHANNEL_COMBO_BOX, GimpChannelComboBox))
|
||||
#define GIMP_IS_CHANNEL_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CHANNEL_COMBO_BOX)
|
||||
|
||||
#define GIMP_TYPE_LAYER_COMBO_BOX (gimp_layer_combo_box_get_type ())
|
||||
#define GIMP_LAYER_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_COMBO_BOX, GimpLayerComboBox))
|
||||
#define GIMP_IS_LAYER_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LAYER_COMBO_BOX)
|
||||
|
||||
|
||||
typedef gboolean (* GimpDrawableConstraintFunc) (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
|
||||
|
||||
GType gimp_drawable_combo_box_get_type (void) G_GNUC_CONST;
|
||||
GType gimp_channel_combo_box_get_type (void) G_GNUC_CONST;
|
||||
GType gimp_layer_combo_box_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
||||
gpointer data);
|
||||
GtkWidget * gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
||||
|
|
|
@ -52,9 +52,6 @@ struct _GimpImageComboBoxClass
|
|||
};
|
||||
|
||||
|
||||
static void gimp_image_combo_box_class_init (GimpImageComboBoxClass *klass);
|
||||
static void gimp_image_combo_box_init (GimpImageComboBox *combo_box);
|
||||
|
||||
static void gimp_image_combo_box_model_add (GtkListStore *store,
|
||||
gint num_images,
|
||||
gint32 *images,
|
||||
|
@ -73,34 +70,9 @@ static void gimp_image_combo_box_drag_data_received (GtkWidget *widget,
|
|||
static const GtkTargetEntry target = { "application/x-gimp-image-id", 0 };
|
||||
|
||||
|
||||
GType
|
||||
gimp_image_combo_box_get_type (void)
|
||||
{
|
||||
static GType combo_box_type = 0;
|
||||
|
||||
if (!combo_box_type)
|
||||
{
|
||||
static const GTypeInfo combo_box_info =
|
||||
{
|
||||
sizeof (GimpImageComboBoxClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gimp_image_combo_box_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpImageComboBox),
|
||||
0,
|
||||
(GInstanceInitFunc) gimp_image_combo_box_init
|
||||
};
|
||||
|
||||
combo_box_type = g_type_register_static (GIMP_TYPE_INT_COMBO_BOX,
|
||||
"GimpImageComboBox",
|
||||
&combo_box_info,
|
||||
0);
|
||||
}
|
||||
|
||||
return combo_box_type;
|
||||
}
|
||||
G_DEFINE_TYPE(GimpImageComboBox,
|
||||
gimp_image_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_image_combo_box_class_init (GimpImageComboBoxClass *klass)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "gimp.h"
|
||||
|
||||
#include "gimpuitypes.h"
|
||||
#include "gimpdrawablecombobox.h"
|
||||
#include "gimppixbuf.h"
|
||||
|
||||
|
@ -38,7 +39,42 @@
|
|||
#define WIDTH_REQUEST 200
|
||||
|
||||
|
||||
static gint gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
typedef struct _GimpDrawableComboBoxClass GimpDrawableComboBoxClass;
|
||||
typedef struct _GimpChannelComboBoxClass GimpChannelComboBoxClass;
|
||||
typedef struct _GimpLayerComboBoxClass GimpLayerComboBoxClass;
|
||||
|
||||
struct _GimpDrawableComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpDrawableComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
struct _GimpChannelComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpChannelComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
struct _GimpLayerComboBox
|
||||
{
|
||||
GimpIntComboBox parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpLayerComboBoxClass
|
||||
{
|
||||
GimpIntComboBoxClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
static void gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
gint32 image,
|
||||
gint num_drawables,
|
||||
gint32 *drawables,
|
||||
|
@ -61,6 +97,31 @@ static const GtkTargetEntry targets[] =
|
|||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpDrawableComboBox,
|
||||
gimp_drawable_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_drawable_combo_box_class_init (GimpDrawableComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_drawable_combo_box_init (GimpDrawableComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 2,
|
||||
GDK_ACTION_COPY);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_combo_box_new:
|
||||
* @constraint: a #GimpDrawableConstraintFunc or %NULL
|
||||
|
@ -91,7 +152,7 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_DRAWABLE_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -125,18 +186,33 @@ gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpChannelComboBox,
|
||||
gimp_channel_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_channel_combo_box_class_init (GimpChannelComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_combo_box_init (GimpChannelComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 2,
|
||||
targets, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +238,7 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_CHANNEL_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -189,18 +265,33 @@ gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
|
||||
G_DEFINE_TYPE(GimpLayerComboBox,
|
||||
gimp_layer_combo_box,
|
||||
GIMP_TYPE_INT_COMBO_BOX);
|
||||
|
||||
static void
|
||||
gimp_layer_combo_box_class_init (GimpLayerComboBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->drag_data_received = gimp_drawable_combo_box_drag_data_received;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_combo_box_init (GimpLayerComboBox *combo_box)
|
||||
{
|
||||
gtk_drag_dest_set (GTK_WIDGET (combo_box),
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets, 1,
|
||||
targets + 1, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,7 +317,7 @@ gimp_layer_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
gint num_images;
|
||||
gint i;
|
||||
|
||||
combo_box = g_object_new (GIMP_TYPE_INT_COMBO_BOX,
|
||||
combo_box = g_object_new (GIMP_TYPE_CHANNEL_COMBO_BOX,
|
||||
"width-request", WIDTH_REQUEST,
|
||||
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
|
||||
NULL);
|
||||
|
@ -253,21 +344,10 @@ gimp_layer_combo_box_new (GimpDrawableConstraintFunc constraint,
|
|||
if (gtk_tree_model_get_iter_first (model, &iter))
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_box), &iter);
|
||||
|
||||
gtk_drag_dest_set (combo_box,
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
targets + 1, 1,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
g_signal_connect (combo_box, "drag-data-received",
|
||||
G_CALLBACK (gimp_drawable_combo_box_drag_data_received),
|
||||
NULL);
|
||||
|
||||
return combo_box;
|
||||
}
|
||||
|
||||
static gint
|
||||
static void
|
||||
gimp_drawable_combo_box_model_add (GtkListStore *store,
|
||||
gint32 image,
|
||||
gint num_drawables,
|
||||
|
@ -276,7 +356,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
gpointer data)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gint added = 0;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < num_drawables; i++)
|
||||
|
@ -305,7 +384,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
GIMP_INT_STORE_LABEL, label,
|
||||
GIMP_INT_STORE_PIXBUF, thumb,
|
||||
-1);
|
||||
added++;
|
||||
|
||||
if (thumb)
|
||||
g_object_unref (thumb);
|
||||
|
@ -313,8 +391,6 @@ gimp_drawable_combo_box_model_add (GtkListStore *store,
|
|||
g_free (label);
|
||||
}
|
||||
}
|
||||
|
||||
return added;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -29,11 +29,28 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#define GIMP_TYPE_DRAWABLE_COMBO_BOX (gimp_drawable_combo_box_get_type ())
|
||||
#define GIMP_DRAWABLE_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DRAWABLE_COMBO_BOX, GimpDrawableComboBox))
|
||||
#define GIMP_IS_DRAWABLE_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DRAWABLE_COMBO_BOX)
|
||||
|
||||
#define GIMP_TYPE_CHANNEL_COMBO_BOX (gimp_channel_combo_box_get_type ())
|
||||
#define GIMP_CHANNEL_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHANNEL_COMBO_BOX, GimpChannelComboBox))
|
||||
#define GIMP_IS_CHANNEL_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CHANNEL_COMBO_BOX)
|
||||
|
||||
#define GIMP_TYPE_LAYER_COMBO_BOX (gimp_layer_combo_box_get_type ())
|
||||
#define GIMP_LAYER_COMBO_BOX (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_COMBO_BOX, GimpLayerComboBox))
|
||||
#define GIMP_IS_LAYER_COMBO_BOX (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LAYER_COMBO_BOX)
|
||||
|
||||
|
||||
typedef gboolean (* GimpDrawableConstraintFunc) (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
|
||||
|
||||
GType gimp_drawable_combo_box_get_type (void) G_GNUC_CONST;
|
||||
GType gimp_channel_combo_box_get_type (void) G_GNUC_CONST;
|
||||
GType gimp_layer_combo_box_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_drawable_combo_box_new (GimpDrawableConstraintFunc constraint,
|
||||
gpointer data);
|
||||
GtkWidget * gimp_channel_combo_box_new (GimpDrawableConstraintFunc constraint,
|
||||
|
|
|
@ -31,9 +31,13 @@ G_BEGIN_DECLS
|
|||
|
||||
typedef struct _GimpAspectPreview GimpAspectPreview;
|
||||
typedef struct _GimpDrawablePreview GimpDrawablePreview;
|
||||
typedef struct _GimpImageComboBox GimpImageComboBox;
|
||||
typedef struct _GimpProgressBar GimpProgressBar;
|
||||
|
||||
typedef struct _GimpImageComboBox GimpImageComboBox;
|
||||
typedef struct _GimpDrawableComboBox GimpDrawableComboBox;
|
||||
typedef struct _GimpChannelComboBox GimpChannelComboBox;
|
||||
typedef struct _GimpLayerComboBox GimpLayerComboBox;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -36,15 +36,6 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_CHAIN_TOP,
|
||||
GIMP_CHAIN_LEFT,
|
||||
GIMP_CHAIN_BOTTOM,
|
||||
GIMP_CHAIN_RIGHT
|
||||
} GimpChainPosition;
|
||||
|
||||
|
||||
#define GIMP_TYPE_CHAIN_BUTTON (gimp_chain_button_get_type ())
|
||||
#define GIMP_CHAIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHAIN_BUTTON, GimpChainButton))
|
||||
#define GIMP_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHAIN_BUTTON, GimpChainButtonClass))
|
||||
|
|
|
@ -8,6 +8,39 @@
|
|||
#include "libgimp/libgimp-intl.h"
|
||||
|
||||
/* enumerations from "./gimpwidgetsenums.h" */
|
||||
GType
|
||||
gimp_chain_position_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_CHAIN_TOP, "GIMP_CHAIN_TOP", "top" },
|
||||
{ GIMP_CHAIN_LEFT, "GIMP_CHAIN_LEFT", "left" },
|
||||
{ GIMP_CHAIN_BOTTOM, "GIMP_CHAIN_BOTTOM", "bottom" },
|
||||
{ GIMP_CHAIN_RIGHT, "GIMP_CHAIN_RIGHT", "right" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_CHAIN_TOP, "GIMP_CHAIN_TOP", NULL },
|
||||
{ GIMP_CHAIN_LEFT, "GIMP_CHAIN_LEFT", NULL },
|
||||
{ GIMP_CHAIN_BOTTOM, "GIMP_CHAIN_BOTTOM", NULL },
|
||||
{ GIMP_CHAIN_RIGHT, "GIMP_CHAIN_RIGHT", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpChainPosition", values);
|
||||
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_color_area_type_get_type (void)
|
||||
{
|
||||
|
@ -78,6 +111,37 @@ gimp_color_selector_channel_get_type (void)
|
|||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_size_entry_update_policy_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_NONE, "GIMP_SIZE_ENTRY_UPDATE_NONE", "none" },
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_SIZE, "GIMP_SIZE_ENTRY_UPDATE_SIZE", "size" },
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, "GIMP_SIZE_ENTRY_UPDATE_RESOLUTION", "resolution" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_NONE, "GIMP_SIZE_ENTRY_UPDATE_NONE", NULL },
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_SIZE, "GIMP_SIZE_ENTRY_UPDATE_SIZE", NULL },
|
||||
{ GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, "GIMP_SIZE_ENTRY_UPDATE_RESOLUTION", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpSizeEntryUpdatePolicy", values);
|
||||
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
/* Generated data ends here */
|
||||
|
||||
|
|
|
@ -26,6 +26,19 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#define GIMP_TYPE_CHAIN_POSITION (gimp_chain_position_get_type ())
|
||||
|
||||
GType gimp_chain_position_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_CHAIN_TOP,
|
||||
GIMP_CHAIN_LEFT,
|
||||
GIMP_CHAIN_BOTTOM,
|
||||
GIMP_CHAIN_RIGHT
|
||||
} GimpChainPosition;
|
||||
|
||||
|
||||
#define GIMP_TYPE_COLOR_AREA_TYPE (gimp_color_area_type_get_type ())
|
||||
|
||||
GType gimp_color_area_type_get_type (void) G_GNUC_CONST;
|
||||
|
@ -54,8 +67,11 @@ typedef enum
|
|||
} GimpColorSelectorChannel;
|
||||
|
||||
|
||||
#define GIMP_TYPE_SIZE_ENTRY_UPDATE_POLICY (gimp_size_entry_update_policy_get_type ())
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
GType gimp_size_entry_update_policy_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_SIZE_ENTRY_UPDATE_NONE = 0,
|
||||
GIMP_SIZE_ENTRY_UPDATE_SIZE = 1,
|
||||
|
|
Loading…
Reference in New Issue