[gnome-builder/wip/gtk4-port: 98/1774] libide/gtk: migrate objects from libide-gui




commit d6b1565a563b44d66e0e2417118fa03cdd27d522
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 28 13:37:14 2022 -0700

    libide/gtk: migrate objects from libide-gui
    
    These do not need IDE functionality so they can go into our new base
    libide-gtk library which contains GTK specific widgetry that isn't
    particularly tied to the rest of the IDE.

 src/libide/{gui => gtk}/ide-cell-renderer-fancy.c |  0
 src/libide/{gui => gtk}/ide-cell-renderer-fancy.h | 18 +++++++++---------
 src/libide/{gui => gtk}/ide-fancy-tree-view.c     |  0
 src/libide/{gui => gtk}/ide-fancy-tree-view.h     | 14 ++++++--------
 src/libide/{gui => gtk}/ide-menu-manager.c        |  0
 src/libide/{gui => gtk}/ide-menu-manager.h        |  9 +++++----
 src/libide/gtk/libide-gtk.h                       |  3 +++
 src/libide/gtk/meson.build                        |  6 ++++++
 src/libide/gui/meson.build                        |  6 ------
 9 files changed, 29 insertions(+), 27 deletions(-)
---
diff --git a/src/libide/gui/ide-cell-renderer-fancy.c b/src/libide/gtk/ide-cell-renderer-fancy.c
similarity index 100%
rename from src/libide/gui/ide-cell-renderer-fancy.c
rename to src/libide/gtk/ide-cell-renderer-fancy.c
diff --git a/src/libide/gui/ide-cell-renderer-fancy.h b/src/libide/gtk/ide-cell-renderer-fancy.h
similarity index 86%
rename from src/libide/gui/ide-cell-renderer-fancy.h
rename to src/libide/gtk/ide-cell-renderer-fancy.h
index 2d768612f..4085b2a3e 100644
--- a/src/libide/gui/ide-cell-renderer-fancy.h
+++ b/src/libide/gtk/ide-cell-renderer-fancy.h
@@ -20,8 +20,8 @@
 
 #pragma once
 
-#if !defined (IDE_GUI_INSIDE) && !defined (IDE_GUI_COMPILATION)
-# error "Only <libide-gui.h> can be included directly."
+#if !defined (IDE_GTK_INSIDE) && !defined (IDE_GTK_COMPILATION)
+# error "Only <libide-gtk.h> can be included directly."
 #endif
 
 #include <gtk/gtk.h>
@@ -31,22 +31,22 @@ G_BEGIN_DECLS
 
 #define IDE_TYPE_CELL_RENDERER_FANCY (ide_cell_renderer_fancy_get_type())
 
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (IdeCellRendererFancy, ide_cell_renderer_fancy, IDE, CELL_RENDERER_FANCY, 
GtkCellRenderer)
 
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 GtkCellRenderer *ide_cell_renderer_fancy_new        (void);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 const gchar     *ide_cell_renderer_fancy_get_body   (IdeCellRendererFancy *self);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 const gchar     *ide_cell_renderer_fancy_get_title  (IdeCellRendererFancy *self);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 void             ide_cell_renderer_fancy_take_title (IdeCellRendererFancy *self,
                                                      gchar                *title);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 void             ide_cell_renderer_fancy_set_title  (IdeCellRendererFancy *self,
                                                      const gchar          *title);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 void             ide_cell_renderer_fancy_set_body   (IdeCellRendererFancy *self,
                                                      const gchar          *body);
 
diff --git a/src/libide/gui/ide-fancy-tree-view.c b/src/libide/gtk/ide-fancy-tree-view.c
similarity index 100%
rename from src/libide/gui/ide-fancy-tree-view.c
rename to src/libide/gtk/ide-fancy-tree-view.c
diff --git a/src/libide/gui/ide-fancy-tree-view.h b/src/libide/gtk/ide-fancy-tree-view.h
similarity index 86%
rename from src/libide/gui/ide-fancy-tree-view.h
rename to src/libide/gtk/ide-fancy-tree-view.h
index e8c7caf0b..63de7d1a6 100644
--- a/src/libide/gui/ide-fancy-tree-view.h
+++ b/src/libide/gtk/ide-fancy-tree-view.h
@@ -20,31 +20,29 @@
 
 #pragma once
 
-#if !defined (IDE_GUI_INSIDE) && !defined (IDE_GUI_COMPILATION)
-# error "Only <libide-gui.h> can be included directly."
+#if !defined (IDE_GTK_INSIDE) && !defined (IDE_GTK_COMPILATION)
+# error "Only <libide-gtk.h> can be included directly."
 #endif
 
 #include <gtk/gtk.h>
