From fdfbd2efb40fc67830736d81cbfbaf8531fa8df9 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 5 May 2010 16:26:25 +0000 Subject: [PATCH] Add symbols_get_context_separator() to plugin API (patch by Colomban Wendling, thanks). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4876 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 4 ++++ plugins/geanyfunctions.h | 2 ++ src/plugindata.h | 11 ++++++++++- src/plugins.c | 8 +++++++- src/symbols.c | 12 ++++++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f465c8ad..a25695ebf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,10 @@ Add {project}, {description} template wildcards (#2954737). * doc/geany.txt, doc/geany.html: Divide template wildcards into groups. + * src/plugindata.h, src/plugins.c, src/symbols.c, + plugins/geanyfunctions.h: + Add symbols_get_context_separator() to plugin API (patch by Colomban + Wendling, thanks). 2010-05-03 Nick Treleaven diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h index 3ce8fe5aa..0b0556ef9 100644 --- a/plugins/geanyfunctions.h +++ b/plugins/geanyfunctions.h @@ -372,5 +372,7 @@ geany_functions->p_stash->stash_group_display #define stash_group_update \ geany_functions->p_stash->stash_group_update +#define symbols_get_context_separator \ + geany_functions->p_symbols->symbols_get_context_separator #endif diff --git a/src/plugindata.h b/src/plugindata.h index c8d3cd954..05619e9fa 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 = 184, + GEANY_API_VERSION = 185, /** The Application Binary Interface (ABI) version, incremented whenever * existing fields in the plugin data types have to be changed or reordered. */ @@ -239,6 +239,7 @@ typedef struct GeanyFunctions struct ScintillaFuncs *p_scintilla; /**< See ScintillaFuncs */ struct MsgWinFuncs *p_msgwin; /**< See msgwindow.h */ struct StashFuncs *p_stash; /**< See stash.h */ + struct SymbolsFuncs *p_symbols; /**< See symbols.h */ } GeanyFunctions; @@ -637,6 +638,14 @@ typedef struct StashFuncs StashFuncs; +/* See symbols.h */ +typedef struct SymbolsFuncs +{ + const gchar* (*symbols_get_context_separator)(gint ft_id); +} +SymbolsFuncs; + + /* Deprecated aliases */ #ifndef GEANY_DISABLE_DEPRECATED diff --git a/src/plugins.c b/src/plugins.c index 9a99e7797..bc938ee52 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -57,6 +57,7 @@ #include "main.h" #include "toolbar.h" #include "stash.h" +#include "symbols.h" #include "keyfile.h" #include "win32.h" #include "pluginutils.h" @@ -326,6 +327,10 @@ static StashFuncs stash_funcs = { &stash_group_update }; +static SymbolsFuncs symbols_funcs = { + &symbols_get_context_separator +}; + static GeanyFunctions geany_functions = { &doc_funcs, &sci_funcs, @@ -347,7 +352,8 @@ static GeanyFunctions geany_functions = { &plugin_funcs, &scintilla_funcs, &msgwin_funcs, - &stash_funcs + &stash_funcs, + &symbols_funcs }; static GeanyData geany_data; diff --git a/src/symbols.c b/src/symbols.c index 67b955985..c81a6f695 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -21,6 +21,11 @@ * $Id$ */ +/** + * @file symbols.h + * Tag-related functions. + **/ + /* * Symbol Tree and TagManager-related convenience functions. * TagManager parses tags for each document, and also adds them to the workspace (session). @@ -269,6 +274,13 @@ GString *symbols_find_tags_as_string(GPtrArray *tags_array, guint tag_types, gin } +/** Gets the context separator used by the tag manager for a particular file + * type. + * @param ft_id File type identifier. + * @return The context separator string. + * + * @since 0.19 + */ const gchar *symbols_get_context_separator(gint ft_id) { switch (ft_id) -- 2.11.4.GIT