Revision: 2371
http://geany.svn.sourceforge.net/geany/?rev=2371&view=rev
Author: ntrel
Date: 2008-03-20 09:17:59 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Load and save plugin keybindings when toggling plugins in the Plugin
Manager.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 16:01:29 UTC (rev 2370)
+++ trunk/ChangeLog 2008-03-20 16:17:59 UTC (rev 2371)
@@ -18,6 +18,9 @@
partial colourisation.
* src/symbols.c:
Fix bug with showing macro list items all on one line.
+ * src/plugins.c:
+ Load and save plugin keybindings when toggling plugins in the Plugin
+ Manager.
2008-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-03-20 16:01:29 UTC (rev 2370)
+++ trunk/src/plugins.c 2008-03-20 16:17:59 UTC (rev 2371)
@@ -825,10 +825,18 @@
/* save the filename of the plugin */
file_name = g_strdup(p->filename);
- /* remove old plugin */
+
+ /* unload plugin module */
+ if (!state)
+ keybindings_write_to_file(); /* save shortcuts (only need this group, but it doesn't take long) */
plugin_free(p, GINT_TO_POINTER(PLUGIN_FREE_ALL));
- /* add new one */
+
+ /* reload plugin module and initialize it if item is checked */
p = plugin_new(file_name, state, TRUE);
+ if (state)
+ keybindings_load_keyfile(); /* load shortcuts */
+
+ /* update model */
gtk_list_store_set(pm_widgets.store, &iter,
PLUGIN_COLUMN_CHECK, state,
PLUGIN_COLUMN_PLUGIN, p, -1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2370
http://geany.svn.sourceforge.net/geany/?rev=2370&view=rev
Author: ntrel
Date: 2008-03-20 09:01:29 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Add items: Make/Compile toolbar button, Make Custom menu, review hidden prefs & compile-time constants for 1.0.
Update and clarify some items.
Change Python scripting wishlist item to Python plugin interface (more useful).
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-03-20 15:48:03 UTC (rev 2369)
+++ trunk/TODO 2008-03-20 16:01:29 UTC (rev 2370)
@@ -1,9 +1,9 @@
TODO List:
----------
-(features included in brackets have lower priority)
+Note: features included in brackets have lower priority.
Fix bugs:
- o fix bug that prevents UTF-16, UTF-32 files from being loaded.
+ o fix bug that prevents UTF-16, UTF-32 files from being loaded
o tagmanager fails on UTF-16/32
@@ -18,13 +18,14 @@
o configurable filetype regex for build errors
o recent projects menu
o project indentation settings support
- o plugin keybindings
+ o improve Compile toolbar button for Make (drop down radio list?)
+ o (selectable menu of arguments to use for Make, from Make Custom)
o (line breaking mode to limit words on a line for e.g. XML content)
o (DBUS)
o (indent wrapped lines - Scintilla issue)
o (folder tree in the sidebar)
o (macro support)
- o (better regex support)
+ o (better search & replace regex support)
o (parsing tags from a memory buffer instead of a file on disk)
o (calltip support for non-C-like languages that use
function_name(arguments) syntax)
@@ -42,16 +43,16 @@
o stable plugin ABI for the 1.0 series? (Split up geany_data, prefs,
GeanyKeyCommand enum into groups)
o review documentation
- o look into using a geany-dev package for plugin development
+ o review any hidden prefs/compile time constants that could be in the
+ Prefs dialog, e.g. invert_all syntax highlighting pref
Wishlist
--------
-Note: These items might not get worked on.
+Note: these items might not get worked on.
- o Some kind of support for ctags files.
- o Scope resolution for object members.
+ o Some kind of support for ctags files
+ o Scope resolution for object members
o Multiline regex support (requires work on Scintilla)
- o Split window editing.
- o Python scripting plugin? (not as efficient as Lua, but perhaps
- more widely known)
+ o Split window editing
+ o Python plugin interface
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2369
http://geany.svn.sourceforge.net/geany/?rev=2369&view=rev
Author: ntrel
Date: 2008-03-20 08:48:03 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Fix bug with showing macro list items all on one line.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/symbols.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 14:30:51 UTC (rev 2368)
+++ trunk/ChangeLog 2008-03-20 15:48:03 UTC (rev 2369)
@@ -16,6 +16,8 @@
When detecting a change on disk, reload the file after all pending
Scintilla messages have been processed, to prevent problems with
partial colourisation.
+ * src/symbols.c:
+ Fix bug with showing macro list items all on one line.
2008-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/symbols.c
===================================================================
--- trunk/src/symbols.c 2008-03-20 14:30:51 UTC (rev 2368)
+++ trunk/src/symbols.c 2008-03-20 15:48:03 UTC (rev 2369)
@@ -271,7 +271,7 @@
tm_tags_sort(ftags, NULL, FALSE);
for (j = 0; j < ftags->len; j++)
{
- if (j > 0) g_string_append_c(words, ' ');
+ if (j > 0) g_string_append_c(words, '\n');
g_string_append(words, TM_TAG(ftags->pdata[j])->name);
}
g_ptr_array_free(ftags, TRUE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2368
http://geany.svn.sourceforge.net/geany/?rev=2368&view=rev
Author: eht16
Date: 2008-03-20 07:30:51 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Add note and link for GTK 2.6 API docs.
Modified Paths:
--------------
trunk/ChangeLog
trunk/HACKING
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 13:09:19 UTC (rev 2367)
+++ trunk/ChangeLog 2008-03-20 14:30:51 UTC (rev 2368)
@@ -1,3 +1,8 @@
+2008-03-20 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * HACKING: Add note and link for GTK 2.6 API docs.
+
+
2008-03-20 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* doc/plugin-symbols.c, doc/Makefile.am, doc/plugins.dox:
Modified: trunk/HACKING
===================================================================
--- trunk/HACKING 2008-03-20 13:09:19 UTC (rev 2367)
+++ trunk/HACKING 2008-03-20 14:30:51 UTC (rev 2368)
@@ -76,6 +76,21 @@
it - this should work fine even if you have another version of Glade
installed on the system.
+GTK API documentation
+---------------------
+The official GTK 2.6 API documentation is not available online anymore,
+so we put them on http://geany.uvena.de/manual/gtk/.
+There is also a tarball with all available files for download and use
+with devhelp.
+
+Using the 2.6 API documentation of the GTK libs (including GLib, GDK and
+Pango) has the advantages that you don't get confused by any newer API
+additions and you don't have to take care about whether you can use
+them or not.
+This is because Geany depends on GTK 2.6. API symbols from newer
+GTK/GLib versions should be avoided to keep the source code building
+against GTK 2.6.
+
Coding
------
Don't write long functions with a lot of variables and/or scopes - break
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2367
http://geany.svn.sourceforge.net/geany/?rev=2367&view=rev
Author: ntrel
Date: 2008-03-20 06:09:19 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
When detecting a change on disk, reload the file after all pending
Scintilla messages have been processed, to prevent problems with
partial colourisation.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 13:02:12 UTC (rev 2366)
+++ trunk/ChangeLog 2008-03-20 13:09:19 UTC (rev 2367)
@@ -7,6 +7,10 @@
* doc/plugins.dox:
Add page links on the main page (easier than going to Related Pages,
and we can also list special files like plugin-symbols.c).
+ * src/utils.c:
+ When detecting a change on disk, reload the file after all pending
+ Scintilla messages have been processed, to prevent problems with
+ partial colourisation.
2008-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2008-03-20 13:02:12 UTC (rev 2366)
+++ trunk/src/utils.c 2008-03-20 13:09:19 UTC (rev 2367)
@@ -314,14 +314,50 @@
}
+static gboolean reload_idx(gpointer data)
+{
+ gint idx = GPOINTER_TO_INT(data);
+
+ /* check idx is still valid now we're idle, in case it was closed */
+ if (DOC_IDX_VALID(idx))
+ {
+ document_reload_file(idx, NULL);
+ }
+ return FALSE;
+}
+
+
+static gboolean check_reload(gint idx)
+{
+ gchar *base_name = g_path_get_basename(doc_list[idx].file_name);
+ gboolean want_reload;
+
+ want_reload = dialogs_show_question_full(NULL, _("_Reload"), GTK_STOCK_CANCEL,
+ _("Do you want to reload it?"),
+ _("The file '%s' on the disk is more recent than\n"
+ "the current buffer."), base_name);
+ if (want_reload)
+ {
+ /* delay reloading because we need to wait for any pending scintilla messages
+ * to be processed, otherwise the reloaded document might not be colourised
+ * properly */
+ g_idle_add(reload_idx, GINT_TO_POINTER(idx));
+ }
+ g_free(base_name);
+ return want_reload;
+}
+
+
/* Set force to force a disk check, otherwise it is ignored if there was a check
- * in the last GEANY_CHECK_FILE_DELAY seconds. */
+ * in the last GEANY_CHECK_FILE_DELAY seconds.
+ * @return @c TRUE if the file has changed. */
gboolean utils_check_disk_status(gint idx, gboolean force)
{
struct stat st;
time_t t;
gchar *locale_filename;
gboolean ret = FALSE;
+ const time_t delay_time = 10; /* seconds to delay disk checks for */
if (idx == -1 || doc_list[idx].file_name == NULL) return FALSE;
@@ -334,26 +370,17 @@
{
/* TODO: warn user file on disk is missing */
}
- else if (doc_list[idx].mtime > t || st.st_mtime > t)
+ else if (doc_list[idx].mtime - delay_time > t || st.st_mtime > t)
{
geany_debug("Strange: Something is wrong with the time stamps.");
}
else if (doc_list[idx].mtime < st.st_mtime)
{
- gchar *base_name = g_path_get_basename(doc_list[idx].file_name);
-
- if (dialogs_show_question_full(NULL, _("_Reload"), GTK_STOCK_CANCEL,
- _("Do you want to reload it?"),
- _("The file '%s' on the disk is more recent than\n"
- "the current buffer."), base_name))
- {
- document_reload_file(idx, NULL);
- doc_list[idx].last_check = t;
- }
+ if (check_reload(idx))
+ doc_list[idx].last_check = t + delay_time; /* Disable checking until after reload */
else
- doc_list[idx].mtime = st.st_mtime;
+ doc_list[idx].mtime = st.st_mtime; /* Ignore this change on disk completely */
- g_free(base_name);
ret = TRUE; /* file has changed */
}
g_free(locale_filename);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2366
http://geany.svn.sourceforge.net/geany/?rev=2366&view=rev
Author: ntrel
Date: 2008-03-20 06:02:12 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Add page links on the main page (easier than going to Related Pages,
and we can also list special files like plugin-symbols.c).
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/plugins.dox
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 12:46:45 UTC (rev 2365)
+++ trunk/ChangeLog 2008-03-20 13:02:12 UTC (rev 2366)
@@ -4,6 +4,9 @@
Move plugin symbols page into separate source file so that symbols
are listed as variables and functions and are autolinked.
Edit plugin symbols description, document some function parameters.
+ * doc/plugins.dox:
+ Add page links on the main page (easier than going to Related Pages,
+ and we can also list special files like plugin-symbols.c).
2008-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/doc/plugins.dox
===================================================================
--- trunk/doc/plugins.dox 2008-03-20 12:46:45 UTC (rev 2365)
+++ trunk/doc/plugins.dox 2008-03-20 13:02:12 UTC (rev 2366)
@@ -38,11 +38,13 @@
* considered as a work in progress.
* We will try to %document as many functions and structs as possible.
*
- * For additional documentation of things like plugin signals or a simple plugin please
- * see Related Pages.
+ * To get started, see the @link howto Plugin Howto @endlink.
*
+ * Other pages:
+ * - @link signals Plugin Signals @endlink.
+ * - @link plugin-symbols.c Plugin Symbols @endlink.
*
- *
+ * @Note Some of these pages are also listed in Related Pages.
*/
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2365
http://geany.svn.sourceforge.net/geany/?rev=2365&view=rev
Author: ntrel
Date: 2008-03-20 05:46:45 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Move plugin symbols page into separate source file so that symbols
are listed as variables and functions and are autolinked.
Edit plugin symbols description, document some function parameters.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/Makefile.am
trunk/doc/plugins.dox
Added Paths:
-----------
trunk/doc/plugin-symbols.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-19 17:42:03 UTC (rev 2364)
+++ trunk/ChangeLog 2008-03-20 12:46:45 UTC (rev 2365)
@@ -1,3 +1,11 @@
+2008-03-20 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * doc/plugin-symbols.c, doc/Makefile.am, doc/plugins.dox:
+ Move plugin symbols page into separate source file so that symbols
+ are listed as variables and functions and are autolinked.
+ Edit plugin symbols description, document some function parameters.
+
+
2008-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/plugins.c:
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2008-03-19 17:42:03 UTC (rev 2364)
+++ trunk/doc/Makefile.am 2008-03-20 12:46:45 UTC (rev 2365)
@@ -1,7 +1,7 @@
man_MANS=geany.1
DOCDIR = $(DESTDIR)/$(datadir)/doc/@PACKAGE@
IMAGE_FILES = images/*.png
-EXTRA_DIST = geany.html geany.css geany.txt geany.1 plugins.dox \
+EXTRA_DIST = geany.html geany.css geany.txt geany.1 plugins.dox plugin-symbols.c \
$(srcdir)/$(IMAGE_FILES)
pdf: geany.txt
Added: trunk/doc/plugin-symbols.c
===================================================================
--- trunk/doc/plugin-symbols.c (rev 0)
+++ trunk/doc/plugin-symbols.c 2008-03-20 12:46:45 UTC (rev 2365)
@@ -0,0 +1,77 @@
+/*
+ * plugin-symbols.c - this file is part of Geany, a fast and lightweight IDE
+ *
+ * Copyright 2008 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+ * Copyright 2008 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+/* Note: this file is for Doxygen only. */
+
+/**
+ * @file plugin-symbols.c
+ * Symbols declared from within plugins.
+ *
+ * Geany looks for these symbols (arrays, pointers and functions) when initializing
+ * plugins. Some of them are optional, i.e. they can be omitted; others are required
+ * and must be defined. Some symbols should only be declared using specific macros in
+ * @link plugindata.h @endlink.
+ */
+
+/** Use the VERSION_CHECK() macro instead. Required by Geany. */
+gint version_check(gint);
+
+/** Use the PLUGIN_INFO() macro to define it. Required by Geany. */
+PluginInfo* info();
+
+/** Geany owned fields and functions. */
+GeanyData* geany_data;
+
+/** Plugin owned fields, including flags. */
+PluginFields* plugin_fields;
+
+/** An array for connecting GeanyObject events, which should be terminated with
+ * @c {NULL, NULL, FALSE, NULL}. See @link signals Signal documentation @endlink. */
+GeanyCallback geany_callbacks[];
+
+/** Most plugins should use the PLUGIN_KEY_GROUP() macro to define it. However,
+ * its fields are not read until after init() is called for the plugin, so it
+ * is possible to setup a variable number of keybindings, e.g. based on the
+ * plugin's configuration file settings.
+ * - The @c name field must not be empty or match Geany's default group name.
+ * - The @c label field is set by Geany after init() is called to the name of the
+ * plugin.
+ * @note This is a single element array for implementation reasons,
+ * but you can treat it like a pointer. */
+KeyBindingGroup plugin_key_group[1];
+
+
+/** Called when the plugin should show a configure dialog to let the user set some basic
+ * plugin configuration. Optionally, can be omitted when not needed.
+ * @param parent The Plugin Manager dialog widget. */
+void configure(GtkWidget *parent);
+
+/** Called after loading the plugin.
+ * @param data The same as #geany_data. */
+void init(GeanyData *data);
+
+/** Called before unloading the plugin. Required for normal plugins - it should undo
+ * everything done in init() - e.g. destroy menu items, free memory. */
+void cleanup(); */
+
Property changes on: trunk/doc/plugin-symbols.c
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/doc/plugins.dox
===================================================================
--- trunk/doc/plugins.dox 2008-03-19 17:42:03 UTC (rev 2364)
+++ trunk/doc/plugins.dox 2008-03-20 12:46:45 UTC (rev 2365)
@@ -43,52 +43,9 @@
*
*
*
- * @page symbols Plugin Symbols
- *
- * The following symbols (functions) should be exported by every plugin. Some of them
- * are optional, i.e. they can be omitted, others are required and must be defined.
- *
- * - @code version_check() @endcode
- * Use the VERSION_CHECK() macro instead. Required by Geany.
- *
- * - @code PluginInfo* info() @endcode
- * Use the PLUGIN_INFO() macro to define it. Required by Geany.
- *
- * - @code GeanyData* geany_data @endcode
- * Geany owned fields and functions.
- *
- * - @code PluginFields* plugin_fields @endcode
- * Plugin owned fields, including flags.
- *
- * - @code GeanyCallback geany_callbacks[] @endcode
- * An array for connecting GeanyObject events, which should be terminated with
- * {NULL, NULL, FALSE, NULL}. See @link signals Signal documentation @endlink.
- *
- * - @code KeyBindingGroup plugin_key_group[1] @endcode
- * Most plugins should use the PLUGIN_KEY_GROUP() macro to define it. However,
- * its fields are not read until after init() is called for the plugin, so it
- * is possible to setup a variable number of keybindings, e.g. based on the
- * plugin's configuration file settings.
- * - The @c name field must not be empty or match Geany's default group name.
- * - Ths @c label field is set by Geany after init() is called to the name of the
- * plugin.
- *
- * @note This is a single element array for implementation reasons,
- * but you can treat it like a pointer.
- *
- * - @code void configure(GtkWidget *parent) @endcode
- * Called when the plugin should show a configure dialog to let the user set some basic
- * plugin configuration. Optionally, can be omitted when not needed.
- *
- * - @code void init(GeanyData *data) @endcode
- * Called after loading the plugin. data is the same as geany_data.
- *
- * - @code void cleanup() @endcode
- * Called before unloading the plugin. Required for normal plugins - it should undo
- * everything done in init() - e.g. destroy menu items, free memory.
- *
- *
- *
+ */
+
+/**
* @page signals Plugin Signals
*
*
@@ -215,7 +172,7 @@
*
* Every plugin must contain some essential symbols unless it won't work. A complete
* list of all necessary and optional symbols can be found in
- * @link symbols Plugin Symbols @endlink.
+ * @link plugin-symbols.c Plugin Symbols @endlink.
* Every plugin should include "geany.h" and "plugindata.h" which provide necessary
* preprocessor macros and other basic information.
* There are two important preprocessor macros which need to be used at the beginning:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2364
http://geany.svn.sourceforge.net/geany/?rev=2364&view=rev
Author: ntrel
Date: 2008-03-19 10:42:03 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
Rename load_plugins() to load_all_plugins(), add comment.
Modified Paths:
--------------
trunk/src/plugins.c
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-03-19 17:15:28 UTC (rev 2363)
+++ trunk/src/plugins.c 2008-03-19 17:42:03 UTC (rev 2364)
@@ -641,7 +641,8 @@
#endif
-static void load_plugins(void)
+/* Load (but don't initialize) all plugins for the Plugin Manager dialog */
+static void load_all_plugins(void)
{
gchar *path;
@@ -837,7 +838,6 @@
/* set again the sensitiveness of the configure button */
gtk_widget_set_sensitive(pm_widgets.configure_button,
p->configure != NULL && is_active_plugin(p));
-
}
@@ -939,7 +939,7 @@
GtkWidget *vbox, *vbox2, *label_vbox, *hbox, *swin, *label, *label2;
/* before showing the dialog, we need to create the list of available plugins */
- load_plugins();
+ load_all_plugins();
pm_widgets.dialog = gtk_dialog_new_with_buttons(_("Plugins"), GTK_WINDOW(app->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.