Kaydet (Commit) 5ad6316e authored tarafından Colomban Wendling's avatar Colomban Wendling

Merge pull request #1038 from kugel-/gi-signals

Fix signals for GI
......@@ -74,14 +74,11 @@ AS_IF([test "x$enable_gtk3" = xyes],
AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
# GTK/GLib/GIO checks
gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.28"
gtk_modules_private="gio-2.0 >= 2.28 gmodule-no-export-2.0"
gtk_modules="$gtk_package >= $gtk_min_version glib-2.0 >= 2.32"
gtk_modules_private="gio-2.0 >= 2.32 gmodule-no-export-2.0"
PKG_CHECK_MODULES([GTK], [$gtk_modules $gtk_modules_private])
AC_SUBST([DEPENDENCIES], [$gtk_modules])
dnl Define minimum requirements to avoid warnings about symbols deprecated afterward.
dnl Although GLIB_VERSION_2_28 is new in 2.32, older versions won't evaluate
dnl GLIB_VERSION_MIN_REQUIRED so it won't be a problem.
AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28"])
AS_VAR_APPEND([GTK_CFLAGS], [" -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"])
dnl Disable all GTK deprecations on 3.x so long as we want to keep 2.x support and only require 3.0.
dnl No need on 2.x as we target the latest version.
AM_COND_IF([GTK3], [AS_VAR_APPEND([GTK_CFLAGS], [" -DGDK_DISABLE_DEPRECATION_WARNINGS"])])
......
......@@ -3250,6 +3250,7 @@ void scintilla_release_resources(void) {
static void *copy_(void *src) { return src; }
static void free_(void *doc) { }
GEANY_API_SYMBOL
GType scnotification_get_type(void) {
static gsize type_id = 0;
if (g_once_init_enter(&type_id)) {
......
......@@ -50,6 +50,14 @@ index 0871ca2..49dc278 100644
GtkWidget *scintilla_object_new() {
return scintilla_new();
}
@@ -3250,6 +3250,7 @@ void scintilla_release_resources(void) {
static void *copy_(void *src) { return src; }
static void free_(void *doc) { }
+GEANY_API_SYMBOL
GType scnotification_get_type(void) {
static gsize type_id = 0;
if (g_once_init_enter(&type_id)) {
diff --git scintilla/src/Catalogue.cxx scintilla/src/Catalogue.cxx
index ed47aa8..e58f1ab 100644
--- scintilla/src/Catalogue.cxx
......
......@@ -54,7 +54,7 @@ fetch_and_unzip()
{
local basename=${1##*/}
curl -L -# "$1" > "$basename"
unzip -q "$basename" -d "$2"
unzip -qn "$basename" -d "$2"
rm -f "$basename"
}
......@@ -87,7 +87,8 @@ mkdir "$BUILDDIR"
cd "$BUILDDIR"
mkdir _deps
fetch_and_unzip "$BUNDLE_ZIP" _deps
fetch_and_unzip "$GTK3_BUNDLE_ZIP" _deps
[ "$GTK3" = yes ] || fetch_and_unzip "$BUNDLE_ZIP" _deps
# fixup the prefix= in the pkg-config files
sed -i "s%^\(prefix=\).*$%\1$PWD/_deps%" _deps/lib/pkgconfig/*.pc
......
......@@ -3847,3 +3847,15 @@ void document_grab_focus(GeanyDocument *doc)
gtk_widget_grab_focus(GTK_WIDGET(doc->editor->sci));
}
static void *copy_(void *src) { return src; }
static void free_(void *doc) { }
/** @gironly
* Gets the GType of GeanyDocument
*
* @return the GeanyDocument type */
GEANY_API_SYMBOL
GType document_get_type (void);
G_DEFINE_BOXED_TYPE(GeanyDocument, document, copy_, free_);
......@@ -70,6 +70,9 @@ typedef struct GeanyFilePrefs
GeanyFilePrefs;
#define GEANY_TYPE_DOCUMENT (document_get_type())
GType document_get_type (void);
/**
* Structure for representing an open tab with all its properties.
**/
......
......@@ -5309,3 +5309,15 @@ void editor_insert_snippet(GeanyEditor *editor, gint pos, const gchar *snippet)
editor_insert_text_block(editor, pattern->str, pos, -1, -1, TRUE);
g_string_free(pattern, TRUE);
}
static void *copy_(void *src) { return src; }
static void free_(void *doc) { }
/** @gironly
* Gets the GType of GeanyEditor
*
* @return the GeanyEditor type */
GEANY_API_SYMBOL
GType editor_get_type (void);
G_DEFINE_BOXED_TYPE(GeanyEditor, editor, copy_, free_);
......@@ -139,6 +139,10 @@ typedef struct GeanyEditorPrefs
}
GeanyEditorPrefs;
#define GEANY_TYPE_EDITOR (editor_get_type())
GType editor_get_type (void);
/** Editor-owned fields for each document. */
typedef struct GeanyEditor
{
......
......@@ -1585,3 +1585,15 @@ gboolean filetype_get_comment_open_close(const GeanyFiletype *ft, gboolean singl
return !EMPTY(*co);
}
static void *copy_(void *src) { return src; }
static void free_(void *doc) { }
/** @gironly
* Gets the GType of GeanyFiletype
*
* @return the GeanyFiletype type */
GEANY_API_SYMBOL
GType filetype_get_type (void);
G_DEFINE_BOXED_TYPE(GeanyFiletype, filetype, copy_, free_);
......@@ -186,6 +186,9 @@ const gchar *filetypes_get_display_name(GeanyFiletype *ft);
const GSList *filetypes_get_sorted_by_name(void);
#define GEANY_TYPE_FILETYPE (filetype_get_type())
GType filetype_get_type (void);
#ifdef GEANY_PRIVATE
......
This diff is collapsed.
......@@ -74,6 +74,8 @@ GeanyCallbackId;
typedef struct _GeanyObject GeanyObject;
typedef struct _GeanyObjectClass GeanyObjectClass;
/** @gironly
* Instance structure for GeanyObject */
struct _GeanyObject
{
GObject parent;
......@@ -82,30 +84,11 @@ struct _GeanyObject
extern GObject *geany_object;
/** @gironly
* Class structure for @a GeanyObject */
struct _GeanyObjectClass
{
GObjectClass parent_class;
void (*document_new)(GeanyDocument *doc);
void (*document_open)(GeanyDocument *doc);
void (*document_reload)(GeanyDocument *doc);
void (*document_before_save)(GeanyDocument *doc);
void (*document_save)(GeanyDocument *doc);
void (*document_filetype_set)(GeanyDocument *doc, GeanyFiletype *filetype_old);
void (*document_activate)(GeanyDocument *doc);
void (*document_close)(GeanyDocument *doc);
void (*project_open)(GKeyFile *keyfile);
void (*project_save)(GKeyFile *keyfile);
void (*project_close)(void);
void (*project_dialog_open)(GtkWidget *notebook);
void (*project_dialog_confirmed)(GtkWidget *notebook);
void (*project_dialog_close)(GtkWidget *notebook);
void (*update_editor_menu)(const gchar *word, gint click_pos, GeanyDocument *doc);
gboolean (*editor_notify)(GeanyEditor *editor, gpointer scnt);
void (*geany_startup_complete)(void);
void (*build_start)(void);
void (*save_settings)(GKeyFile *keyfile);
void (*load_settings)(GKeyFile *keyfile);
};
GType geany_object_get_type (void);
......
......@@ -183,6 +183,12 @@ typedef struct GeanyData
struct GeanyTemplatePrefs *template_prefs; /**< Template settings */
gpointer *_compat; /* Remove field on next ABI break (abi-todo) */
GSList *filetypes_by_title; /**< See filetypes.h#filetypes_by_title. */
/** @gironly
* Global object signalling events via signals
*
* This is mostly for language bindings. Otherwise prefer to use
* plugin_signal_connect() instead this which adds automatic cleanup. */
GObject *object;
}
GeanyData;
......
......@@ -120,7 +120,8 @@ geany_data_init(void)
&tool_prefs,
&template_prefs,
NULL, /* Remove field on next ABI break (abi-todo) */
filetypes_by_title
filetypes_by_title,
geany_object,
};
geany_data = gd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment