aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-01-30 08:22:20 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-01-31 02:21:02 +0100
commitd7279189cbd51d2d1b5dee36a4fb09f3388801e0 (patch)
tree443c7e307a7a60a1d70ffdcaa07c7b16903cca09
parent360925350c4667107c71191176fc479cad8dcaf8 (diff)
downloadsciteco-d7279189cbd51d2d1b5dee36a4fb09f3388801e0.tar.gz
made the fallback GtkFlowBox a stand-alone widget that can be built outside of Gtk
* it was necessary to remove the accessibility integration since I don't want to import a lot of bloat into the SciTECO codebase * Includes follow the guidelines of external Gtk code now * internationalization support has been removed * The "move-cursor" signal uses the generic marshaller now since we don't want to introduce genmarshal just for that signal (and it will never be called from a scripting language)
-rw-r--r--src/gtkflowbox.c51
-rw-r--r--src/gtkflowbox.h41
2 files changed, 23 insertions, 69 deletions
diff --git a/src/gtkflowbox.c b/src/gtkflowbox.c
index 0c55636..1a5c2e9 100644
--- a/src/gtkflowbox.c
+++ b/src/gtkflowbox.c
@@ -52,16 +52,13 @@
*
* GtkFlowBox was added in GTK+ 3.12.
*/
-
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
-#include "gtkflowbox.h"
-#include "gtkmarshalers.h"
-#include "gtkprivate.h"
-#include "gtkintl.h"
+#include <gtk/gtk.h>
-#include "a11y/gtkflowboxaccessibleprivate.h"
-#include "a11y/gtkflowboxchildaccessible.h"
+#include "gtkflowbox.h"
/* Forward declarations and utilities {{{1 */
@@ -596,7 +593,7 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
* it can be used by applications for their own purposes.
*/
child_signals[CHILD_ACTIVATE] =
- g_signal_new (I_("activate"),
+ g_signal_new ("activate",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkFlowBoxChildClass, activate),
@@ -1024,7 +1021,6 @@ gtk_flow_box_update_cursor (GtkFlowBox *box,
BOX_PRIV (box)->cursor_child = child;
gtk_widget_grab_focus (GTK_WIDGET (child));
gtk_widget_queue_draw (GTK_WIDGET (child));
- _gtk_flow_box_accessible_update_cursor (GTK_WIDGET (box), GTK_WIDGET (child));
}
static void
@@ -3485,7 +3481,6 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
static void
gtk_flow_box_selected_children_changed (GtkFlowBox *box)
{
- _gtk_flow_box_accessible_selection_changed (GTK_WIDGET (box));
}
/* GObject implementation {{{2 */
@@ -3644,8 +3639,8 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_SELECTION_MODE,
g_param_spec_enum ("selection-mode",
- P_("Selection mode"),
- P_("The selection mode"),
+ "Selection mode",
+ "The selection mode",
GTK_TYPE_SELECTION_MODE,
GTK_SELECTION_SINGLE,
G_PARAM_READWRITE));
@@ -3659,8 +3654,8 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_ACTIVATE_ON_SINGLE_CLICK,
g_param_spec_boolean ("activate-on-single-click",
- P_("Activate on Single Click"),
- P_("Activate row on a single click"),
+ "Activate on Single Click",
+ "Activate row on a single click",
TRUE,
G_PARAM_READWRITE));
@@ -3673,8 +3668,8 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_HOMOGENEOUS,
g_param_spec_boolean ("homogeneous",
- P_("Homogeneous"),
- P_("Whether the children should all be the same size"),
+ "Homogeneous",
+ "Whether the children should all be the same size",
FALSE,
G_PARAM_READWRITE));
@@ -3691,9 +3686,9 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_MIN_CHILDREN_PER_LINE,
g_param_spec_uint ("min-children-per-line",
- P_("Minimum Children Per Line"),
- P_("The minimum number of children to allocate "
- "consecutively in the given orientation."),
+ "Minimum Children Per Line",
+ "The minimum number of children to allocate "
+ "consecutively in the given orientation.",
0,
G_MAXUINT,
0,
@@ -3708,9 +3703,9 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_MAX_CHILDREN_PER_LINE,
g_param_spec_uint ("max-children-per-line",
- P_("Maximum Children Per Line"),
- P_("The maximum amount of children to request space for "
- "consecutively in the given orientation."),
+ "Maximum Children Per Line",
+ "The maximum amount of children to request space for "
+ "consecutively in the given orientation.",
0,
G_MAXUINT,
DEFAULT_MAX_CHILDREN_PER_LINE,
@@ -3724,8 +3719,8 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_ROW_SPACING,
g_param_spec_uint ("row-spacing",
- P_("Vertical spacing"),
- P_("The amount of vertical space between two children"),
+ "Vertical spacing",
+ "The amount of vertical space between two children",
0,
G_MAXUINT,
0,
@@ -3739,8 +3734,8 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
g_object_class_install_property (object_class,
PROP_COLUMN_SPACING,
g_param_spec_uint ("column-spacing",
- P_("Horizontal spacing"),
- P_("The amount of horizontal space between two children"),
+ "Horizontal spacing",
+ "The amount of horizontal space between two children",
0,
G_MAXUINT,
0,
@@ -3845,7 +3840,7 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkFlowBoxClass, move_cursor),
NULL, NULL,
- _gtk_marshal_VOID__ENUM_INT,
+ NULL,
G_TYPE_NONE, 2,
GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT);
/**
@@ -3932,8 +3927,6 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
"select-all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"unselect-all", 0);
-
- gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_FLOW_BOX_ACCESSIBLE);
}
static void
diff --git a/src/gtkflowbox.h b/src/gtkflowbox.h
index f0f1790..6f0549f 100644
--- a/src/gtkflowbox.h
+++ b/src/gtkflowbox.h
@@ -25,11 +25,7 @@
#ifndef __GTK_FLOW_BOX_H__
#define __GTK_FLOW_BOX_H__
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#include <gtk/gtkbin.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -99,62 +95,41 @@ struct _GtkFlowBoxChildClass
void (*_gtk_reserved2) (void);
};
-GDK_AVAILABLE_IN_3_12
GType gtk_flow_box_child_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_3_12
GtkWidget* gtk_flow_box_child_new (void);
-GDK_AVAILABLE_IN_3_12
gint gtk_flow_box_child_get_index (GtkFlowBoxChild *child);
-GDK_AVAILABLE_IN_3_12
gboolean gtk_flow_box_child_is_selected (GtkFlowBoxChild *child);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_child_changed (GtkFlowBoxChild *child);
-GDK_AVAILABLE_IN_3_12
GType gtk_flow_box_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_3_12
GtkWidget *gtk_flow_box_new (void);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_homogeneous (GtkFlowBox *box,
gboolean homogeneous);
-GDK_AVAILABLE_IN_3_12
gboolean gtk_flow_box_get_homogeneous (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_row_spacing (GtkFlowBox *box,
guint spacing);
-GDK_AVAILABLE_IN_3_12
guint gtk_flow_box_get_row_spacing (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_column_spacing (GtkFlowBox *box,
guint spacing);
-GDK_AVAILABLE_IN_3_12
guint gtk_flow_box_get_column_spacing (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_min_children_per_line (GtkFlowBox *box,
guint n_children);
-GDK_AVAILABLE_IN_3_12
guint gtk_flow_box_get_min_children_per_line (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_max_children_per_line (GtkFlowBox *box,
guint n_children);
-GDK_AVAILABLE_IN_3_12
guint gtk_flow_box_get_max_children_per_line (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_activate_on_single_click (GtkFlowBox *box,
gboolean single);
-GDK_AVAILABLE_IN_3_12
gboolean gtk_flow_box_get_activate_on_single_click (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_insert (GtkFlowBox *box,
GtkWidget *widget,
gint position);
-GDK_AVAILABLE_IN_3_12
GtkFlowBoxChild *gtk_flow_box_get_child_at_index (GtkFlowBox *box,
gint idx);
@@ -162,55 +137,41 @@ typedef void (* GtkFlowBoxForeachFunc) (GtkFlowBox *box,
GtkFlowBoxChild *child,
gpointer user_data);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_selected_foreach (GtkFlowBox *box,
GtkFlowBoxForeachFunc func,
gpointer data);
-GDK_AVAILABLE_IN_3_12
GList *gtk_flow_box_get_selected_children (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_select_child (GtkFlowBox *box,
GtkFlowBoxChild *child);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_unselect_child (GtkFlowBox *box,
GtkFlowBoxChild *child);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_select_all (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_unselect_all (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_selection_mode (GtkFlowBox *box,
GtkSelectionMode mode);
-GDK_AVAILABLE_IN_3_12
GtkSelectionMode gtk_flow_box_get_selection_mode (GtkFlowBox *box);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_hadjustment (GtkFlowBox *box,
GtkAdjustment *adjustment);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_vadjustment (GtkFlowBox *box,
GtkAdjustment *adjustment);
typedef gboolean (*GtkFlowBoxFilterFunc) (GtkFlowBoxChild *child,
gpointer user_data);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_filter_func (GtkFlowBox *box,
GtkFlowBoxFilterFunc filter_func,
gpointer user_data,
GDestroyNotify destroy);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_invalidate_filter (GtkFlowBox *box);
typedef gint (*GtkFlowBoxSortFunc) (GtkFlowBoxChild *child1,
GtkFlowBoxChild *child2,
gpointer user_data);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_set_sort_func (GtkFlowBox *box,
GtkFlowBoxSortFunc sort_func,
gpointer user_data,
GDestroyNotify destroy);
-GDK_AVAILABLE_IN_3_12
void gtk_flow_box_invalidate_sort (GtkFlowBox *box);
G_END_DECLS