[gnome-builder] editor: add public API to create a new document
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editor: add public API to create a new document
- Date: Mon, 19 Jan 2015 07:30:55 +0000 (UTC)
commit b835be7d8ab51c2546d1bb2f00fc7c380a81c3ca
Author: Christian Hergert <christian hergert me>
Date: Sun Jan 18 23:06:26 2015 -0800
editor: add public API to create a new document
src/editor/gb-editor-workspace.c | 17 ++++++++++++-----
src/editor/gb-editor-workspace.h | 7 ++++---
2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/editor/gb-editor-workspace.c b/src/editor/gb-editor-workspace.c
index f0c5e8c..673684e 100644
--- a/src/editor/gb-editor-workspace.c
+++ b/src/editor/gb-editor-workspace.c
@@ -201,12 +201,9 @@ gb_editor_workspace_action_open_uri_list (GSimpleAction *action,
}
}
-static void
-gb_editor_workspace_action_new_document (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
+void
+gb_editor_workspace_new_document (GbEditorWorkspace *workspace)
{
- GbEditorWorkspace *workspace = user_data;
GbDocumentManager *manager;
GbWorkbench *workbench;
GbDocument *document;
@@ -224,6 +221,16 @@ gb_editor_workspace_action_new_document (GSimpleAction *action,
}
static void
+gb_editor_workspace_action_new_document (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GbEditorWorkspace *workspace = user_data;
+ g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
+ gb_editor_workspace_new_document (workspace);
+}
+
+static void
gb_editor_workspace_action_open (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
diff --git a/src/editor/gb-editor-workspace.h b/src/editor/gb-editor-workspace.h
index 4fd0c74..eaff983 100644
--- a/src/editor/gb-editor-workspace.h
+++ b/src/editor/gb-editor-workspace.h
@@ -48,9 +48,10 @@ struct _GbEditorWorkspaceClass
GbWorkspaceClass parent_class;
};
-GType gb_editor_workspace_get_type (void);
-void gb_editor_workspace_open (GbEditorWorkspace *workspace,
- GFile *file);
+GType gb_editor_workspace_get_type (void);
+void gb_editor_workspace_new_document (GbEditorWorkspace *workspace);
+void gb_editor_workspace_open (GbEditorWorkspace *workspace,
+ GFile *file);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]