SF.net SVN: geany-plugins:[481] trunk

frlan at users.sourceforge.net frlan at xxxxx
Sun Feb 15 22:55:16 UTC 2009


Revision: 481
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=481&view=rev
Author:   frlan
Date:     2009-02-15 22:55:16 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
GeanyLaTeX: Added a menu entry for easy formating of text

Modified Paths:
--------------
    trunk/geanylatex/ChangeLog
    trunk/geanylatex/po/POTFILES.in
    trunk/geanylatex/po/de.po
    trunk/geanylatex/po/geanylatex.pot
    trunk/geanylatex/src/Makefile.am
    trunk/geanylatex/src/geanylatex.c
    trunk/geanylatex/src/geanylatex.h
    trunk/wscript

Added Paths:
-----------
    trunk/geanylatex/src/formatpatterns.c
    trunk/geanylatex/src/formatutils.c
    trunk/geanylatex/src/formatutils.h

Modified: trunk/geanylatex/ChangeLog
===================================================================
--- trunk/geanylatex/ChangeLog	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/ChangeLog	2009-02-15 22:55:16 UTC (rev 481)
@@ -1,7 +1,12 @@
+2009-02-15  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
+
+ * Added a menu entry for easy formating of text
+
+
 2009-02-14  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * Added a keyboard shortcut for inserting a new line ( \\ ).
- * Make cursor placed behind inserted text for most cases. 
+ * Make cursor placed behind inserted text for most cases.
    (Inserting BibTeX entries will not reset the cursor)
 
 

Modified: trunk/geanylatex/po/POTFILES.in
===================================================================
--- trunk/geanylatex/po/POTFILES.in	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/po/POTFILES.in	2009-02-15 22:55:16 UTC (rev 481)
@@ -3,3 +3,5 @@
 src/letters.c
 src/bibtex.c
 src/bibtexlabels.c
+src/formatutils.c
+src/formatpatterns.c

Modified: trunk/geanylatex/po/de.po
===================================================================
--- trunk/geanylatex/po/de.po	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/po/de.po	2009-02-15 22:55:16 UTC (rev 481)
@@ -2,7 +2,7 @@
 msgstr ""
 "Project-Id-Version: GeanyLaTeX\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-28 22:23+0100\n"
+"POT-Creation-Date: 2009-02-15 23:43+0100\n"
 "PO-Revision-Date: \n"
 "Last-Translator: Frank Lanitz <frank at frank.uvena.de>\n"
 "Language-Team: geany-118n <geany-118n at uvena.de>\n"
@@ -21,87 +21,87 @@
 msgid "Plugin to provide better LaTeX support"
 msgstr "Plugin zum Verbessern des LaTeX-Support für Geany"
 
-#: src/geanylatex.c:101
+#: src/geanylatex.c:109
 msgid "Insert label"
 msgstr "Lesezeichen einfügen"
 
-#: src/geanylatex.c:114
+#: src/geanylatex.c:122
 msgid "Label name:"
 msgstr "Lesezeichenname:"
 
-#: src/geanylatex.c:149
+#: src/geanylatex.c:158
 msgid "Insert reference"
 msgstr "Verweis einfügen"
 
-#: src/geanylatex.c:162
+#: src/geanylatex.c:171
 msgid "Ref name:"
 msgstr "Lesezeichenname:"
 
-#: src/geanylatex.c:173
+#: src/geanylatex.c:182
 msgid "Standard Reference"
 msgstr "Normaler Verweis"
 
-#: src/geanylatex.c:178
+#: src/geanylatex.c:187
 msgid "Page Reference"
 msgstr "Verweis auf Seite"
 
-#: src/geanylatex.c:351
+#: src/geanylatex.c:363
 msgid "More"
 msgstr "Weitere"
 
 #. Documentclass
-#: src/geanylatex.c:446
+#: src/geanylatex.c:458
 msgid "Documentclass:"
 msgstr "Dokumentenklasse:"
 
-#: src/geanylatex.c:449
+#: src/geanylatex.c:461
 msgid "Choose the kind of document you want to write"
 msgstr "Art des Dokumentes"
 
-#: src/geanylatex.c:451 src/bibtexlabels.c:27
+#: src/geanylatex.c:463 src/bibtexlabels.c:27
 msgid "Book"
 msgstr "Buch"
 
