Skip to content

Commit

Permalink
plugin api: convert GeanyEditor to GBoxed internally
Browse files Browse the repository at this point in the history
GeanyObject signals require GTypes to be gobject-introspection compatible.
  • Loading branch information
kugel- committed Jun 22, 2016
1 parent 7702a46 commit be64b17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/editor.c
Expand Up @@ -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_);
4 changes: 4 additions & 0 deletions src/editor.h
Expand Up @@ -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
{
Expand Down

0 comments on commit be64b17

Please sign in to comment.