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 
0035 
0036 struct _{{ full_name }}
0037 {
0038   GObject parent_instance;
0039 
0040 
0041   /* instance members */
0042   {% for m in members %}
0043   {{ m.type }} {{ m.name }};
0044   {% endfor %}
0045 };
0046 
0047 
0048 struct _{{ full_name }}Class
0049 {
0050   GObjectClass parent_class;
0051 
0052   /* class members */
0053   {% for f in functions %}
0054   {% if f.isVirtual %}
0055     {% with f.arguments as arguments %}
0056     {{ f.returnType|default:"void" }} (*{{ f.name }}) ({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %});
0057     {% endwith %}
0058   {% endif %}
0059   {% endfor %}
0060 
0061 };
0062 
0063 
0064 /* used by {{ uc_prefix }}TYPE_{{ name|upper }} */
0065 GType {{ lc_prefix }}{{ name|lower }}_get_type (void);
0066 
0067 
0068 /*
0069  * Method definitions.
0070  */
0071 {% for f in functions %}
0072 {% with f.arguments as arguments %}
0073 {{ f.returnType|default:"void" }} {{ lc_prefix }}{{ name|lower }}_{{ f.name }}({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %});
0074 {% endwith %}
0075 {% endfor %}
0076 
0077 
0078 #endif /* __{{ uc_prefix }}{{ name|upper }}_H__ */
0079 
0080 {% endwith %}
0081 {% endwith %}
0082 {% endwith %}
0083 {% endwith %}