-#: src/geanylatex.c:453 src/bibtexlabels.c:26
+#: src/geanylatex.c:465 src/bibtexlabels.c:26
 msgid "Article"
 msgstr "Artikel"
 
-#: src/geanylatex.c:455
+#: src/geanylatex.c:467
 msgid "Report"
 msgstr "Bericht"
 
-#: src/geanylatex.c:457
+#: src/geanylatex.c:469
 msgid "Letter"
 msgstr "Brief"
 
-#: src/geanylatex.c:459
+#: src/geanylatex.c:471
 msgid "Presentation"
 msgstr "Präsentation"
 
 #. Encoding
-#: src/geanylatex.c:469
+#: src/geanylatex.c:481
 msgid "Encoding:"
 msgstr "Zeichensatz:"
 
-#: src/geanylatex.c:473
+#: src/geanylatex.c:485
 msgid "Set the encoding for your new document"
 msgstr "Zeichensatz für das neue Dokument"
 
 #. fontsize
-#: src/geanylatex.c:488
+#: src/geanylatex.c:500
 msgid "Fontsize:"
 msgstr "Schriftgröße:"
 
-#: src/geanylatex.c:491
+#: src/geanylatex.c:503
 msgid "Set the default fontsize of your new document"
 msgstr "Setzt die Standardschriftgröße für das neue Dokument"
 
 #. Author
-#: src/geanylatex.c:504
+#: src/geanylatex.c:516
 msgid "Author:"
 msgstr "Autor:"
 
-#: src/geanylatex.c:507
+#: src/geanylatex.c:519
 msgid ""
 "Sets the value of the \\author command. In most cases this should be your "
 "name"
@@ -109,11 +109,11 @@
 "Setzt den Eintrag für den \\author Befehl. Meist sollte hier Ihr Name stehen."
 
 #. Date
-#: src/geanylatex.c:518
+#: src/geanylatex.c:530
 msgid "Date:"
 msgstr "Datum:"
 
-#: src/geanylatex.c:521
+#: src/geanylatex.c:533
 msgid ""
 "Sets the value of the \\date command inside header of your\t\t newly created "
 "LaTeX-document. Keeping it at \\today is a good \t\t decision if you don't "
@@ -123,35 +123,35 @@
 "meisten Fällen sollte \\today eine gute Wahl sein."
 
 #. Title of the new document
-#: src/geanylatex.c:530
+#: src/geanylatex.c:542
 msgid "Title:"
 msgstr "Titel:"
 
-#: src/geanylatex.c:533
+#: src/geanylatex.c:545
 msgid "Sets the title of your new document."
 msgstr "Setzt den Titel für das neue Dokument."
 
 #. Papersize
-#: src/geanylatex.c:539
+#: src/geanylatex.c:551
 msgid "Paper size:"
 msgstr "Papiergröße:"
 
-#: src/geanylatex.c:542
+#: src/geanylatex.c:554
 msgid "Choose the paper format for the newly created document"
 msgstr ""
 "Setzt das Papierformat als Argument der Dokumentenklasse für das neue "
 "Dokument"
 
 #. Building the wizard-dialog and showing it
-#: src/geanylatex.c:557
+#: src/geanylatex.c:569
 msgid "LaTeX-Wizard"
 msgstr "LaTeX-Assistent"
 
-#: src/geanylatex.c:568
+#: src/geanylatex.c:580
 msgid "Use KOMA-script classes if possible"
 msgstr "Benutze KOMA-Skript wenn möglich"
 
-#: src/geanylatex.c:570
+#: src/geanylatex.c:582
 msgid ""
 "Uses the KOMA-script classes by Markus Kohm.\n"
 "Keep in mind: To compile your document these classeshave to be installed "
@@ -160,11 +160,11 @@
 "Wenn diese Option aktiviert ist, werden die KOMA-Skript-Klassen von Markus "
 "Kohm genutzt. Sie müssen natürlich dafür installiert sein."
 
-#: src/geanylatex.c:577
+#: src/geanylatex.c:589
 msgid "Use draft mode"
 msgstr "Entwurfsmodus benutzen"
 
-#: src/geanylatex.c:579
+#: src/geanylatex.c:591
 msgid ""
 "Set the draft flag inside new created documents to get documents with a "
 "number of debugging helpers"
