From d8d971ea9f2238f2bedd2b830f3bf3d3f782c578 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 14 Aug 2007 16:29:03 +0000 Subject: [PATCH] Apply patch from blackdog to add document_save_file() to the plugin API (thanks). Add document_open_file() to plugin API. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1796 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 4 ++++ src/plugindata.h | 5 ++++- src/plugins.c | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7cb76f2..66d16a9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,10 @@ * HACKING: Add more information for adding a filetype. 2 minor edits. + * src/plugindata.h, src/plugins.c: + Apply patch from blackdog to add document_save_file() to the plugin + API (thanks). + Add document_open_file() to plugin API. 2007-08-13 Enrico Tröger diff --git a/src/plugindata.h b/src/plugindata.h index 0c4aa80b..8c8293e8 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -68,7 +68,7 @@ /* The API version should be incremented whenever any plugin data types below are * modified. */ -static const gint api_version = 9; +static const gint api_version = 10; /* The ABI version should be incremented whenever existing fields in the plugin * data types below have to be changed or reordered. It should stay the same if fields @@ -160,6 +160,9 @@ typedef struct DocumentFuncs gint (*new_file) (const gchar *filename, struct filetype *ft); gint (*get_cur_idx) (); struct document* (*get_current) (); + gboolean (*save_file)(gint idx, gboolean force); + gboolean (*open_file)(gint idx, const gchar *filename, gint pos, gboolean readonly, + struct filetype *ft, const gchar *forced_enc); } DocumentFuncs; diff --git a/src/plugins.c b/src/plugins.c index 58f9f86e..25322b7d 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -73,7 +73,9 @@ static GList *plugin_list = NULL; static DocumentFuncs doc_funcs = { &document_new_file, &document_get_cur_idx, - &document_get_current + &document_get_current, + &document_save_file, + &document_open_file }; static ScintillaFuncs sci_funcs = {