[gnome-builder/wip/gtk4-port] libide/gtk: move truncate model to libide-gtk
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/gtk: move truncate model to libide-gtk
- Date: Wed, 30 Mar 2022 21:50:06 +0000 (UTC)
commit abbc357061649ec81ef9b56958d376146031d94d
Author: Christian Hergert <chergert redhat com>
Date: Wed Mar 30 14:46:19 2022 -0700
libide/gtk: move truncate model to libide-gtk
src/libide/greeter/meson.build | 2 --
src/libide/gtk/ide-gtk-init.c | 2 ++
src/libide/{greeter => gtk}/ide-truncate-model.c | 0
src/libide/{greeter => gtk}/ide-truncate-model.h | 14 +++++++++++++-
src/libide/gtk/libide-gtk.h | 1 +
src/libide/gtk/meson.build | 2 ++
6 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/greeter/meson.build b/src/libide/greeter/meson.build
index b009e8737..8f02adb6f 100644
--- a/src/libide/greeter/meson.build
+++ b/src/libide/greeter/meson.build
@@ -17,7 +17,6 @@ libide_greeter_public_headers = [
libide_greeter_private_headers = [
'ide-greeter-buttons-section.h',
'ide-greeter-private.h',
- 'ide-truncate-model.h',
]
install_headers(libide_greeter_public_headers, subdir: libide_greeter_header_subdir)
@@ -35,7 +34,6 @@ libide_greeter_public_sources = [
libide_greeter_private_sources = [
'ide-greeter-workspace-actions.c',
'ide-greeter-buttons-section.c',
- 'ide-truncate-model.c',
]
#
diff --git a/src/libide/gtk/ide-gtk-init.c b/src/libide/gtk/ide-gtk-init.c
index d770789a8..b33ce0773 100644
--- a/src/libide/gtk/ide-gtk-init.c
+++ b/src/libide/gtk/ide-gtk-init.c
@@ -31,6 +31,7 @@
#include "ide-fancy-tree-view.h"
#include "ide-progress-icon.h"
#include "ide-search-entry.h"
+#include "ide-truncate-model.h"
void
_ide_gtk_init (void)
@@ -41,6 +42,7 @@ _ide_gtk_init (void)
g_type_ensure (IDE_TYPE_FANCY_TREE_VIEW);
g_type_ensure (IDE_TYPE_PROGRESS_ICON);
g_type_ensure (IDE_TYPE_SEARCH_ENTRY);
+ g_type_ensure (IDE_TYPE_TRUNCATE_MODEL);
g_resources_register (ide_gtk_get_resource ());
}
diff --git a/src/libide/greeter/ide-truncate-model.c b/src/libide/gtk/ide-truncate-model.c
similarity index 100%
rename from src/libide/greeter/ide-truncate-model.c
rename to src/libide/gtk/ide-truncate-model.c
diff --git a/src/libide/greeter/ide-truncate-model.h b/src/libide/gtk/ide-truncate-model.h
similarity index 84%
rename from src/libide/greeter/ide-truncate-model.h
rename to src/libide/gtk/ide-truncate-model.h
index 2c2d1c62e..8be92a0a2 100644
--- a/src/libide/greeter/ide-truncate-model.h
+++ b/src/libide/gtk/ide-truncate-model.h
@@ -20,21 +20,33 @@
#pragma once
-#include <gio/gio.h>
+#if !defined (IDE_GTK_INSIDE) && !defined (IDE_GTK_COMPILATION)
+# error "Only <libide-gtk.h> can be included directly."
+#endif
+
+#include <libide-core.h>
G_BEGIN_DECLS
#define IDE_TYPE_TRUNCATE_MODEL (ide_truncate_model_get_type())
+IDE_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (IdeTruncateModel, ide_truncate_model, IDE, TRUNCATE_MODEL, GObject)
+IDE_AVAILABLE_IN_ALL
IdeTruncateModel *ide_truncate_model_new (GListModel *child_model);
+IDE_AVAILABLE_IN_ALL
GListModel *ide_truncate_model_get_child_model (IdeTruncateModel *self);
+IDE_AVAILABLE_IN_ALL
guint ide_truncate_model_get_max_items (IdeTruncateModel *self);
+IDE_AVAILABLE_IN_ALL
void ide_truncate_model_set_max_items (IdeTruncateModel *self,
guint max_items);
+IDE_AVAILABLE_IN_ALL
gboolean ide_truncate_model_get_can_expand (IdeTruncateModel *self);
+IDE_AVAILABLE_IN_ALL
gboolean ide_truncate_model_get_expanded (IdeTruncateModel *self);
+IDE_AVAILABLE_IN_ALL
void ide_truncate_model_set_expanded (IdeTruncateModel *self,
gboolean expanded);
diff --git a/src/libide/gtk/libide-gtk.h b/src/libide/gtk/libide-gtk.h
index 1234398d7..a5e93bef9 100644
--- a/src/libide/gtk/libide-gtk.h
+++ b/src/libide/gtk/libide-gtk.h
@@ -30,4 +30,5 @@
# include "ide-menu-manager.h"
# include "ide-progress-icon.h"
# include "ide-search-entry.h"
+# include "ide-truncate-model.h"
#undef IDE_GTK_INSIDE
diff --git a/src/libide/gtk/meson.build b/src/libide/gtk/meson.build
index 9f9d52b38..76e13e0ae 100644
--- a/src/libide/gtk/meson.build
+++ b/src/libide/gtk/meson.build
@@ -15,6 +15,7 @@ libide_gtk_public_headers = [
'ide-menu-manager.h',
'ide-progress-icon.h',
'ide-search-entry.h',
+ 'ide-truncate-model.h',
'libide-gtk.h',
]
@@ -37,6 +38,7 @@ libide_gtk_public_sources = [
'ide-menu-manager.c',
'ide-progress-icon.c',
'ide-search-entry.c',
+ 'ide-truncate-model.c',
]
libide_gtk_private_sources = [
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]