2019-12-08 06:09:59 +00:00
|
|
|
|
|
|
|
#include "action-holder.h"
|
|
|
|
|
|
|
|
struct _ActionHolder {
|
|
|
|
GObject instance;
|
|
|
|
|
2020-07-19 05:56:00 +00:00
|
|
|
GObject *owner;
|
2019-12-08 06:09:59 +00:00
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (ActionHolder, action_holder, G_TYPE_OBJECT)
|
|
|
|
|
|
|
|
static void
|
|
|
|
action_holder_init (ActionHolder *holder)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
action_holder_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
ActionHolder *holder = ACTION_HOLDER (object);
|
|
|
|
|
2020-07-19 05:56:00 +00:00
|
|
|
g_object_unref (holder->owner);
|
2019-12-08 06:09:59 +00:00
|
|
|
g_free (holder->name);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (action_holder_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
action_holder_class_init (ActionHolderClass *class)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
|
|
|
|
|
|
object_class->finalize = action_holder_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
ActionHolder *
|
2020-07-19 05:56:00 +00:00
|
|
|
action_holder_new (GObject *owner,
|
|
|
|
const char *name)
|
2019-12-08 06:09:59 +00:00
|
|
|
{
|
|
|
|
ActionHolder *holder;
|
|
|
|
|
|
|
|
holder = g_object_new (ACTION_TYPE_HOLDER, NULL);
|
|
|
|
|
2020-07-19 05:56:00 +00:00
|
|
|
holder->owner = g_object_ref (owner);
|
2019-12-08 06:09:59 +00:00
|
|
|
holder->name = g_strdup (name);
|
|
|
|
|
|
|
|
return holder;
|
|
|
|
}
|
|
|
|
|
2020-07-19 05:56:00 +00:00
|
|
|
GObject *
|
|
|
|
action_holder_get_owner (ActionHolder *holder)
|
2019-12-08 06:09:59 +00:00
|
|
|
{
|
2020-07-19 05:56:00 +00:00
|
|
|
return holder->owner;
|
2019-12-08 06:09:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
action_holder_get_name (ActionHolder *holder)
|
|
|
|
{
|
|
|
|
return holder->name;
|
|
|
|
}
|