2013-09-29 17:43:27 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Openismus GmbH
|
|
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2014-01-12 12:56:49 +00:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2013-09-29 17:43:27 +00:00
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Tristan Van Berkom <tristanvb@openismus.com>
|
|
|
|
* Matthias Clasen <mclasen@redhat.com>
|
|
|
|
* William Jon McCann <jmccann@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
2020-05-10 01:03:35 +00:00
|
|
|
#include <gtk/gtkwidget.h>
|
2013-09-29 17:43:27 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define GTK_TYPE_FLOW_BOX (gtk_flow_box_get_type ())
|
|
|
|
#define GTK_FLOW_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FLOW_BOX, GtkFlowBox))
|
|
|
|
#define GTK_IS_FLOW_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FLOW_BOX))
|
|
|
|
|
|
|
|
typedef struct _GtkFlowBox GtkFlowBox;
|
|
|
|
typedef struct _GtkFlowBoxChild GtkFlowBoxChild;
|
|
|
|
typedef struct _GtkFlowBoxChildClass GtkFlowBoxChildClass;
|
|
|
|
|
|
|
|
#define GTK_TYPE_FLOW_BOX_CHILD (gtk_flow_box_child_get_type ())
|
|
|
|
#define GTK_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FLOW_BOX_CHILD, GtkFlowBoxChild))
|
|
|
|
#define GTK_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FLOW_BOX_CHILD, GtkFlowBoxChildClass))
|
|
|
|
#define GTK_IS_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FLOW_BOX_CHILD))
|
|
|
|
#define GTK_IS_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FLOW_BOX_CHILD))
|
|
|
|
#define GTK_FLOW_BOX_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EG_TYPE_FLOW_BOX_CHILD, GtkFlowBoxChildClass))
|
|
|
|
|
|
|
|
struct _GtkFlowBoxChild
|
|
|
|
{
|
2021-02-25 11:25:05 +00:00
|
|
|
/*< private >*/
|
2020-05-03 00:53:40 +00:00
|
|
|
GtkWidget parent_instance;
|
2013-09-29 17:43:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkFlowBoxChildClass
|
|
|
|
{
|
2021-02-25 11:25:05 +00:00
|
|
|
/*< private >*/
|
2020-05-03 00:53:40 +00:00
|
|
|
GtkWidgetClass parent_class;
|
2013-09-29 17:43:27 +00:00
|
|
|
|
2021-02-25 11:25:05 +00:00
|
|
|
/*< public >*/
|
2013-09-29 17:43:27 +00:00
|
|
|
void (* activate) (GtkFlowBoxChild *child);
|
|
|
|
|
2021-02-25 11:25:05 +00:00
|
|
|
/*< private >*/
|
2019-05-29 00:01:03 +00:00
|
|
|
gpointer padding[8];
|
2013-09-29 17:43:27 +00:00
|
|
|
};
|
|
|
|
|
2015-08-16 22:05:33 +00:00
|
|
|
/**
|
|
|
|
* GtkFlowBoxCreateWidgetFunc:
|
2017-09-25 13:42:46 +00:00
|
|
|
* @item: (type GObject): the item from the model for which to create a widget for
|
|
|
|
* @user_data: (closure): user data from gtk_flow_box_bind_model()
|
2015-08-16 22:05:33 +00:00
|
|
|
*
|
2021-03-01 06:37:53 +00:00
|
|
|
* Called for flow boxes that are bound to a `GListModel`.
|
2015-08-16 22:05:33 +00:00
|
|
|
*
|
2021-03-01 06:37:53 +00:00
|
|
|
* This function is called for each item that gets added to the model.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): a `GtkWidget` that represents @item
|
2015-08-16 22:05:33 +00:00
|
|
|
*/
|
|
|
|
typedef GtkWidget * (*GtkFlowBoxCreateWidgetFunc) (gpointer item,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GType gtk_flow_box_child_get_type (void) G_GNUC_CONST;
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GtkWidget* gtk_flow_box_child_new (void);
|
2020-05-03 00:53:40 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
void gtk_flow_box_child_set_child (GtkFlowBoxChild *self,
|
|
|
|
GtkWidget *child);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GtkWidget * gtk_flow_box_child_get_child (GtkFlowBoxChild *self);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
int gtk_flow_box_child_get_index (GtkFlowBoxChild *child);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
gboolean gtk_flow_box_child_is_selected (GtkFlowBoxChild *child);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_child_changed (GtkFlowBoxChild *child);
|
|
|
|
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GType gtk_flow_box_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GtkWidget *gtk_flow_box_new (void);
|
2015-08-16 22:05:33 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2015-08-16 22:05:33 +00:00
|
|
|
void gtk_flow_box_bind_model (GtkFlowBox *box,
|
|
|
|
GListModel *model,
|
|
|
|
GtkFlowBoxCreateWidgetFunc create_widget_func,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify user_data_free_func);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_homogeneous (GtkFlowBox *box,
|
|
|
|
gboolean homogeneous);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
gboolean gtk_flow_box_get_homogeneous (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_row_spacing (GtkFlowBox *box,
|
|
|
|
guint spacing);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
guint gtk_flow_box_get_row_spacing (GtkFlowBox *box);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_column_spacing (GtkFlowBox *box,
|
|
|
|
guint spacing);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
guint gtk_flow_box_get_column_spacing (GtkFlowBox *box);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_min_children_per_line (GtkFlowBox *box,
|
|
|
|
guint n_children);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
guint gtk_flow_box_get_min_children_per_line (GtkFlowBox *box);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_max_children_per_line (GtkFlowBox *box,
|
|
|
|
guint n_children);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
guint gtk_flow_box_get_max_children_per_line (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_activate_on_single_click (GtkFlowBox *box,
|
|
|
|
gboolean single);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
gboolean gtk_flow_box_get_activate_on_single_click (GtkFlowBox *box);
|
|
|
|
|
2021-09-30 02:45:45 +00:00
|
|
|
GDK_AVAILABLE_IN_4_6
|
|
|
|
void gtk_flow_box_prepend (GtkFlowBox *self,
|
|
|
|
GtkWidget *child);
|
|
|
|
GDK_AVAILABLE_IN_4_6
|
|
|
|
void gtk_flow_box_append (GtkFlowBox *self,
|
|
|
|
GtkWidget *child);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_insert (GtkFlowBox *box,
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
int position);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-05-08 00:24:05 +00:00
|
|
|
void gtk_flow_box_remove (GtkFlowBox *box,
|
|
|
|
GtkWidget *widget);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GtkFlowBoxChild *gtk_flow_box_get_child_at_index (GtkFlowBox *box,
|
2020-07-24 13:54:49 +00:00
|
|
|
int idx);
|
2013-09-29 17:43:27 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2016-12-16 23:30:39 +00:00
|
|
|
GtkFlowBoxChild *gtk_flow_box_get_child_at_pos (GtkFlowBox *box,
|
2020-07-24 13:54:49 +00:00
|
|
|
int x,
|
|
|
|
int y);
|
2016-12-16 23:30:39 +00:00
|
|
|
|
2013-09-29 17:43:27 +00:00
|
|
|
typedef void (* GtkFlowBoxForeachFunc) (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxChild *child,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_selected_foreach (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxForeachFunc func,
|
|
|
|
gpointer data);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GList *gtk_flow_box_get_selected_children (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_select_child (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxChild *child);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_unselect_child (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxChild *child);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_select_all (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_unselect_all (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_selection_mode (GtkFlowBox *box,
|
|
|
|
GtkSelectionMode mode);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
GtkSelectionMode gtk_flow_box_get_selection_mode (GtkFlowBox *box);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_hadjustment (GtkFlowBox *box,
|
|
|
|
GtkAdjustment *adjustment);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_vadjustment (GtkFlowBox *box,
|
|
|
|
GtkAdjustment *adjustment);
|
|
|
|
|
|
|
|
typedef gboolean (*GtkFlowBoxFilterFunc) (GtkFlowBoxChild *child,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_filter_func (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxFilterFunc filter_func,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify destroy);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_invalidate_filter (GtkFlowBox *box);
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
typedef int (*GtkFlowBoxSortFunc) (GtkFlowBoxChild *child1,
|
|
|
|
GtkFlowBoxChild *child2,
|
|
|
|
gpointer user_data);
|
2013-09-29 17:43:27 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_set_sort_func (GtkFlowBox *box,
|
|
|
|
GtkFlowBoxSortFunc sort_func,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify destroy);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2013-09-29 17:43:27 +00:00
|
|
|
void gtk_flow_box_invalidate_sort (GtkFlowBox *box);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GTK_FLOW_BOX_H__ */
|