Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sat, 18 Oct 2014 16:13:45 UTC Commit: d42837f021105c1060f7b31ff527478fca2acb70 https://github.com/geany/geany/commit/d42837f021105c1060f7b31ff527478fca2acb...
Log Message: ----------- Merge pull request #351 from techee/guards
Protect private definitions by the GEANY_PRIVATE macro in headers
Modified Paths: -------------- src/app.h src/build.h src/dialogs.h src/document.h src/editor.h src/encodings.h src/filetypes.h src/geany.h src/highlighting.h src/keybindings.h src/main.h src/msgwindow.h src/navqueue.h src/prefs.h src/project.h src/sciwrappers.h src/search.h src/stash.h src/symbols.h src/templates.h src/toolbar.h src/ui_utils.h src/utils.h tagmanager/src/Makefile.am tagmanager/src/makefile.win32 tagmanager/src/tm_file_entry.h tagmanager/src/tm_source_file.h tagmanager/src/tm_tag.h tagmanager/src/tm_tagmanager.h tagmanager/src/tm_work_object.h tagmanager/src/tm_workspace.h wscript
Modified: src/app.h 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -53,8 +53,13 @@ typedef struct GeanyApp } GeanyApp;
+ +#ifdef GEANY_PRIVATE + extern GeanyApp *app;
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_APP_H */
Modified: src/build.h 89 lines changed, 47 insertions(+), 42 deletions(-) =================================================================== @@ -31,6 +31,51 @@
G_BEGIN_DECLS
+/** Groups of Build menu items. */ +typedef enum +{ + GEANY_GBG_FT, /* *< filetype items */ + GEANY_GBG_NON_FT, /* *< non filetype items.*/ + GEANY_GBG_EXEC, /* *< execute items */ + GEANY_GBG_COUNT /* *< count of groups. */ +} GeanyBuildGroup; + +/** Build menu item sources in increasing priority */ +typedef enum +{ + GEANY_BCS_DEF, /* *< Default values. */ + GEANY_BCS_FT, /* *< System filetype values. */ + GEANY_BCS_HOME_FT, /* *< Filetypes in ~/.config/geany/filedefs */ + GEANY_BCS_PREF, /* *< Preferences file ~/.config/geany/geany.conf */ + GEANY_BCS_PROJ_FT, /* *< Project file filetype command */ + GEANY_BCS_PROJ, /* *< Project file if open. */ + GEANY_BCS_COUNT /* *< Count of sources. */ +} GeanyBuildSource; + +/** The entries of a command for a menu item */ +typedef enum GeanyBuildCmdEntries +{ + GEANY_BC_LABEL, /* *< The menu item label, _ marks mnemonic */ + GEANY_BC_COMMAND, /* *< The command to run. */ + GEANY_BC_WORKING_DIR, /* *< The directory to run in */ + GEANY_BC_CMDENTRIES_COUNT /* *< Count of entries */ +} GeanyBuildCmdEntries; + +void build_activate_menu_item(const GeanyBuildGroup grp, const guint cmd); + +const gchar *build_get_current_menu_item(const GeanyBuildGroup grp, const guint cmd, + const GeanyBuildCmdEntries field); + +void build_remove_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd); + +void build_set_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, + const guint cmd, const GeanyBuildCmdEntries field, const gchar *value); + +guint build_get_group_count(const GeanyBuildGroup grp); + + +#ifdef GEANY_PRIVATE + /* Order is important (see GBO_TO_GBG, GBO_TO_CMD below) */ /* * Geany Known Build Commands. * These commands are named after their default use. @@ -47,15 +92,6 @@ typedef enum GEANY_GBO_COUNT /* *< count of how many */ } GeanyBuildType;
-/** Groups of Build menu items. */ -typedef enum -{ - GEANY_GBG_FT, /* *< filetype items */ - GEANY_GBG_NON_FT, /* *< non filetype items.*/ - GEANY_GBG_EXEC, /* *< execute items */ - GEANY_GBG_COUNT /* *< count of groups. */ -} GeanyBuildGroup; - /* include the fixed widgets in an array indexed by groups */ #define GBG_FIXED GEANY_GBG_COUNT
@@ -99,18 +135,6 @@ enum GeanyBuildFixedMenuItems GBF_COUNT };
-/** Build menu item sources in increasing priority */ -typedef enum -{ - GEANY_BCS_DEF, /* *< Default values. */ - GEANY_BCS_FT, /* *< System filetype values. */ - GEANY_BCS_HOME_FT, /* *< Filetypes in ~/.config/geany/filedefs */ - GEANY_BCS_PREF, /* *< Preferences file ~/.config/geany/geany.conf */ - GEANY_BCS_PROJ_FT, /* *< Project file filetype command */ - GEANY_BCS_PROJ, /* *< Project file if open. */ - GEANY_BCS_COUNT /* *< Count of sources. */ -} GeanyBuildSource; - typedef struct GeanyBuildInfo { GeanyBuildGroup grp; @@ -124,15 +148,6 @@ typedef struct GeanyBuildInfo
extern GeanyBuildInfo build_info;
-/** The entries of a command for a menu item */ -typedef enum GeanyBuildCmdEntries -{ - GEANY_BC_LABEL, /* *< The menu item label, _ marks mnemonic */ - GEANY_BC_COMMAND, /* *< The command to run. */ - GEANY_BC_WORKING_DIR, /* *< The directory to run in */ - GEANY_BC_CMDENTRIES_COUNT /* *< Count of entries */ -} GeanyBuildCmdEntries; - /* * The command for a menu item. */ typedef struct GeanyBuildCommand { @@ -184,18 +199,8 @@ void build_menu_update(GeanyDocument *doc);
void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
-void build_remove_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd); - GeanyBuildCommand *build_get_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const guint cmd);
-const gchar *build_get_current_menu_item(const GeanyBuildGroup grp, const guint cmd, - const GeanyBuildCmdEntries field); - -void build_set_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, - const guint cmd, const GeanyBuildCmdEntries field, const gchar *value); - -void build_activate_menu_item(const GeanyBuildGroup grp, const guint cmd); - BuildMenuItems *build_get_menu_items(gint filetype_idx);
/* load and store menu configuration */ @@ -205,10 +210,10 @@ void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src);
void build_set_group_count(GeanyBuildGroup grp, gint count);
-guint build_get_group_count(const GeanyBuildGroup grp); - gchar **build_get_regex(GeanyBuildGroup grp, GeanyFiletype *ft, guint *from);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_BUILD_H */
Modified: src/dialogs.h 29 lines changed, 17 insertions(+), 12 deletions(-) =================================================================== @@ -34,13 +34,26 @@
G_BEGIN_DECLS
+gboolean dialogs_show_question(const gchar *text, ...) G_GNUC_PRINTF (1, 2); + +void dialogs_show_msgbox(GtkMessageType type, const gchar *text, ...) G_GNUC_PRINTF (2, 3); + +gboolean dialogs_show_save_as(void); + +gboolean dialogs_show_input_numeric(const gchar *title, const gchar *label_text, + gdouble *value, gdouble min, gdouble max, gdouble step); + +gchar *dialogs_show_input(const gchar *title, GtkWindow *parent, + const gchar *label_text, const gchar *default_text); + + +#ifdef GEANY_PRIVATE + typedef void (*GeanyInputCallback)(const gchar *text, gpointer data);
void dialogs_show_open_file(void);
-gboolean dialogs_show_save_as(void); - gboolean dialogs_show_unsaved_file(GeanyDocument *doc);
void dialogs_show_open_font(void); @@ -49,22 +62,14 @@ void dialogs_show_word_count(void);
void dialogs_show_color(gchar *colour);
-gchar *dialogs_show_input(const gchar *title, GtkWindow *parent, - const gchar *label_text, const gchar *default_text); - gchar *dialogs_show_input_goto_line(const gchar *title, GtkWindow *parent, const gchar *label_text, const gchar *default_text);
GtkWidget *dialogs_show_input_persistent(const gchar *title, GtkWindow *parent, const gchar *label_text, const gchar *default_text, GeanyInputCallback input_cb, gpointer input_cb_data);
-gboolean dialogs_show_input_numeric(const gchar *title, const gchar *label_text, - gdouble *value, gdouble min, gdouble max, gdouble step); - void dialogs_show_file_properties(GeanyDocument *doc);
-gboolean dialogs_show_question(const gchar *text, ...) G_GNUC_PRINTF (1, 2); - gboolean dialogs_show_question_full(GtkWidget *parent, const gchar *yes_btn, const gchar *no_btn, const gchar *extra_text, const gchar *main_text, ...) G_GNUC_PRINTF (5, 6);
@@ -74,10 +79,10 @@ gint dialogs_show_prompt(GtkWidget *parent, const gchar *btn_3, GtkResponseType response_3, const gchar *extra_text, const gchar *main_text, ...) G_GNUC_PRINTF (9, 10);
-void dialogs_show_msgbox(GtkMessageType type, const gchar *text, ...) G_GNUC_PRINTF (2, 3); - void dialogs_show_msgbox_with_secondary(GtkMessageType type, const gchar *text, const gchar *secondary);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_DIALOGS_H */
Modified: src/document.h 90 lines changed, 47 insertions(+), 43 deletions(-) =================================================================== @@ -43,15 +43,6 @@
G_BEGIN_DECLS
-#if defined(G_OS_WIN32) -# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_CRLF -#elif defined(G_OS_UNIX) -# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_LF -#else -# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_CR -#endif - - /** File Prefs. */ typedef struct GeanyFilePrefs { @@ -76,8 +67,6 @@ typedef struct GeanyFilePrefs } GeanyFilePrefs;
-extern GeanyFilePrefs file_prefs; -
/** * Structure for representing an open tab with all its properties. @@ -129,7 +118,6 @@ GeanyDocument;
extern GPtrArray *documents_array;
- /** Wraps @ref documents_array so it can be used with C array syntax. * @warning Always check the returned document is valid (@c doc->is_valid). * @@ -179,11 +167,11 @@ extern GPtrArray *documents_array; (G_LIKELY((doc)->file_name != NULL) ? ((doc)->file_name) : GEANY_STRING_UNTITLED)
-/* These functions will replace the older functions. For now they have a documents_ prefix. */ - GeanyDocument* document_new_file(const gchar *filename, GeanyFiletype *ft, const gchar *text);
-GeanyDocument* document_new_file_if_non_open(void); +GeanyDocument *document_get_current(void); + +GeanyDocument* document_get_from_page(guint page_num);
GeanyDocument* document_find_by_filename(const gchar *utf8_filename);
@@ -191,34 +179,67 @@ GeanyDocument* document_find_by_real_path(const gchar *realname);
gboolean document_save_file(GeanyDocument *doc, gboolean force);
-gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname); - GeanyDocument* document_open_file(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc);
+void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft, + const gchar *forced_enc); + +gboolean document_remove_page(guint page_num); + gboolean document_reload_force(GeanyDocument *doc, const gchar *forced_enc);
-gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc); +void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding);
void document_set_text_changed(GeanyDocument *doc, gboolean changed);
void document_set_filetype(GeanyDocument *doc, GeanyFiletype *type);
-void document_reload_config(GeanyDocument *doc); +gboolean document_close(GeanyDocument *doc); + +GeanyDocument *document_index(gint idx); + +gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname);
void document_rename_file(GeanyDocument *doc, const gchar *new_filename);
-GeanyDocument *document_index(gint idx); +const GdkColor *document_get_status_color(GeanyDocument *doc);
-GeanyDocument *document_find_by_sci(ScintillaObject *sci); +gchar *document_get_basename_for_display(GeanyDocument *doc, gint length); + +gint document_get_notebook_page(GeanyDocument *doc); + +gint document_compare_by_display_name(gconstpointer a, gconstpointer b); + +gint document_compare_by_tab_order(gconstpointer a, gconstpointer b); + +gint document_compare_by_tab_order_reverse(gconstpointer a, gconstpointer b);
GeanyDocument *document_find_by_id(guint id);
-gint document_get_notebook_page(GeanyDocument *doc);
-GeanyDocument* document_get_from_page(guint page_num); +#ifdef GEANY_PRIVATE
-GeanyDocument *document_get_current(void); +#if defined(G_OS_WIN32) +# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_CRLF +#elif defined(G_OS_UNIX) +# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_LF +#else +# define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_CR +#endif + +extern GeanyFilePrefs file_prefs; + + +/* These functions will replace the older functions. For now they have a documents_ prefix. */ + +GeanyDocument* document_new_file_if_non_open(void); + +gboolean document_reload_prompt(GeanyDocument *doc, const gchar *forced_enc); + +void document_reload_config(GeanyDocument *doc); + +GeanyDocument *document_find_by_sci(ScintillaObject *sci);
void document_show_tab(GeanyDocument *doc);
@@ -226,12 +247,8 @@ void document_init_doclist(void);
void document_finalize(void);
-gboolean document_remove_page(guint page_num); - void document_try_focus(GeanyDocument *doc, GtkWidget *source_widget);
-gboolean document_close(GeanyDocument *doc); - gboolean document_account_for_unsaved(void);
gboolean document_close_all(void); @@ -241,9 +258,6 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
void document_open_file_list(const gchar *data, gsize length);
-void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft, - const gchar *forced_enc); - gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gboolean inc, gboolean backwards);
@@ -266,8 +280,6 @@ void document_update_tag_list_in_idle(GeanyDocument *doc);
void document_highlight_tags(GeanyDocument *doc);
-void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding); - gboolean document_check_disk_status(GeanyDocument *doc, gboolean force);
/* own Undo / Redo implementation to be able to undo / redo changes @@ -288,10 +300,6 @@ void document_update_tab_label(GeanyDocument *doc);
const gchar *document_get_status_widget_class(GeanyDocument *doc);
-const GdkColor *document_get_status_color(GeanyDocument *doc); - -gchar *document_get_basename_for_display(GeanyDocument *doc, gint length); - gboolean document_need_save_as(GeanyDocument *doc);
gboolean document_detect_indent_type(GeanyDocument *doc, GeanyIndentType *type_); @@ -300,16 +308,12 @@ gboolean document_detect_indent_width(GeanyDocument *doc, gint *width_);
void document_apply_indent_settings(GeanyDocument *doc);
-gint document_compare_by_display_name(gconstpointer a, gconstpointer b); - -gint document_compare_by_tab_order(gconstpointer a, gconstpointer b); - -gint document_compare_by_tab_order_reverse(gconstpointer a, gconstpointer b); - void document_grab_focus(GeanyDocument *doc);
GeanyDocument *document_clone(GeanyDocument *old_doc);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_DOCUMENT_H */
Modified: src/editor.h 113 lines changed, 57 insertions(+), 56 deletions(-) =================================================================== @@ -41,7 +41,6 @@ struct GeanyDocument; #define GEANY_WORDCHARS "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" #define GEANY_MAX_WORD_LENGTH 192
- /** Whether to use tabs, spaces or both to indent. */ typedef enum { @@ -60,24 +59,6 @@ typedef enum } GeanyAutoIndent;
-typedef enum -{ - GEANY_VIRTUAL_SPACE_DISABLED = 0, - GEANY_VIRTUAL_SPACE_SELECTION = 1, - GEANY_VIRTUAL_SPACE_ALWAYS = 3 -} -GeanyVirtualSpace; - - -/* Auto-close brackets/quotes */ -enum { - GEANY_AC_PARENTHESIS = 1, - GEANY_AC_CBRACKET = 2, - GEANY_AC_SBRACKET = 4, - GEANY_AC_SQUOTE = 8, - GEANY_AC_DQUOTE = 16 -}; - /** Geany indicator types, can be used with Editor indicator functions to highlight * text in the document. */ typedef enum @@ -109,7 +90,6 @@ typedef struct GeanyIndentPrefs } GeanyIndentPrefs;
- /** Default prefs when creating a new editor window. * Some of these can be overridden per document or per project. */ /* @warning Use @c editor_get_prefs() instead to include project overrides. */ @@ -157,9 +137,6 @@ typedef struct GeanyEditorPrefs } GeanyEditorPrefs;
-extern GeanyEditorPrefs editor_prefs; - - /** Editor-owned fields for each document. */ typedef struct GeanyEditor { @@ -175,6 +152,62 @@ typedef struct GeanyEditor } GeanyEditor;
+typedef struct SCNotification SCNotification; + + +const GeanyIndentPrefs *editor_get_indent_prefs(GeanyEditor *editor); + +ScintillaObject *editor_create_widget(GeanyEditor *editor); + +void editor_indicator_set_on_range(GeanyEditor *editor, gint indic, gint start, gint end); + +void editor_indicator_set_on_line(GeanyEditor *editor, gint indic, gint line); + +void editor_indicator_clear(GeanyEditor *editor, gint indic); + +void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type); + +gchar *editor_get_word_at_pos(GeanyEditor *editor, gint pos, const gchar *wordchars); + +const gchar *editor_get_eol_char_name(GeanyEditor *editor); + +gint editor_get_eol_char_len(GeanyEditor *editor); + +const gchar *editor_get_eol_char(GeanyEditor *editor); + +void editor_insert_text_block(GeanyEditor *editor, const gchar *text, + gint insert_pos, gint cursor_index, + gint newline_indent_size, gboolean replace_newlines); + +gint editor_get_eol_char_mode(GeanyEditor *editor); + +gboolean editor_goto_pos(GeanyEditor *editor, gint pos, gboolean mark); + +const gchar *editor_find_snippet(GeanyEditor *editor, const gchar *snippet_name); + +void editor_insert_snippet(GeanyEditor *editor, gint pos, const gchar *snippet); + + +#ifdef GEANY_PRIVATE + +extern GeanyEditorPrefs editor_prefs; + +typedef enum +{ + GEANY_VIRTUAL_SPACE_DISABLED = 0, + GEANY_VIRTUAL_SPACE_SELECTION = 1, + GEANY_VIRTUAL_SPACE_ALWAYS = 3 +} +GeanyVirtualSpace; + +/* Auto-close brackets/quotes */ +enum { + GEANY_AC_PARENTHESIS = 1, + GEANY_AC_CBRACKET = 2, + GEANY_AC_SBRACKET = 4, + GEANY_AC_SQUOTE = 8, + GEANY_AC_DQUOTE = 16 +};
typedef struct { @@ -184,8 +217,6 @@ typedef struct
extern EditorInfo editor_info;
-typedef struct SCNotification SCNotification; -
void editor_init(void);
@@ -193,8 +224,6 @@ GeanyEditor *editor_create(struct GeanyDocument *doc);
void editor_destroy(GeanyEditor *editor);
-ScintillaObject *editor_create_widget(GeanyEditor *editor); - void editor_sci_notify_cb(GtkWidget *widget, gint scn, gpointer scnt, gpointer data);
gboolean editor_start_auto_complete(GeanyEditor *editor, gint pos, gboolean force); @@ -248,8 +277,6 @@ void editor_find_current_word(GeanyEditor *editor, gint pos, gchar *word, gsize
void editor_find_current_word_sciwc(GeanyEditor *editor, gint pos, gchar *word, gsize wordlen);
-gchar *editor_get_word_at_pos(GeanyEditor *editor, gint pos, const gchar *wordchars); - gchar *editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word, const gchar *wordchars);
@@ -264,22 +291,8 @@ void editor_select_indent_block(GeanyEditor *editor);
void editor_set_font(GeanyEditor *editor, const gchar *font);
-void editor_indicator_set_on_line(GeanyEditor *editor, gint indic, gint line); - void editor_indicator_clear_errors(GeanyEditor *editor);
-void editor_indicator_set_on_range(GeanyEditor *editor, gint indic, gint start, gint end); - -void editor_indicator_clear(GeanyEditor *editor, gint indic); - -gint editor_get_eol_char_mode(GeanyEditor *editor); - -const gchar *editor_get_eol_char_name(GeanyEditor *editor); - -gint editor_get_eol_char_len(GeanyEditor *editor); - -const gchar *editor_get_eol_char(GeanyEditor *editor); - void editor_fold_all(GeanyEditor *editor);
void editor_unfold_all(GeanyEditor *editor); @@ -296,18 +309,12 @@ void editor_ensure_final_newline(GeanyEditor *editor);
void editor_insert_color(GeanyEditor *editor, const gchar *colour);
-const GeanyIndentPrefs *editor_get_indent_prefs(GeanyEditor *editor); - -void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type); - void editor_set_indent_width(GeanyEditor *editor, gint width);
void editor_set_indent(GeanyEditor *editor, GeanyIndentType type, gint width);
void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap);
-gboolean editor_goto_pos(GeanyEditor *editor, gint pos, gboolean mark); - gboolean editor_goto_line(GeanyEditor *editor, gint line_no, gint offset);
void editor_set_indentation_guides(GeanyEditor *editor); @@ -316,15 +323,9 @@ void editor_apply_update_prefs(GeanyEditor *editor);
gchar *editor_get_calltip_text(GeanyEditor *editor, const TMTag *tag);
-void editor_insert_text_block(GeanyEditor *editor, const gchar *text, - gint insert_pos, gint cursor_index, - gint newline_indent_size, gboolean replace_newlines); - void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers);
-const gchar *editor_find_snippet(GeanyEditor *editor, const gchar *snippet_name); - -void editor_insert_snippet(GeanyEditor *editor, gint pos, const gchar *snippet); +#endif /* GEANY_PRIVATE */
G_END_DECLS
Modified: src/encodings.h 105 lines changed, 55 insertions(+), 50 deletions(-) =================================================================== @@ -53,56 +53,6 @@ typedef enum GEANY_ENCODING_GROUPS_MAX } GeanyEncodingGroup;
- -/** Structure to represent an encoding to be used in Geany. */ -typedef struct -{ - /** The index of the encoding, must be one of GeanyEncodingIndex. */ - gint idx; - /** Internally used member for grouping */ - gint order; - /** Internally used member for grouping */ - GeanyEncodingGroup group; - /** String representation of the encoding, e.g. "ISO-8859-3" */ - const gchar *charset; - /** Translatable and descriptive name of the encoding, e.g. "South European" */ - const gchar *name; -} GeanyEncoding; - - -const GeanyEncoding* encodings_get_from_charset(const gchar *charset); -const GeanyEncoding* encodings_get_from_index(gint idx); - -gchar* encodings_to_string(const GeanyEncoding* enc); -const gchar* encodings_get_charset(const GeanyEncoding* enc); -const gchar* encodings_get_charset_from_index(gint idx); - -void encodings_select_radio_item(const gchar *charset); - -void encodings_init(void); -void encodings_finalize(void); - -GtkTreeStore *encodings_encoding_store_new(gboolean has_detect); - -gint encodings_encoding_store_get_encoding(GtkTreeStore *store, GtkTreeIter *iter); - -gboolean encodings_encoding_store_get_iter(GtkTreeStore *store, GtkTreeIter *iter, gint enc); - -void encodings_encoding_store_cell_data_func(GtkCellLayout *cell_layout, GtkCellRenderer *cell, - GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); - -gchar *encodings_convert_to_utf8(const gchar *buffer, gssize size, gchar **used_encoding); - -/* Converts a string from the given charset to UTF-8. - * If fast is set, no further checks are performed. */ -gchar *encodings_convert_to_utf8_from_charset(const gchar *buffer, gssize size, - const gchar *charset, gboolean fast); - -gboolean encodings_is_unicode_charset(const gchar *string); - -gboolean encodings_convert_to_utf8_auto(gchar **buf, gsize *size, const gchar *forced_enc, - gchar **used_encoding, gboolean *has_bom, gboolean *partial); - /* * The original versions of the following tables are taken from profterm * @@ -191,6 +141,59 @@ typedef enum GEANY_ENCODINGS_MAX } GeanyEncodingIndex;
+/** Structure to represent an encoding to be used in Geany. */ +typedef struct +{ + /** The index of the encoding, must be one of GeanyEncodingIndex. */ + gint idx; + /** Internally used member for grouping */ + gint order; + /** Internally used member for grouping */ + GeanyEncodingGroup group; + /** String representation of the encoding, e.g. "ISO-8859-3" */ + const gchar *charset; + /** Translatable and descriptive name of the encoding, e.g. "South European" */ + const gchar *name; +} GeanyEncoding; + + +gchar *encodings_convert_to_utf8(const gchar *buffer, gssize size, gchar **used_encoding); + +/* Converts a string from the given charset to UTF-8. + * If fast is set, no further checks are performed. */ +gchar *encodings_convert_to_utf8_from_charset(const gchar *buffer, gssize size, + const gchar *charset, gboolean fast); + +const gchar* encodings_get_charset_from_index(gint idx); + + +#ifdef GEANY_PRIVATE + +const GeanyEncoding* encodings_get_from_charset(const gchar *charset); +const GeanyEncoding* encodings_get_from_index(gint idx); + +gchar* encodings_to_string(const GeanyEncoding* enc); +const gchar* encodings_get_charset(const GeanyEncoding* enc); + +void encodings_select_radio_item(const gchar *charset); + +void encodings_init(void); +void encodings_finalize(void); + +GtkTreeStore *encodings_encoding_store_new(gboolean has_detect); + +gint encodings_encoding_store_get_encoding(GtkTreeStore *store, GtkTreeIter *iter); + +gboolean encodings_encoding_store_get_iter(GtkTreeStore *store, GtkTreeIter *iter, gint enc); + +void encodings_encoding_store_cell_data_func(GtkCellLayout *cell_layout, GtkCellRenderer *cell, + GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); + +gboolean encodings_is_unicode_charset(const gchar *string); + +gboolean encodings_convert_to_utf8_auto(gchar **buf, gsize *size, const gchar *forced_enc, + gchar **used_encoding, gboolean *has_bom, gboolean *partial); +
extern GeanyEncoding encodings[GEANY_ENCODINGS_MAX];
@@ -199,6 +202,8 @@ GeanyEncodingIndex encodings_scan_unicode_bom(const gchar *string, gsize len, gu
GeanyEncodingIndex encodings_get_idx_from_charset(const gchar *charset);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_ENCODINGS_H */
Modified: src/filetypes.h 24 lines changed, 15 insertions(+), 9 deletions(-) =================================================================== @@ -162,11 +162,23 @@ extern GPtrArray *filetypes_array; * @see filetypes_index(). */ #define filetypes ((GeanyFiletype **)GEANY(filetypes_array)->pdata)
-extern GSList *filetypes_by_title;
+GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename);
GeanyFiletype *filetypes_lookup_by_name(const gchar *name);
+GeanyFiletype *filetypes_index(gint idx); + +const gchar *filetypes_get_display_name(GeanyFiletype *ft); + +const GSList *filetypes_get_sorted_by_name(void); + + +#ifdef GEANY_PRIVATE + +extern GSList *filetypes_by_title; + + GeanyFiletype *filetypes_find(GCompareFunc predicate, gpointer user_data);
@@ -179,18 +191,10 @@ void filetypes_reload_extensions(void); void filetypes_reload(void);
-GeanyFiletype *filetypes_index(gint idx); - -const GSList *filetypes_get_sorted_by_name(void); - -const gchar *filetypes_get_display_name(GeanyFiletype *ft); - GeanyFiletype *filetypes_detect_from_document(struct GeanyDocument *doc);
GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename);
-GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename); - void filetypes_free_types(void);
void filetypes_load_config(guint ft_id, gboolean reload); @@ -211,6 +215,8 @@ gboolean filetypes_parse_error_message(GeanyFiletype *ft, const gchar *message, gboolean filetype_get_comment_open_close(const GeanyFiletype *ft, gboolean single_first, const gchar **co, const gchar **cc);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_FILETYPES_H */
Modified: src/geany.h 13 lines changed, 8 insertions(+), 5 deletions(-) =================================================================== @@ -51,11 +51,6 @@ G_BEGIN_DECLS #define GEANY_WINDOW_DEFAULT_WIDTH 900 #define GEANY_WINDOW_DEFAULT_HEIGHT 600
- -/* prototype is here so that all files can use it. */ -void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2); - - #ifndef G_GNUC_WARN_UNUSED_RESULT #define G_GNUC_WARN_UNUSED_RESULT #endif @@ -65,6 +60,14 @@ void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2); # define GEANY(symbol_name) symbol_name #endif
+ +#ifdef GEANY_PRIVATE + +/* prototype is here so that all files can use it. */ +void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2); + +#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_H */
Modified: src/highlighting.h 15 lines changed, 10 insertions(+), 5 deletions(-) =================================================================== @@ -46,20 +46,25 @@ typedef struct GeanyLexerStyle GeanyLexerStyle;
-void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *configh); - -void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft); - const GeanyLexerStyle *highlighting_get_style(gint ft_id, gint style_id);
-void highlighting_free_styles(void); +void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft);
gboolean highlighting_is_string_style(gint lexer, gint style); gboolean highlighting_is_comment_style(gint lexer, gint style); gboolean highlighting_is_code_style(gint lexer, gint style);
+ +#ifdef GEANY_PRIVATE + +void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *configh); + +void highlighting_free_styles(void); + void highlighting_show_color_scheme_dialog(void);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_HIGHLIGHTING_H */
Modified: src/keybindings.h 27 lines changed, 16 insertions(+), 11 deletions(-) =================================================================== @@ -60,9 +60,6 @@ typedef gboolean (*GeanyKeyGroupCallback) (guint key_id); typedef struct GeanyKeyGroup GeanyKeyGroup;
-extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */ - - /* Note: we don't need to break the plugin ABI when appending keybinding or keygroup IDs, * just make sure to insert immediately before the _COUNT item, so * the existing enum values stay the same. */ @@ -240,6 +237,20 @@ enum GeanyKeyBindingID };
+void keybindings_send_command(guint group_id, guint key_id); + +GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id, + GeanyKeyCallback callback, guint key, GdkModifierType mod, + const gchar *name, const gchar *label, GtkWidget *menu_item); + +GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id); + + +#ifdef GEANY_PRIVATE + +extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */ + + void keybindings_init(void);
void keybindings_load_keyfile(void); @@ -253,18 +264,10 @@ GeanyKeyGroup *keybindings_set_group(GeanyKeyGroup *group, const gchar *section_
void keybindings_free_group(GeanyKeyGroup *group);
-GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id, - GeanyKeyCallback callback, guint key, GdkModifierType mod, - const gchar *name, const gchar *label, GtkWidget *menu_item); - -GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id); - gchar *keybindings_get_label(GeanyKeyBinding *kb);
void keybindings_update_combo(GeanyKeyBinding *kb, guint key, GdkModifierType mods);
-void keybindings_send_command(guint group_id, guint key_id); - GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id);
/* just write the content of the keys array to the config file */ @@ -276,6 +279,8 @@ gboolean keybindings_check_event(GdkEventKey *ev, GeanyKeyBinding *kb);
void keybindings_dialog_show_prefs_scroll(const gchar *name);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_KEYBINDINGS_H */
Modified: src/main.h 17 lines changed, 11 insertions(+), 6 deletions(-) =================================================================== @@ -27,6 +27,15 @@
G_BEGIN_DECLS
+void main_reload_configuration(void); + +void main_locale_init(const gchar *locale_dir, const gchar *gettext_package); + +gboolean main_is_realized(void); + + +#ifdef GEANY_PRIVATE + typedef struct { gboolean new_instance; @@ -64,14 +73,10 @@ gboolean main_quit(void);
gboolean main_handle_filename(const gchar *locale_filename);
-void main_reload_configuration(void); - -void main_locale_init(const gchar *locale_dir, const gchar *gettext_package); - -gboolean main_is_realized(void); - void main_load_project_from_command_line(const gchar *locale_filename, gboolean use_session);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_MAIN_H */
Modified: src/msgwindow.h 30 lines changed, 17 insertions(+), 13 deletions(-) =================================================================== @@ -52,6 +52,21 @@ typedef enum } MessageWindowTabNum;
+void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2); + +void msgwin_compiler_add(gint msg_color, const gchar *format, ...) G_GNUC_PRINTF (2, 3); + +void msgwin_msg_add(gint msg_color, gint line, GeanyDocument *doc, const gchar *format, ...) + G_GNUC_PRINTF (4, 5); + +void msgwin_clear_tab(gint tabnum); + +void msgwin_switch_tab(gint tabnum, gboolean show); + +void msgwin_set_messages_dir(const gchar *messages_dir); + + +#ifdef GEANY_PRIVATE
typedef struct { @@ -78,25 +93,12 @@ void msgwin_finalize(void);
void msgwin_show_hide(gboolean show);
-void msgwin_switch_tab(gint tabnum, gboolean show); - -void msgwin_clear_tab(gint tabnum); - -void msgwin_msg_add(gint msg_color, gint line, GeanyDocument *doc, const gchar *format, ...) - G_GNUC_PRINTF (4, 5); - void msgwin_msg_add_string(gint msg_color, gint line, GeanyDocument *doc, const gchar *string);
-void msgwin_compiler_add(gint msg_color, const gchar *format, ...) G_GNUC_PRINTF (2, 3); - void msgwin_compiler_add_string(gint msg_color, const gchar *msg);
-void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2); - void msgwin_show_hide_tabs(void);
-void msgwin_set_messages_dir(const gchar *messages_dir); -
void msgwin_menu_add_common_items(GtkMenu *menu);
@@ -107,6 +109,8 @@ void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir,
gboolean msgwin_goto_messages_file_line(gboolean focus_editor);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_MSGWINDOW_H */
Modified: src/navqueue.h 9 lines changed, 7 insertions(+), 2 deletions(-) =================================================================== @@ -35,18 +35,23 @@
G_BEGIN_DECLS
+gboolean navqueue_goto_line(GeanyDocument *old_doc, GeanyDocument *new_doc, gint line); + + +#ifdef GEANY_PRIVATE + void navqueue_init(void);
void navqueue_free(void);
void navqueue_remove_file(const gchar *filename);
-gboolean navqueue_goto_line(GeanyDocument *old_doc, GeanyDocument *new_doc, gint line); - void navqueue_go_back(void);
void navqueue_go_forward(void);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_NAVQUEUE_H */
Modified: src/prefs.h 11 lines changed, 7 insertions(+), 4 deletions(-) =================================================================== @@ -42,9 +42,6 @@ typedef struct GeanyPrefs } GeanyPrefs;
-extern GeanyPrefs prefs; - - /** Tools preferences */ typedef struct GeanyToolPrefs { @@ -55,13 +52,19 @@ typedef struct GeanyToolPrefs } GeanyToolPrefs;
-extern GeanyToolPrefs tool_prefs;
+#ifdef GEANY_PRIVATE + +extern GeanyPrefs prefs; + +extern GeanyToolPrefs tool_prefs;
void prefs_show_dialog(void);
void prefs_kb_search_name(const gchar *search);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_PREFS_H */
Modified: src/project.h 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -47,6 +47,8 @@ typedef struct GeanyProject GeanyProject;
+#ifdef GEANY_PRIVATE + typedef struct ProjectPrefs { gchar *session_file; @@ -92,6 +94,8 @@ void project_setup_prefs(void);
void project_apply_prefs(void);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_PROJECT_H */
Modified: src/sciwrappers.h 124 lines changed, 71 insertions(+), 53 deletions(-) =================================================================== @@ -29,21 +29,86 @@
G_BEGIN_DECLS
+void sci_set_text (ScintillaObject *sci, const gchar *text); +gboolean sci_has_selection (ScintillaObject *sci); +void sci_end_undo_action (ScintillaObject *sci); +void sci_start_undo_action (ScintillaObject *sci); + +void sci_set_marker_at_line (ScintillaObject *sci, gint line_number, gint marker); +void sci_delete_marker_at_line (ScintillaObject *sci, gint line_number, gint marker); +gboolean sci_is_marker_set_at_line (ScintillaObject *sci, gint line, gint marker); + +gint sci_get_col_from_position (ScintillaObject *sci, gint position); +gint sci_get_line_from_position (ScintillaObject *sci, gint position); +gint sci_get_position_from_line (ScintillaObject *sci, gint line); +gint sci_get_current_position (ScintillaObject *sci); +void sci_set_current_position (ScintillaObject *sci, gint position, gboolean scroll_to_caret); + +gint sci_get_selection_start (ScintillaObject *sci); +gint sci_get_selection_end (ScintillaObject *sci); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); +gint sci_get_selection_mode (ScintillaObject *sci); +void sci_set_selection_mode (ScintillaObject *sci, gint mode); +void sci_set_selection_start (ScintillaObject *sci, gint position); +void sci_set_selection_end (ScintillaObject *sci, gint position); + +gint sci_get_length (ScintillaObject *sci); +void sci_get_text (ScintillaObject *sci, gint len, gchar *text); +gchar* sci_get_contents (ScintillaObject *sci, gint buffer_len); +void sci_get_selected_text (ScintillaObject *sci, gchar *text); +gint sci_get_selected_text_length(ScintillaObject *sci); +gchar* sci_get_selection_contents (ScintillaObject *sci); +gchar* sci_get_line (ScintillaObject *sci, gint line_num); +gint sci_get_line_length (ScintillaObject *sci, gint line); +gint sci_get_line_count (ScintillaObject *sci); + +gint sci_get_line_end_position (ScintillaObject *sci, gint line); + +gboolean sci_get_line_is_visible (ScintillaObject *sci, gint line); +void sci_ensure_line_is_visible (ScintillaObject *sci, gint line); + +gint sci_get_tab_width (ScintillaObject *sci); +gchar sci_get_char_at (ScintillaObject *sci, gint pos); + +void sci_scroll_caret (ScintillaObject *sci); +gint sci_find_text (ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf); +void sci_set_font (ScintillaObject *sci, gint style, const gchar *font, gint size); +void sci_goto_line (ScintillaObject *sci, gint line, gboolean unfold); +gint sci_get_style_at (ScintillaObject *sci, gint position); +void sci_get_text_range (ScintillaObject *sci, gint start, gint end, gchar *text); +gchar* sci_get_contents_range (ScintillaObject *sci, gint start, gint end); +void sci_insert_text (ScintillaObject *sci, gint pos, const gchar *text); + +void sci_set_target_start (ScintillaObject *sci, gint start); +void sci_set_target_end (ScintillaObject *sci, gint end); +gint sci_replace_target (ScintillaObject *sci, const gchar *text, gboolean regex); + +gint sci_get_lexer (ScintillaObject *sci); +void sci_send_command (ScintillaObject *sci, gint cmd); + +gint sci_get_current_line (ScintillaObject *sci); + +void sci_indicator_set (ScintillaObject *sci, gint indic); +void sci_indicator_clear (ScintillaObject *sci, gint pos, gint len); + +void sci_set_line_indentation (ScintillaObject *sci, gint line, gint indent); +gint sci_get_line_indentation (ScintillaObject *sci, gint line); +gint sci_find_matching_brace (ScintillaObject *sci, gint pos); + + +#ifdef GEANY_PRIVATE + gchar* sci_get_string (ScintillaObject *sci, guint msg, gulong wParam);
void sci_set_line_numbers (ScintillaObject *sci, gboolean set); void sci_set_mark_long_lines (ScintillaObject *sci, gint type, gint column, const gchar *color);
-void sci_set_text (ScintillaObject *sci, const gchar *text); void sci_add_text (ScintillaObject *sci, const gchar *text); gboolean sci_can_redo (ScintillaObject *sci); gboolean sci_can_undo (ScintillaObject *sci); -gboolean sci_has_selection (ScintillaObject *sci); void sci_undo (ScintillaObject *sci); void sci_redo (ScintillaObject *sci); void sci_empty_undo_buffer (ScintillaObject *sci); -void sci_end_undo_action (ScintillaObject *sci); -void sci_start_undo_action (ScintillaObject *sci); gboolean sci_is_modified (ScintillaObject *sci);
void sci_set_visible_eols (ScintillaObject *sci, gboolean set); @@ -55,19 +120,11 @@ void sci_set_eol_mode (ScintillaObject *sci, gint eolmode); void sci_zoom_in (ScintillaObject *sci); void sci_zoom_out (ScintillaObject *sci); void sci_zoom_off (ScintillaObject *sci); -void sci_set_marker_at_line (ScintillaObject *sci, gint line_number, gint marker); -void sci_delete_marker_at_line (ScintillaObject *sci, gint line_number, gint marker); void sci_toggle_marker_at_line (ScintillaObject *sci, gint line, gint marker); -gboolean sci_is_marker_set_at_line (ScintillaObject *sci, gint line, gint marker); gint sci_marker_next (ScintillaObject *sci, gint line, gint marker_mask, gboolean wrap); gint sci_marker_previous (ScintillaObject *sci, gint line, gint marker_mask, gboolean wrap);
-gint sci_get_col_from_position (ScintillaObject *sci, gint position); gint sci_get_position_from_col (ScintillaObject *sci, gint line, gint col); -gint sci_get_line_from_position (ScintillaObject *sci, gint position); -gint sci_get_position_from_line (ScintillaObject *sci, gint line); -gint sci_get_current_position (ScintillaObject *sci); -void sci_set_current_position (ScintillaObject *sci, gint position, gboolean scroll_to_caret); void sci_set_current_line (ScintillaObject *sci, gint line);
void sci_cut (ScintillaObject *sci); @@ -75,35 +132,15 @@ void sci_copy (ScintillaObject *sci); void sci_paste (ScintillaObject *sci); void sci_clear (ScintillaObject *sci);
-gint sci_get_selection_start (ScintillaObject *sci); -gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); -gint sci_get_selection_mode (ScintillaObject *sci); -void sci_set_selection_mode (ScintillaObject *sci, gint mode); gint sci_get_pos_at_line_sel_start(ScintillaObject*sci, gint line); gint sci_get_pos_at_line_sel_end (ScintillaObject *sci, gint line); -void sci_set_selection_start (ScintillaObject *sci, gint position); -void sci_set_selection_end (ScintillaObject *sci, gint position); void sci_set_selection (ScintillaObject *sci, gint anchorPos, gint currentPos);
-gint sci_get_length (ScintillaObject *sci); -void sci_get_text (ScintillaObject *sci, gint len, gchar *text); -gchar* sci_get_contents (ScintillaObject *sci, gint buffer_len); -void sci_get_selected_text (ScintillaObject *sci, gchar *text); -gint sci_get_selected_text_length(ScintillaObject *sci); -gchar* sci_get_selection_contents (ScintillaObject *sci); -gchar* sci_get_line (ScintillaObject *sci, gint line_num); -gint sci_get_line_length (ScintillaObject *sci, gint line); -gint sci_get_line_count (ScintillaObject *sci); gint sci_get_position_from_xy (ScintillaObject *sci, gint x, gint y, gboolean nearby);
void sci_set_undo_collection (ScintillaObject *sci, gboolean set);
-gint sci_get_line_end_position (ScintillaObject *sci, gint line); - void sci_toggle_fold (ScintillaObject *sci, gint line); -gboolean sci_get_line_is_visible (ScintillaObject *sci, gint line); -void sci_ensure_line_is_visible (ScintillaObject *sci, gint line); gint sci_get_fold_level (ScintillaObject *sci, gint line); gint sci_get_fold_parent (ScintillaObject *sci, gint start_line);
@@ -114,61 +151,40 @@ void sci_colourise (ScintillaObject *sci, gint start, gint end); void sci_clear_all (ScintillaObject *sci); gint sci_get_end_styled (ScintillaObject *sci); void sci_set_tab_width (ScintillaObject *sci, gint width); -gint sci_get_tab_width (ScintillaObject *sci); -gchar sci_get_char_at (ScintillaObject *sci, gint pos); void sci_set_savepoint (ScintillaObject *sci); void sci_set_indentation_guides (ScintillaObject *sci, gint mode); void sci_use_popup (ScintillaObject *sci, gboolean enable); void sci_goto_pos (ScintillaObject *sci, gint pos, gboolean unfold); void sci_set_search_anchor (ScintillaObject *sci); void sci_set_anchor (ScintillaObject *sci, gint pos); -void sci_scroll_caret (ScintillaObject *sci); void sci_scroll_lines (ScintillaObject *sci, gint lines); void sci_scroll_columns (ScintillaObject *sci, gint columns); gint sci_search_next (ScintillaObject *sci, gint flags, const gchar *text); gint sci_search_prev (ScintillaObject *sci, gint flags, const gchar *text); -gint sci_find_text (ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf); -void sci_set_font (ScintillaObject *sci, gint style, const gchar *font, gint size); -void sci_goto_line (ScintillaObject *sci, gint line, gboolean unfold); void sci_marker_delete_all (ScintillaObject *sci, gint marker); -gint sci_get_style_at (ScintillaObject *sci, gint position); void sci_set_symbol_margin (ScintillaObject *sci, gboolean set); void sci_set_codepage (ScintillaObject *sci, gint cp); void sci_clear_cmdkey (ScintillaObject *sci, gint key); void sci_assign_cmdkey (ScintillaObject *sci, gint key, gint command); -void sci_get_text_range (ScintillaObject *sci, gint start, gint end, gchar *text); -gchar* sci_get_contents_range (ScintillaObject *sci, gint start, gint end); void sci_selection_duplicate (ScintillaObject *sci); void sci_line_duplicate (ScintillaObject *sci); -void sci_insert_text (ScintillaObject *sci, gint pos, const gchar *text);
void sci_target_from_selection (ScintillaObject *sci); -void sci_set_target_start (ScintillaObject *sci, gint start); -void sci_set_target_end (ScintillaObject *sci, gint end); gint sci_get_target_end (ScintillaObject *sci); -gint sci_replace_target (ScintillaObject *sci, const gchar *text, gboolean regex);
void sci_set_keywords (ScintillaObject *sci, guint k, const gchar *text); -gint sci_get_lexer (ScintillaObject *sci); void sci_set_lexer (ScintillaObject *sci, guint lexer_id); void sci_set_readonly (ScintillaObject *sci, gboolean readonly); gint sci_get_zoom (ScintillaObject *sci); -void sci_send_command (ScintillaObject *sci, gint cmd);
-gint sci_get_current_line (ScintillaObject *sci); gint sci_get_lines_selected (ScintillaObject *sci); gint sci_get_first_visible_line (ScintillaObject *sci);
-void sci_indicator_set (ScintillaObject *sci, gint indic); void sci_indicator_fill (ScintillaObject *sci, gint pos, gint len); -void sci_indicator_clear (ScintillaObject *sci, gint pos, gint len);
void sci_select_all (ScintillaObject *sci); gint sci_get_line_indent_position(ScintillaObject *sci, gint line); -void sci_set_line_indentation (ScintillaObject *sci, gint line, gint indent); -gint sci_get_line_indentation (ScintillaObject *sci, gint line); void sci_set_autoc_max_height (ScintillaObject *sci, gint val); -gint sci_find_matching_brace (ScintillaObject *sci, gint pos);
gint sci_get_overtype (ScintillaObject *sci); void sci_set_tab_indents (ScintillaObject *sci, gboolean set); @@ -192,6 +208,8 @@ gint sci_text_width (ScintillaObject *sci, gint styleNumber, const gchar * void sci_move_selected_lines_down (ScintillaObject *sci); void sci_move_selected_lines_up (ScintillaObject *sci);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_SCI_WRAPPERS_H */
Modified: src/search.h 56 lines changed, 30 insertions(+), 26 deletions(-) =================================================================== @@ -33,10 +33,6 @@
G_BEGIN_DECLS
-struct GeanyDocument; /* document.h includes this header */ -struct _ScintillaObject; -struct Sci_TextToFind; - typedef enum GeanyFindFlags { GEANY_FIND_MATCHCASE = 1 << 0, @@ -47,23 +43,6 @@ typedef enum GeanyFindFlags } GeanyFindFlags;
-/* the flags given in the search dialog for "find next", also used by the search bar */ -typedef struct GeanySearchData -{ - gchar *text; - GeanyFindFlags flags; - gboolean backwards; - /* set to TRUE when text was set by a search bar callback to keep track of - * search bar background colour */ - gboolean search_bar; - /* text as it was entered by user */ - gchar *original_text; -} -GeanySearchData; - -extern GeanySearchData search_data; - - enum GeanyFindSelOptions { GEANY_FIND_SEL_CURRENT_WORD, @@ -83,9 +62,6 @@ typedef struct GeanySearchPrefs } GeanySearchPrefs;
-extern GeanySearchPrefs search_prefs; - - typedef struct GeanyMatchInfo { GeanyFindFlags flags; @@ -101,6 +77,34 @@ typedef struct GeanyMatchInfo } GeanyMatchInfo;
+void search_show_find_in_files_dialog(const gchar *dir); + + +#ifdef GEANY_PRIVATE + +struct GeanyDocument; /* document.h includes this header */ +struct _ScintillaObject; +struct Sci_TextToFind; + + +/* the flags given in the search dialog for "find next", also used by the search bar */ +typedef struct GeanySearchData +{ + gchar *text; + GeanyFindFlags flags; + gboolean backwards; + /* set to TRUE when text was set by a search bar callback to keep track of + * search bar background colour */ + gboolean search_bar; + /* text as it was entered by user */ + gchar *original_text; +} +GeanySearchData; + +extern GeanySearchData search_data; + +extern GeanySearchPrefs search_prefs; +
void search_init(void);
@@ -110,8 +114,6 @@ void search_show_find_dialog(void);
void search_show_replace_dialog(void);
-void search_show_find_in_files_dialog(const gchar *dir); - void search_show_find_in_files_dialog_full(const gchar *text, const gchar *dir);
void geany_match_info_free(GeanyMatchInfo *info); @@ -135,6 +137,8 @@ gint search_replace_match(struct _ScintillaObject *sci, const GeanyMatchInfo *ma guint search_replace_range(struct _ScintillaObject *sci, struct Sci_TextToFind *ttf, GeanyFindFlags flags, const gchar *replace_text);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_SEARCH_H */
Modified: src/stash.h 30 lines changed, 18 insertions(+), 12 deletions(-) =================================================================== @@ -36,13 +36,6 @@ typedef gconstpointer StashWidgetID;
StashGroup *stash_group_new(const gchar *name);
-void stash_group_set_various(StashGroup *group, gboolean write_once); - -void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults); - -void stash_group_add_boolean(StashGroup *group, gboolean *setting, - const gchar *key_name, gboolean default_value); - void stash_group_add_integer(StashGroup *group, gint *setting, const gchar *key_name, gint default_value);
@@ -56,16 +49,13 @@ void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile);
void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile);
+void stash_group_free(StashGroup *group); + gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename);
gint stash_group_save_to_file(StashGroup *group, const gchar *filename, GKeyFileFlags flags);
-void stash_group_free_settings(StashGroup *group); - -void stash_group_free(StashGroup *group); - - /* *** GTK-related functions *** */
void stash_group_add_toggle_button(StashGroup *group, gboolean *setting, @@ -95,12 +85,28 @@ void stash_group_display(StashGroup *group, GtkWidget *owner);
void stash_group_update(StashGroup *group, GtkWidget *owner);
+void stash_group_free_settings(StashGroup *group); + + +#ifdef GEANY_PRIVATE + +void stash_group_set_various(StashGroup *group, gboolean write_once); + +void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults); + +void stash_group_add_boolean(StashGroup *group, gboolean *setting, + const gchar *key_name, gboolean default_value); + +/* *** GTK-related functions *** */ + void stash_tree_setup(GPtrArray *group_array, GtkTreeView *tree);
void stash_tree_display(GtkTreeView *tree);
void stash_tree_update(GtkTreeView *tree);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_STASH_H */
Modified: src/symbols.h 9 lines changed, 7 insertions(+), 2 deletions(-) =================================================================== @@ -29,6 +29,11 @@
G_BEGIN_DECLS
+const gchar *symbols_get_context_separator(gint ft_id); + + +#ifdef GEANY_PRIVATE + extern const guint TM_GLOBAL_TYPE_MASK;
enum @@ -49,8 +54,6 @@ void symbols_global_tags_loaded(guint file_type_idx);
GString *symbols_find_tags_as_string(GPtrArray *tags_array, guint tag_types, gint lang);
-const gchar *symbols_get_context_separator(gint ft_id); - const GList *symbols_get_tag_list(GeanyDocument *doc, guint tag_types);
GString *symbols_get_macro_list(gint lang); @@ -69,6 +72,8 @@ gint symbols_get_current_function(GeanyDocument *doc, const gchar **tagname);
gint symbols_get_current_scope(GeanyDocument *doc, const gchar **tagname);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_SYMBOLS_H */
Modified: src/templates.h 38 lines changed, 22 insertions(+), 16 deletions(-) =================================================================== @@ -35,6 +35,26 @@
G_BEGIN_DECLS
+/** Template preferences. */ +typedef struct GeanyTemplatePrefs +{ + gchar *developer; /**< Name */ + gchar *company; /**< Company */ + gchar *mail; /**< Email */ + gchar *initials; /**< Initials */ + gchar *version; /**< Initial version */ + gchar *year_format; + gchar *date_format; + gchar *datetime_format; +} +GeanyTemplatePrefs; + + +gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname); + + +#ifdef GEANY_PRIVATE + struct filetype;
#define GEANY_TEMPLATES_INDENT 3 @@ -53,27 +73,11 @@ enum };
-/** Template preferences. */ -typedef struct GeanyTemplatePrefs -{ - gchar *developer; /**< Name */ - gchar *company; /**< Company */ - gchar *mail; /**< Email */ - gchar *initials; /**< Initials */ - gchar *version; /**< Initial version */ - gchar *year_format; - gchar *date_format; - gchar *datetime_format; -} -GeanyTemplatePrefs; - extern GeanyTemplatePrefs template_prefs;
void templates_init(void);
-gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname); - gchar *templates_get_template_changelog(GeanyDocument *doc);
gchar *templates_get_template_function(GeanyDocument *doc, const gchar *func_name); @@ -88,6 +92,8 @@ void templates_replace_valist(GString *text,
void templates_free_templates(void);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_TEMPLATES_H */
Modified: src/toolbar.h 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -38,6 +38,9 @@ typedef struct GeanyToolbarPrefs } GeanyToolbarPrefs;
+ +#ifdef GEANY_PRIVATE + extern GeanyToolbarPrefs toolbar_prefs;
@@ -63,6 +66,8 @@ void toolbar_finalize(void);
void toolbar_configure(GtkWindow *parent);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_TOOLBAR_H */
Modified: src/ui_utils.h 105 lines changed, 55 insertions(+), 50 deletions(-) =================================================================== @@ -72,9 +72,6 @@ typedef struct GeanyInterfacePrefs GeanyInterfacePrefs;
-extern GeanyInterfacePrefs interface_prefs; - - /** Important widgets in the main window. * Accessed by @c geany->main_widgets. */ typedef struct GeanyMainWidgets @@ -94,6 +91,59 @@ typedef struct GeanyMainWidgets } GeanyMainWidgets;
+ +#define GEANY_STOCK_SAVE_ALL "geany-save-all" +#define GEANY_STOCK_CLOSE_ALL "geany-close-all" +#define GEANY_STOCK_BUILD "geany-build" + + +GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog); + +GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment); + +void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3); + +void ui_table_add_row(GtkTable *table, gint row, ...) G_GNUC_NULL_TERMINATED; + +GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry); + +GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text); + +void ui_add_document_sensitive(GtkWidget *widget); + +void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text); + +GtkWidget *ui_image_menu_item_new(const gchar *stock_id, const gchar *label); + +GtkWidget *ui_lookup_widget(GtkWidget *widget, const gchar *widget_name); + +void ui_progress_bar_start(const gchar *text); + +void ui_progress_bar_stop(void); + +void ui_entry_add_clear_icon(GtkEntry *entry); + +void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback); + +void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active, + GCallback callback, GCompareFunc sort_func); + +void ui_widget_modify_font_from_string(GtkWidget *wid, const gchar *str); + +gboolean ui_is_keyval_enter_or_return(guint keyval); + +gint ui_get_gtk_settings_integer(const gchar *property_name, gint default_value); + +void ui_combo_box_add_to_history(GtkComboBoxText *combo_entry, + const gchar *text, gint history_len); + +const gchar *ui_lookup_stock_label(const gchar *stock_id); + + +#ifdef GEANY_PRIVATE + +extern GeanyInterfacePrefs interface_prefs; + extern GeanyMainWidgets main_widgets;
@@ -169,49 +219,23 @@ typedef enum GeanyUIEditorFeatures;
-#define GEANY_STOCK_SAVE_ALL "geany-save-all" -#define GEANY_STOCK_CLOSE_ALL "geany-close-all" -#define GEANY_STOCK_BUILD "geany-build" - - void ui_widget_show_hide(GtkWidget *widget, gboolean show);
-void ui_widget_modify_font_from_string(GtkWidget *wid, const gchar *str); - void ui_menu_sort_by_label(GtkMenu *menu);
gchar *ui_menu_item_get_text(GtkMenuItem *menu_item);
-GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment); - -GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog); - void ui_dialog_set_primary_button_order(GtkDialog *dialog, gint response, ...);
-GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text); - -GtkWidget *ui_image_menu_item_new(const gchar *stock_id, const gchar *label); - void ui_hbutton_box_copy_layout(GtkButtonBox *master, GtkButtonBox *copy);
-void ui_combo_box_add_to_history(GtkComboBoxText *combo_entry, - const gchar *text, gint history_len); - void ui_combo_box_prepend_text_once(GtkComboBoxText *combo, const gchar *text);
-GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry); - void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title, GtkFileChooserAction action, GtkEntry *entry);
-void ui_table_add_row(GtkTable *table, gint row, ...) G_GNUC_NULL_TERMINATED; - void ui_auto_separator_add_ref(GeanyAutoSeparator *autosep, GtkWidget *item);
-void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text); - -GtkWidget *ui_lookup_widget(GtkWidget *widget, const gchar *widget_name); - gpointer ui_builder_get_object (const gchar *name);
/* Compatibility functions */ @@ -223,8 +247,6 @@ GtkWidget *create_window1(void);
void ui_widget_set_sensitive(GtkWidget *widget, gboolean set);
-void ui_entry_add_clear_icon(GtkEntry *entry); - void ui_entry_add_activate_backward_signal(GtkEntry *entry);
void ui_editable_insert_text_callback(GtkEditable *editable, gchar *new_text, @@ -234,8 +256,6 @@ GtkWidget *ui_label_new_bold(const gchar *text);
void ui_label_set_markup(GtkLabel *label, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
-const gchar *ui_lookup_stock_label(const gchar *stock_id); - /* End of general widget functions */
void ui_init_builder(void); @@ -253,13 +273,6 @@ void ui_init_stock_items(void); void ui_add_config_file_menu_item(const gchar *real_path, const gchar *label, GtkContainer *parent);
-void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback); - -void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active, - GCallback callback, GCompareFunc sort_func); - -void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3); - void ui_update_statusbar(GeanyDocument *doc, gint pos);
@@ -322,22 +335,12 @@ gboolean ui_tree_model_iter_any_next(GtkTreeModel *model, GtkTreeIter *iter, gbo
void ui_statusbar_showhide(gboolean state);
-void ui_add_document_sensitive(GtkWidget *widget); - void ui_toggle_editor_features(GeanyUIEditorFeatures feature);
void ui_update_view_editor_menu_items(void);
-void ui_progress_bar_start(const gchar *text); - -void ui_progress_bar_stop(void); - void ui_swap_sidebar_pos(void);
-gboolean ui_is_keyval_enter_or_return(guint keyval); - -gint ui_get_gtk_settings_integer(const gchar *property_name, gint default_value); - GIcon *ui_get_mime_icon(const gchar *mime_type);
void ui_focus_current_document(void); @@ -348,6 +351,8 @@ gint ui_encodings_combo_box_get_active_encoding(GtkComboBox *combo);
gboolean ui_encodings_combo_box_set_active_encoding(GtkComboBox *combo, gint enc);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_UI_UTILS_H */
Modified: src/utils.h 97 lines changed, 51 insertions(+), 46 deletions(-) =================================================================== @@ -147,20 +147,65 @@ G_BEGIN_DECLS for (i = 0; i < size; i++)
-void utils_open_browser(const gchar *uri); +gboolean utils_str_equal(const gchar *a, const gchar *b);
-gint utils_get_line_endings(const gchar* buffer, gsize size); +guint utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace);
-gboolean utils_isbrace(gchar c, gboolean include_angles); +GSList *utils_get_file_list(const gchar *path, guint *length, GError **error);
-gboolean utils_is_opening_brace(gchar c, gboolean include_angles); +GSList *utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean sort, GError **error);
gint utils_write_file(const gchar *filename, const gchar *text);
+gchar *utils_get_locale_from_utf8(const gchar *utf8_text); + +gchar *utils_get_utf8_from_locale(const gchar *locale_text); + +gchar *utils_remove_ext_from_filename(const gchar *filename); + +gint utils_mkdir(const gchar *path, gboolean create_parent_dirs); + +gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const gchar *key, const gboolean default_value); + +gint utils_get_setting_integer(GKeyFile *config, const gchar *section, const gchar *key, const gint default_value); + +gchar *utils_get_setting_string(GKeyFile *config, const gchar *section, const gchar *key, const gchar *default_value); + +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); + +gboolean utils_spawn_async(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags, + GSpawnChildSetupFunc child_setup, gpointer user_data, GPid *child_pid, + GError **error); + +gint utils_str_casecmp(const gchar *s1, const gchar *s2); + +gchar *utils_get_date_time(const gchar *format, time_t *time_to_use); + +void utils_open_browser(const gchar *uri); + +guint utils_string_replace_first(GString *haystack, const gchar *needle, const gchar *replace); + +gchar *utils_str_middle_truncate(const gchar *string, guint truncate_length); + +gchar *utils_str_remove_chars(gchar *string, const gchar *chars); + +gchar **utils_copy_environment(const gchar **exclude_vars, const gchar *first_varname, ...) G_GNUC_NULL_TERMINATED; + gchar *utils_find_open_xml_tag(const gchar sel[], gint size);
const gchar *utils_find_open_xml_tag_pos(const gchar sel[], gint size);
+ +#ifdef GEANY_PRIVATE + +gint utils_get_line_endings(const gchar* buffer, gsize size); + +gboolean utils_isbrace(gchar c, gboolean include_angles); + +gboolean utils_is_opening_brace(gchar c, gboolean include_angles); + gboolean utils_is_short_html_tag(const gchar *tag_name);
void utils_ensure_same_eol_characters(GString *string, gint target_eol_mode); @@ -179,20 +224,12 @@ const gchar *utils_path_skip_root(const gchar *path);
gdouble utils_scale_round(gdouble val, gdouble factor);
-gboolean utils_str_equal(const gchar *a, const gchar *b); - -gchar *utils_remove_ext_from_filename(const gchar *filename); - gchar utils_brace_opposite(gchar ch);
gint utils_string_find(GString *haystack, gint start, gint end, const gchar *needle);
gint utils_string_replace(GString *str, gint pos, gint len, const gchar *replace);
-guint utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace); - -guint utils_string_replace_first(GString *haystack, const gchar *needle, const gchar *replace); - guint utils_string_regex_replace_all(GString *haystack, GRegex *regex, guint match_num, const gchar *replace, gboolean literal);
@@ -200,16 +237,8 @@ void utils_str_replace_all(gchar **haystack, const gchar *needle, const gchar *r
gint utils_strpos(const gchar* haystack, const gchar *needle);
-gchar *utils_get_date_time(const gchar *format, time_t *time_to_use); - gchar *utils_get_initials(const gchar *name);
-gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const gchar *key, const gboolean default_value); - -gint utils_get_setting_integer(GKeyFile *config, const gchar *section, const gchar *key, const gint default_value); - -gchar *utils_get_setting_string(GKeyFile *config, const gchar *section, const gchar *key, const gchar *default_value); - gchar *utils_get_hex_from_color(GdkColor *color);
const gchar *utils_get_default_dir_utf8(void); @@ -238,22 +267,12 @@ gboolean utils_str_replace_escape(gchar *string, gboolean keep_backslash);
gboolean utils_wrap_string(gchar *string, gint wrapstart);
-gchar *utils_get_locale_from_utf8(const gchar *utf8_text); - -gchar *utils_get_utf8_from_locale(const gchar *locale_text); - void utils_free_pointers(gsize arg_count, ...) G_GNUC_NULL_TERMINATED;
gchar **utils_strv_new(const gchar *first, ...) G_GNUC_NULL_TERMINATED;
gchar **utils_strv_join(gchar **first, gchar **second) G_GNUC_WARN_UNUSED_RESULT;
-gint utils_mkdir(const gchar *path, gboolean create_parent_dirs); - -GSList *utils_get_file_list(const gchar *path, guint *length, GError **error); - -GSList *utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean sort, GError **error); - GSList *utils_get_config_files(const gchar *subdir);
gchar *utils_get_help_url(const gchar *suffix); @@ -263,34 +282,20 @@ gboolean utils_str_has_upper(const gchar *str); gint utils_is_file_writable(const gchar *locale_filename);
-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); - -gboolean utils_spawn_async(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags, - GSpawnChildSetupFunc child_setup, gpointer user_data, GPid *child_pid, - GError **error); - -gint utils_str_casecmp(const gchar *s1, const gchar *s2); - gchar *utils_get_path_from_uri(const gchar *uri);
gboolean utils_is_uri(const gchar *uri);
gboolean utils_is_remote_path(const gchar *path);
-gchar *utils_str_middle_truncate(const gchar *string, guint truncate_length); - -gchar *utils_str_remove_chars(gchar *string, const gchar *chars); - -gchar **utils_copy_environment(const gchar **exclude_vars, const gchar *first_varname, ...) G_GNUC_NULL_TERMINATED; - GDate *utils_parse_date(const gchar *input);
gchar *utils_parse_and_format_build_date(const gchar *input);
gchar *utils_get_user_config_dir(void);
+#endif /* GEANY_PRIVATE */ + G_END_DECLS
#endif /* GEANY_UTILS_H */
Modified: tagmanager/src/Makefile.am 10 lines changed, 8 insertions(+), 2 deletions(-) =================================================================== @@ -2,6 +2,7 @@ AM_CPPFLAGS = \ -I$(srcdir) \ -I$(srcdir)/.. \ -I$(srcdir)/../ctags \ + -DGEANY_PRIVATE \ -DG_LOG_DOMAIN="Tagmanager" AM_CFLAGS = \ $(GTK_CFLAGS) @@ -13,8 +14,6 @@ noinst_LIBRARIES = libtagmanager.a
tagmanager_includedir = $(includedir)/geany/tagmanager tagmanager_include_HEADERS = \ - tm_file_entry.h \ - tm_parser.h \ tm_source_file.h \ tm_tag.h \ tm_tagmanager.h \ @@ -23,8 +22,15 @@ tagmanager_include_HEADERS = \
libtagmanager_a_SOURCES =\ + tm_tagmanager.h \ + tm_parser.h \ + tm_file_entry.h \ tm_file_entry.c \ + tm_source_file.h \ tm_source_file.c \ + tm_tag.h \ tm_tag.c \ tm_work_object.c \ + tm_work_object.h \ + tm_workspace.h \ tm_workspace.c
Modified: tagmanager/src/makefile.win32 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -29,7 +29,7 @@ GTK_INCLUDES= \
INCLUDEDIRS=-I ../ctags -I ../ -I . $(GTK_INCLUDES)
-CBASEFLAGS=-Wall -pipe -mms-bitfields -DPACKAGE="geany" -Wno-missing-braces -Wno-char-subscripts $(INCLUDEDIRS) +CBASEFLAGS=-Wall -pipe -mms-bitfields -DGEANY_PRIVATE -DPACKAGE="geany" -Wno-missing-braces -Wno-char-subscripts $(INCLUDEDIRS) ifdef DEBUG CFLAGS= -O0 -g $(CBASEFLAGS) else
Modified: tagmanager/src/tm_file_entry.h 42 lines changed, 21 insertions(+), 21 deletions(-) =================================================================== @@ -12,7 +12,7 @@
#include <glib.h>
-/*! \file +/* \file The TMFileEntry structure and associated functions can be used for file and directory traversal. The following example demonstrates the use of TMFileEntry. @@ -24,48 +24,48 @@ extern "C" { #endif
-/*! Enum defining file types */ +/* Enum defining file types */ typedef enum { - tm_file_unknown_t, /*!< Unknown file type/file does not exist */ - tm_file_regular_t, /*!< Is a regular file */ - tm_file_dir_t, /*!< Is a directory */ - tm_file_link_t /*!< Is a symbolic link */ + tm_file_unknown_t, /* Unknown file type/file does not exist */ + tm_file_regular_t, /* Is a regular file */ + tm_file_dir_t, /* Is a directory */ + tm_file_link_t /* Is a symbolic link */ } TMFileType;
-/*! +/* This example demonstrates the use of TMFileEntry and associated functions for managing file hierarchies in a project.
\example tm_file_tree_dump.c */
-/*! This structure stores the file tree */ +/* This structure stores the file tree */ typedef struct _TMFileEntry { - TMFileType type; /*!< File type */ - char *path; /*!< Full path to the file (incl. dir and name) */ - char *name; /*!< Just the file name (path minus the directory) */ - char *version; /*!< CVS version in case there is a CVS entry for this file */ - struct _TMFileEntry *parent; /*!< The parent directory file entry */ - GSList *children; /*!< List of children (for directory) */ + TMFileType type; /* File type */ + char *path; /* Full path to the file (incl. dir and name) */ + char *name; /* Just the file name (path minus the directory) */ + char *version; /* CVS version in case there is a CVS entry for this file */ + struct _TMFileEntry *parent; /* The parent directory file entry */ + GSList *children; /* List of children (for directory) */ } TMFileEntry;
-/*! Prototype for the function that gets called for each entry when +/* Prototype for the function that gets called for each entry when tm_file_entry_foreach() is called. */ typedef void (*TMFileEntryFunc) (TMFileEntry *entry, gpointer user_data , guint level);
-/*! Convinience casting macro */ +/* Convinience casting macro */ #define TM_FILE_ENTRY(E) ((TMFileEntry *) (E))
-/*! Function that compares two file entries on name and returns the +/* Function that compares two file entries on name and returns the difference */ gint tm_file_entry_compare(TMFileEntry *e1, TMFileEntry *e2);
-/*! Function to create a new file entry structure. +/* Function to create a new file entry structure. \param path Path to the file for which the entry is to be created. \param parent Should be NULL for the first call. Since the function calls itself recursively, this parameter is required to build the hierarchy. @@ -91,13 +91,13 @@ TMFileEntry *tm_file_entry_new(const char *path, TMFileEntry *parent , GList *dir_match, GList *dir_unmatch, gboolean ignore_hidden_files , gboolean ignore_hidden_dirs);
-/*! Frees a TMFileEntry structure. Freeing is recursive, so all child +/* Frees a TMFileEntry structure. Freeing is recursive, so all child entries are freed as well. \param entry The TMFileEntry structure to be freed. */ void tm_file_entry_free(gpointer entry);
-/*! This will call the function func() for each file entry. +/* This will call the function func() for each file entry. \param entry The root file entry. \param func The function to be called. \param user_data Extra information to be passed to the function. @@ -107,7 +107,7 @@ void tm_file_entry_free(gpointer entry); void tm_file_entry_foreach(TMFileEntry *entry, TMFileEntryFunc func , gpointer user_data, guint level, gboolean reverse);
-/*! This is a sample function to show the use of tm_file_entry_foreach(). +/* This is a sample function to show the use of tm_file_entry_foreach(). */ void tm_file_entry_print(TMFileEntry *entry, gpointer user_data, guint level);
Modified: tagmanager/src/tm_source_file.h 41 lines changed, 25 insertions(+), 16 deletions(-) =================================================================== @@ -44,23 +44,14 @@ typedef struct gboolean inactive; /*!< Whether this file should be scanned for tags */ } TMSourceFile;
- -/* Initializes a TMSourceFile structure from a file name. */ -gboolean tm_source_file_init(TMSourceFile *source_file, const char *file_name, - gboolean update, const char *name); - -/* Initializes a TMSourceFile structure and returns a pointer to it. */ +/*! Initializes a TMSourceFile structure and returns a pointer to it. + * \param file_name The file name. + * \param update Update the tag array of the file. + * \param name Name of the used programming language, NULL for autodetection. + * \return The created TMSourceFile object. + * */ TMWorkObject *tm_source_file_new(const char *file_name, gboolean update, const char *name);
-/* Destroys the contents of the source file. Note that the tags are owned by the - source file and are also destroyed when the source file is destroyed. If pointers - to these tags are used elsewhere, then those tag arrays should be rebuilt. -*/ -void tm_source_file_destroy(TMSourceFile *source_file); - -/* Frees a TMSourceFile structure, including all contents */ -void tm_source_file_free(gpointer source_file); - /*! Updates the source file by reparsing if the modification time is greater than the timestamp in the structure, or if force is TRUE. The tags array and the tags themselves are destroyed and re-created, hence any other tag arrays @@ -78,7 +69,23 @@ void tm_source_file_free(gpointer source_file); gboolean tm_source_file_update(TMWorkObject *source_file, gboolean force , gboolean recurse, gboolean update_parent);
-/*! Updates the source file by reparsing the text-buffer passed as parameter. + +#ifdef GEANY_PRIVATE + +/* Initializes a TMSourceFile structure from a file name. */ +gboolean tm_source_file_init(TMSourceFile *source_file, const char *file_name, + gboolean update, const char *name); + +/* Destroys the contents of the source file. Note that the tags are owned by the + source file and are also destroyed when the source file is destroyed. If pointers + to these tags are used elsewhere, then those tag arrays should be rebuilt. +*/ +void tm_source_file_destroy(TMSourceFile *source_file); + +/* Frees a TMSourceFile structure, including all contents */ +void tm_source_file_free(gpointer source_file); + +/* Updates the source file by reparsing the text-buffer passed as parameter. Ctags will use a parsing based on buffer instead of on files. You should call this function when you don't want a previous saving of the file you're editing. It's useful for a "real-time" updating of the tags. @@ -153,6 +160,8 @@ gint tm_source_file_get_named_lang(const gchar *name); /* Set the argument list of tag identified by its name */ void tm_source_file_set_tag_arglist(const char *tag_name, const char *arglist);
+#endif /* GEANY_PRIVATE */ + #ifdef __cplusplus } #endif
Modified: tagmanager/src/tm_tag.h 63 lines changed, 34 insertions(+), 29 deletions(-) =================================================================== @@ -10,7 +10,7 @@ #ifndef TM_TAG_H #define TM_TAG_H
-/*! \file +/* \file The TMTag structure and the associated functions are used to manipulate tags and arrays of tags. Normally, you should not create tags individually but through an external interface such as tm_source_file_parse(), which generates @@ -151,13 +151,16 @@ typedef struct _TMTag gint refcount; /*!< the reference count of the tag */ } TMTag;
+ +#ifdef GEANY_PRIVATE + typedef enum { TM_FILE_FORMAT_TAGMANAGER, TM_FILE_FORMAT_PIPE, TM_FILE_FORMAT_CTAGS } TMFileFormat;
-/*! +/* Prototype for user-defined tag comparison function. This is the type of argument that needs to be passed to tm_tags_sort_custom() and tm_tags_dedup_custom(). The function should take two void pointers, @@ -166,13 +169,13 @@ typedef enum { */ typedef int (*TMTagCompareFunc) (const void *ptr1, const void *ptr2);
-/*! The GType for a TMTag */ +/* The GType for a TMTag */ #define TM_TYPE_TAG (tm_tag_get_type())
-/*! Gets the GType for a TMTag */ +/* Gets the GType for a TMTag */ GType tm_tag_get_type(void) G_GNUC_CONST;
-/*! +/* Initializes a TMTag structure with information from a tagEntryInfo struct used by the ctags parsers. Note that the TMTag structure must be malloc()ed before calling this function. This function is called by tm_tag_new() - you @@ -184,7 +187,7 @@ GType tm_tag_get_type(void) G_GNUC_CONST; */ gboolean tm_tag_init(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag_entry);
-/*! +/* Initializes an already malloc()ed TMTag structure by reading a tag entry line from a file. The structure should be allocated beforehand. \param tag The TMTag structure to populate @@ -194,18 +197,18 @@ gboolean tm_tag_init(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag_ent */ gboolean tm_tag_init_from_file(TMTag *tag, TMSourceFile *file, FILE *fp);
-/*! +/* Same as tm_tag_init_from_file(), but using an alternative parser for PHP and LaTeX global tags files. */ gboolean tm_tag_init_from_file_alt(TMTag *tag, TMSourceFile *file, FILE *fp);
-/*! +/* Same as tm_tag_init_from_file(), but parsing CTags tag file format */ gboolean tm_tag_init_from_file_ctags(TMTag *tag, TMSourceFile *file, FILE *fp);
-/*! +/* Creates a new tag structure from a tagEntryInfo pointer and a TMSOurceFile pointer and returns a pointer to it. \param file - Pointer to the TMSourceFile structure containing the tag @@ -214,13 +217,13 @@ gboolean tm_tag_init_from_file_ctags(TMTag *tag, TMSourceFile *file, FILE *fp); */ TMTag *tm_tag_new(TMSourceFile *file, const tagEntryInfo *tag_entry);
-/*! +/* Same as tm_tag_new() except that the tag attributes are read from file. \param mode langType to use for the tag. */ TMTag *tm_tag_new_from_file(TMSourceFile *file, FILE *fp, gint mode, TMFileFormat format);
-/*! +/* Writes tag information to the given FILE *. \param tag The tag information to write. \param file FILE pointer to which the tag information is written. @@ -229,7 +232,7 @@ TMTag *tm_tag_new_from_file(TMSourceFile *file, FILE *fp, gint mode, TMFileForma */ gboolean tm_tag_write(TMTag *tag, FILE *file, guint attrs);
-/*! +/* Inbuilt tag comparison function. Do not call directly since it needs some static variables to be set. Always use tm_tags_sort() and tm_tags_dedup() instead. @@ -239,7 +242,7 @@ int tm_tag_compare(const void *ptr1, const void *ptr2); gboolean tm_tags_merge(GPtrArray *tags_array, gsize orig_len, TMTagAttrType *sort_attributes, gboolean dedup);
-/*! +/* Sort an array of tags on the specified attribuites using the inbuilt comparison function. \param tags_array The array of tags to be sorted @@ -249,7 +252,7 @@ gboolean tm_tags_merge(GPtrArray *tags_array, gsize orig_len, */ gboolean tm_tags_sort(GPtrArray *tags_array, TMTagAttrType *sort_attributes, gboolean dedup);
-/*! +/* This function should be used whenever more involved sorting is required. For this, you need to write a function as per the prototype of TMTagCompareFunc() and pass the function as a parameter to this function. @@ -263,7 +266,7 @@ gboolean tm_tags_sort(GPtrArray *tags_array, TMTagAttrType *sort_attributes, gbo */ gboolean tm_tags_custom_sort(GPtrArray *tags_array, TMTagCompareFunc compare_func, gboolean dedup);
-/*! +/* This function will extract the tags of the specified types from an array of tags. The returned value is a GPtrArray which should be free-d with a call to g_ptr_array_free(array, TRUE). However, do not free the tags themselves since they @@ -276,7 +279,7 @@ gboolean tm_tags_custom_sort(GPtrArray *tags_array, TMTagCompareFunc compare_fun */ GPtrArray *tm_tags_extract(GPtrArray *tags_array, guint tag_types);
-/*! +/* Removes NULL tag entries from an array of tags. Called after tm_tags_dedup() and tm_tags_custom_dedup() since these functions substitute duplicate entries with NULL \param tags_array Array of tags to dedup @@ -284,7 +287,7 @@ GPtrArray *tm_tags_extract(GPtrArray *tags_array, guint tag_types); */ gboolean tm_tags_prune(GPtrArray *tags_array);
-/*! +/* Deduplicates an array on tags using the inbuilt comparison function based on the attributes specified. Called by tm_tags_sort() when dedup is TRUE. \param tags_array Array of tags to dedup. @@ -294,7 +297,7 @@ gboolean tm_tags_prune(GPtrArray *tags_array); */ gboolean tm_tags_dedup(GPtrArray *tags_array, TMTagAttrType *sort_attributes);
-/*! +/* This is a more powerful form of tm_tags_dedup() since it can accomodate user defined comparison functions. Called by tm_tags_custom_sort() is dedup is TRUE. \param tags_array Array of tags to dedup. @@ -304,7 +307,7 @@ gboolean tm_tags_dedup(GPtrArray *tags_array, TMTagAttrType *sort_attributes); */ gboolean tm_tags_custom_dedup(GPtrArray *tags_array, TMTagCompareFunc compare_func);
-/*! +/* Returns a pointer to the position of the first matching tag in a (sorted) tags array. The passed array of tags should be already sorted by name for optimal performance. If \c tags_array_sorted is set to FALSE, it may be unsorted but the lookup will be slower. @@ -318,7 +321,7 @@ gboolean tm_tags_custom_dedup(GPtrArray *tags_array, TMTagCompareFunc compare_fu TMTag **tm_tags_find(const GPtrArray *tags_array, const char *name, gboolean partial, gboolean tags_array_sorted, int * tagCount);
-/*! +/* Completely frees an array of tags. \param tags_array Array of tags to be freed. \param free_array Whether the GptrArray is to be freed as well. @@ -326,63 +329,65 @@ TMTag **tm_tags_find(const GPtrArray *tags_array, const char *name, void tm_tags_array_free(GPtrArray *tags_array, gboolean free_all);
#if 0 -/*! +/* Destroys a TMTag structure, i.e. frees all elements except the tag itself. \param tag The TMTag structure to destroy \sa tm_tag_free() */ void tm_tag_destroy(TMTag *tag);
-/*! +/* Destroys all data in the tag and frees the tag structure as well. \param tag Pointer to a TMTag structure */ void tm_tag_free(gpointer tag); #endif
-/*! +/* Drops a reference from a TMTag. If the reference count reaches 0, this function destroys all data in the tag and frees the tag structure as well. \param tag Pointer to a TMTag structure */ void tm_tag_unref(TMTag *tag);
-/*! +/* Adds a reference to a TMTag. \param tag Pointer to a TMTag structure \return the passed-in TMTag */ TMTag *tm_tag_ref(TMTag *tag);
-/*! +/* Returns the type of tag as a string \param tag The tag whose type is required */ const char *tm_tag_type_name(const TMTag *tag);
-/*! +/* Returns the TMTagType given the name of the type. Reverse of tm_tag_type_name. \param tag_name Name of the tag type */ TMTagType tm_tag_name_type(const char* tag_name);
-/*! +/* Prints information about a tag to the given file pointer. \param tag The tag whose info is required. \fp The file pointer of teh file to print the info to. */ void tm_tag_print(TMTag *tag, FILE *fp);
-/*! +/* Prints info about all tags in the array to the given file pointer. */ void tm_tags_array_print(GPtrArray *tags, FILE *fp);
-/*! +/* Returns the depth of tag scope (useful for finding tag hierarchy */ gint tm_tag_scope_depth(const TMTag *t);
+#endif /* GEANY_PRIVATE */ + #ifdef __cplusplus } #endif
Modified: tagmanager/src/tm_tagmanager.h 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -11,11 +11,13 @@ #define TM_TAGMANAGER_H
#include "tm_tag.h" -#include "tm_file_entry.h" #include "tm_workspace.h" #include "tm_work_object.h" #include "tm_source_file.h" +#ifdef GEANY_PRIVATE +#include "tm_file_entry.h" #include "tm_parser.h" +#endif /* GEANY_PRIVATE */
/*! \mainpage Introduction \section Introduction
Modified: tagmanager/src/tm_work_object.h 59 lines changed, 33 insertions(+), 26 deletions(-) =================================================================== @@ -19,9 +19,6 @@ extern "C" { #endif
-/* Evaluates to X is X is defined, else evaluates to Y */ -#define FALLBACK(X,Y) (X)?(X):(Y) - /* Macro to cast a pointer to (TMWorkObject *) */ #define TM_WORK_OBJECT(work_object) ((TMWorkObject *) work_object)
@@ -41,6 +38,34 @@ typedef struct TMWorkObject GPtrArray *tags_array; /*!< Tags obtained by parsing the object */ } TMWorkObject;
+ +/*! + Given a file name, returns a newly allocated string containing the realpath() + of the file. + \param file_name The original file_name + \return A newly allocated string containing the real path to the file. NULL if none is available. +*/ +gchar *tm_get_real_path(const gchar *file_name); + + +/*! + Deallocates a work object and it's component structures. The user can call this + function directly since it will automatically call the correct deallocator function + of the derived class if required. + \param work_object Pointer to a work object or an object derived from it. +*/ +void tm_work_object_free(gpointer work_object); + + +#ifdef GEANY_PRIVATE + +/* Evaluates to X is X is defined, else evaluates to Y */ +#define FALLBACK(X,Y) (X)?(X):(Y) + +#define TM_OBJECT_TYPE(work_object) ((TMWorkObject *) work_object)->type /*< Type of the work object */ +#define TM_OBJECT_FILE(work_object) ((TMWorkObject *) work_object)->file_name /*< File name of the work object */ +#define TM_OBJECT_TAGS(work_object) ((TMWorkObject *) work_object)->tags_array /*< Tag array of the work object */ + /* Prototype of the update function required to be written by all classes derived from TMWorkObject. The function should take a pointer to the object and a flag indicating whether the cache should be ignored, and @@ -68,23 +93,11 @@ typedef TMWorkObject *(*TMFindFunc) (TMWorkObject *work_object, const char *file */ typedef struct _TMWorkObjectClass { - GFreeFunc free_func; /*!< Function to free the derived object */ - TMUpdateFunc update_func; /*!< Function to update the derived object */ - TMFindFunc find_func; /*!< Function to locate contained work objects */ + GFreeFunc free_func; /* Function to free the derived object */ + TMUpdateFunc update_func; /* Function to update the derived object */ + TMFindFunc find_func; /* Function to locate contained work objects */ } TMWorkObjectClass;
-#define TM_OBJECT_TYPE(work_object) ((TMWorkObject *) work_object)->type /*< Type of the work object */ -#define TM_OBJECT_FILE(work_object) ((TMWorkObject *) work_object)->file_name /*< File name of the work object */ -#define TM_OBJECT_TAGS(work_object) ((TMWorkObject *) work_object)->tags_array /*< Tag array of the work object */ - -/*! - Given a file name, returns a newly allocated string containing the realpath() - of the file. - \param file_name The original file_name - \return A newly allocated string containing the real path to the file. NULL if none is available. -*/ -gchar *tm_get_real_path(const gchar *file_name); - /* Initializes the work object structure. This function should be called by the initialization routine of the derived classes to ensure that the base members @@ -122,14 +135,6 @@ time_t tm_get_file_timestamp(const char *file_name); */ void tm_work_object_destroy(TMWorkObject *work_object);
-/*! - Deallocates a work object and it's component structures. The user can call this - function directly since it will automatically call the correct deallocator function - of the derived class if required. - \param work_object Pointer to a work object or an object derived from it. -*/ -void tm_work_object_free(gpointer work_object); - /* This function should be called exactly once by all classes derived from TMWorkObject, since it supplies a unique ID on each call and stores the functions to call for @@ -177,6 +182,8 @@ TMWorkObject *tm_work_object_find(TMWorkObject *work_object, const char *file_na /* Dumps the contents of a work object - useful for debugging */ void tm_work_object_dump(const TMWorkObject *w);
+#endif /* GEANY_PRIVATE */ + #ifdef __cplusplus } #endif
Modified: tagmanager/src/tm_workspace.h 34 lines changed, 19 insertions(+), 15 deletions(-) =================================================================== @@ -21,7 +21,6 @@ extern "C" #endif
- /*! The Tag Manager Workspace. This is a singleton work object containing a list of work objects - individual source files. There is also a global tag list which can be loaded or created. This contains global tags gleaned from @@ -34,6 +33,23 @@ typedef struct GPtrArray *work_objects; /*!< An array of TMWorkObject pointers */ } TMWorkspace;
+/*! Adds a work object (source file) to the workspace. + \param work_object The work object to add to the workspace. + \return TRUE on success, FALSE on failure (e.g. object already exixts). +*/ +gboolean tm_workspace_add_object(TMWorkObject *work_object); + +/*! Removes a member object from the workspace if it exists. + \param work_object Pointer to the work object to be removed. + \param do_free Whether the work object is to be freed as well. + \param update Whether to update workspace objects. + \return TRUE on success, FALSE on failure (e.g. the work object does not exist). +*/ +gboolean tm_workspace_remove_object(TMWorkObject *work_object, gboolean do_free, gboolean update); + + +#ifdef GEANY_PRIVATE + /* Since TMWorkspace is a singleton, you should not create multiple workspaces, but get a pointer to the workspace whenever required. The first time a pointer is requested, or a work object is added to the workspace, @@ -42,12 +58,6 @@ typedef struct */ const TMWorkspace *tm_get_workspace(void);
-/*! Adds a work object (source file) to the workspace. - \param work_object The work object to add to the workspace. - \return TRUE on success, FALSE on failure (e.g. object already exixts). -*/ -gboolean tm_workspace_add_object(TMWorkObject *work_object); - /* Given a file name, returns a pointer to the object if the object's file name is same as the passed file name, otherwise retruns NULL. This is an overloaded version of tm_work_object_find(). @@ -60,14 +70,6 @@ gboolean tm_workspace_add_object(TMWorkObject *work_object); TMWorkObject *tm_workspace_find_object(TMWorkObject *work_object, const char *file_name ,gboolean name_only);
-/*! Removes a member object from the workspace if it exists. - \param work_object Pointer to the work object to be removed. - \param do_free Whether the work object is to be freed as well. - \param update Whether to update workspace objects. - \return TRUE on success, FALSE on failure (e.g. the work object does not exist). -*/ -gboolean tm_workspace_remove_object(TMWorkObject *work_object, gboolean do_free, gboolean update); - /* Loads the global tag list from the specified file. The global tag list should have been first created using tm_workspace_create_global_tags(). \param tags_file The file containing global tags. @@ -180,6 +182,8 @@ void tm_workspace_free(gpointer workspace); */ extern guint workspace_class_id;
+#endif /* GEANY_PRIVATE */ + #ifdef __cplusplus } #endif
Modified: wscript 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -397,7 +397,7 @@ def build(bld): name = 'tagmanager', target = 'tagmanager', includes = ['.', 'tagmanager', 'tagmanager/ctags'], - defines = 'G_LOG_DOMAIN="Tagmanager"', + defines = ['GEANY_PRIVATE', 'G_LOG_DOMAIN="Tagmanager"'], uselib = ['GTK', 'GLIB'], install_path = None) # do not install this library
@@ -551,8 +551,7 @@ def build(bld): scintilla/include/SciLexer.h scintilla/include/Scintilla.h scintilla/include/Scintilla.iface scintilla/include/ScintillaWidget.h ''') bld.install_files('${PREFIX}/include/geany/tagmanager', ''' - tagmanager/src/tm_file_entry.h - tagmanager/src/tm_source_file.h tagmanager/src/tm_parser.h + tagmanager/src/tm_source_file.h tagmanager/src/tm_tag.h tagmanager/src/tm_tagmanager.h tagmanager/src/tm_work_object.h tagmanager/src/tm_workspace.h ''')
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).