@@ -172,66 +172,81 @@
 "Setzt die Option draft für die Dokumentenklasse um das neue Dokument mit "
 "einer Nummer von kleinen Korrekturhinweisen zu versehen."
 
-#: src/geanylatex.c:807
+#: src/geanylatex.c:819
 msgid "Dear Sir or Madame"
 msgstr "Sehr geehrte Damen und Herren"
 
-#: src/geanylatex.c:808
+#: src/geanylatex.c:820
 msgid "With kind regards"
 msgstr "Mit freundlichen Grüßen"
 
-#: src/geanylatex.c:850
+#: src/geanylatex.c:859
+msgid ""
+"GeanyLaTeX is a plugin to improve support for LaTeX in Geany.\n"
+"\n"
+"Please report all bugs or feature requests to one of the authors."
+msgstr ""
+
+#: src/geanylatex.c:878
 msgid "_LaTeX"
 msgstr "_LaTeX"
 
-#: src/geanylatex.c:857
+#: src/geanylatex.c:885
 msgid "LaTeX-_Wizard"
 msgstr "LaTeX-_Assistent"
 
-#: src/geanylatex.c:860
+#: src/geanylatex.c:888
 msgid "Starts a Wizard to easily create LaTeX-documents"
 msgstr "Öffnet einen Assistenten, um einfache LaTeX-Dokumente zu erstellen."
 
-#: src/geanylatex.c:865
+#: src/geanylatex.c:893
 msgid "Insert _Special Character"
 msgstr "_Sonderzeichen einfügen"
 
-#: src/geanylatex.c:867
+#: src/geanylatex.c:895
 msgid "Helps to use some not very common letters and signs"
 msgstr "Unterstützt bei der Verwendung von seltenen Sonderzeichen"
 
-#: src/geanylatex.c:877
+#: src/geanylatex.c:905
 msgid "Insert _Reference"
 msgstr "_Verweis einfügen"
 
-#: src/geanylatex.c:879
+#: src/geanylatex.c:907
 msgid "Inserting references to the document"
 msgstr "Eine Referenz in das Dokument einfügen"
 
-#: src/geanylatex.c:884
+#: src/geanylatex.c:912
 msgid "Insert _Label"
 msgstr "_Lesezeichen einfügen"
 
-#: src/geanylatex.c:886
+#: src/geanylatex.c:914
 msgid "Helps at inserting labels to a document"
 msgstr "Untersützt bei dem Einfügen von Lesezeichen in ein Dokument"
 
-#: src/geanylatex.c:891
+#: src/geanylatex.c:919
 msgid "BibTeX"
 msgstr "BibTeX"
 
-#: src/geanylatex.c:910
+#: src/geanylatex.c:935
+msgid "Format"
+msgstr "Format"
+
+#: src/geanylatex.c:953
 msgid "Run LaTeX-Wizard"
 msgstr "LaTeX-Assistent starten"
 
-#: src/geanylatex.c:912
+#: src/geanylatex.c:955
 msgid "Insert \\label"
 msgstr "\\label einfügen"
 
-#: src/geanylatex.c:914
+#: src/geanylatex.c:957
 msgid "Insert \\ref"
 msgstr "\\ref einfügen"
 
+#: src/geanylatex.c:959
+msgid "Insert linebreak \\\\ "
+msgstr "Zeilenumbruch einfügen (\\\\)"
+
 #: src/latexencodings.c:37
 msgid "UTF-8"
 msgstr "UTF-8"
@@ -556,3 +571,31 @@
 msgstr ""
 "Jahr der Publikation oder der Erstellung, wenn das Werk noch nicht "
 "veröffentlicht ist."
+
+#: src/formatpatterns.c:35
+msgid "Italic"
+msgstr "Kursiv"
+
+#: src/formatpatterns.c:36
+msgid "Boldfont"
+msgstr "Fettdruck"
+
+#: src/formatpatterns.c:37
+msgid "Underline"
+msgstr "Unterstrichen"
+
+#: src/formatpatterns.c:38
+msgid "Slanted"
+msgstr ""
+
+#: src/formatpatterns.c:39
+msgid "Typewriter"
+msgstr "Schreibmaschine"
+
+#: src/formatpatterns.c:40
+msgid "Small Caps"
+msgstr "Kapitälchen"
+
+#: src/formatpatterns.c:41
+msgid "Emphasis"
+msgstr ""

