Commit 65543971 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gimpbrushlist.c forgot to remove #include "gimpsignal.h"

2001-01-10  Michael Natterer  <mitch@gimp.org>

	* app/gimpbrushlist.c
	* app/gimpdrawable.c: forgot to remove #include "gimpsignal.h"

	* app/gimpobject.[ch]: added a "name" argument (not used yet).
parent 92c45a90
2001-01-10 Michael Natterer <mitch@gimp.org>
* app/gimpbrushlist.c
* app/gimpdrawable.c: forgot to remove #include "gimpsignal.h"
* app/gimpobject.[ch]: added a "name" argument (not used yet).
2001-01-10 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
......
......@@ -30,7 +30,6 @@
#include "gimpdrawable.h"
#include "layer.h"
#include "gimppreviewcache.h"
#include "gimpsignal.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpparasite.h"
......
......@@ -25,15 +25,33 @@
#include "gimpobject.h"
static void
gimp_object_init (GimpObject *object)
enum
{
}
NAME_CHANGED,
LAST_SIGNAL
};
static void
gimp_object_class_init (GimpObjectClass *klass)
enum
{
}
ARG_0,
ARG_NAME
};
static void gimp_object_class_init (GimpObjectClass *klass);
static void gimp_object_init (GimpObject *object);
static void gimp_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gimp_object_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static guint object_signals[LAST_SIGNAL] = { 0 };
static GtkObjectClass *parent_class = NULL;
GtkType
gimp_object_get_type (void)
......@@ -59,3 +77,113 @@ gimp_object_get_type (void)
return object_type;
}
static void
gimp_object_class_init (GimpObjectClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GTK_TYPE_OBJECT);
gtk_object_add_arg_type ("GimpObject::name", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_NAME);
object_signals[NAME_CHANGED] =
gtk_signal_new ("name_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpObjectClass,
name_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, object_signals, LAST_SIGNAL);
object_class->set_arg = gimp_object_set_arg;
object_class->get_arg = gimp_object_get_arg;
klass->name_changed = NULL;
}
static void
gimp_object_init (GimpObject *object)
{
object->name = NULL;
}
static void
gimp_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (arg_id)
{
case ARG_NAME:
gimp_object_set_name (gimp_object, GTK_VALUE_STRING (*arg));
break;
default:
break;
}
}
static void
gimp_object_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (arg_id)
{
case ARG_NAME:
GTK_VALUE_STRING (*arg) = g_strdup (gimp_object->name);
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
void
gimp_object_set_name (GimpObject *object,
const gchar *name)
{
g_return_if_fail (object);
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->name && !name) ||
(object->name && name && !strcmp (object->name, name)))
return;
g_free (object->name);
object->name = g_strdup (name);
gimp_object_name_changed (object);
}
const gchar *
gimp_object_get_name (const GimpObject *object)
{
g_return_val_if_fail (object, NULL);
g_return_val_if_fail (GIMP_IS_OBJECT (object), NULL);
return object->name;
}
void
gimp_object_name_changed (GimpObject *object)
{
g_return_if_fail (object);
g_return_if_fail (GIMP_IS_OBJECT (object));
gtk_signal_emit (GTK_OBJECT (object), object_signals[NAME_CHANGED]);
}
......@@ -23,10 +23,11 @@
#include <gtk/gtkobject.h>
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_IS_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OBJECT))
typedef struct _GimpObjectClass GimpObjectClass;
......@@ -34,15 +35,24 @@ typedef struct _GimpObjectClass GimpObjectClass;
struct _GimpObject
{
GtkObject object;
gchar *name;
};
struct _GimpObjectClass
{
GtkObjectClass parent_class;
void (* name_changed) (GimpObject *object);
};
GtkType gimp_object_get_type (void);
GtkType gimp_object_get_type (void);
void gimp_object_set_name (GimpObject *object,
const gchar *name);
const gchar * gimp_object_get_name (const GimpObject *object);
void gimp_object_name_changed (GimpObject *object);
#endif /* __GIMP_OBJECT_H__ */
......@@ -43,7 +43,6 @@
#include "datafiles.h"
#include "gimpcontext.h"
#include "gimprc.h"
#include "gimpsignal.h"
#include "gimplist.h"
#include "gimpbrush.h"
#include "gimpbrushlist.h"
......
......@@ -30,7 +30,6 @@
#include "gimpdrawable.h"
#include "layer.h"
#include "gimppreviewcache.h"
#include "gimpsignal.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpparasite.h"
......
......@@ -25,15 +25,33 @@
#include "gimpobject.h"
static void
gimp_object_init (GimpObject *object)
enum
{
}
NAME_CHANGED,
LAST_SIGNAL
};
static void
gimp_object_class_init (GimpObjectClass *klass)
enum
{
}
ARG_0,
ARG_NAME
};
static void gimp_object_class_init (GimpObjectClass *klass);
static void gimp_object_init (GimpObject *object);
static void gimp_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gimp_object_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static guint object_signals[LAST_SIGNAL] = { 0 };
static GtkObjectClass *parent_class = NULL;
GtkType
gimp_object_get_type (void)
......@@ -59,3 +77,113 @@ gimp_object_get_type (void)
return object_type;
}
static void
gimp_object_class_init (GimpObjectClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GTK_TYPE_OBJECT);
gtk_object_add_arg_type ("GimpObject::name", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_NAME);
object_signals[NAME_CHANGED] =
gtk_signal_new ("name_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpObjectClass,
name_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, object_signals, LAST_SIGNAL);
object_class->set_arg = gimp_object_set_arg;
object_class->get_arg = gimp_object_get_arg;
klass->name_changed = NULL;
}
static void
gimp_object_init (GimpObject *object)
{
object->name = NULL;
}
static void
gimp_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (arg_id)
{
case ARG_NAME:
gimp_object_set_name (gimp_object, GTK_VALUE_STRING (*arg));
break;
default:
break;
}
}
static void
gimp_object_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (arg_id)
{
case ARG_NAME:
GTK_VALUE_STRING (*arg) = g_strdup (gimp_object->name);
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
void
gimp_object_set_name (GimpObject *object,
const gchar *name)
{
g_return_if_fail (object);
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->name && !name) ||
(object->name && name && !strcmp (object->name, name)))
return;
g_free (object->name);
object->name = g_strdup (name);
gimp_object_name_changed (object);
}
const gchar *
gimp_object_get_name (const GimpObject *object)
{
g_return_val_if_fail (object, NULL);
g_return_val_if_fail (GIMP_IS_OBJECT (object), NULL);
return object->name;
}
void
gimp_object_name_changed (GimpObject *object)
{
g_return_if_fail (object);
g_return_if_fail (GIMP_IS_OBJECT (object));
gtk_signal_emit (GTK_OBJECT (object), object_signals[NAME_CHANGED]);
}
......@@ -23,10 +23,11 @@
#include <gtk/gtkobject.h>
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_IS_OBJECT(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_IS_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OBJECT))
typedef struct _GimpObjectClass GimpObjectClass;
......@@ -34,15 +35,24 @@ typedef struct _GimpObjectClass GimpObjectClass;
struct _GimpObject
{
GtkObject object;
gchar *name;
};
struct _GimpObjectClass
{
GtkObjectClass parent_class;
void (* name_changed) (GimpObject *object);
};
GtkType gimp_object_get_type (void);
GtkType gimp_object_get_type (void);
void gimp_object_set_name (GimpObject *object,
const gchar *name);
const gchar * gimp_object_get_name (const GimpObject *object);
void gimp_object_name_changed (GimpObject *object);
#endif /* __GIMP_OBJECT_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment