[anjuta] bgo #702576 - Use a marker comment to get macro and class name



commit e870a98c2df29a7e51fe82e58634134a019b46c7
Author: Marco Diego Aurélio Mesquita <marcodiegomesquita gmail com>
Date:   Tue Jun 18 12:42:52 2013 -0300

    bgo #702576 - Use a marker comment to get macro and class name

 plugins/language-support-cpp-java/plugin.c         |    8 ++++----
 .../templates/gtkapplication/src/application.c     |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index 9b0d4d8..1d46d46 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -441,15 +441,15 @@ prepare_callback_body (gchar* user_data, IAnjutaEditor* editor, gint *offset)
         return g_strdup_printf("\n{\n\tGObject *%s = G_OBJECT (user_data);\n\n}\n", user_data);
     }
 
-    gchar *macro_string = get_text_between (editor, "/* Define the private structure; ", " gets ");
+    gchar *macro_string = get_text_between (editor, "/* ANJUTA: Macro ", " gets ");
 
     if (!macro_string) {
         *offset = C_OFFSET;
         return g_strdup_printf ("%s", C_BODY);
     }
 
-    gchar *prefix = g_strdup_printf ("/* Define the private structure; %s gets ", macro_string);
-    gchar *struct_string = get_text_between(editor, prefix, " */");
+    gchar *prefix = g_strdup_printf ("/* ANJUTA: Macro %s gets ", macro_string);
+    gchar *struct_string = get_text_between(editor, prefix, " - DO NOT REMOVE */");
     g_free (prefix);
 
     if (!struct_string) {
@@ -459,7 +459,7 @@ prepare_callback_body (gchar* user_data, IAnjutaEditor* editor, gint *offset)
     }
 
     gchar *new_body;
-    new_body = g_strdup_printf("\n{\n\t%s *self = %s(user_data);\n\t%sPrivate *priv = self->priv;\n}\n",
+    new_body = g_strdup_printf("\n{\n\t%s *self = %s(user_data);\n\t%sPrivate *priv = self->priv;\n\n}\n",
                                struct_string, macro_string, struct_string);
     *offset = C_OFFSET + 2;
 
diff --git a/plugins/project-wizard/templates/gtkapplication/src/application.c 
b/plugins/project-wizard/templates/gtkapplication/src/application.c
index 6006558..f398908 100644
--- a/plugins/project-wizard/templates/gtkapplication/src/application.c
+++ b/plugins/project-wizard/templates/gtkapplication/src/application.c
@@ -23,6 +23,7 @@
 
 G_DEFINE_TYPE ([+NameCClass+], [+NameCLower+], GTK_TYPE_APPLICATION);
 
+/* ANJUTA: Macro [+NameCUpper+]_APPLICATION gets [+NameCClass+] - DO NOT REMOVE */
 [+IF (=(get "HaveBuilderUI") "1") \+]
 struct _[+NameCClass+]Private
 {


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