[libnma/lr/gtk-4.0: 11/33] private: add more Gtk3/Gtk4 compatibility wrappers
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libnma/lr/gtk-4.0: 11/33] private: add more Gtk3/Gtk4 compatibility wrappers
- Date: Fri, 15 Oct 2021 12:24:13 +0000 (UTC)
commit 69dc91b6eac3b77cade262ef4d555b2fdff89808
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Thu Oct 7 10:57:56 2021 +0200
private: add more Gtk3/Gtk4 compatibility wrappers
This allows code written to utilize Gtk4 to work with Gtk3 reasonably well.
src/nma-private.h | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/nma-private.h b/src/nma-private.h
index 6a6f25b6..74d109a3 100644
--- a/src/nma-private.h
+++ b/src/nma-private.h
@@ -3,15 +3,28 @@
*
* Lubomir Rintel <lkundrak v3 sk>
*
- * Copyright (C) 2019 Red Hat, Inc.
+ * Copyright (C) 2019 - 2021 Red Hat, Inc.
*/
#ifndef NMA_PRIVATE_H
#if !GTK_CHECK_VERSION(3,96,0)
-#define gtk_editable_set_text(editable,text) gtk_entry_set_text(GTK_ENTRY(editable), (text))
-#define gtk_editable_get_text(editable) gtk_entry_get_text(GTK_ENTRY(editable))
-#define gtk_editable_set_width_chars(editable, n_chars) gtk_entry_set_width_chars(GTK_ENTRY(editable),
(n_chars))
+#define gtk_editable_set_text(editable,text) gtk_entry_set_text(GTK_ENTRY(editable), (text))
+#define gtk_editable_get_text(editable) gtk_entry_get_text(GTK_ENTRY(editable))
+#define gtk_editable_set_width_chars(editable, n_chars)
gtk_entry_set_width_chars(GTK_ENTRY(editable), (n_chars))
+#define gtk_box_append(box, widget) gtk_container_add(GTK_CONTAINER(box), (widget))
+#define gtk_box_remove(box, widget) gtk_container_remove(GTK_CONTAINER(box), (widget))
+#define gtk_window_destroy(window) gtk_widget_destroy(GTK_WIDGET (window))
+#define gtk_check_button_get_active(button)
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))
+#define gtk_check_button_set_active(button, active)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), active)
+#define gtk_window_set_child(window, child) gtk_container_add(GTK_CONTAINER (window), child)
+#define gtk_image_new_from_icon_name(name) gtk_image_new_from_icon_name((name),
GTK_ICON_SIZE_BUTTON)
+#define gtk_button_set_child(button, widget) gtk_container_add(GTK_CONTAINER(button), (widget))
+#define gtk_init() gtk_init(&argc, &argv)
+#define gtk_window_new() gtk_window_new(GTK_WINDOW_TOPLEVEL)
+#define gtk_widget_get_root(widget) gtk_widget_get_toplevel(widget)
+
+typedef void GtkRoot;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]