[gnome-builder/wip/chergert/perspective] command-bar: port to new IdeWorkbench changes



commit b522f9411b6307d2bca8bc9c80196d19cbbaaa6c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 16 02:44:56 2015 -0800

    command-bar: port to new IdeWorkbench changes

 libide/ide.h                                      |    3 ++
 libide/util/ide-gtk.h                             |    1 +
 plugins/command-bar/Makefile.am                   |    5 +++
 plugins/command-bar/gb-command-bar.c              |    2 +-
 plugins/command-bar/gb-command-gaction-provider.c |    4 +--
 plugins/command-bar/gb-command-provider.c         |    2 +-
 plugins/command-bar/gb-command-vim-provider.c     |   13 ++++----
 plugins/command-bar/gb-vim.c                      |   34 ++++++++++----------
 8 files changed, 36 insertions(+), 28 deletions(-)
---
diff --git a/libide/ide.h b/libide/ide.h
index 55402f5..8047f35 100644
--- a/libide/ide.h
+++ b/libide/ide.h
@@ -109,6 +109,9 @@ G_BEGIN_DECLS
 #include "ide-workbench.h"
 #include "ide-workbench-addin.h"
 
+#include "editor/ide-editor-view.h"
+#include "editor/ide-editor-view-addin.h"
+
 #include "directory/ide-directory-vcs.h"
 #include "doap/ide-doap-person.h"
 #include "doap/ide-doap.h"
diff --git a/libide/util/ide-gtk.h b/libide/util/ide-gtk.h
index 4b7b00d..d10cea3 100644
--- a/libide/util/ide-gtk.h
+++ b/libide/util/ide-gtk.h
@@ -36,6 +36,7 @@ gboolean      ide_widget_action              (GtkWidget               *widget,
 void          ide_widget_set_context_handler (gpointer                 widget,
                                               IdeWidgetContextHandler  handler);
 void          ide_widget_hide_with_fade      (GtkWidget               *widget);
+void          ide_widget_show_with_fade      (GtkWidget               *widget);
 IdeWorkbench *ide_widget_get_workbench       (GtkWidget               *widget);
 
 G_END_DECLS
diff --git a/plugins/command-bar/Makefile.am b/plugins/command-bar/Makefile.am
index 0cd730d..6876299 100644
--- a/plugins/command-bar/Makefile.am
+++ b/plugins/command-bar/Makefile.am
@@ -36,6 +36,11 @@ libcommand_bar_la_SOURCES = \
 
 libcommand_bar_la_CFLAGS = \
        -I$(top_srcdir)/libide \
+       -I$(top_srcdir)/libide/editor \
+       -I$(top_srcdir)/libide/util \
+       -I$(top_srcdir)/contrib/egg \
+       -I$(top_srcdir)/contrib/gd \
+       -I$(top_srcdir)/contrib/nautilus \
        $(BUILDER_CFLAGS) \
        $(DEBUG_CFLAGS) \
        $(OPTIMIZE_CFLAGS) \
diff --git a/plugins/command-bar/gb-command-bar.c b/plugins/command-bar/gb-command-bar.c
index 78e6130..ae6d9b9 100644
--- a/plugins/command-bar/gb-command-bar.c
+++ b/plugins/command-bar/gb-command-bar.c
@@ -644,7 +644,7 @@ gb_command_bar_finalize (GObject *object)
   g_clear_pointer (&self->last_completion, g_free);
   g_clear_pointer (&self->saved_text, g_free);
   g_queue_free_full (self->history, g_free);
-  gb_clear_weak_pointer (&self->last_focus);
+  ide_clear_weak_pointer (&self->last_focus);
 
   G_OBJECT_CLASS (gb_command_bar_parent_class)->finalize (object);
 }
diff --git a/plugins/command-bar/gb-command-gaction-provider.c 
b/plugins/command-bar/gb-command-gaction-provider.c
index af0da7e..f77184e 100644
--- a/plugins/command-bar/gb-command-gaction-provider.c
+++ b/plugins/command-bar/gb-command-gaction-provider.c
@@ -22,8 +22,6 @@
 #include <string.h>
 #include <glib.h>
 
