[gnome-builder] snippets: tweak gobject snippets a bit more
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: tweak gobject snippets a bit more
- Date: Tue, 12 Jun 2018 23:50:15 +0000 (UTC)
commit d829bdf8063a2283860dd18ca710ba8aed370145
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 12 16:49:36 2018 -0700
snippets: tweak gobject snippets a bit more
data/snippets/gobject.snippets | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/data/snippets/gobject.snippets b/data/snippets/gobject.snippets
index a3cc50186..726ff9038 100644
--- a/data/snippets/gobject.snippets
+++ b/data/snippets/gobject.snippets
@@ -17,6 +17,13 @@ snippet gobject
static GParamSpec *properties [N_PROPS];
+ /**
+ * $3_new:
+ *
+ * Create a new #$2.
+ *
+ * Returns: (transfer full): a newly created #$2
+ */
$2 *
$3_new (void)
{
@@ -90,7 +97,7 @@ snippet gobject
struct _$1Class
{
- $2Class parent;
+ $2Class parent_class;
};
$1 *${$1|functify}_new (void);
@@ -98,7 +105,7 @@ snippet gobject
G_END_DECLS
snippet gobject_final
- scope c
-- desc Create final GObject
+- desc Create GObject for a non-derivable class
#include "${1:$filename|stripsuffix}.h"
struct _${2:$1|camelize}
@@ -174,7 +181,7 @@ snippet gobject_final
{
}
- scope chdr
-- desc Create final GObject header
+- desc Create GObject header for a non-derivable class
#pragma once
#include ${3:<glib-object.h>}
@@ -190,7 +197,7 @@ snippet gobject_final
G_END_DECLS
snippet gobject_boxed_ref
- scope c
-- desc Create Refed Boxed GObject
+- desc Create reference counted boxed type
#include "${1:$filename|stripsuffix}.h"
G_DEFINE_BOXED_TYPE (${2:$1|camelize}, ${3:$1|functify}, $3_ref, $3_unref)
@@ -249,7 +256,7 @@ snippet gobject_boxed_ref
$3_free (self);
}
- scope chdr
-- desc Create Refed Boxed GObject header
+- desc Create header for reference counted boxed type
#pragma once
#include ${3:<glib-object.h>}
@@ -275,11 +282,16 @@ snippet gobject_boxed_ref
G_END_DECLS
snippet gobject_boxed_copy
- scope c
-- desc Create copy/free Boxed GObject
+- desc Create a copy/free boxed type
#include "${1:$filename|stripsuffix}.h"
G_DEFINE_BOXED_TYPE (${2:$1|camelize}, ${3:$1|functify}, $3_copy, $3_free)
+ struct _$1
+ {
+ $0;
+ };
+
$2 *
$3_new (void)
{
@@ -310,7 +322,7 @@ snippet gobject_boxed_copy
g_slice_free ($2, self);
}
- scope chdr
-- desc Create copy/free Boxed GObject header
+- desc Create header for a copy/free boxed type
#pragma once
#include ${3:<glib-object.h>}
@@ -321,11 +333,6 @@ snippet gobject_boxed_copy
typedef struct _$1 ${1:$filename|stripsuffix|camelize};
- struct _$1
- {
- $0;
- };
-
$1 *$4_new (void);
$1 *$4_copy ($1 *self);
void${$1|space} $4_free ($1 *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]