+
 #include <libide-core.h>
 
 G_BEGIN_DECLS
 
 #define IDE_TYPE_FANCY_TREE_VIEW (ide_fancy_tree_view_get_type())
 
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 G_DECLARE_DERIVABLE_TYPE (IdeFancyTreeView, ide_fancy_tree_view, IDE, FANCY_TREE_VIEW, GtkTreeView)
 
 struct _IdeFancyTreeViewClass
 {
   GtkTreeViewClass parent_class;
-
-  /*< private >*/
-  gpointer _reserved[8];
 };
 
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 GtkWidget *ide_fancy_tree_view_new           (void);
-IDE_AVAILABLE_IN_3_32
+IDE_AVAILABLE_IN_ALL
 void       ide_fancy_tree_view_set_data_func (IdeFancyTreeView      *self,
                                               GtkCellLayoutDataFunc  func,
                                               gpointer               func_data,
diff --git a/src/libide/gui/ide-menu-manager.c b/src/libide/gtk/ide-menu-manager.c
similarity index 100%
rename from src/libide/gui/ide-menu-manager.c
rename to src/libide/gtk/ide-menu-manager.c
diff --git a/src/libide/gui/ide-menu-manager.h b/src/libide/gtk/ide-menu-manager.h
similarity index 93%
rename from src/libide/gui/ide-menu-manager.h
rename to src/libide/gtk/ide-menu-manager.h
index 5011f5e14..c2ba702c3 100644
--- a/src/libide/gui/ide-menu-manager.h
+++ b/src/libide/gtk/ide-menu-manager.h
@@ -16,8 +16,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef IDE_MENU_MANAGER_H
-#define IDE_MENU_MANAGER_H
+#pragma once
+
+#if !defined (IDE_GTK_INSIDE) && !defined (IDE_GTK_COMPILATION)
+# error "Only <libide-gtk.h> can be included directly."
+#endif
 
 #include <gtk/gtk.h>
 
@@ -52,5 +55,3 @@ GMenu          *ide_menu_manager_get_menu_by_id (IdeMenuManager  *self,
                                                  const gchar     *menu_id);
 
 G_END_DECLS
-
-#endif /* IDE_MENU_MANAGER_H */
diff --git a/src/libide/gtk/libide-gtk.h b/src/libide/gtk/libide-gtk.h
index d5aa77a6a..a2a8e9df3 100644
--- a/src/libide/gtk/libide-gtk.h
+++ b/src/libide/gtk/libide-gtk.h
@@ -22,5 +22,8 @@
 
 #define IDE_GTK_INSIDE
 # include "ide-animation.h"
+# include "ide-cell-renderer-fancy.h"
+# include "ide-fancy-tree-view.h"
 # include "ide-gtk-enums.h"
+# include "ide-menu-manager.h"
 #undef IDE_GTK_INSIDE
diff --git a/src/libide/gtk/meson.build b/src/libide/gtk/meson.build
index f057f7a9d..d2fb8824c 100644
--- a/src/libide/gtk/meson.build
+++ b/src/libide/gtk/meson.build
@@ -8,6 +8,9 @@ libide_include_directories += include_directories('.')
 
 libide_gtk_public_headers = [
   'ide-animation.h',
+  'ide-cell-renderer-fancy.h',
+  'ide-fancy-tree-view.h',
+  'ide-menu-manager.h',
   'libide-gtk.h',
 ]
 
@@ -23,6 +26,9 @@ install_headers(libide_gtk_public_headers, subdir: libide_gtk_header_subdir)
 
 libide_gtk_public_sources = [
   'ide-animation.c',
+  'ide-cell-renderer-fancy.c',
+  'ide-fancy-tree-view.c',
+  'ide-menu-manager.c',
 ]
 
 libide_gtk_private_sources = [
diff --git a/src/libide/gui/meson.build b/src/libide/gui/meson.build
index eafcfc4a9..85a752382 100644
--- a/src/libide/gui/meson.build
+++ b/src/libide/gui/meson.build
@@ -10,18 +10,15 @@ libide_gui_generated_headers = []
 libide_gui_public_headers = [
   'ide-application.h',
   'ide-application-addin.h',
-  'ide-cell-renderer-fancy.h',
   'ide-command.h',
   'ide-command-manager.h',
   'ide-command-provider.h',
   'ide-config-view-addin.h',
   'ide-environment-editor.h',
-  'ide-fancy-tree-view.h',
   'ide-frame-addin.h',
   'ide-gui-global.h',
   'ide-header-bar.h',
   'ide-marked-view.h',
-  'ide-menu-manager.h',
   'ide-notifications-button.h',
   'ide-omni-bar-addin.h',
   'ide-omni-bar.h',
@@ -91,19 +88,16 @@ libide_gui_public_sources = [
   'ide-application-addin.c',
   'ide-application-command-line.c',
   'ide-application-open.c',
-  'ide-cell-renderer-fancy.c',
   'ide-command.c',
   'ide-command-manager.c',
   'ide-command-provider.c',
   'ide-config-view-addin.c',
   'ide-environment-editor.c',
-  'ide-fancy-tree-view.c',
   'ide-frame-addin.c',
   'ide-frame.c',
   'ide-gui-global.c',
   'ide-header-bar.c',
   'ide-marked-view.c',
-  'ide-menu-manager.c',
   'ide-notifications-button.c',
   'ide-omni-bar-addin.c',
   'ide-omni-bar.c',


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