Skip to content

Commit

Permalink
Merge pull request #171 from b4n/scope/fixes
Browse files Browse the repository at this point in the history
scope: Don't depend on Geany private prototypes
  • Loading branch information
zhekov committed Oct 22, 2014
2 parents 90b4429 + 5ce234b commit 8802193
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scope/src/plugme.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern GeanyFunctions *geany_functions;
/* This file must not depend on Scope */
#include "plugme.h"

#ifndef ui_setup_open_button_callback
static gchar *run_file_chooser(const gchar *title, GtkFileChooserAction action,
const gchar *utf8_path)
{
Expand Down Expand Up @@ -101,7 +100,7 @@ static void ui_path_box_open_clicked(G_GNUC_UNUSED GtkButton *button, gpointer u
/* Setup a GtkButton to run a GtkFileChooser, setting entry text if successful.
* title can be NULL.
* action is the file chooser mode to use. */
void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
void plugme_ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
GtkFileChooserAction action, GtkEntry *entry)
{
GtkWidget *path_entry = GTK_WIDGET(entry);
Expand All @@ -113,11 +112,9 @@ void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
ui_hookup_widget(open_btn, path_entry, "entry");
g_signal_connect(open_btn, "clicked", G_CALLBACK(ui_path_box_open_clicked), open_btn);
}
#endif /* ui_setup_open_button_callback */

#ifndef editor_get_default_selection
/* Note: this is NOT the Geany function, only similar */
gchar *editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word,
gchar *plugme_editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word,
const gchar *wordchars)
{
ScintillaObject *sci = editor->sci;
Expand All @@ -138,7 +135,6 @@ gchar *editor_get_default_selection(GeanyEditor *editor, gboolean use_current_wo

return text;
}
#endif /* editor_get_default_selection */

static void on_config_file_clicked(G_GNUC_UNUSED GtkWidget *widget, gpointer user_data)
{
Expand Down
12 changes: 12 additions & 0 deletions scope/src/plugme.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@

#ifndef PLUGME_H

#ifndef ui_setup_open_button_callback
void plugme_ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
GtkFileChooserAction action, GtkEntry *entry);
#define ui_setup_open_button_callback plugme_ui_setup_open_button_callback
#endif /* ui_setup_open_button_callback */

#ifndef editor_get_default_selection
gchar *plugme_editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word,
const gchar *wordchars);
#define editor_get_default_selection plugme_editor_get_default_selection
#endif /* editor_get_default_selection */

#ifndef ui_add_config_file_menu_item
GtkWidget *plugme_ui_add_config_file_menu_item(const gchar *real_path, const gchar *label,
GtkContainer *parent);
Expand Down

0 comments on commit 8802193

Please sign in to comment.