SF.net SVN: geany-plugins:[672] trunk/geanylatex

frlan at users.sourceforge.net frlan at xxxxx
Tue May 26 20:44:22 UTC 2009


Revision: 672
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=672&view=rev
Author:   frlan
Date:     2009-05-26 20:44:21 +0000 (Tue, 26 May 2009)

Log Message:
-----------
GeanyLaTeX: Make usage of Geany plugin API v136

Modified Paths:
--------------
    trunk/geanylatex/configure.in
    trunk/geanylatex/doc/geanylatex.tex
    trunk/geanylatex/src/formatutils.c
    trunk/geanylatex/src/geanylatex.c
    trunk/geanylatex/src/latexenvironments.c

Modified: trunk/geanylatex/configure.in
===================================================================
--- trunk/geanylatex/configure.in	2009-05-26 20:32:00 UTC (rev 671)
+++ trunk/geanylatex/configure.in	2009-05-26 20:44:21 UTC (rev 672)
@@ -14,7 +14,7 @@
 AC_PROG_INSTALL
 
 # checking for Geany
-PKG_CHECK_MODULES(GEANY, [geany >= 0.16])
+PKG_CHECK_MODULES(GEANY, [geany >= 0.17])
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 

Modified: trunk/geanylatex/doc/geanylatex.tex
===================================================================
--- trunk/geanylatex/doc/geanylatex.tex	2009-05-26 20:32:00 UTC (rev 671)
+++ trunk/geanylatex/doc/geanylatex.tex	2009-05-26 20:44:21 UTC (rev 672)
@@ -114,7 +114,7 @@
 you used a prepared package e.g. from your distribution you probably
 need to install an additional package, this might be called geany-dev
 or geany-devel. Please note that in order to compile and use this
-plugin, you need Geany 0.16 or later (Geany Plugin API v130 or higher).
+plugin, you need Geany 0.17 or later (Geany Plugin API v136 or higher).
 
 Furthermore you need, of course, a C compiler and the Make tool. The
 GNU versions of these tools are recommended. Also there should be a

Modified: trunk/geanylatex/src/formatutils.c
===================================================================
--- trunk/geanylatex/src/formatutils.c	2009-05-26 20:32:00 UTC (rev 671)
+++ trunk/geanylatex/src/formatutils.c	2009-05-26 20:44:21 UTC (rev 672)
@@ -33,11 +33,10 @@
 	{
         if (sci_has_selection(doc->editor->sci))
         {
-            gint selection_len = sci_get_selected_text_length(doc->editor->sci);
-            gchar *selection = g_malloc(selection_len + 1);
+            gchar *selection;
             const gchar *replacement = NULL;
 
-            sci_get_selected_text(doc->editor->sci, selection);
+            selection = sci_get_selection_contents(doc->editor->sci);
 
             replacement = g_strconcat(glatex_format_pattern[format],"{",
                 selection, "}", NULL);

Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c	2009-05-26 20:32:00 UTC (rev 671)
+++ trunk/geanylatex/src/geanylatex.c	2009-05-26 20:44:21 UTC (rev 672)
@@ -24,7 +24,7 @@
 
 #include "geanylatex.h"
 
-PLUGIN_VERSION_CHECK(130)
+PLUGIN_VERSION_CHECK(136)
 
 PLUGIN_SET_INFO(_("LaTeX"), _("Plugin to provide better LaTeX support"),
 	VERSION,"Frank Lanitz <frank at frank.uvena.de>")
@@ -295,18 +295,19 @@
 
 	if (doc != NULL && sci_has_selection(doc->editor->sci))
 	{
-		gint selection_len = sci_get_selected_text_length(doc->editor->sci);
-		gchar *selection = g_malloc(selection_len + 1);
+		guint selection_len;
+		gchar *selection = NULL;
 		GString *replacement = g_string_new(NULL);
-		gint i;
+		guint i;
 		gchar *new = NULL;
 		const gchar *entity = NULL;
 		gchar buf[7];
 		gint len;
 
-		sci_get_selected_text(doc->editor->sci, selection);
+		selection = sci_get_selection_contents(doc->editor->sci);
 
-		selection_len = sci_get_selected_text_length(doc->editor->sci) - 1;
+		selection_len = strlen(selection);
+
 		for (i = 0; i < selection_len; i++)
 		{
 			len = g_unichar_to_utf8(g_utf8_get_char(selection + i), buf);

Modified: trunk/geanylatex/src/latexenvironments.c
===================================================================
--- trunk/geanylatex/src/latexenvironments.c	2009-05-26 20:32:00 UTC (rev 671)
+++ trunk/geanylatex/src/latexenvironments.c	2009-05-26 20:44:21 UTC (rev 672)
@@ -63,11 +63,10 @@
 	{
 		if (sci_has_selection(doc->editor->sci))
         {
-			gint selection_len = sci_get_selected_text_length(doc->editor->sci);
-			gchar *selection = g_malloc(selection_len + 1);
+			gchar *selection  = NULL;
 			const gchar *replacement = NULL;
 
-            sci_get_selected_text(doc->editor->sci, selection);
+            selection = sci_get_selection_contents(doc->editor->sci);
 
             replacement = g_strconcat("\\begin{", environment, "}\n",
                 selection,"\n\\end{", environment, "}\n", NULL);


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