[Geany-devel] Plugin Keybindings (default values)

2009-09-09 Thread Yura Siamashka
Hi

I am writting python debugger plugin which will use a lot of  keys. So question:

How can I assign default shortcuts to actions like toggle breakpoint,
next command etc
so user will not have to assign a lot of keys himself.

Also please add sci_set_marker_at_line and sci_is_marker_set_at_line
to plugin API.  I will need them to show breakpoints and current line
when debugging.

patch is attached

-- 
Best regards,
Yury Siamashka
diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h
index 234961c..288690f 100644
--- a/plugins/geanyfunctions.h
+++ b/plugins/geanyfunctions.h
@@ -168,6 +168,10 @@
 	geany_functions-p_sci-set_target_end
 #define sci_replace_target \
 	geany_functions-p_sci-replace_target
+#define sci_set_marker_at_line \
+	geany_functions-p_sci-set_marker_at_line
+#define sci_is_marker_set_at_line \
+	geany_functions-p_sci-is_marker_set_at_line
 #define templates_get_template_fileheader \
 	geany_functions-p_templates-get_template_fileheader
 #define utils_str_equal \
diff --git a/src/plugindata.h b/src/plugindata.h
index 42fae7b..d2c0ed2 100644
--- a/src/plugindata.h
+++ b/src/plugindata.h
@@ -50,7 +50,7 @@
 enum {
 	/** The Application Programming Interface (API) version, incremented
 	 * whenever any plugin data types are modified or appended to. */
-	GEANY_API_VERSION = 155,
+	GEANY_API_VERSION = 156,
 
 	/** The Application Binary Interface (ABI) version, incremented whenever
 	 * existing fields in the plugin data types have to be changed or reordered. */
@@ -341,6 +341,8 @@ typedef struct SciFuncs
 	void (*set_target_start) (ScintillaObject *sci, gint start);
 	void (*set_target_end) (ScintillaObject *sci, gint end);
 	gint (*replace_target) (ScintillaObject *sci, const gchar *text, gboolean regex);
+	void (*set_marker_at_line) (ScintillaObject* sci, gint line_number, gboolean set, gint marker );
+	gboolean (*is_marker_set_at_line) (ScintillaObject* sci, gint line, gint marker);
 }
 SciFuncs;
 
diff --git a/src/plugins.c b/src/plugins.c
index 395b3fe..645b0ea 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -171,7 +171,9 @@ static SciFuncs sci_funcs = {
 	sci_get_line_end_position,
 	sci_set_target_start,
 	sci_set_target_end,
-	sci_replace_target
+	sci_replace_target,
+	sci_set_marker_at_line,
+	sci_is_marker_set_at_line
 };
 
 static TemplateFuncs template_funcs = {
___
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Nightly build failed: Plugins Windows build

2009-09-09 Thread Yura Siamashka
Hi

On Wed,  9 Sep 2009 03:51:55 + (UTC)
nore...@nightly.geany.org wrote:

 See http://nightly.geany.org/win32/build_win32_plugins_stderr.log for details.
 
 Error messages:
 ../../plugins_svn/codenav/src/codenavigation.c: In function 
 `switch_menu_item_activate':
 ../../plugins_svn/codenav/src/codenavigation.c:251: warning: comparison 
 between signed and unsigned
 ../../plugins_svn/codenav/src/codenavigation.c:315: warning: ISO C90 forbids 
 mixed declarations and code
 ../../plugins_svn/geanylua/glspi_run.c: In function `debug_hook':
 ...
 ../../plugins_svn/geanyprj/src/sidebar.c:278: warning: ISO C90 forbids mixed 
 declarations and code
 default/geanyprj/src/utils_11.o: In function `save_config':
 /home/enrico/geany/_build_/plugins_win32/../../plugins_svn/geanyprj/src/utils.c:170:
  undefined reference to `_utils_write_file'
 collect2: ld returned 1 exit status

Can anyone help me with this error? I have no idea how to fix this error.

-- 
Yura Siamashka yura...@gmail.com
___
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Nightly build failed: Plugins Windows build

2009-09-09 Thread Enrico Tröger
On Thu, 10 Sep 2009 00:49:00 +0300, Yura wrote:

Hi

On Wed,  9 Sep 2009 03:51:55 + (UTC)
nore...@nightly.geany.org wrote:

 See http://nightly.geany.org/win32/build_win32_plugins_stderr.log
 for details.
 
 Error messages:
 ../../plugins_svn/codenav/src/codenavigation.c: In function
 `switch_menu_item_activate': 
 ../../plugins_svn/codenav/src/codenavigation.c:251:
 warning: comparison between signed and
 unsigned ../../plugins_svn/codenav/src/codenavigation.c:315:
 warning: ISO C90 forbids mixed declarations and
 code ../../plugins_svn/geanylua/glspi_run.c: In function
 `debug_hook': ... ../../plugins_svn/geanyprj/src/sidebar.c:278:
 warning: ISO C90 forbids mixed declarations and code
 default/geanyprj/src/utils_11.o: In function
 `save_config': 
 /home/enrico/geany/_build_/plugins_win32/../../plugins_svn/geanyprj/src/utils.c:170:
 undefined reference to `_utils_write_file' collect2: ld returned 1
 exit status

Can anyone help me with this error? I have no idea how to fix this
error.

Something like in the attached patch could be a start. The easiest way
is to migrate all code to the new geanyplugin.h which is basically
the only thing[1] you need to include.
In the patch I did this change only for utils.c, this surely applies to
the other source files as well but you know the code better than me :).


[1] geanyplugin.h includes all necessary Geany headers and the basic
GTK headers. It does *not* include C headers like string.h or
tagmanager/Scintilla headers.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
Index: geany-plugins/geanyprj/src/geanyprj.c
===
--- geany-plugins/geanyprj/src/geanyprj.c	(revision 923)
+++ geany-plugins/geanyprj/src/geanyprj.c	(working copy)
@@ -40,7 +40,7 @@

 #include geanyprj.h

-PLUGIN_VERSION_CHECK(115);
+PLUGIN_VERSION_CHECK(147);
 PLUGIN_SET_INFO(_(Project), _(Alternative project support.), VERSION,
 		_(Yura Siamashka yura...@gmail.com));

Index: geany-plugins/geanyprj/src/utils.c
===
--- geany-plugins/geanyprj/src/utils.c	(revision 923)
+++ geany-plugins/geanyprj/src/utils.c	(working copy)
@@ -18,10 +18,10 @@
  */

 #include string.h
-#include glib.h

-#include geany.h
-#include utils.h
+#include geanyplugin.h
+#include geanyprj.h
+

 gchar *
 find_file_path(const gchar * dir, const gchar * filename)
Index: geany-plugins/geanyprj/src/geanyprj.h
===
--- geany-plugins/geanyprj/src/geanyprj.h	(revision 923)
+++ geany-plugins/geanyprj/src/geanyprj.h	(working copy)
@@ -62,6 +62,7 @@ struct GeanyPrj
 	GHashTable *tags;	/// project tags
 };

+extern GeanyFunctions *geany_functions;

 extern const gchar *project_type_string[NEW_PROJECT_TYPE_SIZE];
 extern void *project_type_filter[NEW_PROJECT_TYPE_SIZE];


pgp0mk2q3YyC3.pgp
Description: PGP signature
___
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel