Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtklistbox.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Red Hat, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 * License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 * Author: Alexander Larsson <alexl@redhat.com>
19 *
20 */
21
22#pragma once
23
24#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25#error "Only <gtk/gtk.h> can be included directly."
26#endif
27
28#include <gtk/gtkwidget.h>
29
31
32
33#define GTK_TYPE_LIST_BOX (gtk_list_box_get_type ())
34#define GTK_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX, GtkListBox))
35#define GTK_IS_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX))
36
37typedef struct _GtkListBox GtkListBox;
40
41#define GTK_TYPE_LIST_BOX_ROW (gtk_list_box_row_get_type ())
42#define GTK_LIST_BOX_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRow))
43#define GTK_LIST_BOX_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRowClass))
44#define GTK_IS_LIST_BOX_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX_ROW))
45#define GTK_IS_LIST_BOX_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_BOX_ROW))
46#define GTK_LIST_BOX_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRowClass))
47
52
53/**
54 * GtkListBoxRowClass:
55 * @parent_class: The parent class.
56 * @activate:
57 */
59{
61
62 /*< public >*/
63
64 void (* activate) (GtkListBoxRow *row);
65
66 /*< private >*/
67
69};
70
71/**
72 * GtkListBoxFilterFunc:
73 * @row: the row that may be filtered
74 * @user_data: (closure): user data
75 *
76 * Will be called whenever the row changes or is added and lets you control
77 * if the row should be visible or not.
78 *
79 * Returns: %TRUE if the row should be visible, %FALSE otherwise
80 */
82 gpointer user_data);
83
84/**
85 * GtkListBoxSortFunc:
86 * @row1: the first row
87 * @row2: the second row
88 * @user_data: (closure): user data
89 *
90 * Compare two rows to determine which should be first.
91 *
92 * Returns: < 0 if @row1 should be before @row2, 0 if they are
93 * equal and > 0 otherwise
94 */
95typedef int (*GtkListBoxSortFunc) (GtkListBoxRow *row1,
96 GtkListBoxRow *row2,
97 gpointer user_data);
98
99/**
100 * GtkListBoxUpdateHeaderFunc:
101 * @row: the row to update
102 * @before: (nullable): the row before @row, or %NULL if it is first
103 * @user_data: (closure): user data
104 *
105 * Whenever @row changes or which row is before @row changes this
106 * is called, which lets you update the header on @row.
107 *
108 * You may remove or set a new one via [method@Gtk.ListBoxRow.set_header]
109 * or just change the state of the current header widget.
110 */
112 GtkListBoxRow *before,
113 gpointer user_data);
114
115/**
116 * GtkListBoxCreateWidgetFunc:
117 * @item: (type GObject): the item from the model for which to create a widget for
118 * @user_data: (closure): user data
119 *
120 * Called for list boxes that are bound to a `GListModel` with
121 * gtk_list_box_bind_model() for each item that gets added to the model.
122 *
123 * If the widget returned is not a #GtkListBoxRow widget, then the widget
124 * will be inserted as the child of an intermediate #GtkListBoxRow.
125 *
126 * Returns: (transfer full): a `GtkWidget` that represents @item
127 */
128typedef GtkWidget * (*GtkListBoxCreateWidgetFunc) (gpointer item,
129 gpointer user_data);
130
135
138 GtkWidget *child);
141
146 GtkWidget *header);
151
154
157 gboolean selectable);
160
161
164 gboolean activatable);
167
172 GtkWidget *child);
175 GtkWidget *child);
178 GtkWidget *child,
179 int position);
182 GtkWidget *child);
185
190 int index_);
193 int y);
196 GtkListBoxRow *row);
199 GtkWidget *placeholder);
202 GtkAdjustment *adjustment);
205
206typedef void (* GtkListBoxForeachFunc) (GtkListBox *box,
207 GtkListBoxRow *row,
208 gpointer user_data);
209
213 gpointer data);
218 GtkListBoxRow *row);
223
226 GtkSelectionMode mode);
231 GtkListBoxFilterFunc filter_func,
232 gpointer user_data,
233 GDestroyNotify destroy);
236 GtkListBoxUpdateHeaderFunc update_header,
237 gpointer user_data,
238 GDestroyNotify destroy);
247 GtkListBoxSortFunc sort_func,
248 gpointer user_data,
249 GDestroyNotify destroy);
252 gboolean single);
259 GtkListBoxRow *row);
262
263
266 GListModel *model,
267 GtkListBoxCreateWidgetFunc create_widget_func,
268 gpointer user_data,
269 GDestroyNotify user_data_free_func);
270
273 gboolean show_separators);
276
279
281
#define GDK_AVAILABLE_IN_4_12
#define GDK_AVAILABLE_IN_ALL
typedefG_BEGIN_DECLS struct _GList GList
Definition glist.h:39
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
Definition gmacros.h:1400
GOBJECT_AVAILABLE_IN_ALL void g_object_unref(gpointer object)
GtkSelectionMode
Definition gtkenums.h:556
GDK_AVAILABLE_IN_ALL void gtk_list_box_unselect_all(GtkListBox *box)
GDK_AVAILABLE_IN_ALL gboolean gtk_list_box_row_is_selected(GtkListBoxRow *row)
GtkWidget *(* GtkListBoxCreateWidgetFunc)(gpointer item, gpointer user_data)
Definition gtklistbox.h:128
GDK_AVAILABLE_IN_4_12 void gtk_list_box_remove_all(GtkListBox *box)
GDK_AVAILABLE_IN_ALL int gtk_list_box_row_get_index(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL GtkListBoxRow * gtk_list_box_get_row_at_index(GtkListBox *box, int index_)
int(* GtkListBoxSortFunc)(GtkListBoxRow *row1, GtkListBoxRow *row2, gpointer user_data)
Definition gtklistbox.h:95
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_sort_func(GtkListBox *box, GtkListBoxSortFunc sort_func, gpointer user_data, GDestroyNotify destroy)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_filter_func(GtkListBox *box, GtkListBoxFilterFunc filter_func, gpointer user_data, GDestroyNotify destroy)
GDK_AVAILABLE_IN_ALL void gtk_list_box_insert(GtkListBox *box, GtkWidget *child, int position)
GDK_AVAILABLE_IN_ALL gboolean gtk_list_box_get_activate_on_single_click(GtkListBox *box)
GDK_AVAILABLE_IN_ALL GType gtk_list_box_get_type(void) G_GNUC_CONST
GDK_AVAILABLE_IN_ALL void gtk_list_box_invalidate_filter(GtkListBox *box)
struct _GtkListBox GtkListBox
Definition gtklistbox.h:37
GDK_AVAILABLE_IN_ALL void gtk_list_box_row_changed(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL GtkListBoxRow * gtk_list_box_get_row_at_y(GtkListBox *box, int y)
GDK_AVAILABLE_IN_ALL gboolean gtk_list_box_get_show_separators(GtkListBox *box)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_placeholder(GtkListBox *box, GtkWidget *placeholder)
GDK_AVAILABLE_IN_ALL void gtk_list_box_selected_foreach(GtkListBox *box, GtkListBoxForeachFunc func, gpointer data)
GDK_AVAILABLE_IN_ALL void gtk_list_box_unselect_row(GtkListBox *box, GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_selection_mode(GtkListBox *box, GtkSelectionMode mode)
GDK_AVAILABLE_IN_ALL void gtk_list_box_row_set_child(GtkListBoxRow *row, GtkWidget *child)
GDK_AVAILABLE_IN_ALL GtkListBoxRow * gtk_list_box_get_selected_row(GtkListBox *box)
GDK_AVAILABLE_IN_ALL void gtk_list_box_drag_highlight_row(GtkListBox *box, GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL GType gtk_list_box_row_get_type(void) G_GNUC_CONST
GDK_AVAILABLE_IN_ALL GtkWidget * gtk_list_box_new(void)
GDK_AVAILABLE_IN_ALL GtkWidget * gtk_list_box_row_get_header(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_append(GtkListBox *box, GtkWidget *child)
GDK_AVAILABLE_IN_ALL void gtk_list_box_row_set_selectable(GtkListBoxRow *row, gboolean selectable)
GDK_AVAILABLE_IN_ALL void gtk_list_box_row_set_header(GtkListBoxRow *row, GtkWidget *header)
GDK_AVAILABLE_IN_ALL void gtk_list_box_remove(GtkListBox *box, GtkWidget *child)
void(* GtkListBoxForeachFunc)(GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
Definition gtklistbox.h:206
gboolean(* GtkListBoxFilterFunc)(GtkListBoxRow *row, gpointer user_data)
Definition gtklistbox.h:81
GDK_AVAILABLE_IN_ALL void gtk_list_box_bind_model(GtkListBox *box, GListModel *model, GtkListBoxCreateWidgetFunc create_widget_func, gpointer user_data, GDestroyNotify user_data_free_func)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_adjustment(GtkListBox *box, GtkAdjustment *adjustment)
GDK_AVAILABLE_IN_ALL void gtk_list_box_row_set_activatable(GtkListBoxRow *row, gboolean activatable)
GDK_AVAILABLE_IN_ALL gboolean gtk_list_box_row_get_activatable(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_show_separators(GtkListBox *box, gboolean show_separators)
GDK_AVAILABLE_IN_ALL GtkWidget * gtk_list_box_row_new(void)
GDK_AVAILABLE_IN_ALL void gtk_list_box_drag_unhighlight_row(GtkListBox *box)
GDK_AVAILABLE_IN_ALL GList * gtk_list_box_get_selected_rows(GtkListBox *box)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_header_func(GtkListBox *box, GtkListBoxUpdateHeaderFunc update_header, gpointer user_data, GDestroyNotify destroy)
GDK_AVAILABLE_IN_ALL GtkAdjustment * gtk_list_box_get_adjustment(GtkListBox *box)
GDK_AVAILABLE_IN_ALL void gtk_list_box_invalidate_headers(GtkListBox *box)
GDK_AVAILABLE_IN_ALL GtkWidget * gtk_list_box_row_get_child(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_set_activate_on_single_click(GtkListBox *box, gboolean single)
void(* GtkListBoxUpdateHeaderFunc)(GtkListBoxRow *row, GtkListBoxRow *before, gpointer user_data)
Definition gtklistbox.h:111
GDK_AVAILABLE_IN_ALL GtkSelectionMode gtk_list_box_get_selection_mode(GtkListBox *box)
GDK_AVAILABLE_IN_ALL gboolean gtk_list_box_row_get_selectable(GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_select_row(GtkListBox *box, GtkListBoxRow *row)
GDK_AVAILABLE_IN_ALL void gtk_list_box_invalidate_sort(GtkListBox *box)
GDK_AVAILABLE_IN_ALL void gtk_list_box_prepend(GtkListBox *box, GtkWidget *child)
GDK_AVAILABLE_IN_ALL void gtk_list_box_select_all(GtkListBox *box)
typedefG_BEGIN_DECLS struct _GtkAdjustment GtkAdjustment
Definition gtktypes.h:35
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
void(* GDestroyNotify)(gpointer data)
Definition gtypes.h:140
GtkWidgetClass parent_class
Definition gtklistbox.h:60
void(* activate)(GtkListBoxRow *row)
Definition gtklistbox.h:64
gpointer padding[8]
Definition gtklistbox.h:68
GtkWidget parent_instance
Definition gtklistbox.h:50