[gnome-builder] workbench: break workspace and workbench into it's own header
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] workbench: break workspace and workbench into it's own header
- Date: Sun, 14 Dec 2014 11:06:21 +0000 (UTC)
commit 924f69bae9ad9419a6380965486985163e6e2ad8
Author: Christian Hergert <christian hergert me>
Date: Sun Dec 14 03:06:00 2014 -0800
workbench: break workspace and workbench into it's own header
src/commands/gb-command-bar.c | 1 +
src/commands/gb-command-manager.c | 3 ++
src/commands/gb-command-manager.h | 14 ++++++------
src/commands/gb-command-provider.c | 1 +
src/commands/gb-command-provider.h | 2 +-
src/commands/gb-command-result.h | 2 +-
src/commands/gb-command-vim-provider.c | 1 +
src/commands/gb-command.h | 2 +-
src/gnome-builder.mk | 2 +
src/navigation/gb-navigation-list.h | 19 ++++++++--------
src/workbench/gb-workbench-types.h | 36 ++++++++++++++++++++++++++++++++
src/workbench/gb-workbench.c | 2 +-
src/workbench/gb-workbench.h | 12 ++++------
src/workbench/gb-workspace.h | 6 +---
14 files changed, 72 insertions(+), 31 deletions(-)
---
diff --git a/src/commands/gb-command-bar.c b/src/commands/gb-command-bar.c
index 7dcea50..456f729 100644
--- a/src/commands/gb-command-bar.c
+++ b/src/commands/gb-command-bar.c
@@ -26,6 +26,7 @@
#include "gb-glib.h"
#include "gb-string.h"
#include "gb-widget.h"
+#include "gb-workbench.h"
struct _GbCommandBarPrivate
{
diff --git a/src/commands/gb-command-manager.c b/src/commands/gb-command-manager.c
index 1eb560d..e9d9c3d 100644
--- a/src/commands/gb-command-manager.c
+++ b/src/commands/gb-command-manager.c
@@ -16,9 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#define G_LOG_DOMAIN "command-manager"
+
#include <string.h>
#include "gb-command-manager.h"
+#include "gb-workbench.h"
struct _GbCommandManagerPrivate
{
diff --git a/src/commands/gb-command-manager.h b/src/commands/gb-command-manager.h
index 69e6cba..a572dc5 100644
--- a/src/commands/gb-command-manager.h
+++ b/src/commands/gb-command-manager.h
@@ -51,13 +51,13 @@ struct _GbCommandManagerClass
GObjectClass parent;
};
-GType gb_command_manager_get_type (void) G_GNUC_CONST;
-GbCommand *gb_command_manager_lookup (GbCommandManager *manager,
- const gchar *command_text);
-gchar ** gb_command_manager_complete (GbCommandManager *manager,
- const gchar *initial_command_text);
-void gb_command_manager_add_provider (GbCommandManager *manager,
- GbCommandProvider *provider);
+GType gb_command_manager_get_type (void);
+GbCommand *gb_command_manager_lookup (GbCommandManager *manager,
+ const gchar *command_text);
+gchar **gb_command_manager_complete (GbCommandManager *manager,
+ const gchar *initial_command_text);
+void gb_command_manager_add_provider (GbCommandManager *manager,
+ GbCommandProvider *provider);
G_END_DECLS
diff --git a/src/commands/gb-command-provider.c b/src/commands/gb-command-provider.c
index d7c5380..6b05ed2 100644
--- a/src/commands/gb-command-provider.c
+++ b/src/commands/gb-command-provider.c
@@ -19,6 +19,7 @@
#include <glib/gi18n.h>
#include "gb-command-provider.h"
+#include "gb-workbench.h"
struct _GbCommandProviderPrivate
{
diff --git a/src/commands/gb-command-provider.h b/src/commands/gb-command-provider.h
index c636f6d..fd0ad91 100644
--- a/src/commands/gb-command-provider.h
+++ b/src/commands/gb-command-provider.h
@@ -23,7 +23,7 @@
#include "gb-command.h"
#include "gb-document-view.h"
-#include "gb-workbench.h"
+#include "gb-workbench-types.h"
G_BEGIN_DECLS
diff --git a/src/commands/gb-command-result.h b/src/commands/gb-command-result.h
index 5efa9ed..ab82d1f 100644
--- a/src/commands/gb-command-result.h
+++ b/src/commands/gb-command-result.h
@@ -48,7 +48,7 @@ struct _GbCommandResultClass
GObjectClass parent;
};
-GType gb_command_result_get_type (void) G_GNUC_CONST;
+GType gb_command_result_get_type (void);
GbCommandResult *gb_command_result_new (void);
gboolean gb_command_result_get_is_running (GbCommandResult *result);
void gb_command_result_set_is_running (GbCommandResult *result,
diff --git a/src/commands/gb-command-vim-provider.c b/src/commands/gb-command-vim-provider.c
index 0842ab0..4d03367 100644
--- a/src/commands/gb-command-vim-provider.c
+++ b/src/commands/gb-command-vim-provider.c
@@ -24,6 +24,7 @@
#include "gb-command-vim-provider.h"
#include "gb-source-view.h"
#include "gb-source-vim.h"
+#include "gb-workbench.h"
G_DEFINE_TYPE (GbCommandVimProvider, gb_command_vim_provider,
GB_TYPE_COMMAND_PROVIDER)
diff --git a/src/commands/gb-command.h b/src/commands/gb-command.h
index d2afdbb..d667088 100644
--- a/src/commands/gb-command.h
+++ b/src/commands/gb-command.h
@@ -52,7 +52,7 @@ struct _GbCommandClass
GbCommandResult *(*execute) (GbCommand *command);
};
-GType gb_command_get_type (void) G_GNUC_CONST;
+GType gb_command_get_type (void);
GbCommand *gb_command_new (void);
GbCommandResult *gb_command_execute (GbCommand *command);
diff --git a/src/gnome-builder.mk b/src/gnome-builder.mk
index e493aa4..2f2d090 100644
--- a/src/gnome-builder.mk
+++ b/src/gnome-builder.mk
@@ -181,6 +181,7 @@ libgnome_builder_la_SOURCES = \
src/vim/gb-source-vim.h \
src/workbench/gb-workbench.c \
src/workbench/gb-workbench.h \
+ src/workbench/gb-workbench-types.h \
src/workbench/gb-workspace.c \
src/workbench/gb-workspace.h
@@ -264,3 +265,4 @@ EXTRA_DIST += src/resources/gnome-builder.gresource.xml
EXTRA_DIST += $(gnome_builder_built_sources)
DISTCLEANFILES += $(gnome_builder_built_sources)
+
diff --git a/src/navigation/gb-navigation-list.h b/src/navigation/gb-navigation-list.h
index 34762c7..bb2666f 100644
--- a/src/navigation/gb-navigation-list.h
+++ b/src/navigation/gb-navigation-list.h
@@ -50,15 +50,16 @@ struct _GbNavigationListClass
GObjectClass parent;
};
-GType gb_navigation_list_get_type (void) G_GNUC_CONST;
-gboolean gb_navigation_list_get_can_go_backward (GbNavigationList *list);
-gboolean gb_navigation_list_get_can_go_forward (GbNavigationList *list);
-GbNavigationItem *gb_navigation_list_get_current_item (GbNavigationList *list);
-void gb_navigation_list_append (GbNavigationList *list,
- GbNavigationItem *item);
-void gb_navigation_list_go_backward (GbNavigationList *list);
-void gb_navigation_list_go_forward (GbNavigationList *list);
-guint gb_navigation_list_get_depth (GbNavigationList *list);
+GType gb_navigation_list_get_type (void);
+gboolean gb_navigation_list_get_can_go_backward (GbNavigationList *list);
+gboolean gb_navigation_list_get_can_go_forward (GbNavigationList *list);
+GbNavigationItem *gb_navigation_list_get_current_item (GbNavigationList *list);
+void gb_navigation_list_append (GbNavigationList *list,
+ GbNavigationItem *item);
+void gb_navigation_list_go_backward (GbNavigationList *list);
+void gb_navigation_list_go_forward (GbNavigationList *list);
+guint gb_navigation_list_get_depth (GbNavigationList *list);
+GbWorkbench *gb_navigation_list_get_workbench (GbNavigationList *list);
G_END_DECLS
diff --git a/src/workbench/gb-workbench-types.h b/src/workbench/gb-workbench-types.h
new file mode 100644
index 0000000..0fbe0a5
--- /dev/null
+++ b/src/workbench/gb-workbench-types.h
@@ -0,0 +1,36 @@
+/* gb-workbench-types.h
+ *
+ * Copyright (C) 2014 Christian Hergert <christian hergert me>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GB_WORKBENCH_TYPES_H
+#define GB_WORKBENCH_TYPES_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GbWorkbench GbWorkbench;
+typedef struct _GbWorkbenchClass GbWorkbenchClass;
+typedef struct _GbWorkbenchPrivate GbWorkbenchPrivate;
+
+typedef struct _GbWorkspace GbWorkspace;
+typedef struct _GbWorkspaceClass GbWorkspaceClass;
+typedef struct _GbWorkspacePrivate GbWorkspacePrivate;
+
+G_END_DECLS
+
+#endif /* GB_WORKBENCH_TYPES_H */
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index c69c6c1..ffc9b14 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -88,7 +88,7 @@ static guint gSignals [LAST_SIGNAL];
*
* Returns: (transfer none) (type GbCommandManager*): A #GbCommandManager.
*/
-gpointer
+GbCommandManager *
gb_workbench_get_command_manager (GbWorkbench *workbench)
{
g_return_val_if_fail (GB_IS_WORKBENCH (workbench), NULL);
diff --git a/src/workbench/gb-workbench.h b/src/workbench/gb-workbench.h
index e651999..8bca85a 100644
--- a/src/workbench/gb-workbench.h
+++ b/src/workbench/gb-workbench.h
@@ -21,7 +21,10 @@
#include <gtk/gtk.h>
+#include "gb-command-manager.h"
+#include "gb-document-manager.h"
#include "gb-navigation-list.h"
+#include "gb-workbench-types.h"
#include "gb-workspace.h"
G_BEGIN_DECLS
@@ -34,10 +37,6 @@ G_BEGIN_DECLS
#define GB_IS_WORKBENCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GB_TYPE_WORKBENCH))
#define GB_WORKBENCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GB_TYPE_WORKBENCH,
GbWorkbenchClass))
-typedef struct _GbWorkbench GbWorkbench;
-typedef struct _GbWorkbenchClass GbWorkbenchClass;
-typedef struct _GbWorkbenchPrivate GbWorkbenchPrivate;
-
struct _GbWorkbench
{
GtkApplicationWindow parent;
@@ -57,12 +56,11 @@ struct _GbWorkbenchClass
GType gb_workbench_get_type (void);
GbNavigationList *gb_workbench_get_navigation_list (GbWorkbench *workbench);
+GbDocumentManager *gb_workbench_get_document_manager (GbWorkbench *workbench);
GbWorkspace *gb_workbench_get_active_workspace (GbWorkbench *workbench);
GbWorkspace *gb_workbench_get_workspace (GbWorkbench *workbench,
GType type);
-gpointer gb_workbench_get_command_manager (GbWorkbench *workbench);
-
-GbWorkbench *gb_navigation_list_get_workbench (GbNavigationList *list);
+GbCommandManager *gb_workbench_get_command_manager (GbWorkbench *workbench);
G_END_DECLS
diff --git a/src/workbench/gb-workspace.h b/src/workbench/gb-workspace.h
index a730142..a747fe8 100644
--- a/src/workbench/gb-workspace.h
+++ b/src/workbench/gb-workspace.h
@@ -21,6 +21,8 @@
#include <gtk/gtk.h>
+#include "gb-workbench-types.h"
+
G_BEGIN_DECLS
#define GB_TYPE_WORKSPACE (gb_workspace_get_type())
@@ -31,10 +33,6 @@ G_BEGIN_DECLS
#define GB_IS_WORKSPACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GB_TYPE_WORKSPACE))
#define GB_WORKSPACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GB_TYPE_WORKSPACE,
GbWorkspaceClass))
-typedef struct _GbWorkspace GbWorkspace;
-typedef struct _GbWorkspaceClass GbWorkspaceClass;
-typedef struct _GbWorkspacePrivate GbWorkspacePrivate;
-
struct _GbWorkspace
{
GtkBin parent;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]