Revision: 488 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=488&view=rev Author: frlan Date: 2009-02-18 00:20:44 +0000 (Wed, 18 Feb 2009)
Log Message: ----------- GeanyLaTeX: Prefix a bunch of functions
Modified Paths: -------------- trunk/geanylatex/src/bibtex.c trunk/geanylatex/src/bibtex.h trunk/geanylatex/src/bibtexlabels.c trunk/geanylatex/src/formatpatterns.c trunk/geanylatex/src/formatutils.c trunk/geanylatex/src/formatutils.h trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/geanylatex.h trunk/geanylatex/src/latexencodings.c trunk/geanylatex/src/latexencodings.h trunk/geanylatex/src/latexutils.c trunk/geanylatex/src/latexutils.h trunk/geanylatex/src/letters.c trunk/geanylatex/src/letters.h trunk/geanylatex/src/reftex.c trunk/geanylatex/src/reftex.h
Modified: trunk/geanylatex/src/bibtex.c =================================================================== --- trunk/geanylatex/src/bibtex.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/bibtex.c 2009-02-18 00:20:44 UTC (rev 488) @@ -22,7 +22,7 @@ #include "bibtex.h" #include "reftex.h"
-#define set_status(entry_number, flag) \ +#define glatex_set_status(entry_number, flag) \ fields[entry_number] = flag;
@@ -41,7 +41,7 @@ } #endif
-void insert_bibtex_entry(G_GNUC_UNUSED GtkMenuItem * menuitem, +void glatex_insert_bibtex_entry(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { int doctype = GPOINTER_TO_INT(gdata); @@ -51,91 +51,91 @@
for (i = 0; i < N_ENTRIES; i++) { - set_status(i, FALSE); + glatex_set_status(i, FALSE); }
switch(doctype) { case ARTICLE: - set_status(AUTHOR, TRUE); - set_status(TITLE, TRUE); - set_status(JOURNAL, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(JOURNAL, TRUE); + glatex_set_status(YEAR, TRUE); break; case BOOK: - set_status(AUTHOR, TRUE); - set_status(EDITOR, TRUE); - set_status(TITLE, TRUE); - set_status(PUBLISHER, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(EDITOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(PUBLISHER, TRUE); + glatex_set_status(YEAR, TRUE); break; case BOOKLET: - set_status(TITLE, TRUE); + glatex_set_status(TITLE, TRUE); break; case CONFERENCE: case INCOLLECTION: case INPROCEEDINGS: - set_status(AUTHOR, TRUE); - set_status(TITLE, TRUE); - set_status(BOOKTITLE, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(BOOKTITLE, TRUE); + glatex_set_status(YEAR, TRUE); break; case INBOOK: - set_status(AUTHOR, TRUE); - set_status(EDITOR, TRUE); - set_status(TITLE, TRUE); - set_status(CHAPTER, TRUE); - set_status(PAGES, TRUE); - set_status(PUBLISHER, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(EDITOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(CHAPTER, TRUE); + glatex_set_status(PAGES, TRUE); + glatex_set_status(PUBLISHER, TRUE); + glatex_set_status(YEAR, TRUE); break; case MANUAL: - set_status(TITLE, TRUE); + glatex_set_status(TITLE, TRUE); break; case MASTERSTHESIS: case PHDTHESIS: - set_status(AUTHOR, TRUE); - set_status(TITLE, TRUE); - set_status(SCHOOL, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(SCHOOL, TRUE); + glatex_set_status(YEAR, TRUE); break; case MISC: for (i = 0; i < N_ENTRIES; i++) { - set_status(i, TRUE); + glatex_set_status(i, TRUE); } case TECHREPORT: - set_status(AUTHOR, TRUE); - set_status(TITLE, TRUE); - set_status(INSTITUTION, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(INSTITUTION, TRUE); + glatex_set_status(YEAR, TRUE); break; case UNPUBLISHED: - set_status(AUTHOR, TRUE); - set_status(TITLE, TRUE); - set_status(NOTE, TRUE); + glatex_set_status(AUTHOR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(NOTE, TRUE); break; case PROCEEDINGS: - set_status(TITLE, TRUE); - set_status(YEAR, TRUE); + glatex_set_status(TITLE, TRUE); + glatex_set_status(YEAR, TRUE); break; default: for (i = 0; i < N_ENTRIES; i++) { - set_status(i, TRUE); + glatex_set_status(i, TRUE); } }
- output = g_strconcat(output, label_types[doctype], "{ \n",NULL); + output = g_strconcat(output, glatex_label_types[doctype], "{ \n",NULL); for (i = 0; i < N_ENTRIES; i++) { if (fields[i] == TRUE) { - output = g_strconcat(output, label_entry_keywords[i], "= {},\n", NULL); + output = g_strconcat(output, glatex_label_entry_keywords[i], "= {},\n", NULL); } }
output = g_strconcat(output, "}\n", NULL); - insert_string(output, FALSE); + glatex_insert_string(output, FALSE);
g_free(output); }
Modified: trunk/geanylatex/src/bibtex.h =================================================================== --- trunk/geanylatex/src/bibtex.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/bibtex.h 2009-02-18 00:20:44 UTC (rev 488) @@ -75,16 +75,17 @@ N_ENTRIES };
-extern gchar *label_types[]; +extern gchar *glatex_label_types[];
-extern const gchar *label_tooltips[]; +extern const gchar *glatex_label_tooltips[];
-extern const gchar *label_entry_keywords[]; +extern const gchar *glatex_label_entry_keywords[];
-extern const gchar *label_entry[]; +extern const gchar *glatex_label_entry[];
-int push_bibtex_entry(int style, GeanyDocument *doc); +int glatex_push_bibtex_entry(int style, GeanyDocument *doc);
-void insert_bibtex_entry(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata); +void glatex_insert_bibtex_entry(G_GNUC_UNUSED GtkMenuItem * menuitem, + G_GNUC_UNUSED gpointer gdata);
#endif
Modified: trunk/geanylatex/src/bibtexlabels.c =================================================================== --- trunk/geanylatex/src/bibtexlabels.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/bibtexlabels.c 2009-02-18 00:20:44 UTC (rev 488) @@ -22,7 +22,7 @@ #include "geanylatex.h" #include "bibtex.h"
-gchar *label_types[] = { +gchar *glatex_label_types[] = { N_("Article"), N_("Book"), N_("Booklet"), @@ -39,7 +39,7 @@ N_("Unpublished")};
-const gchar *label_entry[] = { +const gchar *glatex_label_entry[] = { N_("Address"), N_("Annote"), N_("Author"), @@ -67,7 +67,7 @@ N_("Volume"), N_("Year")};
-const gchar *label_entry_keywords[] = { +const gchar *glatex_label_entry_keywords[] = { ("Address"), ("Annote"), ("Author"), @@ -95,7 +95,7 @@ ("Volume"), ("Year")};
-const gchar *label_tooltips[] = { +const gchar *glatex_label_tooltips[] = { N_("Address of publisher"), N_("Annotation for annotated bibliography styles"), N_("Name(s) of the author(s), separated by 'and' if more than one"),
Modified: trunk/geanylatex/src/formatpatterns.c =================================================================== --- trunk/geanylatex/src/formatpatterns.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/formatpatterns.c 2009-02-18 00:20:44 UTC (rev 488) @@ -21,7 +21,7 @@
#include "geanylatex.h"
-gchar* format_pattern[] = { +gchar* glatex_format_pattern[] = { "\textit", "\textbf", "\underline", @@ -31,7 +31,7 @@ "\emph" };
-const gchar *format_labels[] = { +const gchar *glatex_format_labels[] = { N_("Italic"), N_("Boldfont"), N_("Underline"),
Modified: trunk/geanylatex/src/formatutils.c =================================================================== --- trunk/geanylatex/src/formatutils.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/formatutils.c 2009-02-18 00:20:44 UTC (rev 488) @@ -21,12 +21,12 @@
#include "formatutils.h"
-void insert_latex_format(G_GNUC_UNUSED GtkMenuItem * menuitem, +void glatex_insert_latex_format(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { gint format = GPOINTER_TO_INT(gdata);
- insert_string(format_pattern[format], TRUE); - insert_string("{", TRUE); - insert_string("}", FALSE); + glatex_insert_string(glatex_format_pattern[format], TRUE); + glatex_insert_string("{", TRUE); + glatex_insert_string("}", FALSE); }
Modified: trunk/geanylatex/src/formatutils.h =================================================================== --- trunk/geanylatex/src/formatutils.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/formatutils.h 2009-02-18 00:20:44 UTC (rev 488) @@ -35,8 +35,8 @@ LATEX_STYLES_END };
-extern gchar* format_pattern[]; -extern const gchar *format_labels[]; -void insert_latex_format(GtkMenuItem * menuitem, gpointer gdata); +extern gchar* glatex_format_pattern[]; +extern const gchar *glatex_format_labels[]; +void glatex_insert_latex_format(GtkMenuItem * menuitem, gpointer gdata);
#endif
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/geanylatex.c 2009-02-18 00:20:44 UTC (rev 488) @@ -61,7 +61,7 @@ PLUGIN_KEY_GROUP(geanylatex, COUNT_KB)
void -insert_string(gchar *string, gboolean reset_position) +glatex_insert_string(gchar *string, gboolean reset_position) { GeanyDocument *doc = NULL;
@@ -84,7 +84,7 @@ inline gchar* get_latex_command(gint tab_index) { - return char_array[tab_index].latex; + return glatex_char_array[tab_index].latex; }
@@ -92,7 +92,7 @@ char_insert_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) { - insert_string(get_latex_command(GPOINTER_TO_INT(gdata)), TRUE); + glatex_insert_string(get_latex_command(GPOINTER_TO_INT(gdata)), TRUE); }
@@ -135,7 +135,7 @@ gchar *label_str = NULL; label_str = g_strconcat("\label{",g_strdup(gtk_entry_get_text( GTK_ENTRY(textbox_label))), "}", NULL); - insert_string(label_str, TRUE); + glatex_insert_string(label_str, TRUE); }
gtk_widget_destroy(dialog); @@ -170,7 +170,7 @@
label_ref = gtk_label_new(_("Ref name:")); textbox_ref = gtk_combo_box_entry_new_text(); - add_Labels(textbox_ref, get_aux_file()); + glatex_add_Labels(textbox_ref, glatex_get_aux_file());
gtk_misc_set_alignment(GTK_MISC(label_ref), 0, 0.5);
@@ -210,7 +210,7 @@
if (ref_string != NULL) { - insert_string(ref_string, TRUE); + glatex_insert_string(ref_string, TRUE); g_free(ref_string); } } @@ -236,7 +236,7 @@ * returns 0, if categorie is empty * if gint categorie is -1, function will count every element. * Useful, if there is no need for a categorie check.*/ -gint +static gint count_menu_entries(SubMenuTemplate *tmp, gint categorie) { /* TODO: Reset max value to stop before it's too late */ @@ -268,7 +268,7 @@ return count; }
-gint +static gint count_menu_cat_entries(CategoryName *tmp) { gint i; @@ -278,7 +278,7 @@ }
-void sub_menu_init(GtkWidget *base_menu, SubMenuTemplate *menu_template, +static void sub_menu_init(GtkWidget *base_menu, SubMenuTemplate *menu_template, CategoryName *category_name, SubMenuCallback callback_function) { @@ -844,7 +844,7 @@
static void kb_insert_newline(G_GNUC_UNUSED guint key_id) { - insert_string("\\\n", TRUE); + glatex_insert_string("\\\n", TRUE); }
/*static void kb_bibtex_entry_insert(G_GNUC_UNUSED guint key_id) @@ -883,7 +883,7 @@
main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
- init_encodings_latex(); + glatex_init_encodings_latex();
tooltips = gtk_tooltips_new();
@@ -911,7 +911,7 @@ menu_latex_menu_special_char_submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_menu_special_char), menu_latex_menu_special_char_submenu); - sub_menu_init(menu_latex_menu_special_char_submenu, char_array, cat_names, + sub_menu_init(menu_latex_menu_special_char_submenu, glatex_char_array, glatex_cat_names, char_insert_activated);
menu_latex_ref = gtk_menu_item_new_with_mnemonic(_("Insert _Reference")); @@ -938,10 +938,10 @@ for (i = 0; i < N_TYPES; i++) { tmp = NULL; - tmp = gtk_menu_item_new_with_mnemonic(_(label_types[i])); + tmp = gtk_menu_item_new_with_mnemonic(_(glatex_label_types[i])); gtk_container_add(GTK_CONTAINER(menu_latex_bibtex_submenu), tmp); g_signal_connect((gpointer) tmp, "activate", - G_CALLBACK(insert_bibtex_entry), GINT_TO_POINTER(i)); + G_CALLBACK(glatex_insert_bibtex_entry), GINT_TO_POINTER(i)); }
menu_latex_format_insert = gtk_menu_item_new_with_mnemonic(_("Format")); @@ -954,10 +954,10 @@ for (i = 0; i < LATEX_STYLES_END; i++) { tmp = NULL; - tmp = gtk_menu_item_new_with_mnemonic(_(format_labels[i])); + tmp = gtk_menu_item_new_with_mnemonic(_(glatex_format_labels[i])); gtk_container_add(GTK_CONTAINER(menu_latex_format_insert_submenu), tmp); g_signal_connect((gpointer) tmp, "activate", - G_CALLBACK(insert_latex_format), GINT_TO_POINTER(i)); + G_CALLBACK(glatex_insert_latex_format), GINT_TO_POINTER(i)); }
init_keybindings();
Modified: trunk/geanylatex/src/geanylatex.h =================================================================== --- trunk/geanylatex/src/geanylatex.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/geanylatex.h 2009-02-18 00:20:44 UTC (rev 488) @@ -108,6 +108,6 @@
#define MAX_MENU_ENTRIES 20
-extern void insert_string(gchar *string, gboolean reset_position); +extern void glatex_insert_string(gchar *string, gboolean reset_position);
#endif
Modified: trunk/geanylatex/src/latexencodings.c =================================================================== --- trunk/geanylatex/src/latexencodings.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/latexencodings.c 2009-02-18 00:20:44 UTC (rev 488) @@ -32,7 +32,7 @@ latex_encodings[Charset].latex = LaTeX; \ latex_encodings[Charset].geany_enc = GeanyEnc;
-void init_encodings_latex(void) +void glatex_init_encodings_latex(void) { fill(LATEX_ENCODING_UTF_8, _("UTF-8"), "utf8", GEANY_ENCODING_UTF_8); fill(LATEX_ENCODING_ASCII, _("US-ASCII"), "ascii", GEANY_ENCODING_ISO_8859_1);
Modified: trunk/geanylatex/src/latexencodings.h =================================================================== --- trunk/geanylatex/src/latexencodings.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/latexencodings.h 2009-02-18 00:20:44 UTC (rev 488) @@ -51,6 +51,6 @@
extern LaTeXEncodings latex_encodings[LATEX_ENCODINGS_MAX];
-void init_encodings_latex(void); +void glatex_init_encodings_latex(void);
#endif
Modified: trunk/geanylatex/src/latexutils.c =================================================================== --- trunk/geanylatex/src/latexutils.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/latexutils.c 2009-02-18 00:20:44 UTC (rev 488) @@ -41,7 +41,7 @@ return result; }
-const gchar *get_aux_file() +const gchar *glatex_get_aux_file() { GeanyDocument *doc = NULL; gchar *locale_filename = NULL;
Modified: trunk/geanylatex/src/latexutils.h =================================================================== --- trunk/geanylatex/src/latexutils.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/latexutils.h 2009-02-18 00:20:44 UTC (rev 488) @@ -25,6 +25,6 @@
gchar **geanylatex_read_file_in_array(const gchar *filename);
-const gchar *get_aux_file(); +const gchar *glatex_get_aux_file();
#endif
Modified: trunk/geanylatex/src/letters.c =================================================================== --- trunk/geanylatex/src/letters.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/letters.c 2009-02-18 00:20:44 UTC (rev 488) @@ -35,7 +35,7 @@ LETTERS_END };
-CategoryName cat_names[] = { +CategoryName glatex_cat_names[] = { { GREEK_LETTERS, N_("Greek letters"), TRUE}, { GERMAN_LETTERS, N_("German umlauts"), TRUE}, { MISC_LETTERS, N_("Misc"), FALSE}, @@ -50,7 +50,7 @@ * AAABBBCCC is valid * AAACCCBBB is valid * ACABCBACB is _not_ valid and will course trouble */ -SubMenuTemplate char_array[] = { +SubMenuTemplate glatex_char_array[] = { /* Greek characters */ {GREEK_LETTERS, "Α", "\Alpha" }, {GREEK_LETTERS, "α", "\alpha" },
Modified: trunk/geanylatex/src/letters.h =================================================================== --- trunk/geanylatex/src/letters.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/letters.h 2009-02-18 00:20:44 UTC (rev 488) @@ -25,8 +25,8 @@
#include "datatypes.h"
-extern SubMenuTemplate char_array[]; +extern SubMenuTemplate glatex_char_array[];
-extern CategoryName cat_names[]; +extern CategoryName glatex_cat_names[];
#endif
Modified: trunk/geanylatex/src/reftex.c =================================================================== --- trunk/geanylatex/src/reftex.c 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/reftex.c 2009-02-18 00:20:44 UTC (rev 488) @@ -23,7 +23,7 @@ #include "reftex.h" #include "latexutils.h"
-void add_Labels(GtkWidget *combobox, const gchar *file) +void glatex_add_Labels(GtkWidget *combobox, const gchar *file) { gchar **aux_entries = NULL; int i = 0; @@ -37,7 +37,7 @@ { if (g_str_has_prefix(aux_entries[i], "\newlabel")) { - tmp = parseLine(aux_entries[i]); + tmp = glatex_parseLine(aux_entries[i]); gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp.label_name); } } @@ -45,7 +45,7 @@ } }
-LaTeXLabel parseLine(const gchar *line) +LaTeXLabel glatex_parseLine(const gchar *line) { LaTeXLabel label;
Modified: trunk/geanylatex/src/reftex.h =================================================================== --- trunk/geanylatex/src/reftex.h 2009-02-18 00:19:52 UTC (rev 487) +++ trunk/geanylatex/src/reftex.h 2009-02-18 00:20:44 UTC (rev 488) @@ -31,8 +31,8 @@ gchar *chapter; } LaTeXLabel;
-void add_Labels(GtkWidget *combobox, const gchar *file); +void glatex_add_Labels(GtkWidget *combobox, const gchar *file);
-LaTeXLabel parseLine(const gchar *line); +LaTeXLabel glatex_parseLine(const gchar *line);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.