Modified: trunk/geanylatex/po/geanylatex.pot
===================================================================
--- trunk/geanylatex/po/geanylatex.pot	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/po/geanylatex.pot	2009-02-15 22:55:16 UTC (rev 481)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-28 22:23+0100\n"
+"POT-Creation-Date: 2009-02-15 23:43+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -24,98 +24,98 @@
 msgid "Plugin to provide better LaTeX support"
 msgstr ""
 
-#: src/geanylatex.c:101
+#: src/geanylatex.c:109
 msgid "Insert label"
 msgstr ""
 
-#: src/geanylatex.c:114
+#: src/geanylatex.c:122
 msgid "Label name:"
 msgstr ""
 
-#: src/geanylatex.c:149
+#: src/geanylatex.c:158
 msgid "Insert reference"
 msgstr ""
 
-#: src/geanylatex.c:162
+#: src/geanylatex.c:171
 msgid "Ref name:"
 msgstr ""
 
-#: src/geanylatex.c:173
+#: src/geanylatex.c:182
 msgid "Standard Reference"
 msgstr ""
 
-#: src/geanylatex.c:178
+#: src/geanylatex.c:187
 msgid "Page Reference"
 msgstr ""
 
-#: src/geanylatex.c:351
+#: src/geanylatex.c:363
 msgid "More"
 msgstr ""
 
 #. Documentclass
-#: src/geanylatex.c:446
+#: src/geanylatex.c:458
 msgid "Documentclass:"
 msgstr ""
 
-#: src/geanylatex.c:449
+#: src/geanylatex.c:461
 msgid "Choose the kind of document you want to write"
 msgstr ""
 
-#: src/geanylatex.c:451 src/bibtexlabels.c:27
+#: src/geanylatex.c:463 src/bibtexlabels.c:27
 msgid "Book"
 msgstr ""
 
-#: src/geanylatex.c:453 src/bibtexlabels.c:26
+#: src/geanylatex.c:465 src/bibtexlabels.c:26
 msgid "Article"
 msgstr ""
 
-#: src/geanylatex.c:455
+#: src/geanylatex.c:467
 msgid "Report"
 msgstr ""
 
-#: src/geanylatex.c:457
+#: src/geanylatex.c:469
 msgid "Letter"
 msgstr ""
 
-#: src/geanylatex.c:459
+#: src/geanylatex.c:471
 msgid "Presentation"
 msgstr ""
 
 #. Encoding
-#: src/geanylatex.c:469
+#: src/geanylatex.c:481
 msgid "Encoding:"
 msgstr ""
 
-#: src/geanylatex.c:473
+#: src/geanylatex.c:485
 msgid "Set the encoding for your new document"
 msgstr ""
 
 #. fontsize
-#: src/geanylatex.c:488
+#: src/geanylatex.c:500
 msgid "Fontsize:"
 msgstr ""
 
-#: src/geanylatex.c:491
+#: src/geanylatex.c:503
 msgid "Set the default fontsize of your new document"
 msgstr ""
 
 #. Author
-#: src/geanylatex.c:504
+#: src/geanylatex.c:516
 msgid "Author:"
 msgstr ""
 
-#: src/geanylatex.c:507
+#: src/geanylatex.c:519
 msgid ""
 "Sets the value of the \\author command. In most cases this should be your "
 "name"
 msgstr ""
 
 #. Date
-#: src/geanylatex.c:518
+#: src/geanylatex.c:530
 msgid "Date:"
 msgstr ""
 
-#: src/geanylatex.c:521
+#: src/geanylatex.c:533
 msgid ""
 "Sets the value of the \\date command inside header of your\t\t newly created "
 "LaTeX-document. Keeping it at \\today is a good \t\t decision if you don't "
@@ -123,109 +123,124 @@
 msgstr ""
 
 #. Title of the new document
-#: src/geanylatex.c:530
+#: src/geanylatex.c:542
 msgid "Title:"
 msgstr ""
 
-#: src/geanylatex.c:533
+#: src/geanylatex.c:545
 msgid "Sets the title of your new document."
 msgstr ""
 
 #. Papersize
