2005-11-15 13:03:14 +01:00
|
|
|
#ifndef __{NAMESPACE}_{TEMPLATE}_H__
|
|
|
|
#define __{NAMESPACE}_{TEMPLATE}_H__
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
2005-11-15 13:03:14 +01:00
|
|
|
#include <gtk/gtk.h>
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Type checking and casting macros
|
|
|
|
*/
|
2005-11-15 13:03:14 +01:00
|
|
|
#define {NAMESPACE}_TYPE_{TEMPLATE} ({namespace}_{template_}_get_type())
|
|
|
|
#define {NAMESPACE}_{TEMPLATE}(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}, {Namespace}{Template}))
|
|
|
|
#define {NAMESPACE}_{TEMPLATE}_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}, {Namespace}{Template} const))
|
|
|
|
#define {NAMESPACE}_{TEMPLATE}_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}, {Namespace}{Template}Class))
|
|
|
|
#define {NAMESPACE}_IS_{TEMPLATE}(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}))
|
|
|
|
#define {NAMESPACE}_IS_{TEMPLATE}_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}))
|
|
|
|
#define {NAMESPACE}_{TEMPLATE}_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \
|
|
|
|
{NAMESPACE}_TYPE_{TEMPLATE}, {Namespace}{Template}Class))
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
/* Private structure type */
|
2005-11-15 13:03:14 +01:00
|
|
|
typedef struct _{Namespace}{Template}Private {Namespace}{Template}Private;
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Main object structure
|
|
|
|
*/
|
2005-11-15 13:03:14 +01:00
|
|
|
typedef struct _{Namespace}{Template} {Namespace}{Template};
|
2005-11-07 10:56:25 +01:00
|
|
|
|
2005-11-15 13:03:14 +01:00
|
|
|
struct _{Namespace}{Template} {
|
|
|
|
{Parent_Namespace}{Parent} parent;
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
/*< private > */
|
2005-11-15 13:03:14 +01:00
|
|
|
{Namespace}{Template}Private *priv;
|
2005-11-07 10:56:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Class definition
|
|
|
|
*/
|
2005-11-15 13:03:14 +01:00
|
|
|
typedef struct _{Namespace}{Template}Class {Namespace}{Template}Class;
|
2005-11-07 10:56:25 +01:00
|
|
|
|
2005-11-15 13:03:14 +01:00
|
|
|
struct _{Namespace}{Template}Class {
|
|
|
|
{Parent_Namespace}{Parent}Class parent_class;
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
/* Signals
|
2005-11-15 13:03:14 +01:00
|
|
|
void (* proto) ({Namespace}{Template} *obj); */
|
2005-11-07 10:56:25 +01:00
|
|
|
};
|
|
|
|
|
2005-11-15 13:03:14 +01:00
|
|
|
GType {namespace}_{template_}_get_type(void) G_GNUC_CONST;
|
|
|
|
{Namespace}{Template} *{namespace}_{template_}_new(void);
|
2005-11-07 10:56:25 +01:00
|
|
|
|
|
|
|
G_END_DECLS
|
2005-11-15 13:03:14 +01:00
|
|
|
#endif /* __{NAMESPACE}_{TEMPLATE}_H__ */
|