Branch: refs/heads/master Author: Matthew Brush matt@geany.org Committer: Thomas Martitz kugel@rockbox.org Date: Tue, 10 Mar 2015 21:06:47 UTC Commit: 2f0867076368fdd0333cfe61805f4fdebce34fe9 https://github.com/geany/geany/commit/2f0867076368fdd0333cfe61805f4fdebce34f...
Log Message: ----------- Mark all plugin API functions to have "default" (public) visibility
Adds a new header `pluginexport.h` to put the macros in, could be moved into an existing header (support.h?) by I didn't want to drag a bunch of existing stuff into the source files for this one macro.
TagManager has relative include, this could be fixed by changing the include directories for it if it's a problem. Mark the Scintilla functions exported by re-declaring them in sciwrappers.c with the attribute to avoid changing upstream Scintilla code.
Modified Paths: -------------- src/Makefile.am src/build.c src/dialogs.c src/document.c src/editor.c src/encodings.c src/filetypes.c src/highlighting.c src/keybindings.c src/main.c src/msgwindow.c src/navqueue.c src/pluginexport.h src/pluginutils.c src/sciwrappers.c src/search.c src/stash.c src/symbols.c src/templates.c src/ui_utils.c src/utils.c tagmanager/src/tm_source_file.c tagmanager/src/tm_workspace.c
Modified: src/Makefile.am 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -40,6 +40,7 @@ SRCS = \ navqueue.c navqueue.h \ notebook.c notebook.h \ osx.c osx.h \ + pluginexport.h \ plugins.c plugins.h \ pluginutils.c pluginutils.h \ prefix.c prefix.h \ @@ -167,4 +168,3 @@ $(top_srcdir)/src/dynamicsymbols.list: $(top_srcdir)/data/geany.glade dynamic-symbols: $(top_srcdir)/src/dynamicsymbols.list
endif -
Modified: src/build.c 9 lines changed, 6 insertions(+), 3 deletions(-) =================================================================== @@ -41,6 +41,7 @@ #include "geanyobject.h" #include "keybindingsprivate.h" #include "msgwindow.h" +#include "pluginexport.h" #include "prefs.h" #include "projectprivate.h" #include "sciwrappers.h" @@ -509,6 +510,7 @@ static GeanyBuildCommand *get_build_group(const GeanyBuildSource src, const Gean * Updates the menu. * **/ +GEANY_API_SYMBOL void build_remove_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd) { GeanyBuildCommand *bc; @@ -569,6 +571,7 @@ GeanyBuildCommand *build_get_menu_item(GeanyBuildSource src, GeanyBuildGroup grp * This is a pointer to an internal structure and must not be freed. * **/ +GEANY_API_SYMBOL const gchar *build_get_current_menu_item(const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries fld) { @@ -609,7 +612,7 @@ const gchar *build_get_current_menu_item(const GeanyBuildGroup grp, const guint * @param val the value to set the field to, is copied * **/ - +GEANY_API_SYMBOL void build_set_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries fld, const gchar *val) { @@ -654,7 +657,7 @@ void build_set_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, * @param cmd the index of the command within the group. * **/ - +GEANY_API_SYMBOL void build_activate_menu_item(const GeanyBuildGroup grp, const guint cmd) { on_build_menu_item(NULL, GRP_CMD_TO_POINTER(grp, cmd)); @@ -2782,7 +2785,7 @@ void build_set_group_count(GeanyBuildGroup grp, gint count) * @return a count of the number of commands in the group * **/ - +GEANY_API_SYMBOL guint build_get_group_count(const GeanyBuildGroup grp) { g_return_val_if_fail(grp < GEANY_GBG_COUNT, 0);
Modified: src/dialogs.c 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -35,6 +35,7 @@ #include "encodings.h" #include "filetypes.h" #include "main.h" +#include "pluginexport.h" #include "support.h" #include "utils.h" #include "ui_utils.h" @@ -665,6 +666,7 @@ static gboolean show_save_as_gtk(GeanyDocument *doc) * * @return @c TRUE if the file was saved, otherwise @c FALSE. **/ +GEANY_API_SYMBOL gboolean dialogs_show_save_as(void) { GeanyDocument *doc = document_get_current(); @@ -726,6 +728,7 @@ static void show_msgbox_dialog(GtkWidget *dialog, GtkMessageType type, GtkWindow * @param text Printf()-style format string. * @param ... Arguments for the @a text format string. **/ +GEANY_API_SYMBOL void dialogs_show_msgbox(GtkMessageType type, const gchar *text, ...) { #ifndef G_OS_WIN32 @@ -1067,6 +1070,7 @@ static void on_dialog_input(const gchar *str, gpointer data) * @param default_text Text to display in the input field, or @c NULL. * @return New copy of user input or @c NULL if cancelled. * @since 0.20. */ +GEANY_API_SYMBOL gchar *dialogs_show_input(const gchar *title, GtkWindow *parent, const gchar *label_text, const gchar *default_text) { @@ -1107,6 +1111,7 @@ gchar *dialogs_show_input_goto_line(const gchar *title, GtkWindow *parent, const * * @since 0.16 **/ +GEANY_API_SYMBOL gboolean dialogs_show_input_numeric(const gchar *title, const gchar *label_text, gdouble *value, gdouble min, gdouble max, gdouble step) { @@ -1372,6 +1377,7 @@ static gint show_prompt(GtkWidget *parent, * * @return @c TRUE if the user answered with Yes, otherwise @c FALSE. **/ +GEANY_API_SYMBOL gboolean dialogs_show_question(const gchar *text, ...) { gchar *string;
Modified: src/document.c 25 lines changed, 25 insertions(+), 0 deletions(-) =================================================================== @@ -44,6 +44,7 @@ #include "msgwindow.h" #include "navqueue.h" #include "notebook.h" +#include "pluginexport.h" #include "project.h" #include "sciwrappers.h" #include "sidebar.h" @@ -148,6 +149,7 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty * * @since 0.15 **/ +GEANY_API_SYMBOL GeanyDocument* document_find_by_real_path(const gchar *realname) { guint i; @@ -193,6 +195,7 @@ static gchar *get_real_path_from_utf8(const gchar *utf8_filename) * @return The matching document, or @c NULL. * @see document_find_by_real_path(). **/ +GEANY_API_SYMBOL GeanyDocument *document_find_by_filename(const gchar *utf8_filename) { guint i; @@ -256,6 +259,7 @@ GeanyDocument *document_find_by_sci(ScintillaObject *sci) * gboolean still_open = (doc != NULL); * @endcode * @since 1.25. */ +GEANY_API_SYMBOL GeanyDocument *document_find_by_id(guint id) { guint i; @@ -297,6 +301,7 @@ static GtkWidget *document_get_notebook_child(GeanyDocument *doc) * @param doc The document. * @return The index. * @since 0.19 */ +GEANY_API_SYMBOL gint document_get_notebook_page(GeanyDocument *doc) { GtkWidget *child = document_get_notebook_child(doc); @@ -359,6 +364,7 @@ GeanyDocument *document_get_from_notebook_child(GtkWidget *page) * * @return The corresponding document for the given notebook page, or @c NULL. **/ +GEANY_API_SYMBOL GeanyDocument *document_get_from_page(guint page_num) { GtkWidget *parent; @@ -377,6 +383,7 @@ GeanyDocument *document_get_from_page(guint page_num) * * @return A pointer to the current document or @c NULL if there are no opened documents. **/ +GEANY_API_SYMBOL GeanyDocument *document_get_current(void) { gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook)); @@ -417,6 +424,7 @@ void document_finalize(void) * @since 0.17 */ /* TODO make more use of this */ +GEANY_API_SYMBOL gchar *document_get_basename_for_display(GeanyDocument *doc, gint length) { gchar *base_name, *short_name; @@ -464,6 +472,7 @@ void document_update_tab_label(GeanyDocument *doc) * @param doc The document to use. * @param changed Whether the document state should indicate changes have been made. **/ +GEANY_API_SYMBOL void document_set_text_changed(GeanyDocument *doc, gboolean changed) { g_return_if_fail(doc != NULL); @@ -687,6 +696,7 @@ static GeanyDocument *document_create(const gchar *utf8_filename) * * @since 0.15 **/ +GEANY_API_SYMBOL gboolean document_close(GeanyDocument *doc) { g_return_val_if_fail(doc, FALSE); @@ -776,6 +786,7 @@ static gboolean remove_page(guint page_num) * * @return @c TRUE if the document was actually removed or @c FALSE otherwise. **/ +GEANY_API_SYMBOL gboolean document_remove_page(guint page_num) { gboolean done = remove_page(page_num); @@ -817,6 +828,7 @@ GeanyDocument *document_new_file_if_non_open(void) * * @return The new document. **/ +GEANY_API_SYMBOL GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft, const gchar *text) { GeanyDocument *doc; @@ -900,6 +912,7 @@ GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft, * * @return The document opened or @c NULL. **/ +GEANY_API_SYMBOL GeanyDocument *document_open_file(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc) { @@ -1495,6 +1508,7 @@ void document_open_file_list(const gchar *data, gsize length) * @param ft The filetype for the document or @c NULL to auto-detect the filetype. * @param forced_enc The file encoding to use or @c NULL to auto-detect the file encoding. **/ +GEANY_API_SYMBOL void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc) { @@ -1516,6 +1530,7 @@ void document_open_files(const GSList *filenames, gboolean readonly, GeanyFilety * * @return @c TRUE if the document was actually reloaded or @c FALSE otherwise. **/ +GEANY_API_SYMBOL gboolean document_reload_force(GeanyDocument *doc, const gchar *forced_enc) { gint pos = 0; @@ -1661,6 +1676,7 @@ static void replace_header_filename(GeanyDocument *doc) * * @since 0.16 **/ +GEANY_API_SYMBOL void document_rename_file(GeanyDocument *doc, const gchar *new_filename) { gchar *old_locale_filename = utils_get_locale_from_utf8(doc->file_name); @@ -1726,6 +1742,7 @@ gboolean document_need_save_as(GeanyDocument *doc) * * @since 0.16 **/ +GEANY_API_SYMBOL gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname) { gboolean ret; @@ -2013,6 +2030,7 @@ static gboolean save_file_handle_infobars(GeanyDocument *doc, gboolean force) * * @return @c TRUE if the file was saved or @c FALSE if the file could not or should not be saved. **/ +GEANY_API_SYMBOL gboolean document_save_file(GeanyDocument *doc, gboolean force) { gchar *errmsg; @@ -2726,6 +2744,7 @@ static void document_load_config(GeanyDocument *doc, GeanyFiletype *type, /** Sets the filetype of the document (which controls syntax highlighting and tags) * @param doc The document to use. * @param type The filetype. */ +GEANY_API_SYMBOL void document_set_filetype(GeanyDocument *doc, GeanyFiletype *type) { gboolean ft_changed; @@ -2778,6 +2797,7 @@ void document_reload_config(GeanyDocument *doc) * @param doc The document to use. * @param new_encoding The encoding to be set for the document. **/ +GEANY_API_SYMBOL void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding) { if (doc == NULL || new_encoding == NULL || @@ -3141,6 +3161,7 @@ const gchar *document_get_status_widget_class(GeanyDocument *doc) * * @since 0.16 */ +GEANY_API_SYMBOL const GdkColor *document_get_status_color(GeanyDocument *doc) { gint status; @@ -3192,6 +3213,7 @@ const GdkColor *document_get_status_color(GeanyDocument *doc) * * @since 0.16 */ +GEANY_API_SYMBOL GeanyDocument *document_index(gint idx) { return (idx >= 0 && idx < (gint) documents_array->len) ? documents[idx] : NULL; @@ -3633,6 +3655,7 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force) * * @since 0.21 */ +GEANY_API_SYMBOL gint document_compare_by_display_name(gconstpointer a, gconstpointer b) { GeanyDocument *doc_a = *((GeanyDocument**) a); @@ -3662,6 +3685,7 @@ gint document_compare_by_display_name(gconstpointer a, gconstpointer b) * * @since 0.21 (GEANY_API_VERSION 209) */ +GEANY_API_SYMBOL gint document_compare_by_tab_order(gconstpointer a, gconstpointer b) { GeanyDocument *doc_a = *((GeanyDocument**) a); @@ -3691,6 +3715,7 @@ gint document_compare_by_tab_order(gconstpointer a, gconstpointer b) * * @since 0.21 (GEANY_API_VERSION 209) */ +GEANY_API_SYMBOL gint document_compare_by_tab_order_reverse(gconstpointer a, gconstpointer b) { return -1 * document_compare_by_tab_order(a, b);
Modified: src/editor.c 16 lines changed, 16 insertions(+), 0 deletions(-) =================================================================== @@ -48,6 +48,7 @@ #include "highlighting.h" #include "keybindings.h" #include "main.h" +#include "pluginexport.h" #include "prefs.h" #include "projectprivate.h" #include "sciwrappers.h" @@ -1202,6 +1203,7 @@ get_default_indent_prefs(void) * settings may have changed, or if this function has been called for a different editor. * @param editor The editor, or @c NULL to get the default indent prefs. * @return The indent prefs. */ +GEANY_API_SYMBOL const GeanyIndentPrefs * editor_get_indent_prefs(GeanyEditor *editor) { @@ -1725,6 +1727,7 @@ void editor_find_current_word_sciwc(GeanyEditor *editor, gint pos, gchar *word, * * @since 0.16 */ +GEANY_API_SYMBOL gchar *editor_get_word_at_pos(GeanyEditor *editor, gint pos, const gchar *wordchars) { static gchar cword[GEANY_MAX_WORD_LENGTH]; @@ -2342,6 +2345,7 @@ static void fix_indentation(GeanyEditor *editor, GString *buf) * @warning Make sure all \t tab chars in @a text are intended as indent widths or alignment, * not hard tabs, as those won't be preserved. * @note This doesn't scroll the cursor in view afterwards. **/ +GEANY_API_SYMBOL void editor_insert_text_block(GeanyEditor *editor, const gchar *text, gint insert_pos, gint cursor_index, gint newline_indent_size, gboolean replace_newlines) { @@ -4061,6 +4065,7 @@ void editor_indicator_clear_errors(GeanyEditor *editor) * * @since 0.16 */ +GEANY_API_SYMBOL void editor_indicator_clear(GeanyEditor *editor, gint indic) { glong last_pos; @@ -4086,6 +4091,7 @@ void editor_indicator_clear(GeanyEditor *editor, gint indic) * * @since 0.16 */ +GEANY_API_SYMBOL void editor_indicator_set_on_line(GeanyEditor *editor, gint indic, gint line) { gint start, end; @@ -4135,6 +4141,7 @@ void editor_indicator_set_on_line(GeanyEditor *editor, gint indic, gint line) * * @since 0.16 */ +GEANY_API_SYMBOL void editor_indicator_set_on_range(GeanyEditor *editor, gint indic, gint start, gint end) { g_return_if_fail(editor != NULL); @@ -4188,6 +4195,7 @@ void editor_insert_color(GeanyEditor *editor, const gchar *colour) * * @since 0.20 */ +GEANY_API_SYMBOL gint editor_get_eol_char_mode(GeanyEditor *editor) { gint mode = file_prefs.default_eol_character; @@ -4209,6 +4217,7 @@ gint editor_get_eol_char_mode(GeanyEditor *editor) * * @since 0.19 */ +GEANY_API_SYMBOL const gchar *editor_get_eol_char_name(GeanyEditor *editor) { gint mode = file_prefs.default_eol_character; @@ -4230,6 +4239,7 @@ const gchar *editor_get_eol_char_name(GeanyEditor *editor) * * @since 0.19 */ +GEANY_API_SYMBOL gint editor_get_eol_char_len(GeanyEditor *editor) { gint mode = file_prefs.default_eol_character; @@ -4255,6 +4265,7 @@ gint editor_get_eol_char_len(GeanyEditor *editor) * * @since 0.19 */ +GEANY_API_SYMBOL const gchar *editor_get_eol_char(GeanyEditor *editor) { gint mode = file_prefs.default_eol_character; @@ -4489,6 +4500,7 @@ void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap) * * @since 0.16 */ +GEANY_API_SYMBOL void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type) { editor_set_indent(editor, type, editor->indent_width); @@ -4564,6 +4576,7 @@ gboolean editor_goto_line(GeanyEditor *editor, gint line_no, gint offset) * * @since 0.20 **/ +GEANY_API_SYMBOL gboolean editor_goto_pos(GeanyEditor *editor, gint pos, gboolean mark) { g_return_val_if_fail(editor, FALSE); @@ -4808,6 +4821,7 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor) * * @since 0.15 **/ +GEANY_API_SYMBOL ScintillaObject *editor_create_widget(GeanyEditor *editor) { const GeanyIndentPrefs *iprefs = get_default_indent_prefs(); @@ -5137,6 +5151,7 @@ void editor_indent(GeanyEditor *editor, gboolean increase) * @param snippet_name Snippet name. * @return snippet or @c NULL if it was not found. Must not be freed. */ +GEANY_API_SYMBOL const gchar *editor_find_snippet(GeanyEditor *editor, const gchar *snippet_name) { const gchar *subhash_name = editor ? editor->document->file_type->name : "Default"; @@ -5153,6 +5168,7 @@ const gchar *editor_find_snippet(GeanyEditor *editor, const gchar *snippet_name) * @param pos . * @param snippet . */ +GEANY_API_SYMBOL void editor_insert_snippet(GeanyEditor *editor, gint pos, const gchar *snippet) { GString *pattern;
Modified: src/encodings.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -39,6 +39,7 @@ #include "app.h" #include "callbacks.h" #include "documentprivate.h" +#include "pluginexport.h" #include "support.h" #include "ui_utils.h" #include "utils.h" @@ -263,6 +264,7 @@ const GeanyEncoding *encodings_get_from_index(gint idx) * * @since 0.13 **/ +GEANY_API_SYMBOL const gchar* encodings_get_charset_from_index(gint idx) { g_return_val_if_fail(idx >= 0 && idx < GEANY_ENCODINGS_MAX, NULL); @@ -639,6 +641,7 @@ void encodings_encoding_store_cell_data_func(GtkCellLayout *cell_layout, * @return If the conversion was successful, a newly allocated nul-terminated string, * which must be freed with @c g_free(). Otherwise @c NULL. **/ +GEANY_API_SYMBOL gchar *encodings_convert_to_utf8_from_charset(const gchar *buffer, gssize size, const gchar *charset, gboolean fast) { @@ -797,6 +800,7 @@ static gchar *encodings_convert_to_utf8_with_suggestion(const gchar *buffer, gss * @return If the conversion was successful, a newly allocated nul-terminated string, * which must be freed with @c g_free(). Otherwise @c NULL. **/ +GEANY_API_SYMBOL gchar *encodings_convert_to_utf8(const gchar *buffer, gssize size, gchar **used_encoding) { gchar *regex_charset;
Modified: src/filetypes.c 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -40,6 +40,7 @@ #include "geany.h" #include "geanyobject.h" #include "highlighting.h" +#include "pluginexport.h" #include "projectprivate.h" #include "sciwrappers.h" #include "support.h" @@ -234,6 +235,7 @@ static gint cmp_filetype(gconstpointer pft1, gconstpointer pft2, gpointer data) * The list does not change on subsequent calls. * @return The list - do not free. * @see filetypes_by_title. */ +GEANY_API_SYMBOL const GSList *filetypes_get_sorted_by_name(void) { static GSList *list = NULL; @@ -733,6 +735,7 @@ GeanyFiletype *filetypes_detect_from_document(GeanyDocument *doc) * @return The detected filetype for @a utf8_filename or @c filetypes[GEANY_FILETYPES_NONE] * if it could not be detected. **/ +GEANY_API_SYMBOL GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename) { gchar line[1024]; @@ -1215,6 +1218,7 @@ gboolean filetype_has_tags(GeanyFiletype *ft) * * @since 0.15 **/ +GEANY_API_SYMBOL GeanyFiletype *filetypes_lookup_by_name(const gchar *name) { GeanyFiletype *ft; @@ -1460,6 +1464,7 @@ void filetypes_reload_extensions(void) * * @since 0.16 */ +GEANY_API_SYMBOL GeanyFiletype *filetypes_index(gint idx) { return (idx >= 0 && idx < (gint) filetypes_array->len) ? filetypes[idx] : NULL; @@ -1497,6 +1502,7 @@ void filetypes_reload(void) * @param ft . * @return . * @since Geany 0.20 */ +GEANY_API_SYMBOL const gchar *filetypes_get_display_name(GeanyFiletype *ft) { return ft->id == GEANY_FILETYPES_NONE ? _("None") : ft->name;
Modified: src/highlighting.c 6 lines changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -37,6 +37,7 @@ #include "document.h" #include "editor.h" #include "filetypesprivate.h" +#include "pluginexport.h" #include "sciwrappers.h" #include "support.h" #include "symbols.h" @@ -1071,6 +1072,7 @@ void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *co /** Sets up highlighting and other visual settings. * @param sci Scintilla widget. * @param ft Filetype settings to use. */ +GEANY_API_SYMBOL void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft) { guint lexer_id = get_lexer_filetype(ft); @@ -1159,6 +1161,7 @@ void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft) * @param style_id A Scintilla lexer style, e.g. @c SCE_DIFF_ADDED. See scintilla/include/SciLexer.h. * @return A pointer to the style struct. * @see Scintilla messages @c SCI_STYLEGETFORE, etc, for use with scintilla_send_message(). */ +GEANY_API_SYMBOL const GeanyLexerStyle *highlighting_get_style(gint ft_id, gint style_id) { g_return_val_if_fail(ft_id >= 0 && (guint) ft_id < filetypes_array->len, NULL); @@ -1381,6 +1384,7 @@ void highlighting_show_color_scheme_dialog(void) * * @return @c TRUE if the style is a string, @c FALSE otherwise. */ +GEANY_API_SYMBOL gboolean highlighting_is_string_style(gint lexer, gint style) { /* Don't forget STRINGEOL, to prevent completion whilst typing a string with no closing char. */ @@ -1567,6 +1571,7 @@ gboolean highlighting_is_string_style(gint lexer, gint style) * * @return @c TRUE if the style is a comment, @c FALSE otherwise. */ +GEANY_API_SYMBOL gboolean highlighting_is_comment_style(gint lexer, gint style) { switch (lexer) @@ -1738,6 +1743,7 @@ gboolean highlighting_is_comment_style(gint lexer, gint style) * * @return @c TRUE if the style is code, @c FALSE otherwise. */ +GEANY_API_SYMBOL gboolean highlighting_is_code_style(gint lexer, gint style) { switch (lexer)
Modified: src/keybindings.c 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -43,6 +43,7 @@ #include "msgwindow.h" #include "navqueue.h" #include "notebook.h" +#include "pluginexport.h" #include "prefs.h" #include "sciwrappers.h" #include "sidebar.h" @@ -119,6 +120,7 @@ static void add_popup_menu_accels(void); * @param mods GdkModifierType mask. * @return Significant modifiers from the mask. * @since 1.25. */ +GEANY_API_SYMBOL GdkModifierType keybindings_get_modifiers(GdkModifierType mods) { #ifdef __APPLE__ @@ -134,6 +136,7 @@ GdkModifierType keybindings_get_modifiers(GdkModifierType mods) * @param key_id Keybinding index for the group. * @return The keybinding. * @since 0.19. */ +GEANY_API_SYMBOL GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id) { if (group->plugin) @@ -163,6 +166,7 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id) * underscores - these won't be displayed. * @param menu_item Optional widget to set an accelerator for, or @c NULL. * @return The keybinding - normally this is ignored. */ +GEANY_API_SYMBOL GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id, GeanyKeyCallback callback, guint key, GdkModifierType mod, const gchar *kf_name, const gchar *label, GtkWidget *menu_item) @@ -1289,6 +1293,7 @@ GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id) * Example: @code keybindings_send_command(GEANY_KEY_GROUP_FILE, GEANY_KEYS_FILE_OPEN); @endcode * @param group_id @ref GeanyKeyGroupID keybinding group index that contains the @a key_id keybinding. * @param key_id @ref GeanyKeyBindingID keybinding index. */ +GEANY_API_SYMBOL void keybindings_send_command(guint group_id, guint key_id) { GeanyKeyBinding *kb;
Modified: src/main.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -46,6 +46,7 @@ #include "msgwindow.h" #include "navqueue.h" #include "notebook.h" +#include "pluginexport.h" #include "plugins.h" #include "prefs.h" #include "printing.h" @@ -415,6 +416,7 @@ static void setup_paths(void) * * @since 0.19 **/ +GEANY_API_SYMBOL gboolean main_is_realized(void) { return main_status.main_window_realized; @@ -445,6 +447,7 @@ gboolean main_is_realized(void) * * @since 0.16 **/ +GEANY_API_SYMBOL void main_locale_init(const gchar *locale_dir, const gchar *package) { #ifdef HAVE_LOCALE_H @@ -1381,6 +1384,7 @@ gboolean main_quit(void) * * @since 0.15 **/ +GEANY_API_SYMBOL void main_reload_configuration(void) { /* reload templates */
Modified: src/msgwindow.c 7 lines changed, 7 insertions(+), 0 deletions(-) =================================================================== @@ -40,6 +40,7 @@ #include "keybindings.h" #include "main.h" #include "navqueue.h" +#include "pluginexport.h" #include "prefs.h" #include "support.h" #include "ui_utils.h" @@ -104,6 +105,7 @@ void msgwin_show_hide_tabs(void) /** Sets the Messages path for opening any parsed filenames without absolute path * from message lines. * @param messages_dir The directory. **/ +GEANY_API_SYMBOL void msgwin_set_messages_dir(const gchar *messages_dir) { g_free(msgwindow.messages_dir); @@ -286,6 +288,7 @@ static const GdkColor *get_color(gint msg_color) * @param format @c printf()-style format string. * @param ... Arguments for the @c format string. **/ +GEANY_API_SYMBOL void msgwin_compiler_add(gint msg_color, const gchar *format, ...) { gchar *string; @@ -359,6 +362,7 @@ void msgwin_show_hide(gboolean show) * * @since 0.15 **/ +GEANY_API_SYMBOL void msgwin_msg_add(gint msg_color, gint line, GeanyDocument *doc, const gchar *format, ...) { gchar *string; @@ -417,6 +421,7 @@ void msgwin_msg_add_string(gint msg_color, gint line, GeanyDocument *doc, const * @param format @c printf()-style format string. * @param ... Arguments for the @c format string. **/ +GEANY_API_SYMBOL void msgwin_status_add(const gchar *format, ...) { GtkTreeIter iter; @@ -1199,6 +1204,7 @@ static gboolean on_msgwin_button_press_event(GtkWidget *widget, GdkEventButton * * * @since 0.15 **/ +GEANY_API_SYMBOL void msgwin_switch_tab(gint tabnum, gboolean show) { GtkWidget *widget = NULL; /* widget to focus */ @@ -1233,6 +1239,7 @@ void msgwin_switch_tab(gint tabnum, gboolean show) * * @since 0.15 **/ +GEANY_API_SYMBOL void msgwin_clear_tab(gint tabnum) { GtkListStore *store = NULL;
Modified: src/navqueue.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -32,6 +32,7 @@
#include "document.h" #include "geanyobject.h" +#include "pluginexport.h" #include "sciwrappers.h" #include "toolbar.h" #include "utils.h" @@ -149,6 +150,7 @@ static void add_new_position(const gchar *utf8_filename, gint pos) * * @return @c TRUE if the cursor has changed the position to @a line or @c FALSE otherwise. **/ +GEANY_API_SYMBOL gboolean navqueue_goto_line(GeanyDocument *old_doc, GeanyDocument *new_doc, gint line) { gint pos;
Modified: src/pluginexport.h 34 lines changed, 34 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,34 @@ +/* + * pluginexport.h - this file is part of Geany, a fast and lightweight IDE + * + * Copyright 2014 Matthew Brush mbrush@codebrainz.ca + * + * 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. + */ + +#ifndef GEANY_PLUGINEXPORT_H +#define GEANY_PLUGINEXPORT_H 1 + +#if defined(_WIN32) || defined(__CYGWIN__) +# define GEANY_EXPORT_SYMBOL __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define GEANY_EXPORT_SYMBOL __attribute__((visibility ("default"))) +#else +# define GEANY_API_SYMBOL +#endif + +#define GEANY_API_SYMBOL GEANY_EXPORT_SYMBOL + +#endif /* GEANY_PLUGINEXPORT_H */
Modified: src/pluginutils.c 10 lines changed, 10 insertions(+), 0 deletions(-) =================================================================== @@ -34,6 +34,7 @@ #include "app.h" #include "geanyobject.h" #include "plugindata.h" +#include "pluginexport.h" #include "pluginprivate.h" #include "plugins.h" #include "support.h" @@ -48,6 +49,7 @@ * @note You should still destroy @a item yourself, usually in @ref plugin_cleanup(). * @param plugin Must be @ref geany_plugin. * @param item The item to add. */ +GEANY_API_SYMBOL void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item) { GtkToolbar *toolbar = GTK_TOOLBAR(main_widgets.toolbar); @@ -91,6 +93,7 @@ void plugin_add_toolbar_item(GeanyPlugin *plugin, GtkToolItem *item) * * @since 0.16 */ +GEANY_API_SYMBOL void plugin_module_make_resident(GeanyPlugin *plugin) { g_return_if_fail(plugin); @@ -126,6 +129,7 @@ void plugin_module_make_resident(GeanyPlugin *plugin) * @note Since version 1.25 (API >= 218), the object lifetime is watched and so the above * restriction does not apply. However, for objects destroyed by the plugin, * @c g_signal_connect() is safe and has lower overhead. */ +GEANY_API_SYMBOL void plugin_signal_connect(GeanyPlugin *plugin, GObject *object, const gchar *signal_name, gboolean after, GCallback callback, gpointer user_data) @@ -238,6 +242,7 @@ static guint plugin_source_add(GeanyPlugin *plugin, GSource *source, GSourceFunc * @see g_timeout_add() * @since 0.21, plugin API 205. */ +GEANY_API_SYMBOL guint plugin_timeout_add(GeanyPlugin *plugin, guint interval, GSourceFunc function, gpointer data) { return plugin_source_add(plugin, g_timeout_source_new(interval), function, data); @@ -257,6 +262,7 @@ guint plugin_timeout_add(GeanyPlugin *plugin, guint interval, GSourceFunc functi * @see g_timeout_add_seconds() * @since 0.21, plugin API 205. */ +GEANY_API_SYMBOL guint plugin_timeout_add_seconds(GeanyPlugin *plugin, guint interval, GSourceFunc function, gpointer data) { @@ -276,6 +282,7 @@ guint plugin_timeout_add_seconds(GeanyPlugin *plugin, guint interval, GSourceFun * @see g_idle_add() * @since 0.21, plugin API 205. */ +GEANY_API_SYMBOL guint plugin_idle_add(GeanyPlugin *plugin, GSourceFunc function, gpointer data) { return plugin_source_add(plugin, g_idle_source_new(), function, data); @@ -290,6 +297,7 @@ guint plugin_idle_add(GeanyPlugin *plugin, GSourceFunc function, gpointer data) * @param callback Group callback, or @c NULL if you only want individual keybinding callbacks. * @return The plugin's keybinding group. * @since 0.19. */ +GEANY_API_SYMBOL GeanyKeyGroup *plugin_set_key_group(GeanyPlugin *plugin, const gchar *section_name, gsize count, GeanyKeyGroupCallback callback) { @@ -402,6 +410,7 @@ static void configure_plugins(Plugin *current_plugin) * @param plugin Must be @ref geany_plugin. * @since 0.19. */ /* if NULL, show all plugins */ +GEANY_API_SYMBOL void plugin_show_configure(GeanyPlugin *plugin) { Plugin *p; @@ -489,6 +498,7 @@ static void connect_plugin_signals(GtkBuilder *builder, GObject *object, * * @since 1.24, plugin API 217. */ +GEANY_API_SYMBOL void plugin_builder_connect_signals(GeanyPlugin *plugin, GtkBuilder *builder, gpointer user_data) {
Modified: src/sciwrappers.c 62 lines changed, 62 insertions(+), 0 deletions(-) =================================================================== @@ -37,6 +37,7 @@
#include "sciwrappers.h"
+#include "pluginexport.h" #include "utils.h"
#include <string.h> @@ -44,6 +45,15 @@
#define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
+ +/* These functions need to be exported for the plugin API but to avoid + * modifying upstream sources, they are (re-)declared here with the + * needed export attribute. */ +GEANY_API_SYMBOL sptr_t scintilla_send_message(ScintillaObject *sci, + unsigned int iMessage, uptr_t wParam, sptr_t lParam); +GEANY_API_SYMBOL GtkWidget* scintilla_new(void); + + /* line numbers visibility */ void sci_set_line_numbers(ScintillaObject *sci, gboolean set) { @@ -181,6 +191,7 @@ void sci_add_text(ScintillaObject *sci, const gchar *text) /** Sets all text. * @param sci Scintilla widget. * @param text Text. */ +GEANY_API_SYMBOL void sci_set_text(ScintillaObject *sci, const gchar *text) { if( text != NULL ){ /* if null text is passed to scintilla will segfault */ @@ -218,6 +229,7 @@ void sci_redo(ScintillaObject *sci) /** Begins grouping a set of edits together as one Undo action. * You must call sci_end_undo_action() after making your edits. * @param sci Scintilla @c GtkWidget. */ +GEANY_API_SYMBOL void sci_start_undo_action(ScintillaObject *sci) { SSM(sci, SCI_BEGINUNDOACTION, 0, 0); @@ -227,6 +239,7 @@ void sci_start_undo_action(ScintillaObject *sci) /** Ends grouping a set of edits together as one Undo action. * @param sci Scintilla @c GtkWidget. * @see sci_start_undo_action(). */ +GEANY_API_SYMBOL void sci_end_undo_action(ScintillaObject *sci) { SSM(sci, SCI_ENDUNDOACTION, 0, 0); @@ -279,6 +292,7 @@ gint sci_get_zoom(ScintillaObject *sci) * @param sci Scintilla widget. * @param line_number Line number. * @param marker Marker number. */ +GEANY_API_SYMBOL void sci_set_marker_at_line(ScintillaObject *sci, gint line_number, gint marker) { SSM(sci, SCI_MARKERADD, (uptr_t) line_number, marker); @@ -289,6 +303,7 @@ void sci_set_marker_at_line(ScintillaObject *sci, gint line_number, gint marker) * @param sci Scintilla widget. * @param line_number Line number. * @param marker Marker number. */ +GEANY_API_SYMBOL void sci_delete_marker_at_line(ScintillaObject *sci, gint line_number, gint marker) { SSM(sci, SCI_MARKERDELETE, (uptr_t) line_number, marker); @@ -300,6 +315,7 @@ void sci_delete_marker_at_line(ScintillaObject *sci, gint line_number, gint mark * @param line Line number. * @param marker Marker number. * @return Whether it's set. */ +GEANY_API_SYMBOL gboolean sci_is_marker_set_at_line(ScintillaObject *sci, gint line, gint marker) { gint state; @@ -357,6 +373,7 @@ gint sci_marker_previous(ScintillaObject *sci, gint line, gint marker_mask, gboo * @param sci Scintilla widget. * @param position Position. * @return The line. */ +GEANY_API_SYMBOL gint sci_get_line_from_position(ScintillaObject *sci, gint position) { return (gint) SSM(sci, SCI_LINEFROMPOSITION, (uptr_t) position, 0); @@ -367,6 +384,7 @@ gint sci_get_line_from_position(ScintillaObject *sci, gint position) * @param sci Scintilla widget. * @param position Position. * @return The column. */ +GEANY_API_SYMBOL gint sci_get_col_from_position(ScintillaObject *sci, gint position) { return (gint) SSM(sci, SCI_GETCOLUMN, (uptr_t) position, 0); @@ -383,6 +401,7 @@ gint sci_get_position_from_col(ScintillaObject *sci, gint line, gint col) * @param sci Scintilla widget. * @param line Line. * @return Position. */ +GEANY_API_SYMBOL gint sci_get_position_from_line(ScintillaObject *sci, gint line) { return (gint) SSM(sci, SCI_POSITIONFROMLINE, (uptr_t) line, 0); @@ -392,6 +411,7 @@ gint sci_get_position_from_line(ScintillaObject *sci, gint line) /** Gets the cursor position. * @param sci Scintilla widget. * @return Position. */ +GEANY_API_SYMBOL gint sci_get_current_position(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETCURRENTPOS, 0, 0); @@ -413,6 +433,7 @@ gint sci_get_cursor_virtual_space(ScintillaObject *sci) * @param sci Scintilla widget. * @param position Position. * @param scroll_to_caret Whether to scroll the cursor in view. */ +GEANY_API_SYMBOL void sci_set_current_position(ScintillaObject *sci, gint position, gboolean scroll_to_caret) { if (scroll_to_caret) @@ -438,6 +459,7 @@ void sci_set_current_line(ScintillaObject *sci, gint line) /** Gets the total number of lines. * @param sci Scintilla widget. * @return The line count. */ +GEANY_API_SYMBOL gint sci_get_line_count(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETLINECOUNT, 0, 0); @@ -447,6 +469,7 @@ gint sci_get_line_count(ScintillaObject *sci) /** Sets the selection start position. * @param sci Scintilla widget. * @param position Position. */ +GEANY_API_SYMBOL void sci_set_selection_start(ScintillaObject *sci, gint position) { SSM(sci, SCI_SETSELECTIONSTART, (uptr_t) position, 0); @@ -456,6 +479,7 @@ void sci_set_selection_start(ScintillaObject *sci, gint position) /** Sets the selection end position. * @param sci Scintilla widget. * @param position Position. */ +GEANY_API_SYMBOL void sci_set_selection_end(ScintillaObject *sci, gint position) { SSM(sci, SCI_SETSELECTIONEND, (uptr_t) position, 0); @@ -472,6 +496,7 @@ void sci_set_selection(ScintillaObject *sci, gint anchorPos, gint currentPos) * @param sci Scintilla widget. * @param line Line. * @return The position at the end of the line. */ +GEANY_API_SYMBOL gint sci_get_line_end_position(ScintillaObject *sci, gint line) { return (gint) SSM(sci, SCI_GETLINEENDPOSITION, (uptr_t) line, 0); @@ -505,6 +530,7 @@ void sci_clear(ScintillaObject *sci) /** Gets the selection start position. * @param sci Scintilla widget. * @return Position. */ +GEANY_API_SYMBOL gint sci_get_selection_start(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETSELECTIONSTART, 0, 0); @@ -514,6 +540,7 @@ gint sci_get_selection_start(ScintillaObject *sci) /** Gets the selection end position. * @param sci Scintilla widget. * @return Position. */ +GEANY_API_SYMBOL gint sci_get_selection_end(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETSELECTIONEND, 0, 0); @@ -523,6 +550,7 @@ gint sci_get_selection_end(ScintillaObject *sci) /** Replaces selection. * @param sci Scintilla widget. * @param text Text. */ +GEANY_API_SYMBOL void sci_replace_sel(ScintillaObject *sci, const gchar *text) { SSM(sci, SCI_REPLACESEL, 0, (sptr_t) text); @@ -532,6 +560,7 @@ void sci_replace_sel(ScintillaObject *sci, const gchar *text) /** Gets the length of all text. * @param sci Scintilla widget. * @return Length. */ +GEANY_API_SYMBOL gint sci_get_length(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETLENGTH, 0, 0); @@ -542,6 +571,7 @@ gint sci_get_length(ScintillaObject *sci) * @param sci Scintilla widget. * @returns The lexer ID */ +GEANY_API_SYMBOL gint sci_get_lexer(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETLEXER, 0, 0); @@ -563,6 +593,7 @@ void sci_set_lexer(ScintillaObject *sci, guint lexer_id) * @param sci Scintilla widget. * @param line Line number. * @return Length. */ +GEANY_API_SYMBOL gint sci_get_line_length(ScintillaObject *sci, gint line) { return (gint) SSM(sci, SCI_LINELENGTH, (uptr_t) line, 0); @@ -586,6 +617,7 @@ gchar *sci_get_string(ScintillaObject *sci, guint msg, gulong wParam) * @param sci Scintilla widget. * @param line_num Line number. * @return A @c NULL-terminated copy of the line text. */ +GEANY_API_SYMBOL gchar *sci_get_line(ScintillaObject *sci, gint line_num) { return sci_get_string(sci, SCI_GETLINE, (gulong) line_num); @@ -599,6 +631,7 @@ gchar *sci_get_line(ScintillaObject *sci, gint line_num) * @param sci Scintilla widget. * @param len Length of @a text buffer, usually sci_get_length() + 1. * @param text Text buffer; must be allocated @a len + 1 bytes for null-termination. */ +GEANY_API_SYMBOL void sci_get_text(ScintillaObject *sci, gint len, gchar *text) { SSM(sci, SCI_GETTEXT, (uptr_t) len, (sptr_t) text); @@ -614,6 +647,7 @@ void sci_get_text(ScintillaObject *sci, gint len, gchar *text) * * @since 1.23 (0.17) */ +GEANY_API_SYMBOL gchar *sci_get_contents(ScintillaObject *sci, gint buffer_len) { gchar *text; @@ -634,6 +668,7 @@ gchar *sci_get_contents(ScintillaObject *sci, gint buffer_len) * @param sci Scintilla widget. * @param text Text buffer; must be allocated sci_get_selected_text_length() + 1 bytes * for null-termination. */ +GEANY_API_SYMBOL void sci_get_selected_text(ScintillaObject *sci, gchar *text) { SSM(sci, SCI_GETSELTEXT, 0, (sptr_t) text); @@ -647,6 +682,7 @@ void sci_get_selected_text(ScintillaObject *sci, gchar *text) * * @since 0.17 */ +GEANY_API_SYMBOL gchar *sci_get_selection_contents(ScintillaObject *sci) { return sci_get_string(sci, SCI_GETSELTEXT, 0); @@ -656,6 +692,7 @@ gchar *sci_get_selection_contents(ScintillaObject *sci) /** Gets selected text length. * @param sci Scintilla widget. * @return Length. */ +GEANY_API_SYMBOL gint sci_get_selected_text_length(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETSELTEXT, 0, 0); @@ -673,6 +710,7 @@ gint sci_get_position_from_xy(ScintillaObject *sci, gint x, gint y, gboolean nea * @param sci Scintilla widget. * @param line Line number. * @return Whether @a line will be drawn on the screen. */ +GEANY_API_SYMBOL gboolean sci_get_line_is_visible(ScintillaObject *sci, gint line) { return SSM(sci, SCI_GETLINEVISIBLE, (uptr_t) line, 0) != FALSE; @@ -682,6 +720,7 @@ gboolean sci_get_line_is_visible(ScintillaObject *sci, gint line) /** Makes @a line visible (folding may have hidden it). * @param sci Scintilla widget. * @param line Line number. */ +GEANY_API_SYMBOL void sci_ensure_line_is_visible(ScintillaObject *sci, gint line) { SSM(sci, SCI_ENSUREVISIBLE, (uptr_t) line, 0); @@ -743,6 +782,7 @@ void sci_set_tab_width(ScintillaObject *sci, gint width) * * @since 0.15 **/ +GEANY_API_SYMBOL gint sci_get_tab_width(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETTABWIDTH, 0, 0); @@ -753,6 +793,7 @@ gint sci_get_tab_width(ScintillaObject *sci) * @param sci Scintilla widget. * @param pos Position. * @return Char. */ +GEANY_API_SYMBOL gchar sci_get_char_at(ScintillaObject *sci, gint pos) { return (gchar) SSM(sci, SCI_GETCHARAT, (uptr_t) pos, 0); @@ -783,6 +824,7 @@ void sci_use_popup(ScintillaObject *sci, gboolean enable) * * @since 0.15 **/ +GEANY_API_SYMBOL gboolean sci_has_selection(ScintillaObject *sci) { if (SSM(sci, SCI_GETSELECTIONEND, 0, 0) - SSM(sci, SCI_GETSELECTIONSTART, 0, 0)) @@ -817,6 +859,7 @@ void sci_set_anchor(ScintillaObject *sci, gint pos)
/** Scrolls the cursor in view. * @param sci Scintilla widget. */ +GEANY_API_SYMBOL void sci_scroll_caret(ScintillaObject *sci) { SSM(sci, SCI_SCROLLCARET, 0, 0); @@ -862,6 +905,7 @@ gint sci_search_prev(ScintillaObject *sci, gint flags, const gchar *text) * The @c chrgText.cpMin and @c chrgText.cpMax members of @c TextToFind are filled in * with the start and end positions of the found text. */ +GEANY_API_SYMBOL gint sci_find_text(ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf) { return (gint) SSM(sci, SCI_FINDTEXT, (uptr_t) flags, (sptr_t) ttf); @@ -873,6 +917,7 @@ gint sci_find_text(ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf) * @param style The style. * @param font The font name. * @param size The font size. */ +GEANY_API_SYMBOL void sci_set_font(ScintillaObject *sci, gint style, const gchar *font, gint size) { SSM(sci, SCI_STYLESETFONT, (uptr_t) style, (sptr_t) font); @@ -887,6 +932,7 @@ void sci_set_font(ScintillaObject *sci, gint style, const gchar *font, gint size * @param line Line. * @param unfold Whether to unfold first. */ +GEANY_API_SYMBOL void sci_goto_line(ScintillaObject *sci, gint line, gboolean unfold) { if (unfold) SSM(sci, SCI_ENSUREVISIBLE, (uptr_t) line, 0); @@ -904,6 +950,7 @@ void sci_marker_delete_all(ScintillaObject *sci, gint marker) * @param sci Scintilla widget. * @param position Position. * @return Style ID. */ +GEANY_API_SYMBOL gint sci_get_style_at(ScintillaObject *sci, gint position) { return (gint) SSM(sci, SCI_GETSTYLEAT, (uptr_t) position, 0); @@ -937,6 +984,7 @@ void sci_clear_cmdkey(ScintillaObject *sci, gint key) * @param start Start. * @param end End. * @param text Text will be zero terminated and must be allocated (end - start + 1) bytes. */ +GEANY_API_SYMBOL void sci_get_text_range(ScintillaObject *sci, gint start, gint end, gchar *text) { struct Sci_TextRange tr; @@ -955,6 +1003,7 @@ void sci_get_text_range(ScintillaObject *sci, gint start, gint end, gchar *text) * * @since 0.17 */ +GEANY_API_SYMBOL gchar *sci_get_contents_range(ScintillaObject *sci, gint start, gint end) { gchar *text; @@ -983,6 +1032,7 @@ void sci_selection_duplicate(ScintillaObject *sci) * @param sci Scintilla widget. * @param pos Position, or -1 for current. * @param text Text. */ +GEANY_API_SYMBOL void sci_insert_text(ScintillaObject *sci, gint pos, const gchar *text) { SSM(sci, SCI_INSERTTEXT, (uptr_t) pos, (sptr_t) text); @@ -995,18 +1045,21 @@ void sci_target_from_selection(ScintillaObject *sci) }
+GEANY_API_SYMBOL void sci_set_target_start(ScintillaObject *sci, gint start) { SSM(sci, SCI_SETTARGETSTART, (uptr_t) start, 0); }
+GEANY_API_SYMBOL void sci_set_target_end(ScintillaObject *sci, gint end) { SSM(sci, SCI_SETTARGETEND, (uptr_t) end, 0); }
+GEANY_API_SYMBOL gint sci_replace_target(ScintillaObject *sci, const gchar *text, gboolean regex) { return (gint) SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, (uptr_t) -1, (sptr_t) text); @@ -1032,6 +1085,7 @@ void sci_set_readonly(ScintillaObject *sci, gboolean readonly) * * @since 0.16 */ +GEANY_API_SYMBOL void sci_send_command(ScintillaObject *sci, gint cmd) { SSM(sci, cmd, 0, 0); @@ -1041,6 +1095,7 @@ void sci_send_command(ScintillaObject *sci, gint cmd) /** Gets current line number. * @param sci Scintilla widget. * @return Line number. */ +GEANY_API_SYMBOL gint sci_get_current_line(ScintillaObject *sci) { return (gint) SSM(sci, SCI_LINEFROMPOSITION, (uptr_t) SSM(sci, SCI_GETCURRENTPOS, 0, 0), 0); @@ -1084,6 +1139,7 @@ gint sci_get_first_visible_line(ScintillaObject *sci) * * @since 0.16 */ +GEANY_API_SYMBOL void sci_indicator_set(ScintillaObject *sci, gint indic) { SSM(sci, SCI_SETINDICATORCURRENT, (uptr_t) indic, 0); @@ -1108,6 +1164,7 @@ void sci_indicator_fill(ScintillaObject *sci, gint pos, gint len) * * @since 0.16 */ +GEANY_API_SYMBOL void sci_indicator_clear(ScintillaObject *sci, gint pos, gint len) { SSM(sci, SCI_INDICATORCLEARRANGE, (uptr_t) pos, len); @@ -1139,6 +1196,7 @@ void sci_set_autoc_max_height(ScintillaObject *sci, gint val) * * @since 0.15 **/ +GEANY_API_SYMBOL gint sci_find_matching_brace(ScintillaObject *sci, gint pos) { return (gint) SSM(sci, SCI_BRACEMATCH, (uptr_t) pos, 0); @@ -1178,6 +1236,7 @@ gint sci_get_pos_at_line_sel_end(ScintillaObject *sci, gint line) /** Gets selection mode. * @param sci Scintilla widget. * @return Selection mode. */ +GEANY_API_SYMBOL gint sci_get_selection_mode(ScintillaObject *sci) { return (gint) SSM(sci, SCI_GETSELECTIONMODE, 0, 0); @@ -1187,6 +1246,7 @@ gint sci_get_selection_mode(ScintillaObject *sci) /** Sets selection mode. * @param sci Scintilla widget. * @param mode Mode. */ +GEANY_API_SYMBOL void sci_set_selection_mode(ScintillaObject *sci, gint mode) { SSM(sci, SCI_SETSELECTIONMODE, (uptr_t) mode, 0); @@ -1207,6 +1267,7 @@ void sci_set_scrollbar_mode(ScintillaObject *sci, gboolean visible) * * @since 0.19 */ +GEANY_API_SYMBOL void sci_set_line_indentation(ScintillaObject *sci, gint line, gint indent) { SSM(sci, SCI_SETLINEINDENTATION, (uptr_t) line, indent); @@ -1220,6 +1281,7 @@ void sci_set_line_indentation(ScintillaObject *sci, gint line, gint indent) * * @since 0.19 */ +GEANY_API_SYMBOL gint sci_get_line_indentation(ScintillaObject *sci, gint line) { return (gint) SSM(sci, SCI_GETLINEINDENTATION, (uptr_t) line, 0);
Modified: src/search.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -35,6 +35,7 @@ #include "encodings.h" #include "keyfile.h" #include "msgwindow.h" +#include "pluginexport.h" #include "prefs.h" #include "sciwrappers.h" #include "stash.h" @@ -1034,6 +1035,7 @@ static void create_fif_dialog(void) * * @since 0.14, plugin API 53 */ +GEANY_API_SYMBOL void search_show_find_in_files_dialog(const gchar *dir) { search_show_find_in_files_dialog_full(NULL, dir);
Modified: src/stash.c 21 lines changed, 21 insertions(+), 0 deletions(-) =================================================================== @@ -78,6 +78,7 @@
#include "stash.h"
+#include "pluginexport.h" /* for GEANY_API_SYMBOL */ #include "support.h" /* only for _("text") */ #include "utils.h" /* only for foreach_*, utils_get_setting_*(). Stash should not depend on Geany. */
@@ -274,6 +275,7 @@ static void keyfile_action(SettingAction action, StashGroup *group, GKeyFile *ke * so that all Stash settings are initialized to defaults. * @param group . * @param keyfile Usually loaded from a configuration file first. */ +GEANY_API_SYMBOL void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile) { keyfile_action(SETTING_READ, group, keyfile); @@ -284,6 +286,7 @@ void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile) * @a keyfile is usually written to a configuration file afterwards. * @param group . * @param keyfile . */ +GEANY_API_SYMBOL void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile) { keyfile_action(SETTING_WRITE, group, keyfile); @@ -298,6 +301,7 @@ void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile) * @return @c TRUE if a key file could be loaded. * @see stash_group_load_from_key_file(). **/ +GEANY_API_SYMBOL gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename) { GKeyFile *keyfile; @@ -322,6 +326,7 @@ gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename) * failed operation is returned. * @see stash_group_save_to_key_file(). **/ +GEANY_API_SYMBOL gint stash_group_save_to_file(StashGroup *group, const gchar *filename, GKeyFileFlags flags) { @@ -346,6 +351,7 @@ gint stash_group_save_to_file(StashGroup *group, const gchar *filename, /** Creates a new group. * @param name Name used for @c GKeyFile group. * @return Group. */ +GEANY_API_SYMBOL StashGroup *stash_group_new(const gchar *name) { StashGroup *group = g_new0(StashGroup, 1); @@ -361,6 +367,7 @@ StashGroup *stash_group_new(const gchar *name) * Useful e.g. to avoid freeing strings individually. * @note This is *not* called by stash_group_free(). * @param group . */ +GEANY_API_SYMBOL void stash_group_free_settings(StashGroup *group) { StashPref *entry; @@ -382,6 +389,7 @@ void stash_group_free_settings(StashGroup *group)
/** Frees a group. * @param group . */ +GEANY_API_SYMBOL void stash_group_free(StashGroup *group) { StashPref *entry; @@ -442,6 +450,7 @@ add_pref(StashGroup *group, GType type, gpointer setting, * @param setting Address of setting variable. * @param key_name Name for key in a @c GKeyFile. * @param default_value Value to use if the key doesn't exist when loading. */ +GEANY_API_SYMBOL void stash_group_add_boolean(StashGroup *group, gboolean *setting, const gchar *key_name, gboolean default_value) { @@ -454,6 +463,7 @@ void stash_group_add_boolean(StashGroup *group, gboolean *setting, * @param setting Address of setting variable. * @param key_name Name for key in a @c GKeyFile. * @param default_value Value to use if the key doesn't exist when loading. */ +GEANY_API_SYMBOL void stash_group_add_integer(StashGroup *group, gint *setting, const gchar *key_name, gint default_value) { @@ -467,6 +477,7 @@ void stash_group_add_integer(StashGroup *group, gint *setting, * @param setting Address of setting variable. * @param key_name Name for key in a @c GKeyFile. * @param default_value String to copy if the key doesn't exist when loading, or @c NULL. */ +GEANY_API_SYMBOL void stash_group_add_string(StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value) { @@ -480,6 +491,7 @@ void stash_group_add_string(StashGroup *group, gchar **setting, * @param setting Address of setting variable. * @param key_name Name for key in a @c GKeyFile. * @param default_value Vector to copy if the key doesn't exist when loading. Usually @c NULL. */ +GEANY_API_SYMBOL void stash_group_add_string_vector(StashGroup *group, gchar ***setting, const gchar *key_name, const gchar **default_value) { @@ -734,6 +746,7 @@ static void pref_action(PrefAction action, StashGroup *group, GtkWidget *owner) * @param owner If non-NULL, used to lookup widgets by name, otherwise * widget pointers are assumed. * @see stash_group_update(). */ +GEANY_API_SYMBOL void stash_group_display(StashGroup *group, GtkWidget *owner) { pref_action(PREF_DISPLAY, group, owner); @@ -746,6 +759,7 @@ void stash_group_display(StashGroup *group, GtkWidget *owner) * @param owner If non-NULL, used to lookup widgets by name, otherwise * widget pointers are assumed. * @see stash_group_display(). */ +GEANY_API_SYMBOL void stash_group_update(StashGroup *group, GtkWidget *owner) { pref_action(PREF_UPDATE, group, owner); @@ -773,6 +787,7 @@ add_widget_pref(StashGroup *group, GType setting_type, gpointer setting, * @param default_value Value to use if the key doesn't exist when loading. * @param widget_id @c GtkWidget pointer or string to lookup widget later. * @see stash_group_add_radio_buttons(). */ +GEANY_API_SYMBOL void stash_group_add_toggle_button(StashGroup *group, gboolean *setting, const gchar *key_name, gboolean default_value, StashWidgetID widget_id) { @@ -795,6 +810,7 @@ void stash_group_add_toggle_button(StashGroup *group, gboolean *setting, * stash_group_add_radio_buttons(group, &which_one_setting, "which_one", BAR, * "radio_foo", FOO, "radio_bar", BAR, NULL); * @endcode */ +GEANY_API_SYMBOL void stash_group_add_radio_buttons(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id, gint enum_id, ...) @@ -845,6 +861,7 @@ void stash_group_add_radio_buttons(StashGroup *group, gint *setting, * @param key_name Name for key in a @c GKeyFile. * @param default_value Value to use if the key doesn't exist when loading. * @param widget_id @c GtkWidget pointer or string to lookup widget later. */ +GEANY_API_SYMBOL void stash_group_add_spin_button_integer(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id) { @@ -860,6 +877,7 @@ void stash_group_add_spin_button_integer(StashGroup *group, gint *setting, * @param default_value Value to use if the key doesn't exist when loading. * @param widget_id @c GtkWidget pointer or string to lookup widget later. * @see stash_group_add_combo_box_entry(). */ +GEANY_API_SYMBOL void stash_group_add_combo_box(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id) { @@ -876,6 +894,7 @@ void stash_group_add_combo_box(StashGroup *group, gint *setting, * @param widget_id @c GtkWidget pointer or string to lookup widget later. */ /* We could maybe also have something like stash_group_add_combo_box_entry_with_menu() * for the history list - or should that be stored as a separate setting? */ +GEANY_API_SYMBOL void stash_group_add_combo_box_entry(StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value, StashWidgetID widget_id) { @@ -890,6 +909,7 @@ void stash_group_add_combo_box_entry(StashGroup *group, gchar **setting, * @param key_name Name for key in a @c GKeyFile. * @param default_value Value to use if the key doesn't exist when loading. * @param widget_id @c GtkWidget pointer or string to lookup widget later. */ +GEANY_API_SYMBOL void stash_group_add_entry(StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value, StashWidgetID widget_id) { @@ -922,6 +942,7 @@ static GType object_get_property_type(GObject *object, const gchar *property_nam * @c GObject data. * @warning Currently only string GValue properties will be freed before setting; patch for * other types - see @c handle_widget_property(). */ +GEANY_API_SYMBOL void stash_group_add_widget_property(StashGroup *group, gpointer setting, const gchar *key_name, gpointer default_value, StashWidgetID widget_id, const gchar *property_name, GType type)
Modified: src/symbols.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -47,6 +47,7 @@ #include "geanyobject.h" #include "main.h" #include "navqueue.h" +#include "pluginexport.h" #include "sciwrappers.h" #include "sidebar.h" #include "support.h" @@ -292,6 +293,7 @@ GString *symbols_find_typenames_as_string(gint lang, gboolean global) * * @since 0.19 */ +GEANY_API_SYMBOL const gchar *symbols_get_context_separator(gint ft_id) { switch (ft_id)
Modified: src/templates.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -37,6 +37,7 @@ #include "geany.h" #include "geanymenubuttonaction.h" #include "geanyobject.h" +#include "pluginexport.h" #include "support.h" #include "toolbar.h" #include "ui_utils.h" @@ -456,6 +457,7 @@ static gchar *get_template_fileheader(GeanyFiletype *ft)
/* TODO change the signature to take a GeanyDocument? this would break plugin API/ABI */ +GEANY_API_SYMBOL gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname) { GeanyFiletype *ft = filetypes[filetype_idx];
Modified: src/ui_utils.c 22 lines changed, 22 insertions(+), 0 deletions(-) =================================================================== @@ -40,6 +40,7 @@ #include "keyfile.h" #include "main.h" #include "msgwindow.h" +#include "pluginexport.h" #include "prefs.h" #include "project.h" #include "sciwrappers.h" @@ -165,6 +166,7 @@ static void set_statusbar(const gchar *text, gboolean allow_override) /** Displays text on the statusbar. * @param log Whether the message should be recorded in the Status window. * @param format A @c printf -style string. */ +GEANY_API_SYMBOL void ui_set_statusbar(gboolean log, const gchar *format, ...) { gchar *string; @@ -966,6 +968,7 @@ static void on_doc_sensitive_widget_destroy(GtkWidget *widget, G_GNUC_UNUSED gpo * * @since 0.15 **/ +GEANY_API_SYMBOL void ui_add_document_sensitive(GtkWidget *widget) { gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) > 0; @@ -1459,6 +1462,7 @@ void ui_update_view_editor_menu_items(void) * @param label_text The label text. * @param alignment An address to store the alignment widget pointer. * @return The frame widget, setting the alignment container for packing child widgets. */ +GEANY_API_SYMBOL GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment) { GtkWidget *label, *align; @@ -1481,6 +1485,7 @@ GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alig /** Makes a fixed border for dialogs without increasing the button box border. * @param dialog The parent container for the @c GtkVBox. * @return The packed @c GtkVBox. */ +GEANY_API_SYMBOL GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog) { GtkWidget *vbox = gtk_vbox_new(FALSE, 12); /* need child vbox to set a separate border. */ @@ -1555,6 +1560,7 @@ void ui_dialog_set_primary_button_order(GtkDialog *dialog, gint response, ...) * @param text Button label text, can include mnemonics. * @return The new @c GtkButton. */ +GEANY_API_SYMBOL GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text) { GtkWidget *image, *button; @@ -1575,6 +1581,7 @@ GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text) * * @since 0.16 */ +GEANY_API_SYMBOL GtkWidget * ui_image_menu_item_new(const gchar *stock_id, const gchar *label) { @@ -1605,6 +1612,7 @@ static void entry_clear_icon_release_cb(GtkEntry *entry, gint icon_pos, * * @since 0.16 */ +GEANY_API_SYMBOL void ui_entry_add_clear_icon(GtkEntry *entry) { g_object_set(entry, "secondary-icon-stock", GTK_STOCK_CLEAR, @@ -1697,6 +1705,7 @@ static gboolean tree_model_find_text(GtkTreeModel *model, * @param combo_entry . * @param text Text to add, or @c NULL for current entry text. * @param history_len Max number of items, or @c 0 for default. */ +GEANY_API_SYMBOL void ui_combo_box_add_to_history(GtkComboBoxText *combo_entry, const gchar *text, gint history_len) { @@ -1875,6 +1884,7 @@ static gboolean ui_tree_view_query_tooltip_cb(GtkWidget *widget, gint x, gint y, */ /* Note: @p column is int and not uint both to match gtk_tree_view_set_tooltip_column() signature * and to allow future support of -1 to unset if ever wanted */ +GEANY_API_SYMBOL void ui_tree_view_set_tooltip_text_column(GtkTreeView *tree_view, gint column) { g_return_if_fail(column >= 0); @@ -1892,6 +1902,7 @@ void ui_tree_view_set_tooltip_text_column(GtkTreeView *tree_view, gint column) * @param widget The widget. * @param str The font name as expected by pango_font_description_from_string(). */ +GEANY_API_SYMBOL void ui_widget_modify_font_from_string(GtkWidget *widget, const gchar *str) { PangoFontDescription *pfd; @@ -1913,6 +1924,7 @@ void ui_widget_modify_font_from_string(GtkWidget *widget, const gchar *str) * @return The @c GtkHBox. */ /* @see ui_setup_open_button_callback(). */ +GEANY_API_SYMBOL GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry) { GtkWidget *vbox, *dirbtn, *openimg, *hbox, *path_entry; @@ -2063,6 +2075,7 @@ void ui_statusbar_showhide(gboolean state) * @param table * @param row The row number of the table. */ +GEANY_API_SYMBOL void ui_table_add_row(GtkTable *table, gint row, ...) { va_list args; @@ -2642,6 +2655,7 @@ void ui_auto_separator_add_ref(GeanyAutoSeparator *autosep, GtkWidget *item) * @since 0.16 * @deprecated 0.21 use gtk_widget_set_tooltip_text() instead */ +GEANY_API_SYMBOL void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text) { gtk_widget_set_tooltip_text(widget, text); @@ -2659,6 +2673,7 @@ void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text) * * @since 0.16 */ +GEANY_API_SYMBOL GtkWidget *ui_lookup_widget(GtkWidget *widget, const gchar *widget_name) { GtkWidget *parent, *found_widget; @@ -2737,6 +2752,7 @@ static gboolean progress_bar_pulse(gpointer data) * * @since 0.16 **/ +GEANY_API_SYMBOL void ui_progress_bar_start(const gchar *text) { g_return_if_fail(progress_bar_timer_id == 0); @@ -2756,6 +2772,7 @@ void ui_progress_bar_start(const gchar *text) * * @since 0.16 **/ +GEANY_API_SYMBOL void ui_progress_bar_stop(void) { gtk_widget_hide(GTK_WIDGET(main_widgets.progressbar)); @@ -2837,6 +2854,7 @@ GtkWidget *ui_label_new_bold(const gchar *text) * the corresponding document pointer as @c user_data. * @warning You should check @c doc->is_valid in the callback. * @since 0.19 */ +GEANY_API_SYMBOL void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback) { ui_menu_add_document_items_sorted(menu, active, callback, NULL); @@ -2857,6 +2875,7 @@ void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback * @param compare_func is used to sort the list. Might be @c NULL to not sort the list. * @warning You should check @c doc->is_valid in the callback. * @since 0.21 */ +GEANY_API_SYMBOL void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active, GCallback callback, GCompareFunc compare_func) { @@ -2916,6 +2935,7 @@ void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active, * @param keyval A keyval. * @return @c TRUE if @a keyval is the one of the Enter/Return key values, otherwise @c FALSE. * @since 0.19 */ +GEANY_API_SYMBOL gboolean ui_is_keyval_enter_or_return(guint keyval) { return (keyval == GDK_Return || keyval == GDK_ISO_Enter|| keyval == GDK_KP_Enter); @@ -2928,6 +2948,7 @@ gboolean ui_is_keyval_enter_or_return(guint keyval) * @param default_value The default value in case the value could not be read. * @return The value for the property if it exists, otherwise the @a default_value. * @since 0.19 */ +GEANY_API_SYMBOL gint ui_get_gtk_settings_integer(const gchar *property_name, gint default_value) { if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT( @@ -3017,6 +3038,7 @@ void ui_focus_current_document(void) * @param stock_id stock_id to lookup e.g. @c GTK_STOCK_OPEN. * @return The label text for stock * @since Geany 1.22 */ +GEANY_API_SYMBOL const gchar *ui_lookup_stock_label(const gchar *stock_id) { GtkStockItem item;
Modified: src/utils.c 24 lines changed, 24 insertions(+), 0 deletions(-) =================================================================== @@ -32,6 +32,7 @@ #include "app.h" #include "dialogs.h" #include "document.h" +#include "pluginexport.h" #include "prefs.h" #include "sciwrappers.h" #include "support.h" @@ -69,6 +70,7 @@ * * @since 0.16 **/ +GEANY_API_SYMBOL void utils_open_browser(const gchar *uri) { #ifdef G_OS_WIN32 @@ -210,6 +212,7 @@ gboolean utils_is_opening_brace(gchar c, gboolean include_angles) * @return 0 if the file was successfully written, otherwise the @c errno of the * failed operation is returned. **/ +GEANY_API_SYMBOL gint utils_write_file(const gchar *filename, const gchar *text) { g_return_val_if_fail(filename != NULL, ENOENT); @@ -269,6 +272,7 @@ gint utils_write_file(const gchar *filename, const gchar *text) * @param size . * @return The tag name (newly allocated) or @c NULL if no opening tag was found. */ +GEANY_API_SYMBOL gchar *utils_find_open_xml_tag(const gchar sel[], gint size) { const gchar *cur, *begin; @@ -293,6 +297,7 @@ gchar *utils_find_open_xml_tag(const gchar sel[], gint size) * @param size . * @return pointer to '<' of the found opening tag within @a sel, or @c NULL if no opening tag was found. */ +GEANY_API_SYMBOL const gchar *utils_find_open_xml_tag_pos(const gchar sel[], gint size) { /* stolen from anjuta and modified */ @@ -500,6 +505,7 @@ static gchar *utf8_strdown(const gchar *str) * * @since 0.16 */ +GEANY_API_SYMBOL gint utils_str_casecmp(const gchar *s1, const gchar *s2) { gchar *tmp1, *tmp2; @@ -542,6 +548,7 @@ gint utils_str_casecmp(const gchar *s1, const gchar *s2) * @since 0.17 */ /* This following function is taken from Gedit. */ +GEANY_API_SYMBOL gchar *utils_str_middle_truncate(const gchar *string, guint truncate_length) { GString *truncated; @@ -591,6 +598,7 @@ gchar *utils_str_middle_truncate(const gchar *string, guint truncate_length) * * @return @c TRUE if @a a equals @a b, else @c FALSE. **/ +GEANY_API_SYMBOL gboolean utils_str_equal(const gchar *a, const gchar *b) { /* (taken from libexo from os-cillation) */ @@ -608,6 +616,7 @@ gboolean utils_str_equal(const gchar *a, const gchar *b) * * @return A newly-allocated string, should be freed when no longer needed. **/ +GEANY_API_SYMBOL gchar *utils_remove_ext_from_filename(const gchar *filename) { gchar *last_dot; @@ -726,6 +735,7 @@ gint utils_strpos(const gchar *haystack, const gchar *needle) * * @since 0.16 */ +GEANY_API_SYMBOL gchar *utils_get_date_time(const gchar *format, time_t *time_to_use) { const struct tm *tm; @@ -794,6 +804,7 @@ gchar *utils_get_initials(const gchar *name) * @return The value associated with @a key as an integer, or the given default value if the value * could not be retrieved. **/ +GEANY_API_SYMBOL gint utils_get_setting_integer(GKeyFile *config, const gchar *section, const gchar *key, const gint default_value) { @@ -824,6 +835,7 @@ gint utils_get_setting_integer(GKeyFile *config, const gchar *section, const gch * @return The value associated with @a key as a boolean, or the given default value if the value * could not be retrieved. **/ +GEANY_API_SYMBOL gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const gchar *key, const gboolean default_value) { @@ -854,6 +866,7 @@ gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const * @return A newly allocated string, either the value for @a key or a copy of the given * default value if it could not be retrieved. **/ +GEANY_API_SYMBOL gchar *utils_get_setting_string(GKeyFile *config, const gchar *section, const gchar *key, const gchar *default_value) { @@ -1247,6 +1260,7 @@ gboolean utils_wrap_string(gchar *string, gint wrapstart) * @return The converted string in locale encoding, or a copy of the input string if conversion * failed. Should be freed with g_free(). If @a utf8_text is @c NULL, @c NULL is returned. **/ +GEANY_API_SYMBOL gchar *utils_get_locale_from_utf8(const gchar *utf8_text) { #ifdef G_OS_WIN32 @@ -1275,6 +1289,7 @@ gchar *utils_get_locale_from_utf8(const gchar *utf8_text) * @return The converted string in UTF-8 encoding, or a copy of the input string if conversion * failed. Should be freed with g_free(). If @a locale_text is @c NULL, @c NULL is returned. **/ +GEANY_API_SYMBOL gchar *utils_get_utf8_from_locale(const gchar *locale_text) { #ifdef G_OS_WIN32 @@ -1364,6 +1379,7 @@ gchar **utils_strv_new(const gchar *first, ...) * @return 0 if the directory was successfully created, otherwise the @c errno of the * failed operation is returned. **/ +GEANY_API_SYMBOL gint utils_mkdir(const gchar *path, gboolean create_parent_dirs) { gint mode = 0700; @@ -1400,6 +1416,7 @@ gint utils_mkdir(const gchar *path, gboolean create_parent_dirs) * freed when no longer needed. * @see utils_get_file_list(). **/ +GEANY_API_SYMBOL GSList *utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean sort, GError **error) { GSList *list = NULL; @@ -1444,6 +1461,7 @@ GSList *utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean * freed when no longer needed. * @see utils_get_file_list_full(). **/ +GEANY_API_SYMBOL GSList *utils_get_file_list(const gchar *path, guint *length, GError **error) { GSList *list = utils_get_file_list_full(path, FALSE, TRUE, error); @@ -1531,6 +1549,7 @@ gint utils_string_replace(GString *str, gint pos, gint len, const gchar *replace * * @return Number of replacements made. **/ +GEANY_API_SYMBOL guint utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace) { guint count = 0; @@ -1564,6 +1583,7 @@ guint utils_string_replace_all(GString *haystack, const gchar *needle, const gch * * @since 0.16 */ +GEANY_API_SYMBOL guint utils_string_replace_first(GString *haystack, const gchar *needle, const gchar *replace) { gint pos = utils_string_find(haystack, 0, -1, needle); @@ -1648,6 +1668,7 @@ const gchar *utils_get_default_dir_utf8(void) * * @return @c TRUE on success, @c FALSE if an error was set. **/ +GEANY_API_SYMBOL gboolean utils_spawn_sync(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gchar **std_out, gchar **std_err, gint *exit_status, GError **error) @@ -1691,6 +1712,7 @@ gboolean utils_spawn_sync(const gchar *dir, gchar **argv, gchar **env, GSpawnFla * * @return @c TRUE on success, @c FALSE if an error was set. **/ +GEANY_API_SYMBOL gboolean utils_spawn_async(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, GPid *child_pid, GError **error) @@ -1859,6 +1881,7 @@ void utils_tidy_path(gchar *filename) * * @see @c g_strdelimit. **/ +GEANY_API_SYMBOL gchar *utils_str_remove_chars(gchar *string, const gchar *chars) { const gchar *r; @@ -1970,6 +1993,7 @@ static gboolean str_in_array(const gchar **haystack, const gchar *needle) * * @return The new environment array. **/ +GEANY_API_SYMBOL gchar **utils_copy_environment(const gchar **exclude_vars, const gchar *first_varname, ...) { gchar **result;
Modified: tagmanager/src/tm_source_file.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -34,6 +34,7 @@ #define LIBCTAGS_DEFINED #include "tm_source_file.h" #include "tm_tag.h" +#include "../src/pluginexport.h" /* for GEANY_API_SYMBOL */
static TMSourceFile *current_source_file = NULL; @@ -84,6 +85,7 @@ static char *realpath (const char *pathname, char *resolved_path) @param file_name The original file_name @return A newly allocated string containing the real path to the file. NULL if none is available. */ +GEANY_API_SYMBOL gchar *tm_get_real_path(const gchar *file_name) { if (file_name) @@ -195,6 +197,7 @@ static gboolean tm_source_file_init(TMSourceFile *source_file, const char *file_ * @param name Name of the used programming language, NULL for autodetection. * @return The created unparsed TMSourceFile object. * */ +GEANY_API_SYMBOL TMSourceFile *tm_source_file_new(const char *file_name, const char *name) { TMSourceFile *source_file = g_new(TMSourceFile, 1); @@ -225,6 +228,7 @@ static void tm_source_file_destroy(TMSourceFile *source_file) function the TMSourceFile has to be removed from the TMWorkspace. @param source_file The source file to free. */ +GEANY_API_SYMBOL void tm_source_file_free(TMSourceFile *source_file) { if (NULL != source_file)
Modified: tagmanager/src/tm_workspace.c 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -32,6 +32,7 @@
#include "tm_workspace.h" #include "tm_tag.h" +#include "../src/pluginexport.h" /* for GEANY_API_SYMBOL */
/* when changing, always keep the three sort criteria below in sync */ @@ -157,6 +158,7 @@ static void update_source_file(TMSourceFile *source_file, guchar* text_buf, /** Adds a source file to the workspace, parses it and updates the workspace tags. @param source_file The source file to add to the workspace. */ +GEANY_API_SYMBOL void tm_workspace_add_source_file(TMSourceFile *source_file) { g_return_if_fail(source_file != NULL); @@ -199,6 +201,7 @@ void tm_workspace_update_source_file_buffer(TMSourceFile *source_file, guchar* t pointer call tm_source_file_free() on it. @param source_file Pointer to the source file to be removed. */ +GEANY_API_SYMBOL void tm_workspace_remove_source_file(TMSourceFile *source_file) { guint i; @@ -266,6 +269,7 @@ static void tm_workspace_update(void) tm_workspace_update_source_file() separately for each of the files. @param source_files The source files to be added to the workspace. */ +GEANY_API_SYMBOL void tm_workspace_add_source_files(GPtrArray *source_files) { guint i; @@ -290,6 +294,7 @@ void tm_workspace_add_source_files(GPtrArray *source_files) call tm_source_file_free() on each of them. @param source_files The source files to be removed from the workspace. */ +GEANY_API_SYMBOL void tm_workspace_remove_source_files(GPtrArray *source_files) { guint i, j;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).