Revision: 652 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=652&view=rev Author: frlan Date: 2009-05-17 21:09:23 +0000 (Sun, 17 May 2009)
Log Message: ----------- GeanyLaTeX_ Adding some more items to toolbar for centerin, left and right formatted text. Created LaTeX code based on needs still some improvement. Please use with care.
Modified Paths: -------------- trunk/geanylatex/src/formatpatterns.c trunk/geanylatex/src/formatutils.h trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/latexkeybindings.c trunk/geanylatex/src/latexkeybindings.h
Modified: trunk/geanylatex/src/formatpatterns.c =================================================================== --- trunk/geanylatex/src/formatpatterns.c 2009-05-15 21:34:08 UTC (rev 651) +++ trunk/geanylatex/src/formatpatterns.c 2009-05-17 21:09:23 UTC (rev 652) @@ -28,7 +28,10 @@ "\textsl", "\texttt", "\textsc", - "\emph" + "\emph", + "\centering", + "\raggedleft", + "\raggedright", };
const gchar *glatex_format_labels[] = { @@ -39,4 +42,7 @@ N_("Typewriter"), N_("Small Caps"), N_("Emphasis"), + N_("Centered"), + N_("Left side oriented"), + N_("Right side oriented") };
Modified: trunk/geanylatex/src/formatutils.h =================================================================== --- trunk/geanylatex/src/formatutils.h 2009-05-15 21:34:08 UTC (rev 651) +++ trunk/geanylatex/src/formatutils.h 2009-05-17 21:09:23 UTC (rev 652) @@ -32,6 +32,9 @@ LATEX_TYPEWRITER, LATEX_SMALLCAPS, LATEX_EMPHASIS, + LATEX_CENTER, + LATEX_LEFT, + LATEX_RIGHT, LATEX_STYLES_END };
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-05-15 21:34:08 UTC (rev 651) +++ trunk/geanylatex/src/geanylatex.c 2009-05-17 21:09:23 UTC (rev 652) @@ -85,6 +85,9 @@ { "Italic", GTK_STOCK_ITALIC, NULL, NULL, N_("Marks selected text as italic"), G_CALLBACK(glatex_kb_format_bold) }, { "Bold", GTK_STOCK_BOLD, NULL, NULL, N_("Marks selected text as bold"), G_CALLBACK(glatex_kb_format_bold) }, { "Underline", GTK_STOCK_UNDERLINE, NULL, NULL, N_("Underlines selected text"), G_CALLBACK(glatex_kb_format_bold) }, + { "Centered", GTK_STOCK_JUSTIFY_CENTER, NULL, NULL, NULL, G_CALLBACK(glatex_kb_format_centering) }, + { "Left", GTK_STOCK_JUSTIFY_LEFT, NULL, NULL, NULL, G_CALLBACK(glatex_kb_format_left) }, + { "Right", GTK_STOCK_JUSTIFY_RIGHT, NULL, NULL, NULL, G_CALLBACK(glatex_kb_format_right) }, };
const guint ui_entries_n = G_N_ELEMENTS(format_icons); @@ -97,6 +100,10 @@ "<toolitem action='Italic'/>" "<toolitem action='Bold'/>" "<toolitem action='Underline'/>" + "<separator/>" + "<toolitem action='Centered' />" + "<toolitem action='Left' />" + "<toolitem action='Right'/>" "</toolbar>" "</ui>";
@@ -1010,6 +1017,8 @@ { GtkTooltips *tooltips = NULL; GtkWidget *tmp = NULL; + static GtkWidget *menubar_toolbar_separator = NULL; + int i;
main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); @@ -1018,6 +1027,9 @@
tooltips = gtk_tooltips_new();
+ menubar_toolbar_separator = GTK_WIDGET(gtk_separator_tool_item_new()); + + menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), menu_latex);
Modified: trunk/geanylatex/src/latexkeybindings.c =================================================================== --- trunk/geanylatex/src/latexkeybindings.c 2009-05-15 21:34:08 UTC (rev 651) +++ trunk/geanylatex/src/latexkeybindings.c 2009-05-17 21:09:23 UTC (rev 652) @@ -89,3 +89,24 @@ return; glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_TYPEWRITER)); } + +void glatex_kb_format_centering(G_GNUC_UNUSED guint key_id) +{ + if (NULL == document_get_current()) + return; + glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_CENTER)); +} + +void glatex_kb_format_left(G_GNUC_UNUSED guint key_id) +{ + if (NULL == document_get_current()) + return; + glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_LEFT)); +} + +void glatex_kb_format_right(G_GNUC_UNUSED guint key_id) +{ + if (NULL == document_get_current()) + return; + glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_RIGHT)); +}
Modified: trunk/geanylatex/src/latexkeybindings.h =================================================================== --- trunk/geanylatex/src/latexkeybindings.h 2009-05-15 21:34:08 UTC (rev 651) +++ trunk/geanylatex/src/latexkeybindings.h 2009-05-17 21:09:23 UTC (rev 652) @@ -34,5 +34,8 @@ void glatex_kb_format_bold(G_GNUC_UNUSED guint key_id); void glatex_kb_format_italic(G_GNUC_UNUSED guint key_id); void glatex_kb_format_typewriter(G_GNUC_UNUSED guint key_id); +void glatex_kb_format_centering(G_GNUC_UNUSED guint key_id); +void glatex_kb_format_left(G_GNUC_UNUSED guint key_id); +void glatex_kb_format_right(G_GNUC_UNUSED guint key_id);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org