This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
hedera/template/lib-object.c

102 lines
2.3 KiB
C

/*
* Copyright (C) 2012 - Juan Ferrer Toribio
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "lib-object.h"
/**
* SECTION: lib-object
* @Short_description: a template object
* @Title: LibObject
*
* Long description of the object.
*/
G_DEFINE_TYPE (LibObject, lib_object, G_TYPE_OBJECT);
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Methods
/**
* lib_object_method:
* @obj: a #LibObject
*
* Description of method here.
*
* Return value: #void
**/
void lib_object_method (LibObject * obj)
{
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties
enum
{
PROP_PROPERTY = 1
};
static void lib_object_set_property (LibObject * obj, guint id,
const GValue * value, GParamSpec * pspec)
{
switch (id)
{
case PROP_PROPERTY:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
}
}
static void lib_object_get_property (LibObject * obj, guint id,
GValue * value, GParamSpec * pspec)
{
switch (id)
{
case PROP_PROPERTY:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Class
static void lib_object_init (LibObject * obj)
{
}
static void lib_object_finalize (LibObject * obj)
{
G_OBJECT_CLASS (lib_object_parent_class)->finalize (G_OBJECT (obj));
}
static void lib_object_class_init (LibObjectClass * klass)
{
GObjectClass * k = G_OBJECT_CLASS (klass);
k->finalize = (GObjectFinalizeFunc) lib_object_finalize;
k->set_property = (GObjectSetPropertyFunc) lib_object_set_property;
k->get_property = (GObjectGetPropertyFunc) lib_object_get_property;
g_object_class_install_property (k, PROP_FIRST,
g_param_spec_string ("property"
,"Property"
,"Description"
,NULL
,G_PARAM_READWRITE
));
}