-#: src/geanylatex.c:539
+#: src/geanylatex.c:551
 msgid "Paper size:"
 msgstr ""
 
-#: src/geanylatex.c:542
+#: src/geanylatex.c:554
 msgid "Choose the paper format for the newly created document"
 msgstr ""
 
 #. Building the wizard-dialog and showing it
-#: src/geanylatex.c:557
+#: src/geanylatex.c:569
 msgid "LaTeX-Wizard"
 msgstr ""
 
-#: src/geanylatex.c:568
+#: src/geanylatex.c:580
 msgid "Use KOMA-script classes if possible"
 msgstr ""
 
-#: src/geanylatex.c:570
+#: src/geanylatex.c:582
 msgid ""
 "Uses the KOMA-script classes by Markus Kohm.\n"
 "Keep in mind: To compile your document these classeshave to be installed "
 "before."
 msgstr ""
 
-#: src/geanylatex.c:577
+#: src/geanylatex.c:589
 msgid "Use draft mode"
 msgstr ""
 
-#: src/geanylatex.c:579
+#: src/geanylatex.c:591
 msgid ""
 "Set the draft flag inside new created documents to get documents with a "
 "number of debugging helpers"
 msgstr ""
 
-#: src/geanylatex.c:807
+#: src/geanylatex.c:819
 msgid "Dear Sir or Madame"
 msgstr ""
 
-#: src/geanylatex.c:808
+#: src/geanylatex.c:820
 msgid "With kind regards"
 msgstr ""
 
-#: src/geanylatex.c:850
+#: src/geanylatex.c:859
+msgid ""
+"GeanyLaTeX is a plugin to improve support for LaTeX in Geany.\n"
+"\n"
+"Please report all bugs or feature requests to one of the authors."
+msgstr ""
+
+#: src/geanylatex.c:878
 msgid "_LaTeX"
 msgstr ""
 
-#: src/geanylatex.c:857
+#: src/geanylatex.c:885
 msgid "LaTeX-_Wizard"
 msgstr ""
 
-#: src/geanylatex.c:860
+#: src/geanylatex.c:888
 msgid "Starts a Wizard to easily create LaTeX-documents"
 msgstr ""
 
-#: src/geanylatex.c:865
+#: src/geanylatex.c:893
 msgid "Insert _Special Character"
 msgstr ""
 
-#: src/geanylatex.c:867
+#: src/geanylatex.c:895
 msgid "Helps to use some not very common letters and signs"
 msgstr ""
 
-#: src/geanylatex.c:877
+#: src/geanylatex.c:905
 msgid "Insert _Reference"
 msgstr ""
 
-#: src/geanylatex.c:879
+#: src/geanylatex.c:907
 msgid "Inserting references to the document"
 msgstr ""
 
-#: src/geanylatex.c:884
+#: src/geanylatex.c:912
 msgid "Insert _Label"
 msgstr ""
 
-#: src/geanylatex.c:886
+#: src/geanylatex.c:914
 msgid "Helps at inserting labels to a document"
 msgstr ""
 
-#: src/geanylatex.c:891
+#: src/geanylatex.c:919
 msgid "BibTeX"
 msgstr ""
 
-#: src/geanylatex.c:910
+#: src/geanylatex.c:935
+msgid "Format"
+msgstr ""
+
+#: src/geanylatex.c:953
 msgid "Run LaTeX-Wizard"
 msgstr ""
 
-#: src/geanylatex.c:912
+#: src/geanylatex.c:955
 msgid "Insert \\label"
 msgstr ""
 
-#: src/geanylatex.c:914
+#: src/geanylatex.c:957
 msgid "Insert \\ref"
 msgstr ""
 
+#: src/geanylatex.c:959
+msgid "Insert linebreak \\\\ "
+msgstr ""
+
 #: src/latexencodings.c:37
 msgid "UTF-8"
 msgstr ""
@@ -547,3 +562,31 @@
 #: src/bibtexlabels.c:124
 msgid "Year of publication or creation if unpublished"
 msgstr ""
