File indexing completed on 2024-05-12 04:37:33
0001 {% load kdev_filters %} 0002 {% include "license_header_cpp.txt" %} 0003 0004 0005 {% with namespaces|join:"_"|default:"___"|add:"_"|cut:"____"|upper as uc_prefix %} 0006 {% with namespaces|join:"_"|default:"___"|add:"_"|cut:"____"|lower as lc_prefix %} 0007 {% with namespaces|join:"" as prefix %} 0008 {% with prefix|add:name as full_name %} 0009 0010 /* inclusion guard */ 0011 #ifndef __{{ uc_prefix }}{{ name|upper }}_H__ 0012 #define __{{ uc_prefix }}{{ name|upper }}_H__ 0013 0014 0015 #include <glib-object.h> 0016 /* 0017 * Potentially, include other headers on which this header depends. 0018 */ 0019 0020 0021 /* 0022 * Type macros. 0023 */ 0024 #define {{ uc_prefix }}TYPE_{{ name|upper }} ({{ lc_prefix }}{{ name|lower }}_get_type ()) 0025 #define {{ uc_prefix }}{{ name|upper }}(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), {{ uc_prefix }}TYPE_{{ name|upper }}, {{ full_name }})) 0026 #define {{ uc_prefix }}IS_{{ name|upper }}(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), {{ uc_prefix }}TYPE_{{ name|upper }})) 0027 #define {{ uc_prefix }}{{ name|upper }}_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), {{ uc_prefix }}TYPE_{{ name|upper }}, {{ full_name }}Class)) 0028 #define {{ uc_prefix }}IS_{{ name|upper }}_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), {{ uc_prefix }}TYPE_{{ name|upper }})) 0029 #define {{ uc_prefix }}{{ name|upper }}_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), {{ uc_prefix }}TYPE_{{ name|upper }}, {{ full_name }}Class)) 0030 0031 0032 typedef struct _{{ full_name }} {{ full_name }}; 0033 typedef struct _{{ full_name }}Class {{ full_name }}Class; 0034 typedef struct _{{ full_name }}Private {{ full_name }}Private; 0035 0036 0037 struct _{{ full_name }} 0038 { 0039 GObject parent_instance; 0040 0041 0042 /* instance members */ 0043 {% for m in members %} 0044 {{ m.type }} {{ m.name }}; 0045 {% endfor %} 0046 0047 /*< private >*/ 0048 {{ full_name }}Private *priv; 0049 }; 0050 0051 0052 struct _{{ full_name }}Class 0053 { 0054 GObjectClass parent_class; 0055 0056 /* class members */ 0057 {% for f in functions %} 0058 {% if f.isVirtual %} 0059 {% with f.arguments as arguments %} 0060 {{ f.returnType|default:"void" }} (*{{ f.name }}) ({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %}); 0061 {% endwith %} 0062 {% endif %} 0063 {% endfor %} 0064 0065 }; 0066 0067 0068 /* used by {{ uc_prefix }}TYPE_{{ name|upper }} */ 0069 GType {{ lc_prefix }}{{ name|lower }}_get_type (void); 0070 0071 0072 /* 0073 * Method definitions. 0074 */ 0075 {% for f in functions %} 0076 {% with f.arguments as arguments %} 0077 {{ f.returnType|default:"void" }} {{ lc_prefix }}{{ name|lower }}_{{ f.name }}({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %}); 0078 {% endwith %} 0079 {% endfor %} 0080 0081 0082 #endif /* __{{ uc_prefix }}{{ name|upper }}_H__ */ 0083 0084 {% endwith %} 0085 {% endwith %} 0086 {% endwith %} 0087 {% endwith %}