| 1 |
|
| 2 |
|
| 3 |
package gtk |
| 4 |
|
| 5 |
|
| 6 |
import "C" |
| 7 |
import ( |
| 8 |
"unsafe" |
| 9 |
|
| 10 |
"github.com/gotk3/gotk3/glib" |
| 11 |
"github.com/gotk3/gotk3/internal/callback" |
| 12 |
) |
| 13 |
|
| 14 |
|
| 15 |
func goListBoxFilterFuncs(row *C.GtkListBoxRow, userData C.gpointer) C.gboolean { |
| 16 |
fn := callback.Get(uintptr(userData)).(ListBoxFilterFunc) |
| 17 |
return gbool(fn(wrapListBoxRow(glib.Take(unsafe.Pointer(row))))) |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
func goListBoxHeaderFuncs(row *C.GtkListBoxRow, before *C.GtkListBoxRow, userData C.gpointer) { |
| 22 |
fn := callback.Get(uintptr(userData)).(ListBoxHeaderFunc) |
| 23 |
fn( |
| 24 |
wrapListBoxRow(glib.Take(unsafe.Pointer(row))), |
| 25 |
wrapListBoxRow(glib.Take(unsafe.Pointer(before))), |
| 26 |
) |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
func goListBoxSortFuncs(row1 *C.GtkListBoxRow, row2 *C.GtkListBoxRow, userData C.gpointer) C.gint { |
| 31 |
fn := callback.Get(uintptr(userData)).(ListBoxSortFunc) |
| 32 |
return C.gint(fn( |
| 33 |
wrapListBoxRow(glib.Take(unsafe.Pointer(row1))), |
| 34 |
wrapListBoxRow(glib.Take(unsafe.Pointer(row2))), |
| 35 |
)) |
| 36 |
} |