+
+#: src/formatpatterns.c:35
+msgid "Italic"
+msgstr ""
+
+#: src/formatpatterns.c:36
+msgid "Boldfont"
+msgstr ""
+
+#: src/formatpatterns.c:37
+msgid "Underline"
+msgstr ""
+
+#: src/formatpatterns.c:38
+msgid "Slanted"
+msgstr ""
+
+#: src/formatpatterns.c:39
+msgid "Typewriter"
+msgstr ""
+
+#: src/formatpatterns.c:40
+msgid "Small Caps"
+msgstr ""
+
+#: src/formatpatterns.c:41
+msgid "Emphasis"
+msgstr ""

Modified: trunk/geanylatex/src/Makefile.am
===================================================================
--- trunk/geanylatex/src/Makefile.am	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/src/Makefile.am	2009-02-15 22:55:16 UTC (rev 481)
@@ -1,5 +1,5 @@
 lib_LTLIBRARIES = geanylatex.la
-geanylatex_la_SOURCES = geanylatex.c geanylatex.h datatypes.h latexencodings.c latexencodings.h letters.c letters.h bibtex.h bibtex.c bibtexlabels.c reftex.c reftex.h latexutils.c latexutils.h
+geanylatex_la_SOURCES = geanylatex.c geanylatex.h datatypes.h latexencodings.c latexencodings.h letters.c letters.h bibtex.h bibtex.c bibtexlabels.c reftex.c reftex.h latexutils.c latexutils.h formatutils.c formatutils.h formatpatterns.c
 
 geanylatex_la_LDFLAGS = -module -avoid-version
 geanylatex_la_LIBADD  = @GEANY_LIBS@  $(INTLLIBS)

Added: trunk/geanylatex/src/formatpatterns.c
===================================================================
--- trunk/geanylatex/src/formatpatterns.c	                        (rev 0)
+++ trunk/geanylatex/src/formatpatterns.c	2009-02-15 22:55:16 UTC (rev 481)
@@ -0,0 +1,42 @@
+/*
+ *      formatpatterns.c
+ *
+ *      Copyright 2009 Frank Lanitz <frank at Jupiter>
+ *
+ *      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 "geanylatex.h"
+
+gchar* format_pattern[] = {
+	"\\textit",
+	"\\textbf",
+	"\\underline",
+	"\\textsl",
+	"\\texttt",
+	"\\textsc",
+	"\\emph"
+};
+
+const gchar *format_labels[] = {
+	N_("Italic"),
+	N_("Boldfont"),
+	N_("Underline"),
+	N_("Slanted"),
+	N_("Typewriter"),
+	N_("Small Caps"),
+	N_("Emphasis"),
+};

Added: trunk/geanylatex/src/formatutils.c
===================================================================
--- trunk/geanylatex/src/formatutils.c	                        (rev 0)
+++ trunk/geanylatex/src/formatutils.c	2009-02-15 22:55:16 UTC (rev 481)
@@ -0,0 +1,32 @@
+/*
+ *      formatutils.c
+ *
+ *      Copyright 2009 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 "formatutils.h"
+
+void insert_latex_format(G_GNUC_UNUSED GtkMenuItem * menuitem,
+                         G_GNUC_UNUSED gpointer gdata)
+{
+    gint format = GPOINTER_TO_INT(gdata);
+
+    insert_string(format_pattern[format], TRUE);
+    insert_string("{", TRUE);
+    insert_string("}", FALSE);
+}

Added: trunk/geanylatex/src/formatutils.h
===================================================================
--- trunk/geanylatex/src/formatutils.h	                        (rev 0)
+++ trunk/geanylatex/src/formatutils.h	2009-02-15 22:55:16 UTC (rev 481)
@@ -0,0 +1,42 @@
+/*
+ *      formatutils.h
+ *
+ *      Copyright 2009 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 LATEXFORMATUTILS_H
+#define LATEXFORMATUTILS_H
+
+#include "geanylatex.h"
+
+enum {
+    LATEX_ITALIC = 0,
+    LATEX_BOLD,
+    LATEX_UNDERLINE,
+    LATEX_SLANTED,
+    LATEX_TYPEWRITER,
+    LATEX_SMALLCAPS,
+    LATEX_EMPHASIS,
+	LATEX_STYLES_END
+};
+
+extern gchar* format_pattern[];
+extern const gchar *format_labels[];
+void insert_latex_format(GtkMenuItem * menuitem, gpointer gdata);
+
+#endif

Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/src/geanylatex.c	2009-02-15 22:55:16 UTC (rev 481)
@@ -43,6 +43,8 @@
 GtkWidget *menu_latex_label = NULL;
 GtkWidget *menu_latex_bibtex = NULL;
 GtkWidget *menu_latex_bibtex_submenu = NULL;
+GtkWidget *menu_latex_format_insert = NULL;
+GtkWidget *menu_latex_format_insert_submenu = NULL;
 
 static GtkWidget *main_menu_item = NULL;
 
@@ -930,15 +932,30 @@
 			G_CALLBACK(insert_bibtex_entry), GINT_TO_POINTER(i));
 	}
 
+	menu_latex_format_insert = gtk_menu_item_new_with_mnemonic(_("Format"));
+	gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_format_insert);
+
+	menu_latex_format_insert_submenu = gtk_menu_new();
+	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex_format_insert),
+		menu_latex_format_insert_submenu);
+
+	for (i = 0; i < LATEX_STYLES_END; i++)
+	{
+		tmp = NULL;
+		tmp = gtk_menu_item_new_with_mnemonic(_(format_labels[i]));
+		gtk_container_add(GTK_CONTAINER(menu_latex_format_insert_submenu), tmp);
+		g_signal_connect((gpointer) tmp, "activate",
+			G_CALLBACK(insert_latex_format), GINT_TO_POINTER(i));
+	}
+
 	/* init keybindins */