-#include "gb-editor-view.h"
-
 #include "gb-command-gaction-provider.h"
 #include "gb-command-gaction.h"
 
@@ -178,7 +176,7 @@ discover_groups (GbCommandGactionProvider *provider)
 
       /* We exclude these types, they're already in the widgets hierarchy */
       type = G_OBJECT_TYPE (widget);
-      if (type == GB_TYPE_EDITOR_VIEW)
+      if (type == IDE_TYPE_EDITOR_VIEW)
         continue;
 
       prefixes = gtk_widget_list_action_prefixes (widget);
diff --git a/plugins/command-bar/gb-command-provider.c b/plugins/command-bar/gb-command-provider.c
index 480a7d9..1bc865d 100644
--- a/plugins/command-bar/gb-command-provider.c
+++ b/plugins/command-bar/gb-command-provider.c
@@ -352,7 +352,7 @@ gb_command_provider_class_init (GbCommandProviderClass *klass)
     g_param_spec_object ("workbench",
                          "Workbench",
                          "The target workbench.",
-                         GB_TYPE_WORKBENCH,
+                         IDE_TYPE_WORKBENCH,
                          (G_PARAM_READWRITE |
                           G_PARAM_CONSTRUCT_ONLY |
                           G_PARAM_STATIC_STRINGS));
diff --git a/plugins/command-bar/gb-command-vim-provider.c b/plugins/command-bar/gb-command-vim-provider.c
index 4238a7f..4727a48 100644
--- a/plugins/command-bar/gb-command-vim-provider.c
+++ b/plugins/command-bar/gb-command-vim-provider.c
@@ -20,12 +20,13 @@
 
 #include <ide.h>
 
+#include "ide-editor-frame.h"
+#include "ide-editor-frame-private.h"
+#include "ide-editor-view-private.h"
+#include "ide-gtk.h"
+
 #include "gb-command-vim.h"
 #include "gb-command-vim-provider.h"
-#include "gb-editor-frame.h"
-#include "gb-editor-frame-private.h"
-#include "gb-editor-view.h"
-#include "gb-editor-view-private.h"
 #include "gb-vim.h"
 
 struct _GbCommandVimProvider
@@ -51,11 +52,11 @@ get_source_view (GbCommandProvider *provider)
 
   /* Make sure we have an editor tab last focused */
   active_view = gb_command_provider_get_active_view (provider);
-  if (!GB_IS_EDITOR_VIEW (active_view))
+  if (!IDE_IS_EDITOR_VIEW (active_view))
     return NULL;
 
   /* TODO: Perhaps get the last focused frame? */
-  source_view = GB_EDITOR_VIEW (active_view)->frame1->source_view;
+  source_view = IDE_EDITOR_VIEW (active_view)->frame1->source_view;
   if (!IDE_IS_SOURCE_VIEW (source_view))
     return NULL;
 
diff --git a/plugins/command-bar/gb-vim.c b/plugins/command-bar/gb-vim.c
index 9a599c3..ea85330 100644
--- a/plugins/command-bar/gb-vim.c
+++ b/plugins/command-bar/gb-vim.c
@@ -22,9 +22,9 @@
 #include <glib/gi18n.h>
 #include <ide.h>
 
-#include "gb-string.h"
+#include "ide-gtk.h"
+
 #include "gb-vim.h"
-#include "gb-widget.h"
 
 G_DEFINE_QUARK (gb-vim-error-quark, gb_vim_error)
 
