1 /*
2  * Copyright (c) 2013-2014 Conformal Systems <info@conformal.com>
3  *
4  * This file originated from: http://opensource.conformal.com/
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #include "gtk.go.h" // for gotk3_callbackDelete
20 #include <stdlib.h>
21 
toGtkHeaderBar(void * p)22 static GtkHeaderBar *toGtkHeaderBar(void *p) { return (GTK_HEADER_BAR(p)); }
23 
toGtkListBox(void * p)24 static GtkListBox *toGtkListBox(void *p) { return (GTK_LIST_BOX(p)); }
25 
toGtkListBoxRow(void * p)26 static GtkListBoxRow *toGtkListBoxRow(void *p) { return (GTK_LIST_BOX_ROW(p)); }
27 
toGtkRevealer(void * p)28 static GtkRevealer *toGtkRevealer(void *p) { return (GTK_REVEALER(p)); }
29 
toGtkSearchBar(void * p)30 static GtkSearchBar *toGtkSearchBar(void *p) { return (GTK_SEARCH_BAR(p)); }
31 
toGtkStack(void * p)32 static GtkStack *toGtkStack(void *p) { return (GTK_STACK(p)); }
33 
toGtkStackSwitcher(void * p)34 static GtkStackSwitcher *toGtkStackSwitcher(void *p) {
35   return (GTK_STACK_SWITCHER(p));
36 }
37 
38 extern gboolean goListBoxFilterFuncs(GtkListBoxRow *row, gpointer user_data);
39 
_gtk_list_box_set_filter_func(GtkListBox * box,gpointer user_data)40 static inline void _gtk_list_box_set_filter_func(GtkListBox *box,
41                                                  gpointer user_data) {
42   gtk_list_box_set_filter_func(box,
43                                (GtkListBoxFilterFunc)(goListBoxFilterFuncs),
44                                user_data, (GDestroyNotify)(gotk3_callbackDelete));
45 }
46 
47 extern void goListBoxHeaderFuncs(GtkListBoxRow *row, GtkListBoxRow *before,
48                                  gpointer user_data);
49 
_gtk_list_box_set_header_func(GtkListBox * box,gpointer user_data)50 static inline void _gtk_list_box_set_header_func(GtkListBox *box,
51                                                  gpointer user_data) {
52   gtk_list_box_set_header_func(
53       box, (GtkListBoxUpdateHeaderFunc)(goListBoxHeaderFuncs), user_data,
54       (GDestroyNotify)(gotk3_callbackDelete));
55 }
56 
57 extern gint goListBoxSortFuncs(GtkListBoxRow *row1, GtkListBoxRow *row2,
58                                gpointer user_data);
59 
_gtk_list_box_set_sort_func(GtkListBox * box,gpointer user_data)60 static inline void _gtk_list_box_set_sort_func(GtkListBox *box,
61                                                gpointer user_data) {
62   gtk_list_box_set_sort_func(box, (GtkListBoxSortFunc)(goListBoxSortFuncs),
63                              user_data, (GDestroyNotify)(gotk3_callbackDelete));
64 }
65