-
 	keybindings_set_item(plugin_key_group, LATEX_WIZZARD_KB, kbwizard,
 		0, 0, "run_latex_wizard", _("Run LaTeX-Wizard"), menu_latex_wizzard);
 	keybindings_set_item(plugin_key_group, LATEX_INSERT_LABEL_KB, kblabel_insert,
 		0, 0, "insert_latex_label", _("Insert \\label"), menu_latex_label);
 	keybindings_set_item(plugin_key_group, LATEX_INSERT_REF_KB, kbref_insert,
 		0, 0, "insert_latex_ref", _("Insert \\ref"), menu_latex_ref);
-	keybindings_set_item(plugin_key_group, LATEX_INSERT_NEWLINE, kb_insert_newline, 
+	keybindings_set_item(plugin_key_group, LATEX_INSERT_NEWLINE, kb_insert_newline,
 		0, 0, "insert_new_line", _("Insert linebreak \\\\ "), NULL);
 /*	keybindings_set_item(plugin_key_group, LATEX_INSERT_BIBTEX_ENTRY_KB,
 		kb_bibtex_entry_insert, 0, 0, "insert_latex_bibtex_entry", _("Add BiBTeX entry"),

Modified: trunk/geanylatex/src/geanylatex.h
===================================================================
--- trunk/geanylatex/src/geanylatex.h	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/geanylatex/src/geanylatex.h	2009-02-15 22:55:16 UTC (rev 481)
@@ -28,7 +28,7 @@
 
 #include "geany.h"
 #include "support.h"
-#include "plugindata.h"
+
 #include "document.h"
 #include "editor.h"
 #include "filetypes.h"
@@ -38,13 +38,15 @@
 #include "ui_utils.h"
 #include "keybindings.h"
 #include "prefs.h"
-#include "geanyfunctions.h"
 #include "datatypes.h"
 #include "letters.h"
 #include "latexencodings.h"
 #include "bibtex.h"
 #include "latexutils.h"
 #include "reftex.h"
+#include "formatutils.h"
+#include "plugindata.h"
+#include "geanyfunctions.h"
 
 #include <gtk/gtk.h>
 

Modified: trunk/wscript
===================================================================
--- trunk/wscript	2009-02-15 22:54:13 UTC (rev 480)
+++ trunk/wscript	2009-02-15 22:55:16 UTC (rev 481)
@@ -84,7 +84,8 @@
 		 [ 'geanylatex/src/latexencodings.c', 'geanylatex/src/geanylatex.c',
 		   'geanylatex/src/letters.c', 'geanylatex/src/bibtex.c',
 		   'geanylatex/src/bibtexlabels.c', 'geanylatex/src/reftex.c',
-		   'geanylatex/src/latexutils.c'],
+		   'geanylatex/src/latexutils.c', 'geanylatex/src/formatutils.c',
+		   'geanylatex/src/formatpatterns.c'],
 		 [ 'geanylatex' ], # include dirs
 		 '0.3'),
 	Plugin('geanylua',


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list