[gnome-builder] gobject: add snippets for async/finish pair in a vtable



commit fa9f7fecff32f2b728f155284e6a7c7486f083f7
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 12 18:41:37 2018 -0700

    gobject: add snippets for async/finish pair in a vtable
    
    This is useful when making interfaces and base classes

 data/snippets/gobject.snippets | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/data/snippets/gobject.snippets b/data/snippets/gobject.snippets
index ff932f444..853c13bba 100644
--- a/data/snippets/gobject.snippets
+++ b/data/snippets/gobject.snippets
@@ -452,6 +452,13 @@ snippet async
             ${$2|space} ${$1|space}         GCancellable *cancellable,
             ${$2|space} ${$1|space}         GAsyncReadyCallback callback,
             ${$2|space} ${$1|space}         gpointer user_data);
+snippet vtasync
+- scope chdr
+- desc Create a vtable async function for an async/finish pair
+       void     (*${1:do_someting}_async)  (${2:$filename|stripsuffix|camelize} *self,
+                  ${$1|space}          GCancellable         *cancellable,
+                  ${$1|space}          GAsyncReadyCallback   callback,
+                  ${$1|space}          gpointer              user_data);
 snippet finish
 - scope c
 - desc Create the finish function for an async/finish pair
@@ -478,6 +485,12 @@ snippet finish
        gboolean ${$2|functify}_${1:do_something}_finish (${2:$filename|stripsuffix|camelize} *self,
                 ${$2|space} ${$1|space}          GAsyncResult *result,
                 ${$2|space} ${$1|space}          GError **error);
+snippet vtfinish
+- scope chdr
+- desc Create a vtable finish function for an async/finish pair
+       gboolean (*${1:do_someting}_finish) (${2:$filename|stripsuffix|camelize} *self,
+                  ${$1|space}          GAsyncResult         *result,
+                  ${$1|space}          GError              **error);
 snippet Private
 - desc Define a local for the GObject's private data.
 - scope c, chdr


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]