[gnome-builder] snippets: modernize gobject interface snippet
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: modernize gobject interface snippet
- Date: Wed, 3 Jun 2015 04:53:57 +0000 (UTC)
commit fb2f6f3ca8f361d77f507f23028f31b6bd2cb637
Author: Christian Hergert <christian hergert me>
Date: Tue Jun 2 21:53:41 2015 -0700
snippets: modernize gobject interface snippet
data/snippets/gobject.snippets | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/data/snippets/gobject.snippets b/data/snippets/gobject.snippets
index f2c7fdb..de2e88b 100644
--- a/data/snippets/gobject.snippets
+++ b/data/snippets/gobject.snippets
@@ -129,24 +129,20 @@ snippet gobj_interface
#ifndef ${$1|functify|upper}_H
#define ${$1|functify|upper}_H
- #include <glib-object.h>
+ #include ${3:<glib-object.h>}
G_BEGIN_DECLS
- #define ${$1|functify|namespace|upper}_TYPE_${$1|class|functify|upper}
(${$1|functify}_get_type ())
- #define ${$1|functify|namespace|upper}_${$1|class|functify|upper}(obj)
(G_TYPE_CHECK_INSTANCE_CAST ((obj), ${$1|functify|namespace|upper}_TYPE_${$1|class|functify|upper}, $1))
- #define ${$1|functify|namespace|upper}_IS_${$1|class|functify|upper}(obj)
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ${$1|functify|namespace|upper}_TYPE_${$1|class|functify|upper}))
- #define ${$1|functify|namespace|upper}_${$1|class|functify|upper}_GET_INTERFACE(obj)
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), ${$1|functify|namespace|upper}_TYPE_${$1|class|functify|upper},
$1Interface))
+ #define ${$1|functify|namespace|upper}_TYPE_${$1|class|functify|upper} (${$1|functify}_get_type ())
- typedef struct _$1 $1;
- typedef struct _$1Interface $1Interface;
+ G_DECLARE_INTERFACE ($1, ${$1|functify}, ${$1|functify|namespace|upper}, ${$1|class|functify|upper},
${2:GObject})
struct _${1:$filename|stripsuffix|functify|camelize}Interface
{
GTypeInterface parent;
- };
- GType ${$1|functify}_get_type (void);
+ $0
+ };
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]