diff --git a/ChangeLog b/ChangeLog index 2d8b75254..ee368b507 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-07-24 Nick Treleaven + + * src/plugindata.h, src/plugins.c: + Apply patch from Jeff Pohlmeyer to add plugin functions for getting + a file list and modifying scintilla text selections (thanks). + + 2007-07-24 Enrico Tröger * Makefile.am, doc/Makefile.am, icons/Makefile.am, plugins/Makefile.am, diff --git a/src/plugindata.h b/src/plugindata.h index b86388d18..f7fc84506 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -135,8 +135,9 @@ struct filetype; struct DocumentFuncs { - gint (*new_file) (const gchar *filename, struct filetype *ft); - gint (*get_cur_idx) (); + gint (*new_file) (const gchar *filename, struct filetype *ft); + gint (*get_cur_idx) (); + struct document* (*get_current) (); }; struct _ScintillaObject; @@ -146,6 +147,11 @@ struct ScintillaFuncs void (*set_text) (struct _ScintillaObject *sci, const gchar *text); void (*insert_text) (struct _ScintillaObject *sci, gint pos, const gchar *text); gint (*get_current_position) (struct _ScintillaObject *sci); + void (*get_text) (struct _ScintillaObject *sci, gint len, gchar* text); + gint (*get_length) (struct _ScintillaObject *sci); + void (*replace_sel) (struct _ScintillaObject* sci, const gchar* text); + void (*get_selected_text) (struct _ScintillaObject* sci, gchar* text); + gint (*get_selected_text_length) (struct _ScintillaObject* sci); }; struct TemplateFuncs @@ -157,6 +163,7 @@ struct UtilsFuncs { gboolean (*str_equal) (const gchar *a, const gchar *b); gchar* (*str_replace) (gchar *haystack, const gchar *needle, const gchar *replacement); + GSList* (*get_file_list) (const gchar *path, guint *length, GError **error); }; struct UIUtilsFuncs diff --git a/src/plugins.c b/src/plugins.c index 1926db58f..ab8fcb70d 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -56,13 +56,19 @@ static GList *plugin_list = NULL; static DocumentFuncs doc_funcs = { &document_new_file, - &document_get_cur_idx + &document_get_cur_idx, + &document_get_current }; static ScintillaFuncs sci_funcs = { &sci_set_text, &sci_insert_text, - &sci_get_current_position + &sci_get_current_position, + &sci_get_text, + &sci_get_length, + &sci_replace_sel, + &sci_get_selected_text, + &sci_get_selected_text_length }; static TemplateFuncs template_funcs = { @@ -71,7 +77,8 @@ static TemplateFuncs template_funcs = { static UtilsFuncs utils_funcs = { &utils_str_equal, - &utils_str_replace + &utils_str_replace, + &utils_get_file_list }; static UIUtilsFuncs uiutils_funcs = {