Skip to content

Commit

Permalink
Protect private definitions by the GEANY_PRIVATE macro in headers
Browse files Browse the repository at this point in the history
In addition, this patch defines the GEANY_PRIVATE macro for the tag
manager library where it wasn't defined before, removes 2 tag manager
headers from distribution as they are not needed by plugins and
in the tag manager changes the docstrings to ordinary comments for
private definitions.
  • Loading branch information
techee committed Oct 9, 2014
1 parent 245ae66 commit 10a28b4
Show file tree
Hide file tree
Showing 31 changed files with 717 additions and 577 deletions.
5 changes: 5 additions & 0 deletions src/app.h
Expand Up @@ -53,8 +53,13 @@ typedef struct GeanyApp
}
GeanyApp;


#ifdef GEANY_PRIVATE

extern GeanyApp *app;

#endif /* GEANY_PRIVATE */

G_END_DECLS

#endif /* GEANY_APP_H */
89 changes: 47 additions & 42 deletions src/build.h
Expand Up @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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;
Expand All @@ -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
{
Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
29 changes: 17 additions & 12 deletions src/dialogs.h
Expand Up @@ -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);
Expand All @@ -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);

Expand All @@ -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 */

0 comments on commit 10a28b4

Please sign in to comment.