Revision: 803 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=803&view=rev Author: frlan Date: 2009-07-06 19:13:55 +0000 (Mon, 06 Jul 2009)
Log Message: ----------- GeanyLaTeX: Prefix bibTeX enums with GLATEX_BIBTEX_ to make it ore clear
Modified Paths: -------------- trunk/geanylatex/src/bibtex.c trunk/geanylatex/src/bibtex.h trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/bibtex.c =================================================================== --- trunk/geanylatex/src/bibtex.c 2009-07-04 16:22:56 UTC (rev 802) +++ trunk/geanylatex/src/bibtex.c 2009-07-06 19:13:55 UTC (rev 803) @@ -45,88 +45,88 @@ G_GNUC_UNUSED gpointer gdata) { int doctype = GPOINTER_TO_INT(gdata); - gboolean fields[N_ENTRIES]; + gboolean fields[GLATEX_BIBTEX_N_ENTRIES]; gchar *output = g_strdup("@"); int i;
- for (i = 0; i < N_ENTRIES; i++) + for (i = 0; i < GLATEX_BIBTEX_N_ENTRIES; i++) { glatex_set_status(i, FALSE); }
switch(doctype) { - case ARTICLE: - glatex_set_status(AUTHOR, TRUE); - glatex_set_status(TITLE, TRUE); - glatex_set_status(JOURNAL, TRUE); - glatex_set_status(YEAR, TRUE); + case GLATEX_BIBTEX_ARTICLE: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_JOURNAL, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case BOOK: - 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); + case GLATEX_BIBTEX_BOOK: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_EDITOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_PUBLISHER, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case BOOKLET: - glatex_set_status(TITLE, TRUE); + case GLATEX_BIBTEX_BOOKLET: + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); break; - case CONFERENCE: - case INCOLLECTION: - case INPROCEEDINGS: - glatex_set_status(AUTHOR, TRUE); - glatex_set_status(TITLE, TRUE); - glatex_set_status(BOOKTITLE, TRUE); - glatex_set_status(YEAR, TRUE); + case GLATEX_BIBTEX_CONFERENCE: + case GLATEX_BIBTEX_INCOLLECTION: + case GLATEX_BIBTEX_INPROCEEDINGS: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_BOOKTITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case INBOOK: - 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); + case GLATEX_BIBTEX_INBOOK: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_EDITOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_CHAPTER, TRUE); + glatex_set_status(GLATEX_BIBTEX_PAGES, TRUE); + glatex_set_status(GLATEX_BIBTEX_PUBLISHER, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case MANUAL: - glatex_set_status(TITLE, TRUE); + case GLATEX_BIBTEX_MANUAL: + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); break; - case MASTERSTHESIS: - case PHDTHESIS: - glatex_set_status(AUTHOR, TRUE); - glatex_set_status(TITLE, TRUE); - glatex_set_status(SCHOOL, TRUE); - glatex_set_status(YEAR, TRUE); + case GLATEX_BIBTEX_MASTERSTHESIS: + case GLATEX_BIBTEX_PHDTHESIS: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_SCHOOL, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case MISC: - for (i = 0; i < N_ENTRIES; i++) + case GLATEX_BIBTEX_MISC: + for (i = 0; i < GLATEX_BIBTEX_N_ENTRIES; i++) { glatex_set_status(i, TRUE); } - case TECHREPORT: - glatex_set_status(AUTHOR, TRUE); - glatex_set_status(TITLE, TRUE); - glatex_set_status(INSTITUTION, TRUE); - glatex_set_status(YEAR, TRUE); + case GLATEX_BIBTEX_TECHREPORT: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_INSTITUTION, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; - case UNPUBLISHED: - glatex_set_status(AUTHOR, TRUE); - glatex_set_status(TITLE, TRUE); - glatex_set_status(NOTE, TRUE); + case GLATEX_BIBTEX_UNPUBLISHED: + glatex_set_status(GLATEX_BIBTEX_AUTHOR, TRUE); + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_NOTE, TRUE); break; - case PROCEEDINGS: - glatex_set_status(TITLE, TRUE); - glatex_set_status(YEAR, TRUE); + case GLATEX_BIBTEX_PROCEEDINGS: + glatex_set_status(GLATEX_BIBTEX_TITLE, TRUE); + glatex_set_status(GLATEX_BIBTEX_YEAR, TRUE); break; default: - for (i = 0; i < N_ENTRIES; i++) + for (i = 0; i < GLATEX_BIBTEX_N_ENTRIES; i++) { glatex_set_status(i, TRUE); } }
output = g_strconcat(output, glatex_label_types[doctype], "{ \n",NULL); - for (i = 0; i < N_ENTRIES; i++) + for (i = 0; i < GLATEX_BIBTEX_N_ENTRIES; i++) { if (fields[i] == TRUE) { @@ -139,3 +139,4 @@
g_free(output); } +
Modified: trunk/geanylatex/src/bibtex.h =================================================================== --- trunk/geanylatex/src/bibtex.h 2009-07-04 16:22:56 UTC (rev 802) +++ trunk/geanylatex/src/bibtex.h 2009-07-06 19:13:55 UTC (rev 803) @@ -27,52 +27,52 @@
/* Define generic stuff */ enum { - ARTICLE = 0, - BOOK, - BOOKLET, - CONFERENCE, - INBOOK, - INCOLLECTION, - INPROCEEDINGS, - MANUAL, - MASTERSTHESIS, - MISC, - PHDTHESIS, - PROCEEDINGS, - TECHREPORT, - UNPUBLISHED, - N_TYPES + GLATEX_BIBTEX_ARTICLE = 0, + GLATEX_BIBTEX_BOOK, + GLATEX_BIBTEX_BOOKLET, + GLATEX_BIBTEX_CONFERENCE, + GLATEX_BIBTEX_INBOOK, + GLATEX_BIBTEX_INCOLLECTION, + GLATEX_BIBTEX_INPROCEEDINGS, + GLATEX_BIBTEX_MANUAL, + GLATEX_BIBTEX_MASTERSTHESIS, + GLATEX_BIBTEX_MISC, + GLATEX_BIBTEX_PHDTHESIS, + GLATEX_BIBTEX_PROCEEDINGS, + GLATEX_BIBTEX_TECHREPORT, + GLATEX_BIBTEX_UNPUBLISHED, + GLATEX_BIBTEX_N_TYPES };
enum { - ADDRESS = 0, - ANNOTE, - AUTHOR, - BOOKTITLE, - CHAPTER, - CROSSREF, - EDITION, - EDITOR, - EPRINT, - HOWPUBLISHED, - INSTITUTION, - JOURNAL, - KEY, - MONTH, - NOTE, - NUMBER, - ORGANIZATION, - PAGES, - PUBLISHER, - SCHOOL, - SERIES, - TITLE, - TYPE, - URL, - VOLUME, - YEAR, - N_ENTRIES + GLATEX_BIBTEX_ADDRESS = 0, + GLATEX_BIBTEX_ANNOTE, + GLATEX_BIBTEX_AUTHOR, + GLATEX_BIBTEX_BOOKTITLE, + GLATEX_BIBTEX_CHAPTER, + GLATEX_BIBTEX_CROSSREF, + GLATEX_BIBTEX_EDITION, + GLATEX_BIBTEX_EDITOR, + GLATEX_BIBTEX_EPRINT, + GLATEX_BIBTEX_HOWPUBLISHED, + GLATEX_BIBTEX_INSTITUTION, + GLATEX_BIBTEX_JOURNAL, + GLATEX_BIBTEX_KEY, + GLATEX_BIBTEX_MONTH, + GLATEX_BIBTEX_NOTE, + GLATEX_BIBTEX_NUMBER, + GLATEX_BIBTEX_ORGANIZATION, + GLATEX_BIBTEX_PAGES, + GLATEX_BIBTEX_PUBLISHER, + GLATEX_BIBTEX_SCHOOL, + GLATEX_BIBTEX_SERIES, + GLATEX_BIBTEX_TITLE, + GLATEX_BIBTEX_TYPE, + GLATEX_BIBTEX_URL, + GLATEX_BIBTEX_VOLUME, + GLATEX_BIBTEX_YEAR, + GLATEX_BIBTEX_N_ENTRIES };
extern gchar *glatex_label_types[];
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-07-04 16:22:56 UTC (rev 802) +++ trunk/geanylatex/src/geanylatex.c 2009-07-06 19:13:55 UTC (rev 803) @@ -1241,7 +1241,7 @@ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_bibtex), menu_latex_bibtex_submenu);
- for (i = 0; i < N_TYPES; i++) + for (i = 0; i < GLATEX_BIBTEX_N_TYPES; i++) { tmp = NULL; tmp = gtk_menu_item_new_with_mnemonic(_(glatex_label_types[i]));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org