From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- src/gtkcompat.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/gtkcompat.h b/src/gtkcompat.h index ca1c187..9cfc50b 100644 --- a/src/gtkcompat.h +++ b/src/gtkcompat.h @@ -92,6 +92,8 @@ G_BEGIN_DECLS compat_widget_set_flag((widget), GTK_NO_WINDOW, !(has_window)) # define gtk_widget_set_can_focus(widget, can_focus) \ compat_widget_set_flag((widget), GTK_CAN_FOCUS, (can_focus)) +# define gtk_widget_set_can_default(widget, can_default) \ + compat_widget_set_flag((widget), GTK_CAN_DEFAULT, (can_default)) #endif #if ! GTK_CHECK_VERSION(2, 20, 0) # define gtk_widget_get_mapped(widget) GTK_WIDGET_MAPPED(widget)
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- src/gtkcompat.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/gtkcompat.h b/src/gtkcompat.h index 9cfc50b..325fd93 100644 --- a/src/gtkcompat.h +++ b/src/gtkcompat.h @@ -23,6 +23,7 @@ #ifndef GTK_COMPAT_H #define GTK_COMPAT_H
+#include <string.h> #include <gtk/gtk.h> #if GTK_CHECK_VERSION(3, 0, 0) # include <gdk/gdkkeysyms-compat.h> @@ -94,6 +95,8 @@ G_BEGIN_DECLS compat_widget_set_flag((widget), GTK_CAN_FOCUS, (can_focus)) # define gtk_widget_set_can_default(widget, can_default) \ compat_widget_set_flag((widget), GTK_CAN_DEFAULT, (can_default)) +# define gtk_widget_get_allocation(widget, alloc) \ + memcpy((alloc), &(GTK_WIDGET(widget)->allocation)); #endif #if ! GTK_CHECK_VERSION(2, 20, 0) # define gtk_widget_get_mapped(widget) GTK_WIDGET_MAPPED(widget)
On 13-11-05 07:21 AM, Quentin Glidic wrote:
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net
src/gtkcompat.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/gtkcompat.h b/src/gtkcompat.h index 9cfc50b..325fd93 100644 --- a/src/gtkcompat.h +++ b/src/gtkcompat.h @@ -23,6 +23,7 @@ #ifndef GTK_COMPAT_H #define GTK_COMPAT_H
+#include <string.h> #include <gtk/gtk.h> #if GTK_CHECK_VERSION(3, 0, 0) # include <gdk/gdkkeysyms-compat.h> @@ -94,6 +95,8 @@ G_BEGIN_DECLS compat_widget_set_flag((widget), GTK_CAN_FOCUS, (can_focus)) # define gtk_widget_set_can_default(widget, can_default) \ compat_widget_set_flag((widget), GTK_CAN_DEFAULT, (can_default)) +# define gtk_widget_get_allocation(widget, alloc) \
memcpy((alloc), &(GTK_WIDGET(widget)->allocation));
+ do { \ + GtkAllocation *al = (alloc); \ + GtkWidget *wid = (widget); \ + g_warn_if_fail(al && GTK_IS_WIDGET(wid)); \ + memcpy(al, &(GTK_WIDGET(wid)->allocation), \ + sizeof(GTK_WIDGET(wid)->allocation)); \ + } while (FALSE)
#endif #if ! GTK_CHECK_VERSION(2, 20, 0) # define gtk_widget_get_mapped(widget) GTK_WIDGET_MAPPED(widget)