Revision: 150 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=150&view=rev Author: frlan Date: 2008-08-31 23:29:18 +0000 (Sun, 31 Aug 2008)
Log Message: ----------- GeanyLaTeX: Ported build system of spellcheck plugin
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/Makefile.am trunk/geanylatex/configure.in trunk/geanylatex/makefile.win32
Added Paths: ----------- trunk/geanylatex/po/ trunk/geanylatex/po/ChangeLog trunk/geanylatex/po/POTFILES.in trunk/geanylatex/po/geanylatex.pot trunk/geanylatex/src/ trunk/geanylatex/src/Makefile.am trunk/geanylatex/src/datatypes.h trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/latexencodings.c trunk/geanylatex/src/latexencodings.h trunk/geanylatex/src/letters.c trunk/geanylatex/src/letters.h
Removed Paths: ------------- trunk/geanylatex/datatypes.h trunk/geanylatex/geanylatex.c trunk/geanylatex/latexencodings.c trunk/geanylatex/latexencodings.h trunk/geanylatex/letters.c trunk/geanylatex/letters.h
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/ChangeLog 2008-08-31 23:29:18 UTC (rev 150) @@ -1,3 +1,8 @@ +2008-09-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Ported build system of spellcheck plugin. + + 2008-07-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Make plugin work together with Geany plugin API v78.
Modified: trunk/geanylatex/Makefile.am =================================================================== --- trunk/geanylatex/Makefile.am 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/Makefile.am 2008-08-31 23:29:18 UTC (rev 150) @@ -1,17 +1,17 @@ -## Makefile.am -- Process this file with automake to produce Makefile.in -#SUBDIRS = tests +SUBDIRS = src po
-noinst_HEADERS = makefile.win32 +EXTRA_DIST = \ + autogen.sh \ + makefile.win32 \ + po/LINGUAS
-lib_LTLIBRARIES = geanylatex.la -geanylatex_la_SOURCES = geanylatex.c letters.c latexencodings.c latexencodings.h letters.h datatypes.h -geanylatex_la_LDFLAGS = -module -avoid-version -geanylatex_la_LIBADD = @GEANY_LIBS@ +dist-bzip2: distdir + BZIP2=$(BZIP2_ENV) $(AMTAR) --bzip2 -chof $(distdir).tar.bz2 $(distdir) + -rm -rf $(distdir)
-AM_CPPFLAGS = @GEANY_CFLAGS@ -DGEANY_DISABLE_DEPRECATED +sign: + if test -f $(PACKAGE)-$(VERSION).tar.gz; then \ + gpg --detach-sign --digest-algo SHA512 $(PACKAGE)-$(VERSION).tar.gz; fi + if test -f $(PACKAGE)-$(VERSION).tar.bz2; then \ + gpg --detach-sign --digest-algo SHA512 $(PACKAGE)-$(VERSION).tar.bz2; fi
-GEANY_DIR = $(shell geany --print-prefix | grep lib) - -install: .libs/$(PACKAGE).so - mkdir -p $(DESTDIR)$(GEANY_DIR)/geany - cp $< $(DESTDIR)$(GEANY_DIR)/geany/
Modified: trunk/geanylatex/configure.in =================================================================== --- trunk/geanylatex/configure.in 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/configure.in 2008-08-31 23:29:18 UTC (rev 150) @@ -1,17 +1,61 @@ -dnl Process this file with autoconf to produce a configure script. +# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.59) +AC_INIT(configure.in) +AM_INIT_AUTOMAKE(geanylatex, 0.2svn)
-AC_INIT([geanylatex], [0.2-dev], [frank@frank.uvena.de]) +AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([1.9 foreign]) +AC_PROG_CC
-AC_PROG_CC +AC_DISABLE_STATIC AM_PROG_LIBTOOL +LIBTOOL="$LIBTOOL --silent"
+AC_PROG_INSTALL + +# checking for Geany PKG_CHECK_MODULES(GEANY, [geany >= 0.15]) -AC_SUBST(GEANY_CFLAGS) -AC_SUBST(GEANY_LIBS) +AC_SUBST(GTK_CFLAGS) +AC_SUBST(GTK_LIBS)
-AC_CONFIG_FILES([Makefile]) -AC_OUTPUT +GEANY_VERSION=`$PKG_CONFIG --modversion geany` +GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0` + +# i18n +GETTEXT_PACKAGE=geanylatex +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) + +ALL_LINGUAS="`sed -e '/^#/d' $srcdir/po/LINGUAS`" # take all languages found in file po/LINGUAS + +AM_GLIB_GNU_GETTEXT +# workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845) +if test "x$MSGFMT" = "xno"; then + AC_MSG_ERROR([msgfmt not found. Please install the gettext package.]) +fi + +# intltool hack to define install_sh on Debian/Ubuntu systems +if test "x$install_sh" = "x"; then + install_sh="`pwd`/install-sh" + AC_SUBST(install_sh) +fi + +# get the plugin installed at the correct location for Geany +# TODO find a way to NOT override --libdir command line option if given +libdir="`$PKG_CONFIG --variable=libdir geany`/geany" + + +AC_OUTPUT([ +Makefile +src/Makefile +po/Makefile.in +]) + +echo "----------------------------------------" +echo "Install geanylatex plugin binary in : ${libdir}" +echo "Install geanylatex in : ${prefix}" +echo "Using Geany version : ${GEANY_VERSION}" +echo "Using GTK version : ${GTK_VERSION}" +echo "" +echo "Configuration is done OK." +echo ""
Deleted: trunk/geanylatex/datatypes.h =================================================================== --- trunk/geanylatex/datatypes.h 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/datatypes.h 2008-08-31 23:29:18 UTC (rev 150) @@ -1,40 +0,0 @@ -/* - * datatypes.h - * - * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef DATATYPES_H -#define DATATYPES_H - -typedef struct -{ - gint cat; - gchar *label; - gchar *latex; -} SubMenuTemplate; - - -typedef struct -{ - gint cat; - gchar *label; - gboolean sorted; -} CategoryName; - -#endif
Deleted: trunk/geanylatex/geanylatex.c =================================================================== --- trunk/geanylatex/geanylatex.c 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/geanylatex.c 2008-08-31 23:29:18 UTC (rev 150) @@ -1,866 +0,0 @@ -/* - * geanylatex.c - Plugin to let Geany better work together with LaTeX - * - * Copyright 2007-2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * For long list of friendly supporters please have a look at THANKS. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* LaTeX plugin */ -/* This plugin improves the work with LaTeX and Geany.*/ - -#include "geany.h" -#include "support.h" -#include "plugindata.h" -#include "document.h" -#include "editor.h" -#include "filetypes.h" -#include "templates.h" -#include "utils.h" -#include "ui_utils.h" -#include "keybindings.h" -#include "prefs.h" -#include "pluginmacros.h" - -#include "datatypes.h" -#include "letters.h" -#include "latexencodings.h" - -typedef void (*SubMenuCallback) (G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata); - -PluginInfo *plugin_info; -PluginFields *plugin_fields; -GeanyData *geany_data; -GeanyFunctions *geany_functions; - - -PLUGIN_VERSION_CHECK(78) -PLUGIN_SET_INFO(_("LaTeX"), _("Plugin to make Geany better support LaTeX"), "0.2-dev", - "Frank Lanitz frank@frank.uvena.de") - -GtkWidget *menu_latex = NULL; -GtkWidget *menu_latex_menu = NULL; -GtkWidget *menu_latex_wizzard = NULL; -GtkWidget *menu_latex_menu_special_char = NULL; -GtkWidget *menu_latex_menu_special_char_submenu = NULL; -GtkWidget *menu_latex_ref = NULL; -GtkWidget *menu_latex_label = NULL; - -/* Doing some basic keybinding stuff */ -enum -{ - LATEX_WIZZARD_KB, - LATEX_INSERT_LABEL_KB, - LATEX_INSERT_REF_KB, - COUNT_KB -}; - -PLUGIN_KEY_GROUP(geanylatex, COUNT_KB) - - -#define TEMPLATE_LATEX "\ -\documentclass[{CLASSOPTION}]{{DOCUMENTCLASS}}\n\ -{ENCODING}\ -{TITLE}\ -{AUTHOR}\ -{DATE}\ -\begin{document}\n\ -\n\ -\end{document}\n" - -#define create_sub_menu(base_menu, menu, item, title) \ - (menu) = gtk_menu_new(); \ - (item) = gtk_menu_item_new_with_mnemonic((title)); \ - gtk_menu_item_set_submenu(GTK_MENU_ITEM((item)), (menu)); \ - gtk_container_add(GTK_CONTAINER(base_menu), (item)); \ - gtk_widget_show((item)); - -#define MAX_MENU_ENTRIES 20 - -static void -insert_string(gchar *string) -{ - GeanyDocument *doc = NULL; - - doc = p_document->get_current(); - - if (doc != NULL) - { - gint pos = p_sci->get_current_position(doc->editor->sci); - p_sci->insert_text(doc->editor->sci, pos, string); - } -} - - -inline gchar* -get_latex_command(gint tab_index) -{ - return char_array[tab_index].latex; -} - -static void -char_insert_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) -{ - insert_string(get_latex_command(GPOINTER_TO_INT(gdata))); -} - -static void -insert_label_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) -{ - GtkWidget *dialog = NULL; - GtkWidget *vbox = NULL; - GtkWidget *label = NULL; - GtkWidget *textbox_label = NULL; - GtkWidget *table = NULL; - - dialog = gtk_dialog_new_with_buttons(_("Insert label"), - GTK_WINDOW(geany->main_widgets->window), - GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL); - vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); - gtk_widget_set_name(dialog, "GeanyDialog"); - gtk_box_set_spacing(GTK_BOX(vbox), 10); - - table = gtk_table_new(1, 2, FALSE); - gtk_table_set_col_spacings(GTK_TABLE(table), 6); - gtk_table_set_row_spacings(GTK_TABLE(table), 6); - - label = gtk_label_new(_("Label name:")); - textbox_label = gtk_entry_new(); - - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1); - gtk_table_attach_defaults(GTK_TABLE(table), textbox_label, 1, 2, 0, 1); - gtk_container_add(GTK_CONTAINER(vbox), table); - - gtk_widget_show_all(vbox); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) - { - gchar *label_str = NULL; - label_str = g_strconcat("\label{", g_strdup(gtk_entry_get_text(GTK_ENTRY(textbox_label))), "}", NULL); - insert_string(label_str); - } - gtk_widget_destroy(dialog); -} - -static void -insert_ref_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) -{ - GtkWidget *dialog; - GtkWidget *vbox = NULL; - GtkWidget *label_ref = NULL; - GtkWidget *textbox_ref = NULL; - GtkWidget *table = NULL; - GtkWidget *radio1 = NULL; - GtkWidget *radio2 = NULL; - - dialog = gtk_dialog_new_with_buttons(_("Insert reference"), - GTK_WINDOW(geany->main_widgets->window), - GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL); - vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); - gtk_widget_set_name(dialog, "GeanyDialog"); - gtk_box_set_spacing(GTK_BOX(vbox), 10); - - table = gtk_table_new(1, 2, FALSE); - gtk_table_set_col_spacings(GTK_TABLE(table), 6); - gtk_table_set_row_spacings(GTK_TABLE(table), 6); - - label_ref = gtk_label_new(_("Ref name:")); - textbox_ref = gtk_entry_new(); - - gtk_misc_set_alignment(GTK_MISC(label_ref), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label_ref, 0, 1, 0, 1); - gtk_table_attach_defaults(GTK_TABLE(table), textbox_ref, 1, 2, 0, 1); - gtk_container_add(GTK_CONTAINER(vbox), table); - - radio1 = gtk_radio_button_new_with_label(NULL, - _("standard reference")); - gtk_button_set_focus_on_click(GTK_BUTTON(radio1), FALSE); - gtk_container_add(GTK_CONTAINER(vbox), radio1); - - radio2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio1), - _("page reference")); - gtk_button_set_focus_on_click(GTK_BUTTON(radio2), FALSE); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio2), FALSE); - gtk_container_add(GTK_CONTAINER(vbox), radio2); - - gtk_widget_show_all(vbox); - - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) - { - gchar *ref_string = NULL; - - ref_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(textbox_ref))); - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio2)) == FALSE) - { - ref_string = g_strconcat("\ref{", ref_string, "}", NULL); - } - else - { - ref_string = g_strconcat("\pageref{", ref_string, "}", NULL); - } - - if (ref_string != NULL) - { - insert_string(ref_string); - g_free(ref_string); - } - } - - gtk_widget_destroy(dialog); -} - -static void character_create_menu_item(GtkWidget *menu, const gchar *label, gint letter, SubMenuCallback callback) -{ - GtkWidget *tmp; - - tmp = gtk_menu_item_new_with_label(label); - gtk_widget_show(tmp); - gtk_container_add(GTK_CONTAINER(menu), tmp); - g_signal_connect((gpointer) tmp, "activate", G_CALLBACK(callback), GINT_TO_POINTER(letter)); -} - -/* returns -1, if there are more than gint can work with or any other error - * 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 -count_menu_entries(SubMenuTemplate *tmp, gint categorie) -{ - // TODO: Reset max value for to stop before it's too late - gint i; - gint count = 0; - if (categorie == -1) - { - for (i =1; tmp[i].label != NULL; i++) - { - count = count + 1; - } - } - else - { - for (i = 1; tmp[i].label != NULL; i++) - { - if (tmp[i].cat == categorie) - { - count = count + 1; - } - if (i >= 256) - { - count = -1; - break; - } - } - } - return count; -} - -gint -count_menu_cat_entries(CategoryName *tmp) -{ - gint i; - - for (i = 0; tmp[i].label != NULL; i++); - return i; -} - -void sub_menu_init(GtkWidget *base_menu, SubMenuTemplate *menu_template, CategoryName *category_name, SubMenuCallback callback_function) -{ - gint i; - gint j; - gint max_menu_entries = MAX_MENU_ENTRIES; - gint categories = count_menu_cat_entries(category_name); - GtkWidget *sub_menu = NULL; - GtkWidget *sub_menu_cat[categories][2]; - GtkWidget *active_submenu = NULL; - - // Creates sub menus based on information from letter.h - for (i = 0; i < categories; i++) - { - if (count_menu_entries(menu_template, i) > 0) - { - create_sub_menu(base_menu, sub_menu_cat[i][0], - sub_menu_cat[i][1], category_name[i].label); - } - } - - // Searching for all categories - for (i = 0; i < categories; i++) - { - gboolean split = FALSE; - gboolean last_sub_menu = FALSE; - gboolean sorted = category_name[i].sorted; - gint local_count = 0; // To check whether we need to build up a new sub sub menu. - gint item_count = count_menu_entries(menu_template, i); - - if (item_count < 1) - continue; - - // Default is, not to split anything to make menu not - // deeper than realy needed. - if (item_count > max_menu_entries) - { - split = TRUE; - } - - // Setting active sub menu to sub menu of catagorie - sub_menu = sub_menu_cat[i][0]; - active_submenu = sub_menu; - // Finding entries for each categorie - - for (j = 0; menu_template[j].latex != NULL; j++) - { - if (menu_template[j].cat == i) - { - // Creates a new sub sub menu if needed - if (split == TRUE && (local_count % max_menu_entries) == 0) - { - gint next_split_point = 0; - GtkWidget *tmp = NULL; - GtkWidget *tmp_item = NULL; - - sub_menu = active_submenu; - - for (next_split_point = 0; - next_split_point < max_menu_entries ; next_split_point ++) - { - if (menu_template[j+next_split_point].cat != i) - { - last_sub_menu = TRUE; - break; - } - - } - - if (sorted == TRUE) - { - create_sub_menu(sub_menu_cat[i][0], tmp, tmp_item, g_strconcat(menu_template[j].label, " ... ", menu_template[j + next_split_point-1].label, NULL)); - - sub_menu = tmp; - } - else if (sorted == FALSE) - { - if (last_sub_menu == FALSE) - { - create_sub_menu(sub_menu, tmp, tmp_item, _("More")); - sub_menu = active_submenu; - active_submenu = tmp; - } - } - } - - // Sets the counter to keep in track if a new submenu needs to be build up - local_count = local_count + 1; - character_create_menu_item(sub_menu, g_strconcat(menu_template[j].label, "\t", menu_template[j].latex, NULL), j, callback_function); - } - } - } -} - -static int -find_latex_enc(gint l_geany_enc) -{ - guint i; - for (i = 0; i < LATEX_ENCODINGS_MAX; i++) - { - if (latex_encodings[i].geany_enc == l_geany_enc) - return i; - } - return LATEX_ENCODING_NONE; -} - - -static void -show_output(const gchar * output, const gchar * name, const gint local_enc) -{ - GeanyDocument *doc = NULL; - GeanyFiletype *ft = p_filetypes->lookup_by_name("LaTeX"); - - if (output) - { - doc = p_document->new_file(name, ft, output); - p_document->set_encoding(doc, p_encodings->get_charset_from_index(latex_encodings[local_enc].geany_enc)); - } - -} - -static void -wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) -{ - gint i; - GString *code = NULL; - gchar *author = NULL; - gchar *date = NULL; - gchar *output = NULL; - gchar *classoptions = NULL; - gchar *title = NULL; - gchar *enc_latex_char = NULL; - gchar *documentclass_str = NULL; - gchar *papersize = NULL; - gchar *draft = NULL; - gchar *scriptsize = NULL; - gint documentclass_int; - gint encoding_int; - gint papersize_int; - gint scriptsize_int; - GtkWidget *dialog = NULL; - GtkWidget *vbox = NULL; - GtkWidget *label_documentclass = NULL; - GtkWidget *documentclass_combobox = NULL; - GtkWidget *label_encoding = NULL; - GtkWidget *encoding_combobox = NULL; - GtkWidget *scriptsize_combobox = NULL; - GtkWidget *label_scriptsize = NULL; - GtkWidget *table = NULL; - GtkWidget *checkbox_KOMA = NULL; - GtkWidget *author_textbox = NULL; - GtkWidget *label_author = NULL; - GtkWidget *date_textbox = NULL; - GtkWidget *label_date = NULL; - GtkWidget *title_textbox = NULL; - GtkWidget *label_title = NULL; - GtkWidget *papersize_combobox = NULL; - GtkWidget *label_papersize = NULL; - GtkWidget *checkbox_draft = NULL; - gboolean KOMA_active = TRUE; - gboolean draft_active = FALSE; - - GtkTooltips *tooltip = NULL; - - tooltip = gtk_tooltips_new(); - - // Creating and formating table - table = gtk_table_new(2, 6, FALSE); - gtk_table_set_col_spacings(GTK_TABLE(table), 6); - gtk_table_set_row_spacings(GTK_TABLE(table), 6); - - // Documentclass - label_documentclass = gtk_label_new(_("Documentclass:")); - documentclass_combobox = gtk_combo_box_new_text(); - gtk_tooltips_set_tip(tooltip, documentclass_combobox, - _("Chooce the kind of document you want to write"), NULL); - gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 0, "Book"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 1, "Article"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 2, "Report"); - - gtk_combo_box_set_active(GTK_COMBO_BOX(documentclass_combobox), 0); - - gtk_misc_set_alignment(GTK_MISC(label_documentclass), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label_documentclass, 0, 1, 0, 1); - gtk_table_attach_defaults(GTK_TABLE(table), documentclass_combobox, 1, 2, 0, 1); - - // Encoding - label_encoding = gtk_label_new(_("Encoding:")); - - encoding_combobox = gtk_combo_box_new_text(); - gtk_tooltips_set_tip(tooltip, encoding_combobox, - _("Set the encoding for your new document"), NULL); - for (i = 0; i < LATEX_ENCODINGS_MAX; i++) - { - gtk_combo_box_insert_text(GTK_COMBO_BOX(encoding_combobox), i, - latex_encodings[i].name); - } - - gtk_combo_box_set_active(GTK_COMBO_BOX(encoding_combobox), find_latex_enc(geany_data->file_prefs->default_new_encoding)); - - gtk_misc_set_alignment(GTK_MISC(label_encoding), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label_encoding, 0, 1, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), encoding_combobox, 1, 2, 1, 2); - - // Scriptsize - label_scriptsize = gtk_label_new(_("Scriptsize:")); - scriptsize_combobox = gtk_combo_box_new_text(); - gtk_tooltips_set_tip(tooltip, scriptsize_combobox, - _("Set the default script size of your new document"), NULL); - gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 0, "10pt"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 1, "11pt"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 2, "12pt"); - - gtk_combo_box_set_active(GTK_COMBO_BOX(scriptsize_combobox), 0); - - gtk_misc_set_alignment(GTK_MISC(label_scriptsize), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label_scriptsize, 0, 1, 2, 3); - gtk_table_attach_defaults(GTK_TABLE(table), scriptsize_combobox, 1, 2, 2, 3); - - // Author - label_author = gtk_label_new(_("Author:")); - author_textbox = gtk_entry_new(); - gtk_tooltips_set_tip(tooltip, author_textbox, - _("Sets the entry of \author command. In most cases here should stay your name"), NULL); - if (geany_data->template_prefs->developer != NULL) - { - author = geany_data->template_prefs->developer; - gtk_entry_set_text(GTK_ENTRY(author_textbox), author); - } - gtk_misc_set_alignment(GTK_MISC(label_author), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label_author, 0, 1, 3, 4); - gtk_table_attach_defaults(GTK_TABLE(table), author_textbox, 1, 2, 3, 4); - - // Date - label_date = gtk_label_new(_("Date:")); - date_textbox = gtk_entry_new(); - gtk_tooltips_set_tip(tooltip, date_textbox, - _("Sets the entry of the \date command inside header of your newly created LaTeX-document. Keeping it at \today is a good decision if you don't need any fixed date."), NULL); - gtk_entry_set_text(GTK_ENTRY(date_textbox), "\today"); - gtk_misc_set_alignment(GTK_MISC(label_date), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label_date, 0, 1, 4, 5); - gtk_table_attach_defaults(GTK_TABLE(table), date_textbox, 1, 2, 4, 5); - - // Title of the new document - label_title = gtk_label_new(_("Title:")); - title_textbox = gtk_entry_new(); - gtk_tooltips_set_tip(tooltip, title_textbox, _("Sets the title of your newly document."), - NULL); - gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0.5); - gtk_table_attach_defaults(GTK_TABLE(table), label_title, 0, 1, 5, 6); - gtk_table_attach_defaults(GTK_TABLE(table), title_textbox, 1, 2, 5, 6); - - // Papersize - label_papersize = gtk_label_new(_("Paper size:")); - papersize_combobox = gtk_combo_box_new_text(); - gtk_tooltips_set_tip(tooltip, papersize_combobox, - _("Chooce the paper format for the new created document"), NULL); - gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 0, "A4"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 1, "A5"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 2, "A6"); - - gtk_combo_box_set_active(GTK_COMBO_BOX(papersize_combobox), 0); - - gtk_misc_set_alignment(GTK_MISC(label_papersize), 0, 0.5); - - gtk_table_attach_defaults(GTK_TABLE(table), label_papersize, 0, 1, 6, 7); - gtk_table_attach_defaults(GTK_TABLE(table), papersize_combobox, 1, 2, 6, 7); - - gtk_widget_show_all(table); - - // Buidling the wizard-dialog and showing it - dialog = gtk_dialog_new_with_buttons(_("LaTeX-Wizard"), - GTK_WINDOW(geany->main_widgets->window), - GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL); - vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); - gtk_widget_set_name(dialog, "GeanyDialog"); - gtk_box_set_spacing(GTK_BOX(vbox), 10); - gtk_container_add(GTK_CONTAINER(vbox), table); - - checkbox_KOMA = gtk_check_button_new_with_label(_("Use KOMA-script classes if possible")); - gtk_tooltips_set_tip(tooltip, checkbox_KOMA, - _ - ("Uses the KOMA-script classes by Markus Kohm.\nKeep in mind: To compile your document these classes have to been installed before."), - NULL); - gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_KOMA), FALSE); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_KOMA), KOMA_active); - gtk_box_pack_start(GTK_BOX(vbox), checkbox_KOMA, FALSE, FALSE, 5); - - checkbox_draft = gtk_check_button_new_with_label(_("Use draft mode")); - gtk_tooltips_set_tip(tooltip, checkbox_draft, - _("Set the draft flag inside new created documents to get documents with a number of debugging helpers"), NULL); - gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_draft), FALSE); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_draft), draft_active); - gtk_box_pack_start(GTK_BOX(vbox), checkbox_draft, FALSE, FALSE, 5); - - gtk_widget_show_all(vbox); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) - { - KOMA_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_KOMA)); - draft_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_draft)); - documentclass_int = gtk_combo_box_get_active(GTK_COMBO_BOX(documentclass_combobox)); - encoding_int = gtk_combo_box_get_active(GTK_COMBO_BOX(encoding_combobox)); - enc_latex_char = g_strconcat("\usepackage[", latex_encodings[encoding_int].latex,"]{inputenc}\n", NULL); - author = g_strdup(gtk_entry_get_text(GTK_ENTRY(author_textbox))); - date = g_strdup(gtk_entry_get_text(GTK_ENTRY(date_textbox))); - title = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_textbox))); - papersize_int = gtk_combo_box_get_active(GTK_COMBO_BOX(papersize_combobox)); - switch (papersize_int) - { - case 0: - { - papersize = g_utf8_casefold("a4paper", -1); - break; - } - case 1: - { - papersize = g_utf8_casefold("a5paper", -1); - break; - } - case 2: - { - papersize = g_utf8_casefold("a6paper", -1); - break; - } - } - - scriptsize_int = gtk_combo_box_get_active(GTK_COMBO_BOX(scriptsize_combobox)); - switch (scriptsize_int) - { - case 0: - { - scriptsize = g_strconcat("10pt", NULL); - break; - } - case 1: - { - scriptsize = g_strconcat("11pt", NULL); - break; - } - case 2: - { - scriptsize = g_strconcat("12pt", NULL); - break; - } - } - - if (papersize != NULL) - { - classoptions = g_strconcat(papersize, NULL); - } - if (classoptions != NULL && draft_active == TRUE) - { - draft = g_utf8_casefold("draft", -1); - classoptions = g_strconcat(classoptions,",", draft, NULL); - } - else if (classoptions == NULL && draft_active == TRUE) - { - draft = g_utf8_casefold("draft", -1); - classoptions = g_strconcat(draft, NULL); - } - if (classoptions != NULL && scriptsize != NULL) - { - classoptions = g_strconcat(classoptions, ",", scriptsize, NULL); - } - else if (classoptions == NULL && scriptsize != NULL) - { - classoptions = g_strconcat(scriptsize, NULL); - } - - if (KOMA_active) - { - switch (documentclass_int) - { - case 0: - { - documentclass_str = g_utf8_casefold("scrbook", -1); - break; - } - case 1: - { - documentclass_str = g_utf8_casefold("scrartcl", -1); - break; - } - case 2: - { - documentclass_str = g_utf8_casefold("scrreprt", -1); - break; - } - } - } - else - { - switch (documentclass_int) - { - case 0: - { - documentclass_str = g_utf8_casefold("book", -1); - break; - } - case 1: - { - documentclass_str = g_utf8_casefold("article", -1); - break; - } - case 2: - { - documentclass_str = g_utf8_casefold("report", -1); - break; - } - } - } - - code = g_string_new(TEMPLATE_LATEX); - - if (classoptions != NULL) - { - p_utils->string_replace_all(code, "{CLASSOPTION}", classoptions); - g_free(classoptions); - } - if (documentclass_str != NULL) - { - p_utils->string_replace_all(code, "{DOCUMENTCLASS}", documentclass_str); - g_free(documentclass_str); - } - if (enc_latex_char != NULL) - { - p_utils->string_replace_all(code, "{ENCODING}", enc_latex_char); - g_free(enc_latex_char); - } - if (author != NULL) - { - if (author[0] != '\0') - { - author = g_strconcat("\author{", author, "}\n", NULL); - p_utils->string_replace_all(code, "{AUTHOR}", author); - } - else - p_utils->string_replace_all(code, "{AUTHOR}", "% \author{}\n"); - g_free(author); - } - if (date != NULL) - { - if (date[0] != '\0') - { - date = g_strconcat("\date{", date, "}\n", NULL); - p_utils->string_replace_all(code, "{DATE}", date); - } - else - p_utils->string_replace_all(code, "{DATE}", "% \date{}\n"); - g_free(date); - } - if (title != NULL) - { - if (title[0] != '\0') - { - title = g_strconcat("\title{", title, "}\n", NULL); - p_utils->string_replace_all(code, "{TITLE}", title); - } - else - p_utils->string_replace_all(code, "{TITLE}", "% \title{} \n"); - g_free(title); - } - output = g_string_free(code, FALSE); - show_output(output, NULL, encoding_int); - } - gtk_widget_destroy(dialog); -} - -static void -update_menu_items() -{ - GeanyDocument *doc = NULL; - gboolean have_file; - - doc = p_document->get_current(); - have_file = doc && doc->file_name && g_path_is_absolute(doc->file_name); - - if (have_file) - { - gtk_widget_set_sensitive(menu_latex_menu_special_char, TRUE); - gtk_widget_set_sensitive(menu_latex_ref, TRUE); - gtk_widget_set_sensitive(menu_latex_label, TRUE); - } - else - { - gtk_widget_set_sensitive(menu_latex_menu_special_char, FALSE); - gtk_widget_set_sensitive(menu_latex_ref, FALSE); - gtk_widget_set_sensitive(menu_latex_label, FALSE); - } - - gtk_widget_set_sensitive(menu_latex_wizzard, TRUE); - -} - -static void kblabel_insert(G_GNUC_UNUSED guint key_id) -{ - insert_label_activated(NULL, NULL); -} - -static void kbref_insert(G_GNUC_UNUSED guint key_id) -{ - insert_ref_activated(NULL, NULL); -} - -static void kbwizard(G_GNUC_UNUSED guint key_id) -{ - wizard_activated(NULL, NULL); -} - -void -plugin_init(G_GNUC_UNUSED GeanyData * data) -{ - GtkTooltips *tooltips = NULL; - - gchar *kblabel_insert_label = _("Insert \label"); - gchar *kblabel_insert_ref = _("Insert \ref"); - gchar *kblabel_wizard = _("Run LaTeX-Wizard"); - - init_encodings_latex(); - - tooltips = gtk_tooltips_new(); - - menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); - gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_latex); - g_signal_connect((gpointer) menu_latex, "activate", G_CALLBACK(update_menu_items), NULL); - - menu_latex_menu = gtk_menu_new(); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu); - - menu_latex_wizzard = gtk_menu_item_new_with_mnemonic(_("LaTeX-_Wizard")); - gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_wizzard); - gtk_tooltips_set_tip(tooltips, menu_latex_wizzard, - _("Starts a Wizard to create easily LaTeX-dokuments"), NULL); - - g_signal_connect((gpointer) menu_latex_wizzard, "activate", - G_CALLBACK(wizard_activated), NULL); - - menu_latex_menu_special_char = gtk_menu_item_new_with_mnemonic(_("Insert _Special Character")); - gtk_tooltips_set_tip(tooltips, menu_latex_menu_special_char, - _("Helps to use some not very common letters and signs"), NULL); - gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_menu_special_char); - - 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, char_insert_activated); - - menu_latex_ref = gtk_menu_item_new_with_mnemonic(_("Insert _Reference")); - gtk_tooltips_set_tip(tooltips, menu_latex_ref, - _("Inserting references to the document"), NULL); - gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_ref); - g_signal_connect((gpointer) menu_latex_ref, "activate", G_CALLBACK(insert_ref_activated), NULL); - - menu_latex_label = gtk_menu_item_new_with_mnemonic(_("Insert _Label")); - gtk_tooltips_set_tip(tooltips, menu_latex_label, - _("Helps at inserting labels to a docuemnt"), NULL); - gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_label); - g_signal_connect((gpointer) menu_latex_label, "activate", G_CALLBACK(insert_label_activated), NULL); - - /* init keybindins */ - p_keybindings->set_item(plugin_key_group, LATEX_WIZZARD_KB, kbwizard, - 0, 0, "run_latex_wizard", kblabel_wizard, menu_latex_wizzard); - p_keybindings->set_item(plugin_key_group, LATEX_INSERT_LABEL_KB, kblabel_insert, - 0, 0, "insert_latex_label", kblabel_insert_label, menu_latex_wizzard); - p_keybindings->set_item(plugin_key_group, LATEX_INSERT_REF_KB, kbref_insert, - 0, 0, "insert_latex_ref", kblabel_insert_ref, menu_latex_wizzard); - gtk_widget_show_all(menu_latex); - plugin_fields->menu_item = menu_latex; -} - -void -plugin_cleanup() -{ - gtk_widget_destroy(plugin_fields->menu_item); -}
Deleted: trunk/geanylatex/latexencodings.c =================================================================== --- trunk/geanylatex/latexencodings.c 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/latexencodings.c 2008-08-31 23:29:18 UTC (rev 150) @@ -1,55 +0,0 @@ -/* - * latexencodings.h - * - * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include <gtk/gtk.h> -#include "support.h" -#include "encodings.h" -#include "latexencodings.h" - -LaTeXEncodings latex_encodings[LATEX_ENCODINGS_MAX]; - -#define fill(Charset, Name, LaTeX, GeanyEnc) \ - latex_encodings[Charset].charset = Charset; \ - latex_encodings[Charset].name = Name; \ - latex_encodings[Charset].latex = LaTeX; \ - latex_encodings[Charset].geany_enc = GeanyEnc; - -void init_encodings_latex(void) -{ - fill(LATEX_ENCODING_UTF_8, _("UTF-8"), "utf8x", GEANY_ENCODING_UTF_8); - fill(LATEX_ENCODING_ASCII, _("US-ASCII"), "ascii", GEANY_ENCODING_ISO_8859_1); - fill(LATEX_ENCODING_ISO_8859_1, _("ISO-8859-1 (Latin-1)"), "latin1", - GEANY_ENCODING_ISO_8859_1); - fill(LATEX_ENCODING_ISO_8859_2, _("ISO-8859-2 (Latin-2)"), "latin2", - GEANY_ENCODING_ISO_8859_2); - fill(LATEX_ENCODING_ISO_8859_3, _("ISO-8859-3 (Latin-3)"), "latin3", - GEANY_ENCODING_ISO_8859_3); - fill(LATEX_ENCODING_ISO_8859_4, _("ISO-8859-4 (Latin-4)"), "latin4", - GEANY_ENCODING_ISO_8859_4); - fill(LATEX_ENCODING_ISO_8859_5, _("ISO-8859-5 (Latin-5)"), "latin5", - GEANY_ENCODING_ISO_8859_5); - fill(LATEX_ENCODING_ISO_8859_9, _("ISO-8859-9 (Latin-9)"), "latin9", - GEANY_ENCODING_ISO_8859_9); - fill(LATEX_ENCODING_ISO_8859_10, _("ISO-8859-10 (Latin-10)"), "latin10", GEANY_ENCODING_ISO_8859_10); - fill(LATEX_ENCODING_IBM_850, _("IBM 850 code page"), "cp850", GEANY_ENCODING_IBM_850); - fill(LATEX_ENCODING_IBM_852, _("IBM 852 code page"), "cp852", GEANY_ENCODING_IBM_852); - fill(LATEX_ENCODING_NONE, _("Misc"), NULL, GEANY_ENCODING_NONE); -}
Deleted: trunk/geanylatex/latexencodings.h =================================================================== --- trunk/geanylatex/latexencodings.h 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/latexencodings.h 2008-08-31 23:29:18 UTC (rev 150) @@ -1,56 +0,0 @@ -/* - * latexencodings.h - * - * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef LATEXEXCODINGS_H -#define LATEXEXCODINGS_H - - -typedef enum -{ - LATEX_ENCODING_UTF_8 = 0, - LATEX_ENCODING_ASCII, - LATEX_ENCODING_ISO_8859_1, - LATEX_ENCODING_ISO_8859_2, - LATEX_ENCODING_ISO_8859_3, - LATEX_ENCODING_ISO_8859_4, - LATEX_ENCODING_ISO_8859_5, - LATEX_ENCODING_ISO_8859_9, - LATEX_ENCODING_ISO_8859_10, - LATEX_ENCODING_IBM_850, - LATEX_ENCODING_IBM_852, - LATEX_ENCODING_NONE, - LATEX_ENCODINGS_MAX -} LaTeXEncodingIndex; - - -typedef struct -{ - LaTeXEncodingIndex charset; - gchar *name; - gchar *latex; - gint geany_enc; -} LaTeXEncodings; - -extern LaTeXEncodings latex_encodings[LATEX_ENCODINGS_MAX]; - -void init_encodings_latex(void); - -#endif
Deleted: trunk/geanylatex/letters.c =================================================================== --- trunk/geanylatex/letters.c 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/letters.c 2008-08-31 23:29:18 UTC (rev 150) @@ -1,222 +0,0 @@ -/* - * letters.h - * - * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include <gtk/gtk.h> -#include "support.h" -#include "datatypes.h" -#include "letters.h" - -enum -{ - GREEK_LETTERS = 0, - GERMAN_LETTERS, - MISC_LETTERS, - ARROW_CHAR, - RELATIONAL_SIGNS, - BINARY_OPERATIONS, - LETTERS_END -}; - -CategoryName cat_names[] = { - { GREEK_LETTERS, N_("Greek letters"), TRUE}, - { GERMAN_LETTERS, N_("German umlauts"), TRUE}, - { MISC_LETTERS, N_("Misc"), FALSE}, - { ARROW_CHAR, N_("Arrow characters"), FALSE}, - { RELATIONAL_SIGNS, N_("Relational"), FALSE}, - { BINARY_OPERATIONS, N_("Binary operation"), FALSE}, - { 0, NULL, FALSE} -}; - -/* Entries need to be sorted by categorie (1st field) or some random - * features will occure. - * AAABBBCCC is valid - * AAACCCBBB is valid - * ACABCBACB is _not_ valid and will course trouble */ -SubMenuTemplate char_array[] = { - // Greek characters - {GREEK_LETTERS, "Α", "\Alpha" }, - {GREEK_LETTERS, "α", "\alpha" }, - {GREEK_LETTERS, "Β", "\Beta" }, - {GREEK_LETTERS, "β", "\beta" }, - {GREEK_LETTERS, "Γ", "\Gamma" }, - {GREEK_LETTERS, "γ", "\gamma" }, - {GREEK_LETTERS, "Δ", "\Delta" }, - {GREEK_LETTERS, "δ", "\Delta" }, - {GREEK_LETTERS, "δ", "\delta" }, - {GREEK_LETTERS, "Ε", "\Epsilon" }, - {GREEK_LETTERS, "ε", "\epsilon" }, - {GREEK_LETTERS, "Ζ", "\Zeta" }, - {GREEK_LETTERS, "ζ", "\zeta" }, - {GREEK_LETTERS, "Η", "\Eta" }, - {GREEK_LETTERS, "η", "\eta" }, - {GREEK_LETTERS, "Θ", "\Theta" }, - {GREEK_LETTERS, "θ", "\theta" }, - {GREEK_LETTERS, "Ι", "\Iota" }, - {GREEK_LETTERS, "ι", "\iota" }, - {GREEK_LETTERS, "Κ", "\Kappa" }, - {GREEK_LETTERS, "κ", "\kappa" }, - {GREEK_LETTERS, "Λ", "\Lambda" }, - {GREEK_LETTERS, "λ", "\lambda" }, - {GREEK_LETTERS, "Μ", "\Mu" }, - {GREEK_LETTERS, "μ", "\mu" }, - {GREEK_LETTERS, "Ν", "\Nu" }, - {GREEK_LETTERS, "ν", "\nu" }, - {GREEK_LETTERS, "Ξ", "\Xi" }, - {GREEK_LETTERS, "ξ", "\xi" }, - {GREEK_LETTERS, "Ο", "\Omicron" }, - {GREEK_LETTERS, "ο", "\omicron" }, - {GREEK_LETTERS, "Π", "\Pi" }, - {GREEK_LETTERS, "π", "\pi" }, - {GREEK_LETTERS, "Ρ", "\Rho" }, - {GREEK_LETTERS, "ρ", "\rho" }, - {GREEK_LETTERS, "Σ", "\Sigma" }, - {GREEK_LETTERS, "ς", "\sigmaf" }, - {GREEK_LETTERS, "σ", "\sigma" }, - {GREEK_LETTERS, "Τ", "\Tau" }, - {GREEK_LETTERS, "τ", "\tau" }, - {GREEK_LETTERS, "Υ", "\Upsilon" }, - {GREEK_LETTERS, "υ", "\upsilon" }, - {GREEK_LETTERS, "Φ", "\Phi" }, - {GREEK_LETTERS, "φ", "\phi" }, - {GREEK_LETTERS, "Χ", "\Chi" }, - {GREEK_LETTERS, "χ", "\chi" }, - {GREEK_LETTERS, "Ψ", "\Psi" }, - {GREEK_LETTERS, "ψ", "\psi" }, - {GREEK_LETTERS, "Ω", "\Omega" }, - {GREEK_LETTERS, "ω", "\omega" }, - {GREEK_LETTERS, "ϑ", "\thetasym" }, - {GREEK_LETTERS, "ϒ", "\upsih" }, - {GREEK_LETTERS, "ϖ", "\piv" }, - - // German Umlaute - {GERMAN_LETTERS, "ä",""a"}, - {GERMAN_LETTERS, "ü",""u"}, - {GERMAN_LETTERS, "ö",""o"}, - {GERMAN_LETTERS, "ß",""s"}, - - //// Czech characters - //{"ě","\v{e}"}, - //{"š","\v{s}"}, - //{"č","\v[c}"}, - //{"ř","\v{r}"}, - //{"ž","\v{z}"}, - //{"ý",""}, - //{"á",""}, - //{"í",""}, - //{"é",""}, - //{"Ě","\v{E}"}, - //{"Š","\v{S}"}, - //{"Č","\v{C}"}, - //{"Ř","\v{R}"}, - //{"Ž","\v{Z}"}, - //{"Ý",""}, - //{"Á",""}, - //{"Í",""}, - //{"É",""}, - //// Misc - {MISC_LETTERS, "\","\backslash"}, - {MISC_LETTERS, "€", "\euro"}, - {ARROW_CHAR, "←", "\leftarrow" }, - {ARROW_CHAR, "↑", "\uparrow" }, - {ARROW_CHAR, "→", "\rightarrow" }, - {ARROW_CHAR, "↓", "\downarrow" }, - {ARROW_CHAR, "↔", "\leftrightarrow" }, - {ARROW_CHAR, "⇐", "\Leftarrow" }, - {ARROW_CHAR, "⇑", "\Uparrow" }, - {ARROW_CHAR, "⇒", "\Rightarrow" }, - {ARROW_CHAR, "⇓", "\Downarrow" }, - {ARROW_CHAR, "⇔", "\Leftrightarrow" }, - {RELATIONAL_SIGNS, "\u2264", "\leq"}, - {RELATIONAL_SIGNS, "\u2265", "\geq"}, - {RELATIONAL_SIGNS, "\u220E", "\qed"}, - {RELATIONAL_SIGNS, "\u2261", "\equiv"}, - {RELATIONAL_SIGNS, "\u22A7", "\models"}, - {RELATIONAL_SIGNS, "\u227A", "\prec"}, - {RELATIONAL_SIGNS, "\u227B", "\succ"}, - {RELATIONAL_SIGNS, "\u223C", "\sim"}, - {RELATIONAL_SIGNS, "\u27C2", "\perp"}, - {RELATIONAL_SIGNS, "\u2AAF", "\preceq"}, - {RELATIONAL_SIGNS, "\u2AB0", "\succeq"}, - {RELATIONAL_SIGNS, "\u2243", "\simeq"}, - {RELATIONAL_SIGNS, "\u2223", "\mid"}, - {RELATIONAL_SIGNS, "\u226A", "\ll"}, - {RELATIONAL_SIGNS, "\u226B", "\gg"}, - {RELATIONAL_SIGNS, "\u224D", "\asymp"}, - {RELATIONAL_SIGNS, "\u2225", "\parallel"}, - {RELATIONAL_SIGNS, "\u2282", "\subset"}, - {RELATIONAL_SIGNS, "\u2283", "\supset"}, - {RELATIONAL_SIGNS, "\u2248", "\approx"}, - {RELATIONAL_SIGNS, "\u22C8", "\bowtie"}, - {RELATIONAL_SIGNS, "\u2286", "\subseteq"}, - {RELATIONAL_SIGNS, "\u2287", "\supseteq"}, - {RELATIONAL_SIGNS, "\u2245", "\cong"}, - {RELATIONAL_SIGNS, "\u2A1D", "\Join"}, - {RELATIONAL_SIGNS, "\u228F", "\sqsubset"}, - {RELATIONAL_SIGNS, "\u2290", "\sqsupset"}, - {RELATIONAL_SIGNS, "\u2260", "\neq"}, - {RELATIONAL_SIGNS, "\u2323", "\smile"}, - {RELATIONAL_SIGNS, "\u2291", "\sqsubseteq"}, - {RELATIONAL_SIGNS, "\u2292", "\sqsupseteq"}, - {RELATIONAL_SIGNS, "\u2250", "\doteq"}, - {RELATIONAL_SIGNS, "\u2322", "\frown"}, - {RELATIONAL_SIGNS, "\u2208", "\in"}, - {RELATIONAL_SIGNS, "\u220B", "\ni"}, - {RELATIONAL_SIGNS, "\u221D", "\propto"}, - {RELATIONAL_SIGNS, "\u22A2", "\vdash"}, - {RELATIONAL_SIGNS, "\u22A3", "\dashv"}, - {BINARY_OPERATIONS, "\u00B1", "\pm"}, - {BINARY_OPERATIONS, "\u2213", "\mp"}, - {BINARY_OPERATIONS, "\u00D7", "\times"}, - {BINARY_OPERATIONS, "\u00F7", "\div"}, - {BINARY_OPERATIONS, "\u2217", "\ast"}, - {BINARY_OPERATIONS, "\u22C6", "\star"}, - {BINARY_OPERATIONS, "\u2218", "\circ"}, - {BINARY_OPERATIONS, "\u2219", "\bullet"}, - {BINARY_OPERATIONS, "\u22C5", "\cdot"}, - {BINARY_OPERATIONS, "\u2229", "\cap"}, - {BINARY_OPERATIONS, "\u222A", "\cup"}, - {BINARY_OPERATIONS, "\u228E", "\uplus"}, - {BINARY_OPERATIONS, "\u2293", "\sqcap"}, - {BINARY_OPERATIONS, "\u2228", "\vee"}, - {BINARY_OPERATIONS, "\u2227", "\wedge"}, - {BINARY_OPERATIONS, "\u2216", "\setminus"}, - {BINARY_OPERATIONS, "\u2240", "\wr"}, - {BINARY_OPERATIONS, "\u22C4", "\diamond"}, - {BINARY_OPERATIONS, "\u25B3", "\bigtriangleup"}, - {BINARY_OPERATIONS, "\u25BD", "\bigtriangledown"}, - {BINARY_OPERATIONS, "\u25C1", "\triangleleft"}, - {BINARY_OPERATIONS, "\u25B7", "\triangleright"}, - {BINARY_OPERATIONS, "", "\lhd"}, - {BINARY_OPERATIONS, "", "\rhd"}, - {BINARY_OPERATIONS, "", "\unlhd"}, - {BINARY_OPERATIONS, "", "\unrhd"}, - {BINARY_OPERATIONS, "\u2295", "\oplus"}, - {BINARY_OPERATIONS, "\u2296", "\ominus"}, - {BINARY_OPERATIONS, "\u2297", "\otimes"}, - {BINARY_OPERATIONS, "\u2205", "\oslash"}, - {BINARY_OPERATIONS, "\u2299", "\odot"}, - {BINARY_OPERATIONS, "\u25CB", "\bigcirc"}, - {BINARY_OPERATIONS, "\u2020", "\dagger"}, - {BINARY_OPERATIONS, "\u2021", "\ddagger"}, - {BINARY_OPERATIONS, "\u2A3F", "\amalg"}, - {0, NULL, NULL}, - -};
Deleted: trunk/geanylatex/letters.h =================================================================== --- trunk/geanylatex/letters.h 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/letters.h 2008-08-31 23:29:18 UTC (rev 150) @@ -1,32 +0,0 @@ -/* - * letters.h - * - * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -#ifndef LETTERS_H -#define LETTER_H - -#include "datatypes.h" - -extern SubMenuTemplate char_array[]; - -extern CategoryName cat_names[]; - -#endif
Modified: trunk/geanylatex/makefile.win32 =================================================================== --- trunk/geanylatex/makefile.win32 2008-08-31 23:08:49 UTC (rev 149) +++ trunk/geanylatex/makefile.win32 2008-08-31 23:29:18 UTC (rev 150) @@ -1,61 +1,60 @@ -# Running make creates config.h then calls the sub makefiles. -# -# Other targets are: -# deps: delete the dependencies so they are regenerated on next make -# clean: clean all generated files -# -# localwin32.mk is an optional file to override make variables. -# Use localwin32.mk instead of editing variables as it is included in sub -# makefiles. -# localwin32.mk to set PREFIX instead of the default C:\libs -# For MSYS use localwin32.mk to set CP and RM. -# By default this will work in a Windows command prompt. - -CC = gcc -CP = copy -RM = del -PREFIX = C:\libs -GEANY_SRC = c:\geany_svn -TARGET = geanylatex.dll -.SUFFIXES: .c .o --include localwin32.mk - -OBJS = geanylatex.o -INCLUDEDIRS= -I.. \ - -I$(GEANY_SRC) \ - -I$(GEANY_SRC)\src \ - -I$(GEANY_SRC)\plugins \ - -I$(GEANY_SRC)\tagmanager\include \ - -I$(GEANY_SRC)\scintilla\include \ - -I$(PREFIX)/include/gtk-2.0 \ - -I$(PREFIX)/lib/gtk-2.0/include \ - -I$(PREFIX)/include/atk-1.0 \ - -I$(PREFIX)/include/pango-1.0 \ - -I$(PREFIX)/include/cairo \ - -I$(PREFIX)/include/glib-2.0 \ - -I$(PREFIX)/lib/glib-2.0/include \ - -I$(PREFIX)/include/gettext \ - -I$(PREFIX)/include -ALL_GTK_LIBS= \ - -L"$(PREFIX)/lib" \ - -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ - -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv -CCFLAGS=-Wall -O2 -mms-bitfields -DHAVE_CONFIG_H - - -all: $(TARGET) - -deps.mak: - $(CC) -MM $(CCFLAGS) $(INCLUDEDIRS) *.c >deps.mak - -.c.o: - $(CC) $(CCFLAGS) $(INCLUDEDIRS) -c $< - -$(TARGET): $(OBJS) deps.mak - $(CC) -shared $(OBJS) $(ALL_GTK_LIBS) -o $(TARGET) - -clean: - -$(RM) deps.mak *.o *.dll - -# Generate header dependencies with "make deps.mak" -include deps.mak +# +# localwin32.mk is an optional file to override make variables. +# Use localwin32.mk instead of editing variables as it is included in sub +# makefiles. +# localwin32.mk to set PREFIX instead of the default C:\libs +# For MSYS use localwin32.mk to set CP and RM. +# By default this will work in a Windows command prompt. + +CC = gcc +CP = copy +RM = del +PREFIX = C:\libs + +GEANY_SRC = c:\geany_svn +TARGET = geanylatex.dll +.SUFFIXES: .c .o +-include localwin32.mk + + +OBJS = geanylatex.o +INCLUDEDIRS= -I. \ + -I$(GEANY_SRC) \ + -I$(GEANY_SRC)\src \ + -I$(GEANY_SRC)\plugins \ + -I$(GEANY_SRC)\tagmanager\include \ + -I$(GEANY_SRC)\scintilla\include \ + -I$(PREFIX)/include/gtk-2.0 \ + -I$(PREFIX)/lib/gtk-2.0/include \ + -I$(PREFIX)/include/atk-1.0 \ + -I$(PREFIX)/include/pango-1.0 \ + -I$(PREFIX)/include/cairo \ + -I$(PREFIX)/include/glib-2.0 \ + -I$(PREFIX)/lib/glib-2.0/include \ + -I$(PREFIX)/include/gettext \ + -I$(PREFIX)/include \ + -I$(ASPELL_PREFIX)/interfaces/cc + +ALL_GTK_LIBS= \ + -L"$(PREFIX)/lib" \ + -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ + -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv +CCFLAGS=-Wall -O2 -mms-bitfields -DHAVE_CONFIG_H + + +all: $(TARGET) + +deps.mak: + $(CC) -MM $(CCFLAGS) $(INCLUDEDIRS) src/*.c >deps.mak + +spellcheck.o: + $(CC) $(CCFLAGS) $(INCLUDEDIRS) -c $< + +$(TARGET): deps.mak $(OBJS) + $(CC) -shared $(OBJS) $(ALL_GTK_LIBS) -o $(TARGET) + +clean: + -$(RM) deps.mak *.o *.dll + +# Generate header dependencies with "make deps.mak" +include deps.mak
Added: trunk/geanylatex/po/POTFILES.in =================================================================== --- trunk/geanylatex/po/POTFILES.in (rev 0) +++ trunk/geanylatex/po/POTFILES.in 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,3 @@ +src/geanylatex.c +src/latexencodings.c +src/letters.c
Added: trunk/geanylatex/po/geanylatex.pot =================================================================== --- trunk/geanylatex/po/geanylatex.pot (rev 0) +++ trunk/geanylatex/po/geanylatex.pot 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,194 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR EMAIL@ADDRESS, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-01 01:20+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME EMAIL@ADDRESS\n" +"Language-Team: LANGUAGE LL@li.org\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/geanylatex.c:51 +msgid "LaTeX" +msgstr "" + +#: src/geanylatex.c:51 +msgid "Plugin to make Geany better support LaTeX" +msgstr "" + +#: src/geanylatex.c:129 +msgid "Insert label" +msgstr "" + +#: src/geanylatex.c:142 +msgid "Label name:" +msgstr "" + +#: src/geanylatex.c:173 +msgid "Insert reference" +msgstr "" + +#: src/geanylatex.c:186 +msgid "Ref name:" +msgstr "" + +#: src/geanylatex.c:196 +msgid "standard reference" +msgstr "" + +#: src/geanylatex.c:201 +msgid "page reference" +msgstr "" + +#: src/geanylatex.c:366 +msgid "More" +msgstr "" + +#. Documentclass +#: src/geanylatex.c:459 +msgid "Documentclass:" +msgstr "" + +#: src/geanylatex.c:462 +msgid "Chooce the kind of document you want to write" +msgstr "" + +#. Encoding +#: src/geanylatex.c:475 +msgid "Encoding:" +msgstr "" + +#: src/geanylatex.c:479 +msgid "Set the encoding for your new document" +msgstr "" + +#. Scriptsize +#: src/geanylatex.c:494 +msgid "Scriptsize:" +msgstr "" + +#: src/geanylatex.c:497 +msgid "Set the default script size of your new document" +msgstr "" + +#. Author +#: src/geanylatex.c:510 +msgid "Author:" +msgstr "" + +#: src/geanylatex.c:513 +msgid "" +"Sets the entry of \author command. In most cases here should stay your name" +msgstr "" + +#. Date +#: src/geanylatex.c:524 +msgid "Date:" +msgstr "" + +#: src/geanylatex.c:527 +msgid "" +"Sets the entry of the \date command inside header of your newly created " +"LaTeX-document. Keeping it at \today is a good decision if you don't need " +"any fixed date." +msgstr "" + +#. Title of the new document +#: src/geanylatex.c:534 +msgid "Title:" +msgstr "" + +#: src/geanylatex.c:536 +msgid "Sets the title of your newly document." +msgstr "" + +#. Papersize +#: src/geanylatex.c:543 +msgid "Paper size:" +msgstr "" + +#: src/geanylatex.c:546 +msgid "Chooce the paper format for the new created document" +msgstr "" + +#. Buidling the wizard-dialog and showing it +#: src/geanylatex.c:561 +msgid "LaTeX-Wizard" +msgstr "" + +#: src/geanylatex.c:571 +msgid "Use KOMA-script classes if possible" +msgstr "" + +#: src/geanylatex.c:574 +msgid "" +"Uses the KOMA-script classes by Markus Kohm.\n" +"Keep in mind: To compile your document these classes have to been installed " +"before." +msgstr "" + +#: src/geanylatex.c:580 +msgid "Use draft mode" +msgstr "" + +#: src/geanylatex.c:582 +msgid "" +"Set the draft flag inside new created documents to get documents with a " +"number of debugging helpers" +msgstr "" + +#: src/geanylatex.c:807 +msgid "Insert \label" +msgstr "" + +#: src/geanylatex.c:808 +msgid "Insert \ref" +msgstr "" + +#: src/geanylatex.c:809 +msgid "Run LaTeX-Wizard" +msgstr "" + +#: src/geanylatex.c:815 +msgid "_LaTeX" +msgstr "" + +#: src/geanylatex.c:822 +msgid "LaTeX-_Wizard" +msgstr "" + +#: src/geanylatex.c:825 +msgid "Starts a Wizard to create easily LaTeX-dokuments" +msgstr "" + +#: src/geanylatex.c:830 +msgid "Insert _Special Character" +msgstr "" + +#: src/geanylatex.c:832 +msgid "Helps to use some not very common letters and signs" +msgstr "" + +#: src/geanylatex.c:839 +msgid "Insert _Reference" +msgstr "" + +#: src/geanylatex.c:841 +msgid "Inserting references to the document" +msgstr "" + +#: src/geanylatex.c:845 +msgid "Insert _Label" +msgstr "" + +#: src/geanylatex.c:847 +msgid "Helps at inserting labels to a docuemnt" +msgstr ""
Added: trunk/geanylatex/src/Makefile.am =================================================================== --- trunk/geanylatex/src/Makefile.am (rev 0) +++ trunk/geanylatex/src/Makefile.am 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,6 @@ +lib_LTLIBRARIES = geanylatex.la +geanylatex_la_SOURCES = geanylatex.c datatypes.h latexencodings.c latexencodings.h letters.c letters.h +geanylatex_la_LDFLAGS = -module -avoid-version +geanylatex_la_LIBADD = @GEANY_LIBS@ $(INTLLIBS) + +AM_CFLAGS = @GEANY_CFLAGS@ -DLOCALEDIR=""$(localedir)""
Copied: trunk/geanylatex/src/datatypes.h (from rev 143, trunk/geanylatex/datatypes.h) =================================================================== --- trunk/geanylatex/src/datatypes.h (rev 0) +++ trunk/geanylatex/src/datatypes.h 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,40 @@ +/* + * datatypes.h + * + * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#ifndef DATATYPES_H +#define DATATYPES_H + +typedef struct +{ + gint cat; + gchar *label; + gchar *latex; +} SubMenuTemplate; + + +typedef struct +{ + gint cat; + gchar *label; + gboolean sorted; +} CategoryName; + +#endif
Copied: trunk/geanylatex/src/geanylatex.c (from rev 143, trunk/geanylatex/geanylatex.c) =================================================================== --- trunk/geanylatex/src/geanylatex.c (rev 0) +++ trunk/geanylatex/src/geanylatex.c 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,866 @@ +/* + * geanylatex.c - Plugin to let Geany better work together with LaTeX + * + * Copyright 2007-2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * For long list of friendly supporters please have a look at THANKS. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* LaTeX plugin */ +/* This plugin improves the work with LaTeX and Geany.*/ + +#include "geany.h" +#include "support.h" +#include "plugindata.h" +#include "document.h" +#include "editor.h" +#include "filetypes.h" +#include "templates.h" +#include "utils.h" +#include "ui_utils.h" +#include "keybindings.h" +#include "prefs.h" +#include "pluginmacros.h" + +#include "datatypes.h" +#include "letters.h" +#include "latexencodings.h" + +typedef void (*SubMenuCallback) (G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata); + +PluginInfo *plugin_info; +PluginFields *plugin_fields; +GeanyData *geany_data; +GeanyFunctions *geany_functions; + + +PLUGIN_VERSION_CHECK(78) +PLUGIN_SET_INFO(_("LaTeX"), _("Plugin to make Geany better support LaTeX"), "0.2-dev", + "Frank Lanitz frank@frank.uvena.de") + +GtkWidget *menu_latex = NULL; +GtkWidget *menu_latex_menu = NULL; +GtkWidget *menu_latex_wizzard = NULL; +GtkWidget *menu_latex_menu_special_char = NULL; +GtkWidget *menu_latex_menu_special_char_submenu = NULL; +GtkWidget *menu_latex_ref = NULL; +GtkWidget *menu_latex_label = NULL; + +/* Doing some basic keybinding stuff */ +enum +{ + LATEX_WIZZARD_KB, + LATEX_INSERT_LABEL_KB, + LATEX_INSERT_REF_KB, + COUNT_KB +}; + +PLUGIN_KEY_GROUP(geanylatex, COUNT_KB) + + +#define TEMPLATE_LATEX "\ +\documentclass[{CLASSOPTION}]{{DOCUMENTCLASS}}\n\ +{ENCODING}\ +{TITLE}\ +{AUTHOR}\ +{DATE}\ +\begin{document}\n\ +\n\ +\end{document}\n" + +#define create_sub_menu(base_menu, menu, item, title) \ + (menu) = gtk_menu_new(); \ + (item) = gtk_menu_item_new_with_mnemonic((title)); \ + gtk_menu_item_set_submenu(GTK_MENU_ITEM((item)), (menu)); \ + gtk_container_add(GTK_CONTAINER(base_menu), (item)); \ + gtk_widget_show((item)); + +#define MAX_MENU_ENTRIES 20 + +static void +insert_string(gchar *string) +{ + GeanyDocument *doc = NULL; + + doc = p_document->get_current(); + + if (doc != NULL) + { + gint pos = p_sci->get_current_position(doc->editor->sci); + p_sci->insert_text(doc->editor->sci, pos, string); + } +} + + +inline gchar* +get_latex_command(gint tab_index) +{ + return char_array[tab_index].latex; +} + +static void +char_insert_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +{ + insert_string(get_latex_command(GPOINTER_TO_INT(gdata))); +} + +static void +insert_label_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +{ + GtkWidget *dialog = NULL; + GtkWidget *vbox = NULL; + GtkWidget *label = NULL; + GtkWidget *textbox_label = NULL; + GtkWidget *table = NULL; + + dialog = gtk_dialog_new_with_buttons(_("Insert label"), + GTK_WINDOW(geany->main_widgets->window), + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); + vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); + gtk_widget_set_name(dialog, "GeanyDialog"); + gtk_box_set_spacing(GTK_BOX(vbox), 10); + + table = gtk_table_new(1, 2, FALSE); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + + label = gtk_label_new(_("Label name:")); + textbox_label = gtk_entry_new(); + + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1); + gtk_table_attach_defaults(GTK_TABLE(table), textbox_label, 1, 2, 0, 1); + gtk_container_add(GTK_CONTAINER(vbox), table); + + gtk_widget_show_all(vbox); + + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + gchar *label_str = NULL; + label_str = g_strconcat("\label{", g_strdup(gtk_entry_get_text(GTK_ENTRY(textbox_label))), "}", NULL); + insert_string(label_str); + } + gtk_widget_destroy(dialog); +} + +static void +insert_ref_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +{ + GtkWidget *dialog; + GtkWidget *vbox = NULL; + GtkWidget *label_ref = NULL; + GtkWidget *textbox_ref = NULL; + GtkWidget *table = NULL; + GtkWidget *radio1 = NULL; + GtkWidget *radio2 = NULL; + + dialog = gtk_dialog_new_with_buttons(_("Insert reference"), + GTK_WINDOW(geany->main_widgets->window), + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); + vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); + gtk_widget_set_name(dialog, "GeanyDialog"); + gtk_box_set_spacing(GTK_BOX(vbox), 10); + + table = gtk_table_new(1, 2, FALSE); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + + label_ref = gtk_label_new(_("Ref name:")); + textbox_ref = gtk_entry_new(); + + gtk_misc_set_alignment(GTK_MISC(label_ref), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label_ref, 0, 1, 0, 1); + gtk_table_attach_defaults(GTK_TABLE(table), textbox_ref, 1, 2, 0, 1); + gtk_container_add(GTK_CONTAINER(vbox), table); + + radio1 = gtk_radio_button_new_with_label(NULL, + _("standard reference")); + gtk_button_set_focus_on_click(GTK_BUTTON(radio1), FALSE); + gtk_container_add(GTK_CONTAINER(vbox), radio1); + + radio2 = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(radio1), + _("page reference")); + gtk_button_set_focus_on_click(GTK_BUTTON(radio2), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio2), FALSE); + gtk_container_add(GTK_CONTAINER(vbox), radio2); + + gtk_widget_show_all(vbox); + + + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + gchar *ref_string = NULL; + + ref_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(textbox_ref))); + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio2)) == FALSE) + { + ref_string = g_strconcat("\ref{", ref_string, "}", NULL); + } + else + { + ref_string = g_strconcat("\pageref{", ref_string, "}", NULL); + } + + if (ref_string != NULL) + { + insert_string(ref_string); + g_free(ref_string); + } + } + + gtk_widget_destroy(dialog); +} + +static void character_create_menu_item(GtkWidget *menu, const gchar *label, gint letter, SubMenuCallback callback) +{ + GtkWidget *tmp; + + tmp = gtk_menu_item_new_with_label(label); + gtk_widget_show(tmp); + gtk_container_add(GTK_CONTAINER(menu), tmp); + g_signal_connect((gpointer) tmp, "activate", G_CALLBACK(callback), GINT_TO_POINTER(letter)); +} + +/* returns -1, if there are more than gint can work with or any other error + * 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 +count_menu_entries(SubMenuTemplate *tmp, gint categorie) +{ + // TODO: Reset max value for to stop before it's too late + gint i; + gint count = 0; + if (categorie == -1) + { + for (i =1; tmp[i].label != NULL; i++) + { + count = count + 1; + } + } + else + { + for (i = 1; tmp[i].label != NULL; i++) + { + if (tmp[i].cat == categorie) + { + count = count + 1; + } + if (i >= 256) + { + count = -1; + break; + } + } + } + return count; +} + +gint +count_menu_cat_entries(CategoryName *tmp) +{ + gint i; + + for (i = 0; tmp[i].label != NULL; i++); + return i; +} + +void sub_menu_init(GtkWidget *base_menu, SubMenuTemplate *menu_template, CategoryName *category_name, SubMenuCallback callback_function) +{ + gint i; + gint j; + gint max_menu_entries = MAX_MENU_ENTRIES; + gint categories = count_menu_cat_entries(category_name); + GtkWidget *sub_menu = NULL; + GtkWidget *sub_menu_cat[categories][2]; + GtkWidget *active_submenu = NULL; + + // Creates sub menus based on information from letter.h + for (i = 0; i < categories; i++) + { + if (count_menu_entries(menu_template, i) > 0) + { + create_sub_menu(base_menu, sub_menu_cat[i][0], + sub_menu_cat[i][1], category_name[i].label); + } + } + + // Searching for all categories + for (i = 0; i < categories; i++) + { + gboolean split = FALSE; + gboolean last_sub_menu = FALSE; + gboolean sorted = category_name[i].sorted; + gint local_count = 0; // To check whether we need to build up a new sub sub menu. + gint item_count = count_menu_entries(menu_template, i); + + if (item_count < 1) + continue; + + // Default is, not to split anything to make menu not + // deeper than realy needed. + if (item_count > max_menu_entries) + { + split = TRUE; + } + + // Setting active sub menu to sub menu of catagorie + sub_menu = sub_menu_cat[i][0]; + active_submenu = sub_menu; + // Finding entries for each categorie + + for (j = 0; menu_template[j].latex != NULL; j++) + { + if (menu_template[j].cat == i) + { + // Creates a new sub sub menu if needed + if (split == TRUE && (local_count % max_menu_entries) == 0) + { + gint next_split_point = 0; + GtkWidget *tmp = NULL; + GtkWidget *tmp_item = NULL; + + sub_menu = active_submenu; + + for (next_split_point = 0; + next_split_point < max_menu_entries ; next_split_point ++) + { + if (menu_template[j+next_split_point].cat != i) + { + last_sub_menu = TRUE; + break; + } + + } + + if (sorted == TRUE) + { + create_sub_menu(sub_menu_cat[i][0], tmp, tmp_item, g_strconcat(menu_template[j].label, " ... ", menu_template[j + next_split_point-1].label, NULL)); + + sub_menu = tmp; + } + else if (sorted == FALSE) + { + if (last_sub_menu == FALSE) + { + create_sub_menu(sub_menu, tmp, tmp_item, _("More")); + sub_menu = active_submenu; + active_submenu = tmp; + } + } + } + + // Sets the counter to keep in track if a new submenu needs to be build up + local_count = local_count + 1; + character_create_menu_item(sub_menu, g_strconcat(menu_template[j].label, "\t", menu_template[j].latex, NULL), j, callback_function); + } + } + } +} + +static int +find_latex_enc(gint l_geany_enc) +{ + guint i; + for (i = 0; i < LATEX_ENCODINGS_MAX; i++) + { + if (latex_encodings[i].geany_enc == l_geany_enc) + return i; + } + return LATEX_ENCODING_NONE; +} + + +static void +show_output(const gchar * output, const gchar * name, const gint local_enc) +{ + GeanyDocument *doc = NULL; + GeanyFiletype *ft = p_filetypes->lookup_by_name("LaTeX"); + + if (output) + { + doc = p_document->new_file(name, ft, output); + p_document->set_encoding(doc, p_encodings->get_charset_from_index(latex_encodings[local_enc].geany_enc)); + } + +} + +static void +wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer gdata) +{ + gint i; + GString *code = NULL; + gchar *author = NULL; + gchar *date = NULL; + gchar *output = NULL; + gchar *classoptions = NULL; + gchar *title = NULL; + gchar *enc_latex_char = NULL; + gchar *documentclass_str = NULL; + gchar *papersize = NULL; + gchar *draft = NULL; + gchar *scriptsize = NULL; + gint documentclass_int; + gint encoding_int; + gint papersize_int; + gint scriptsize_int; + GtkWidget *dialog = NULL; + GtkWidget *vbox = NULL; + GtkWidget *label_documentclass = NULL; + GtkWidget *documentclass_combobox = NULL; + GtkWidget *label_encoding = NULL; + GtkWidget *encoding_combobox = NULL; + GtkWidget *scriptsize_combobox = NULL; + GtkWidget *label_scriptsize = NULL; + GtkWidget *table = NULL; + GtkWidget *checkbox_KOMA = NULL; + GtkWidget *author_textbox = NULL; + GtkWidget *label_author = NULL; + GtkWidget *date_textbox = NULL; + GtkWidget *label_date = NULL; + GtkWidget *title_textbox = NULL; + GtkWidget *label_title = NULL; + GtkWidget *papersize_combobox = NULL; + GtkWidget *label_papersize = NULL; + GtkWidget *checkbox_draft = NULL; + gboolean KOMA_active = TRUE; + gboolean draft_active = FALSE; + + GtkTooltips *tooltip = NULL; + + tooltip = gtk_tooltips_new(); + + // Creating and formating table + table = gtk_table_new(2, 6, FALSE); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + + // Documentclass + label_documentclass = gtk_label_new(_("Documentclass:")); + documentclass_combobox = gtk_combo_box_new_text(); + gtk_tooltips_set_tip(tooltip, documentclass_combobox, + _("Chooce the kind of document you want to write"), NULL); + gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 0, "Book"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 1, "Article"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(documentclass_combobox), 2, "Report"); + + gtk_combo_box_set_active(GTK_COMBO_BOX(documentclass_combobox), 0); + + gtk_misc_set_alignment(GTK_MISC(label_documentclass), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label_documentclass, 0, 1, 0, 1); + gtk_table_attach_defaults(GTK_TABLE(table), documentclass_combobox, 1, 2, 0, 1); + + // Encoding + label_encoding = gtk_label_new(_("Encoding:")); + + encoding_combobox = gtk_combo_box_new_text(); + gtk_tooltips_set_tip(tooltip, encoding_combobox, + _("Set the encoding for your new document"), NULL); + for (i = 0; i < LATEX_ENCODINGS_MAX; i++) + { + gtk_combo_box_insert_text(GTK_COMBO_BOX(encoding_combobox), i, + latex_encodings[i].name); + } + + gtk_combo_box_set_active(GTK_COMBO_BOX(encoding_combobox), find_latex_enc(geany_data->file_prefs->default_new_encoding)); + + gtk_misc_set_alignment(GTK_MISC(label_encoding), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label_encoding, 0, 1, 1, 2); + gtk_table_attach_defaults(GTK_TABLE(table), encoding_combobox, 1, 2, 1, 2); + + // Scriptsize + label_scriptsize = gtk_label_new(_("Scriptsize:")); + scriptsize_combobox = gtk_combo_box_new_text(); + gtk_tooltips_set_tip(tooltip, scriptsize_combobox, + _("Set the default script size of your new document"), NULL); + gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 0, "10pt"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 1, "11pt"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(scriptsize_combobox), 2, "12pt"); + + gtk_combo_box_set_active(GTK_COMBO_BOX(scriptsize_combobox), 0); + + gtk_misc_set_alignment(GTK_MISC(label_scriptsize), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label_scriptsize, 0, 1, 2, 3); + gtk_table_attach_defaults(GTK_TABLE(table), scriptsize_combobox, 1, 2, 2, 3); + + // Author + label_author = gtk_label_new(_("Author:")); + author_textbox = gtk_entry_new(); + gtk_tooltips_set_tip(tooltip, author_textbox, + _("Sets the entry of \author command. In most cases here should stay your name"), NULL); + if (geany_data->template_prefs->developer != NULL) + { + author = geany_data->template_prefs->developer; + gtk_entry_set_text(GTK_ENTRY(author_textbox), author); + } + gtk_misc_set_alignment(GTK_MISC(label_author), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table), label_author, 0, 1, 3, 4); + gtk_table_attach_defaults(GTK_TABLE(table), author_textbox, 1, 2, 3, 4); + + // Date + label_date = gtk_label_new(_("Date:")); + date_textbox = gtk_entry_new(); + gtk_tooltips_set_tip(tooltip, date_textbox, + _("Sets the entry of the \date command inside header of your newly created LaTeX-document. Keeping it at \today is a good decision if you don't need any fixed date."), NULL); + gtk_entry_set_text(GTK_ENTRY(date_textbox), "\today"); + gtk_misc_set_alignment(GTK_MISC(label_date), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table), label_date, 0, 1, 4, 5); + gtk_table_attach_defaults(GTK_TABLE(table), date_textbox, 1, 2, 4, 5); + + // Title of the new document + label_title = gtk_label_new(_("Title:")); + title_textbox = gtk_entry_new(); + gtk_tooltips_set_tip(tooltip, title_textbox, _("Sets the title of your newly document."), + NULL); + gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0.5); + gtk_table_attach_defaults(GTK_TABLE(table), label_title, 0, 1, 5, 6); + gtk_table_attach_defaults(GTK_TABLE(table), title_textbox, 1, 2, 5, 6); + + // Papersize + label_papersize = gtk_label_new(_("Paper size:")); + papersize_combobox = gtk_combo_box_new_text(); + gtk_tooltips_set_tip(tooltip, papersize_combobox, + _("Chooce the paper format for the new created document"), NULL); + gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 0, "A4"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 1, "A5"); + gtk_combo_box_insert_text(GTK_COMBO_BOX(papersize_combobox), 2, "A6"); + + gtk_combo_box_set_active(GTK_COMBO_BOX(papersize_combobox), 0); + + gtk_misc_set_alignment(GTK_MISC(label_papersize), 0, 0.5); + + gtk_table_attach_defaults(GTK_TABLE(table), label_papersize, 0, 1, 6, 7); + gtk_table_attach_defaults(GTK_TABLE(table), papersize_combobox, 1, 2, 6, 7); + + gtk_widget_show_all(table); + + // Buidling the wizard-dialog and showing it + dialog = gtk_dialog_new_with_buttons(_("LaTeX-Wizard"), + GTK_WINDOW(geany->main_widgets->window), + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); + vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog)); + gtk_widget_set_name(dialog, "GeanyDialog"); + gtk_box_set_spacing(GTK_BOX(vbox), 10); + gtk_container_add(GTK_CONTAINER(vbox), table); + + checkbox_KOMA = gtk_check_button_new_with_label(_("Use KOMA-script classes if possible")); + gtk_tooltips_set_tip(tooltip, checkbox_KOMA, + _ + ("Uses the KOMA-script classes by Markus Kohm.\nKeep in mind: To compile your document these classes have to been installed before."), + NULL); + gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_KOMA), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_KOMA), KOMA_active); + gtk_box_pack_start(GTK_BOX(vbox), checkbox_KOMA, FALSE, FALSE, 5); + + checkbox_draft = gtk_check_button_new_with_label(_("Use draft mode")); + gtk_tooltips_set_tip(tooltip, checkbox_draft, + _("Set the draft flag inside new created documents to get documents with a number of debugging helpers"), NULL); + gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_draft), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_draft), draft_active); + gtk_box_pack_start(GTK_BOX(vbox), checkbox_draft, FALSE, FALSE, 5); + + gtk_widget_show_all(vbox); + + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + KOMA_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_KOMA)); + draft_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_draft)); + documentclass_int = gtk_combo_box_get_active(GTK_COMBO_BOX(documentclass_combobox)); + encoding_int = gtk_combo_box_get_active(GTK_COMBO_BOX(encoding_combobox)); + enc_latex_char = g_strconcat("\usepackage[", latex_encodings[encoding_int].latex,"]{inputenc}\n", NULL); + author = g_strdup(gtk_entry_get_text(GTK_ENTRY(author_textbox))); + date = g_strdup(gtk_entry_get_text(GTK_ENTRY(date_textbox))); + title = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_textbox))); + papersize_int = gtk_combo_box_get_active(GTK_COMBO_BOX(papersize_combobox)); + switch (papersize_int) + { + case 0: + { + papersize = g_utf8_casefold("a4paper", -1); + break; + } + case 1: + { + papersize = g_utf8_casefold("a5paper", -1); + break; + } + case 2: + { + papersize = g_utf8_casefold("a6paper", -1); + break; + } + } + + scriptsize_int = gtk_combo_box_get_active(GTK_COMBO_BOX(scriptsize_combobox)); + switch (scriptsize_int) + { + case 0: + { + scriptsize = g_strconcat("10pt", NULL); + break; + } + case 1: + { + scriptsize = g_strconcat("11pt", NULL); + break; + } + case 2: + { + scriptsize = g_strconcat("12pt", NULL); + break; + } + } + + if (papersize != NULL) + { + classoptions = g_strconcat(papersize, NULL); + } + if (classoptions != NULL && draft_active == TRUE) + { + draft = g_utf8_casefold("draft", -1); + classoptions = g_strconcat(classoptions,",", draft, NULL); + } + else if (classoptions == NULL && draft_active == TRUE) + { + draft = g_utf8_casefold("draft", -1); + classoptions = g_strconcat(draft, NULL); + } + if (classoptions != NULL && scriptsize != NULL) + { + classoptions = g_strconcat(classoptions, ",", scriptsize, NULL); + } + else if (classoptions == NULL && scriptsize != NULL) + { + classoptions = g_strconcat(scriptsize, NULL); + } + + if (KOMA_active) + { + switch (documentclass_int) + { + case 0: + { + documentclass_str = g_utf8_casefold("scrbook", -1); + break; + } + case 1: + { + documentclass_str = g_utf8_casefold("scrartcl", -1); + break; + } + case 2: + { + documentclass_str = g_utf8_casefold("scrreprt", -1); + break; + } + } + } + else + { + switch (documentclass_int) + { + case 0: + { + documentclass_str = g_utf8_casefold("book", -1); + break; + } + case 1: + { + documentclass_str = g_utf8_casefold("article", -1); + break; + } + case 2: + { + documentclass_str = g_utf8_casefold("report", -1); + break; + } + } + } + + code = g_string_new(TEMPLATE_LATEX); + + if (classoptions != NULL) + { + p_utils->string_replace_all(code, "{CLASSOPTION}", classoptions); + g_free(classoptions); + } + if (documentclass_str != NULL) + { + p_utils->string_replace_all(code, "{DOCUMENTCLASS}", documentclass_str); + g_free(documentclass_str); + } + if (enc_latex_char != NULL) + { + p_utils->string_replace_all(code, "{ENCODING}", enc_latex_char); + g_free(enc_latex_char); + } + if (author != NULL) + { + if (author[0] != '\0') + { + author = g_strconcat("\author{", author, "}\n", NULL); + p_utils->string_replace_all(code, "{AUTHOR}", author); + } + else + p_utils->string_replace_all(code, "{AUTHOR}", "% \author{}\n"); + g_free(author); + } + if (date != NULL) + { + if (date[0] != '\0') + { + date = g_strconcat("\date{", date, "}\n", NULL); + p_utils->string_replace_all(code, "{DATE}", date); + } + else + p_utils->string_replace_all(code, "{DATE}", "% \date{}\n"); + g_free(date); + } + if (title != NULL) + { + if (title[0] != '\0') + { + title = g_strconcat("\title{", title, "}\n", NULL); + p_utils->string_replace_all(code, "{TITLE}", title); + } + else + p_utils->string_replace_all(code, "{TITLE}", "% \title{} \n"); + g_free(title); + } + output = g_string_free(code, FALSE); + show_output(output, NULL, encoding_int); + } + gtk_widget_destroy(dialog); +} + +static void +update_menu_items() +{ + GeanyDocument *doc = NULL; + gboolean have_file; + + doc = p_document->get_current(); + have_file = doc && doc->file_name && g_path_is_absolute(doc->file_name); + + if (have_file) + { + gtk_widget_set_sensitive(menu_latex_menu_special_char, TRUE); + gtk_widget_set_sensitive(menu_latex_ref, TRUE); + gtk_widget_set_sensitive(menu_latex_label, TRUE); + } + else + { + gtk_widget_set_sensitive(menu_latex_menu_special_char, FALSE); + gtk_widget_set_sensitive(menu_latex_ref, FALSE); + gtk_widget_set_sensitive(menu_latex_label, FALSE); + } + + gtk_widget_set_sensitive(menu_latex_wizzard, TRUE); + +} + +static void kblabel_insert(G_GNUC_UNUSED guint key_id) +{ + insert_label_activated(NULL, NULL); +} + +static void kbref_insert(G_GNUC_UNUSED guint key_id) +{ + insert_ref_activated(NULL, NULL); +} + +static void kbwizard(G_GNUC_UNUSED guint key_id) +{ + wizard_activated(NULL, NULL); +} + +void +plugin_init(G_GNUC_UNUSED GeanyData * data) +{ + GtkTooltips *tooltips = NULL; + + gchar *kblabel_insert_label = _("Insert \label"); + gchar *kblabel_insert_ref = _("Insert \ref"); + gchar *kblabel_wizard = _("Run LaTeX-Wizard"); + + init_encodings_latex(); + + tooltips = gtk_tooltips_new(); + + menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); + gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_latex); + g_signal_connect((gpointer) menu_latex, "activate", G_CALLBACK(update_menu_items), NULL); + + menu_latex_menu = gtk_menu_new(); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu); + + menu_latex_wizzard = gtk_menu_item_new_with_mnemonic(_("LaTeX-_Wizard")); + gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_wizzard); + gtk_tooltips_set_tip(tooltips, menu_latex_wizzard, + _("Starts a Wizard to create easily LaTeX-dokuments"), NULL); + + g_signal_connect((gpointer) menu_latex_wizzard, "activate", + G_CALLBACK(wizard_activated), NULL); + + menu_latex_menu_special_char = gtk_menu_item_new_with_mnemonic(_("Insert _Special Character")); + gtk_tooltips_set_tip(tooltips, menu_latex_menu_special_char, + _("Helps to use some not very common letters and signs"), NULL); + gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_menu_special_char); + + 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, char_insert_activated); + + menu_latex_ref = gtk_menu_item_new_with_mnemonic(_("Insert _Reference")); + gtk_tooltips_set_tip(tooltips, menu_latex_ref, + _("Inserting references to the document"), NULL); + gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_ref); + g_signal_connect((gpointer) menu_latex_ref, "activate", G_CALLBACK(insert_ref_activated), NULL); + + menu_latex_label = gtk_menu_item_new_with_mnemonic(_("Insert _Label")); + gtk_tooltips_set_tip(tooltips, menu_latex_label, + _("Helps at inserting labels to a docuemnt"), NULL); + gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_label); + g_signal_connect((gpointer) menu_latex_label, "activate", G_CALLBACK(insert_label_activated), NULL); + + /* init keybindins */ + p_keybindings->set_item(plugin_key_group, LATEX_WIZZARD_KB, kbwizard, + 0, 0, "run_latex_wizard", kblabel_wizard, menu_latex_wizzard); + p_keybindings->set_item(plugin_key_group, LATEX_INSERT_LABEL_KB, kblabel_insert, + 0, 0, "insert_latex_label", kblabel_insert_label, menu_latex_wizzard); + p_keybindings->set_item(plugin_key_group, LATEX_INSERT_REF_KB, kbref_insert, + 0, 0, "insert_latex_ref", kblabel_insert_ref, menu_latex_wizzard); + gtk_widget_show_all(menu_latex); + plugin_fields->menu_item = menu_latex; +} + +void +plugin_cleanup() +{ + gtk_widget_destroy(plugin_fields->menu_item); +}
Copied: trunk/geanylatex/src/latexencodings.c (from rev 143, trunk/geanylatex/latexencodings.c) =================================================================== --- trunk/geanylatex/src/latexencodings.c (rev 0) +++ trunk/geanylatex/src/latexencodings.c 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,55 @@ +/* + * latexencodings.h + * + * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include <gtk/gtk.h> +#include "support.h" +#include "encodings.h" +#include "latexencodings.h" + +LaTeXEncodings latex_encodings[LATEX_ENCODINGS_MAX]; + +#define fill(Charset, Name, LaTeX, GeanyEnc) \ + latex_encodings[Charset].charset = Charset; \ + latex_encodings[Charset].name = Name; \ + latex_encodings[Charset].latex = LaTeX; \ + latex_encodings[Charset].geany_enc = GeanyEnc; + +void init_encodings_latex(void) +{ + fill(LATEX_ENCODING_UTF_8, _("UTF-8"), "utf8x", GEANY_ENCODING_UTF_8); + fill(LATEX_ENCODING_ASCII, _("US-ASCII"), "ascii", GEANY_ENCODING_ISO_8859_1); + fill(LATEX_ENCODING_ISO_8859_1, _("ISO-8859-1 (Latin-1)"), "latin1", + GEANY_ENCODING_ISO_8859_1); + fill(LATEX_ENCODING_ISO_8859_2, _("ISO-8859-2 (Latin-2)"), "latin2", + GEANY_ENCODING_ISO_8859_2); + fill(LATEX_ENCODING_ISO_8859_3, _("ISO-8859-3 (Latin-3)"), "latin3", + GEANY_ENCODING_ISO_8859_3); + fill(LATEX_ENCODING_ISO_8859_4, _("ISO-8859-4 (Latin-4)"), "latin4", + GEANY_ENCODING_ISO_8859_4); + fill(LATEX_ENCODING_ISO_8859_5, _("ISO-8859-5 (Latin-5)"), "latin5", + GEANY_ENCODING_ISO_8859_5); + fill(LATEX_ENCODING_ISO_8859_9, _("ISO-8859-9 (Latin-9)"), "latin9", + GEANY_ENCODING_ISO_8859_9); + fill(LATEX_ENCODING_ISO_8859_10, _("ISO-8859-10 (Latin-10)"), "latin10", GEANY_ENCODING_ISO_8859_10); + fill(LATEX_ENCODING_IBM_850, _("IBM 850 code page"), "cp850", GEANY_ENCODING_IBM_850); + fill(LATEX_ENCODING_IBM_852, _("IBM 852 code page"), "cp852", GEANY_ENCODING_IBM_852); + fill(LATEX_ENCODING_NONE, _("Misc"), NULL, GEANY_ENCODING_NONE); +}
Copied: trunk/geanylatex/src/latexencodings.h (from rev 143, trunk/geanylatex/latexencodings.h) =================================================================== --- trunk/geanylatex/src/latexencodings.h (rev 0) +++ trunk/geanylatex/src/latexencodings.h 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,56 @@ +/* + * latexencodings.h + * + * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#ifndef LATEXEXCODINGS_H +#define LATEXEXCODINGS_H + + +typedef enum +{ + LATEX_ENCODING_UTF_8 = 0, + LATEX_ENCODING_ASCII, + LATEX_ENCODING_ISO_8859_1, + LATEX_ENCODING_ISO_8859_2, + LATEX_ENCODING_ISO_8859_3, + LATEX_ENCODING_ISO_8859_4, + LATEX_ENCODING_ISO_8859_5, + LATEX_ENCODING_ISO_8859_9, + LATEX_ENCODING_ISO_8859_10, + LATEX_ENCODING_IBM_850, + LATEX_ENCODING_IBM_852, + LATEX_ENCODING_NONE, + LATEX_ENCODINGS_MAX +} LaTeXEncodingIndex; + + +typedef struct +{ + LaTeXEncodingIndex charset; + gchar *name; + gchar *latex; + gint geany_enc; +} LaTeXEncodings; + +extern LaTeXEncodings latex_encodings[LATEX_ENCODINGS_MAX]; + +void init_encodings_latex(void); + +#endif
Copied: trunk/geanylatex/src/letters.c (from rev 143, trunk/geanylatex/letters.c) =================================================================== --- trunk/geanylatex/src/letters.c (rev 0) +++ trunk/geanylatex/src/letters.c 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,222 @@ +/* + * letters.h + * + * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include <gtk/gtk.h> +#include "support.h" +#include "datatypes.h" +#include "letters.h" + +enum +{ + GREEK_LETTERS = 0, + GERMAN_LETTERS, + MISC_LETTERS, + ARROW_CHAR, + RELATIONAL_SIGNS, + BINARY_OPERATIONS, + LETTERS_END +}; + +CategoryName cat_names[] = { + { GREEK_LETTERS, N_("Greek letters"), TRUE}, + { GERMAN_LETTERS, N_("German umlauts"), TRUE}, + { MISC_LETTERS, N_("Misc"), FALSE}, + { ARROW_CHAR, N_("Arrow characters"), FALSE}, + { RELATIONAL_SIGNS, N_("Relational"), FALSE}, + { BINARY_OPERATIONS, N_("Binary operation"), FALSE}, + { 0, NULL, FALSE} +}; + +/* Entries need to be sorted by categorie (1st field) or some random + * features will occure. + * AAABBBCCC is valid + * AAACCCBBB is valid + * ACABCBACB is _not_ valid and will course trouble */ +SubMenuTemplate char_array[] = { + // Greek characters + {GREEK_LETTERS, "Α", "\Alpha" }, + {GREEK_LETTERS, "α", "\alpha" }, + {GREEK_LETTERS, "Β", "\Beta" }, + {GREEK_LETTERS, "β", "\beta" }, + {GREEK_LETTERS, "Γ", "\Gamma" }, + {GREEK_LETTERS, "γ", "\gamma" }, + {GREEK_LETTERS, "Δ", "\Delta" }, + {GREEK_LETTERS, "δ", "\Delta" }, + {GREEK_LETTERS, "δ", "\delta" }, + {GREEK_LETTERS, "Ε", "\Epsilon" }, + {GREEK_LETTERS, "ε", "\epsilon" }, + {GREEK_LETTERS, "Ζ", "\Zeta" }, + {GREEK_LETTERS, "ζ", "\zeta" }, + {GREEK_LETTERS, "Η", "\Eta" }, + {GREEK_LETTERS, "η", "\eta" }, + {GREEK_LETTERS, "Θ", "\Theta" }, + {GREEK_LETTERS, "θ", "\theta" }, + {GREEK_LETTERS, "Ι", "\Iota" }, + {GREEK_LETTERS, "ι", "\iota" }, + {GREEK_LETTERS, "Κ", "\Kappa" }, + {GREEK_LETTERS, "κ", "\kappa" }, + {GREEK_LETTERS, "Λ", "\Lambda" }, + {GREEK_LETTERS, "λ", "\lambda" }, + {GREEK_LETTERS, "Μ", "\Mu" }, + {GREEK_LETTERS, "μ", "\mu" }, + {GREEK_LETTERS, "Ν", "\Nu" }, + {GREEK_LETTERS, "ν", "\nu" }, + {GREEK_LETTERS, "Ξ", "\Xi" }, + {GREEK_LETTERS, "ξ", "\xi" }, + {GREEK_LETTERS, "Ο", "\Omicron" }, + {GREEK_LETTERS, "ο", "\omicron" }, + {GREEK_LETTERS, "Π", "\Pi" }, + {GREEK_LETTERS, "π", "\pi" }, + {GREEK_LETTERS, "Ρ", "\Rho" }, + {GREEK_LETTERS, "ρ", "\rho" }, + {GREEK_LETTERS, "Σ", "\Sigma" }, + {GREEK_LETTERS, "ς", "\sigmaf" }, + {GREEK_LETTERS, "σ", "\sigma" }, + {GREEK_LETTERS, "Τ", "\Tau" }, + {GREEK_LETTERS, "τ", "\tau" }, + {GREEK_LETTERS, "Υ", "\Upsilon" }, + {GREEK_LETTERS, "υ", "\upsilon" }, + {GREEK_LETTERS, "Φ", "\Phi" }, + {GREEK_LETTERS, "φ", "\phi" }, + {GREEK_LETTERS, "Χ", "\Chi" }, + {GREEK_LETTERS, "χ", "\chi" }, + {GREEK_LETTERS, "Ψ", "\Psi" }, + {GREEK_LETTERS, "ψ", "\psi" }, + {GREEK_LETTERS, "Ω", "\Omega" }, + {GREEK_LETTERS, "ω", "\omega" }, + {GREEK_LETTERS, "ϑ", "\thetasym" }, + {GREEK_LETTERS, "ϒ", "\upsih" }, + {GREEK_LETTERS, "ϖ", "\piv" }, + + // German Umlaute + {GERMAN_LETTERS, "ä",""a"}, + {GERMAN_LETTERS, "ü",""u"}, + {GERMAN_LETTERS, "ö",""o"}, + {GERMAN_LETTERS, "ß",""s"}, + + //// Czech characters + //{"ě","\v{e}"}, + //{"š","\v{s}"}, + //{"č","\v[c}"}, + //{"ř","\v{r}"}, + //{"ž","\v{z}"}, + //{"ý",""}, + //{"á",""}, + //{"í",""}, + //{"é",""}, + //{"Ě","\v{E}"}, + //{"Š","\v{S}"}, + //{"Č","\v{C}"}, + //{"Ř","\v{R}"}, + //{"Ž","\v{Z}"}, + //{"Ý",""}, + //{"Á",""}, + //{"Í",""}, + //{"É",""}, + //// Misc + {MISC_LETTERS, "\","\backslash"}, + {MISC_LETTERS, "€", "\euro"}, + {ARROW_CHAR, "←", "\leftarrow" }, + {ARROW_CHAR, "↑", "\uparrow" }, + {ARROW_CHAR, "→", "\rightarrow" }, + {ARROW_CHAR, "↓", "\downarrow" }, + {ARROW_CHAR, "↔", "\leftrightarrow" }, + {ARROW_CHAR, "⇐", "\Leftarrow" }, + {ARROW_CHAR, "⇑", "\Uparrow" }, + {ARROW_CHAR, "⇒", "\Rightarrow" }, + {ARROW_CHAR, "⇓", "\Downarrow" }, + {ARROW_CHAR, "⇔", "\Leftrightarrow" }, + {RELATIONAL_SIGNS, "\u2264", "\leq"}, + {RELATIONAL_SIGNS, "\u2265", "\geq"}, + {RELATIONAL_SIGNS, "\u220E", "\qed"}, + {RELATIONAL_SIGNS, "\u2261", "\equiv"}, + {RELATIONAL_SIGNS, "\u22A7", "\models"}, + {RELATIONAL_SIGNS, "\u227A", "\prec"}, + {RELATIONAL_SIGNS, "\u227B", "\succ"}, + {RELATIONAL_SIGNS, "\u223C", "\sim"}, + {RELATIONAL_SIGNS, "\u27C2", "\perp"}, + {RELATIONAL_SIGNS, "\u2AAF", "\preceq"}, + {RELATIONAL_SIGNS, "\u2AB0", "\succeq"}, + {RELATIONAL_SIGNS, "\u2243", "\simeq"}, + {RELATIONAL_SIGNS, "\u2223", "\mid"}, + {RELATIONAL_SIGNS, "\u226A", "\ll"}, + {RELATIONAL_SIGNS, "\u226B", "\gg"}, + {RELATIONAL_SIGNS, "\u224D", "\asymp"}, + {RELATIONAL_SIGNS, "\u2225", "\parallel"}, + {RELATIONAL_SIGNS, "\u2282", "\subset"}, + {RELATIONAL_SIGNS, "\u2283", "\supset"}, + {RELATIONAL_SIGNS, "\u2248", "\approx"}, + {RELATIONAL_SIGNS, "\u22C8", "\bowtie"}, + {RELATIONAL_SIGNS, "\u2286", "\subseteq"}, + {RELATIONAL_SIGNS, "\u2287", "\supseteq"}, + {RELATIONAL_SIGNS, "\u2245", "\cong"}, + {RELATIONAL_SIGNS, "\u2A1D", "\Join"}, + {RELATIONAL_SIGNS, "\u228F", "\sqsubset"}, + {RELATIONAL_SIGNS, "\u2290", "\sqsupset"}, + {RELATIONAL_SIGNS, "\u2260", "\neq"}, + {RELATIONAL_SIGNS, "\u2323", "\smile"}, + {RELATIONAL_SIGNS, "\u2291", "\sqsubseteq"}, + {RELATIONAL_SIGNS, "\u2292", "\sqsupseteq"}, + {RELATIONAL_SIGNS, "\u2250", "\doteq"}, + {RELATIONAL_SIGNS, "\u2322", "\frown"}, + {RELATIONAL_SIGNS, "\u2208", "\in"}, + {RELATIONAL_SIGNS, "\u220B", "\ni"}, + {RELATIONAL_SIGNS, "\u221D", "\propto"}, + {RELATIONAL_SIGNS, "\u22A2", "\vdash"}, + {RELATIONAL_SIGNS, "\u22A3", "\dashv"}, + {BINARY_OPERATIONS, "\u00B1", "\pm"}, + {BINARY_OPERATIONS, "\u2213", "\mp"}, + {BINARY_OPERATIONS, "\u00D7", "\times"}, + {BINARY_OPERATIONS, "\u00F7", "\div"}, + {BINARY_OPERATIONS, "\u2217", "\ast"}, + {BINARY_OPERATIONS, "\u22C6", "\star"}, + {BINARY_OPERATIONS, "\u2218", "\circ"}, + {BINARY_OPERATIONS, "\u2219", "\bullet"}, + {BINARY_OPERATIONS, "\u22C5", "\cdot"}, + {BINARY_OPERATIONS, "\u2229", "\cap"}, + {BINARY_OPERATIONS, "\u222A", "\cup"}, + {BINARY_OPERATIONS, "\u228E", "\uplus"}, + {BINARY_OPERATIONS, "\u2293", "\sqcap"}, + {BINARY_OPERATIONS, "\u2228", "\vee"}, + {BINARY_OPERATIONS, "\u2227", "\wedge"}, + {BINARY_OPERATIONS, "\u2216", "\setminus"}, + {BINARY_OPERATIONS, "\u2240", "\wr"}, + {BINARY_OPERATIONS, "\u22C4", "\diamond"}, + {BINARY_OPERATIONS, "\u25B3", "\bigtriangleup"}, + {BINARY_OPERATIONS, "\u25BD", "\bigtriangledown"}, + {BINARY_OPERATIONS, "\u25C1", "\triangleleft"}, + {BINARY_OPERATIONS, "\u25B7", "\triangleright"}, + {BINARY_OPERATIONS, "", "\lhd"}, + {BINARY_OPERATIONS, "", "\rhd"}, + {BINARY_OPERATIONS, "", "\unlhd"}, + {BINARY_OPERATIONS, "", "\unrhd"}, + {BINARY_OPERATIONS, "\u2295", "\oplus"}, + {BINARY_OPERATIONS, "\u2296", "\ominus"}, + {BINARY_OPERATIONS, "\u2297", "\otimes"}, + {BINARY_OPERATIONS, "\u2205", "\oslash"}, + {BINARY_OPERATIONS, "\u2299", "\odot"}, + {BINARY_OPERATIONS, "\u25CB", "\bigcirc"}, + {BINARY_OPERATIONS, "\u2020", "\dagger"}, + {BINARY_OPERATIONS, "\u2021", "\ddagger"}, + {BINARY_OPERATIONS, "\u2A3F", "\amalg"}, + {0, NULL, NULL}, + +};
Copied: trunk/geanylatex/src/letters.h (from rev 143, trunk/geanylatex/letters.h) =================================================================== --- trunk/geanylatex/src/letters.h (rev 0) +++ trunk/geanylatex/src/letters.h 2008-08-31 23:29:18 UTC (rev 150) @@ -0,0 +1,32 @@ +/* + * letters.h + * + * Copyright 2008 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + + +#ifndef LETTERS_H +#define LETTER_H + +#include "datatypes.h" + +extern SubMenuTemplate char_array[]; + +extern CategoryName cat_names[]; + +#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org