File indexing completed on 2025-12-21 04:40:34
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 /*< private >*/
0043 {{ full_name }}Private *priv;
0044 };
0045
0046
0047 struct _{{ full_name }}Class
0048 {
0049 GObjectClass parent_class;
0050
0051 /* class members */
0052 {% for f in functions %}
0053 {% if f.isVirtual %}
0054 {% with f.arguments as arguments %}
0055 {{ f.returnType|default:"void" }} (*{{ f.name }}) ({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %});
0056 {% endwith %}
0057 {% endif %}
0058 {% endfor %}
0059
0060 };
0061
0062
0063 /* used by {{ uc_prefix }}TYPE_{{ name|upper }} */
0064 GType {{ lc_prefix }}{{ name|lower }}_get_type (void);
0065
0066
0067 /*
0068 * Method definitions.
0069 */
0070 {% for f in functions %}
0071 {% with f.arguments as arguments %}
0072 {{ f.returnType|default:"void" }} {{ lc_prefix }}{{ name|lower }}_{{ f.name }}({{ full_name }}* self{% if arguments %}, {% include "arguments_types_names.txt" %}{% endif %});
0073 {% endwith %}
0074 {% endfor %}
0075
0076
0077 #endif /* __{{ uc_prefix }}{{ name|upper }}_H__ */
0078
0079 {% endwith %}
0080 {% endwith %}
0081 {% endwith %}
0082 {% endwith %}