@@ -407,11 +407,11 @@ gb_vim_command_edit (GtkSourceView  *source_view,
 
   if (ide_str_empty0 (options))
     {
-      gb_widget_activate_action (GTK_WIDGET (source_view), "workbench", "open", NULL);
+      ide_widget_action (GTK_WIDGET (source_view), "workbench", "open", NULL);
       return TRUE;
     }
 
-  if (!(workbench = gb_widget_get_workbench (GTK_WIDGET (source_view))) ||
+  if (!(workbench = ide_widget_get_workbench (GTK_WIDGET (source_view))) ||
       !(context = ide_workbench_get_context (workbench)) ||
       !(vcs = ide_context_get_vcs (context)) ||
       !(workdir = ide_vcs_get_working_directory (vcs)))
@@ -428,7 +428,7 @@ gb_vim_command_edit (GtkSourceView  *source_view,
   else
     file = g_file_get_child (workdir, options);
 
-  ide_workbench_open (workbench, file);
+  ide_workbench_open_files_async (workbench, &file, 1, NULL, NULL, NULL);
 
   g_clear_object (&file);
 
@@ -444,7 +444,7 @@ gb_vim_command_tabe (GtkSourceView  *source_view,
   if (!ide_str_empty0 (options))
     return gb_vim_command_edit (source_view, command, options, error);
 
-  gb_widget_activate_action (GTK_WIDGET (source_view), "workbench", "new-document", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "workbench", "new-document", NULL);
 
   return TRUE;
 }
@@ -455,8 +455,8 @@ gb_vim_command_quit (GtkSourceView  *source_view,
                      const gchar    *options,
                      GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view", "save", NULL);
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view", "close", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view", "save", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view", "close", NULL);
   return TRUE;
 }
 
@@ -466,7 +466,7 @@ gb_vim_command_split (GtkSourceView  *source_view,
                       const gchar    *options,
                       GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "split-down", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view-stack", "split-down", NULL);
   return TRUE;
 }
 
@@ -476,7 +476,7 @@ gb_vim_command_vsplit (GtkSourceView  *source_view,
                        const gchar    *options,
                        GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "split-left", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view-stack", "split-left", NULL);
   return TRUE;
 }
 
@@ -486,7 +486,7 @@ gb_vim_command_write (GtkSourceView  *source_view,
                       const gchar    *options,
                       GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view", "save", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view", "save", NULL);
   return TRUE;
 }
 
@@ -524,7 +524,7 @@ gb_vim_command_make (GtkSourceView  *source_view,
                      const gchar    *options,
                      GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "workbench", "build", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "workbench", "build", NULL);
   return TRUE;
 }
 
@@ -574,7 +574,7 @@ gb_vim_command_bnext (GtkSourceView  *source_view,
                       const gchar    *options,
                       GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "next-view", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view-stack", "next-view", NULL);
   return TRUE;
 }
 
@@ -584,7 +584,7 @@ gb_vim_command_bprevious (GtkSourceView  *source_view,
                           const gchar    *options,
                           GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "previous-view", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view-stack", "previous-view", NULL);
   return TRUE;
 }
 
@@ -616,7 +616,7 @@ gb_vim_command_buffers (GtkSourceView  *source_view,
                         const gchar    *options,
                         GError        **error)
 {
-  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "show-list", NULL);
+  ide_widget_action (GTK_WIDGET (source_view), "view-stack", "show-list", NULL);
   return TRUE;
 }
 
@@ -659,7 +659,7 @@ gb_vim_command_help (GtkSourceView  *source_view,
   GVariant *param;
 
   param = g_variant_new_string (options);
-  gb_widget_activate_action (GTK_WIDGET (source_view), "workbench", "search-docs", param);
+  ide_widget_action (GTK_WIDGET (source_view), "workbench", "search-docs", param);
   return TRUE;
 }
 
@@ -1086,7 +1086,7 @@ gb_vim_complete_edit_files (GtkSourceView *source_view,
   g_assert (ar);
   g_assert (prefix);
 
-  if (!(workbench = gb_widget_get_workbench (GTK_WIDGET (source_view))) ||
+  if (!(workbench = ide_widget_get_workbench (GTK_WIDGET (source_view))) ||
       !(context = ide_workbench_get_context (workbench)) ||
       !(vcs = ide_context_get_vcs (context)) ||
       !(workdir = ide_vcs_get_working_directory (vcs)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]