From 33a0cbddb018790baf6baf00133580028f77353f Mon Sep 17 00:00:00 2001 From: Don Alfons Nisnoni Date: Mon, 7 Nov 2022 22:50:17 +0800 Subject: [PATCH 1/3] - Fix compilation with latest V - Fix examples - Add test import gio module Signed-off-by: Don Alfons Nisnoni --- examples/basic.v | 42 +- examples/box.v | 6 +- examples/dialog.v | 2 +- examples/entry.v | 4 +- examples/grid.v | 2 +- examples/label.v | 40 +- glib/_cdefs.v | 39 +- glib/array.v | 5 +- glib/list.v | 3 +- glib/slist.v | 2 +- glib/string.v | 33 +- gtk/_cdefs.v | 391 +++++++++--------- gtk/about_dialog.v | 72 ++-- gtk/accel_map.v | 8 +- gtk/actionable.v | 40 +- gtk/application.v | 19 +- gtk/application_window.v | 2 +- gtk/bin.v | 2 +- gtk/box.v | 42 +- gtk/buildable.v | 55 +-- gtk/builder.v | 43 +- gtk/button.v | 18 +- gtk/check_button.v | 16 +- gtk/color_chooser.v | 46 +-- gtk/container.v | 2 +- gtk/dialog.v | 10 +- gtk/entry.v | 28 +- gtk/grid.v | 26 +- gtk/label.v | 16 +- gtk/menu.v | 8 +- gtk/message_dialog.v | 3 +- gtk/radio_button.v | 66 +-- gtk/requisition.v | 2 +- gtk/text_view.v | 4 +- gtk/utils.v | 2 +- gtk/widget.v | 100 ++--- gtk/window.v | 21 +- tests/importing_gdb_glib_and_gtk_works_test.v | 2 + 38 files changed, 657 insertions(+), 565 deletions(-) diff --git a/examples/basic.v b/examples/basic.v index b8ca5f8..f40c06e 100644 --- a/examples/basic.v +++ b/examples/basic.v @@ -18,7 +18,7 @@ fn run_quit(mi gtk.Button, data voidptr) { fn run_code(mi gtk.Button, data voidptr) { source := 'runme.v' app := &AppState(data) - input := app.code.get_text() + input := app.code.get_text() os.rm(source) or {} mut f := os.open_file(source, 'w+') or { panic(err) } @@ -43,7 +43,7 @@ fn menu_exit(mi gtk.MenuItem, data voidptr) { } fn menu_about(mi gtk.MenuItem, data voidptr) { - os.system("ls /") + os.system('ls /') } fn alert_clicked(btn gtk.Button, data voidptr) { @@ -56,11 +56,11 @@ fn win_destroy(win gtk.Window, data voidptr) { struct AppState { mut: - window gtk.Window - menubar gtk.MenuBar + window gtk.Window + menubar gtk.MenuBar have_menubar bool - code gtk.TextView - result gtk.TextView + code gtk.TextView + result gtk.TextView } fn new_appstate() AppState { @@ -73,18 +73,18 @@ fn (mut app AppState) ready() { w := app.window w.set_position(.center) w.set_title('Im made with V') - w.on('destroy', win_destroy, voidptr(0)) + w.on('destroy', win_destroy, unsafe { nil }) w.show_all() } -fn (mut app AppState)get_bbox() gtk.ButtonBox { +fn (mut app AppState) get_bbox() gtk.ButtonBox { bbox := gtk.new_hbutton_box() bbox.set_layout(.end) - gtk.Box(bbox).set_spacing(10) + gtk.to_box(bbox).set_spacing(10) app.window.set_border_width(10) -// c := >k.Container(vbox.c) - //c.set_border_width(10) + // c := >k.Container(vbox.c) + // c.set_border_width(10) a := gtk.new_button_with_label('Run') a.on('activate', run_code, app) @@ -97,7 +97,7 @@ fn (mut app AppState)get_bbox() gtk.ButtonBox { return bbox } -fn (mut app AppState)get_paned() gtk.Paned { +fn (mut app AppState) get_paned() gtk.Paned { p := gtk.new_paned(.horizontal) p.set_position(200) p.set_wide_handle(true) @@ -122,21 +122,21 @@ fn (mut app AppState)get_paned() gtk.Paned { return p } -fn (mut app AppState)get_menubar() gtk.MenuBar { +fn (mut app AppState) get_menubar() gtk.MenuBar { if app.have_menubar { return app.menubar } -/* + /* if mb := app.menubar { return mb } -*/ + */ bar := gtk.new_menu_bar() app.menubar = bar menu := gtk.new_menu() - file_me := gtk.new_menu_item_with_label("File") - quit := gtk.new_menu_item_with_label("Quit") + file_me := gtk.new_menu_item_with_label('File') + quit := gtk.new_menu_item_with_label('Quit') quit.set_accel_path('GTKTest/File/Quit') quit.set_use_underline(true) quit.on('activate', menu_exit, &app) @@ -146,7 +146,7 @@ fn (mut app AppState)get_menubar() gtk.MenuBar { edit_me.set_submenu(menu) about := gtk.new_menu_item_with_label('About') - about.on('activate', menu_about, voidptr(0)) + about.on('activate', menu_about, unsafe { nil }) menu.append(gtk.new_menu_item_with_label('Open')) menu.append(about) // menu.append(gtk.new_separator_menu_item()) @@ -173,7 +173,7 @@ fn main() { btn.set_size(200, 100) btn2.set_size(100, 50) alert.set_size(80, 20) -/* + /* entry.set_text("Good Night!") btn.on("clicked", btn_clicked, &window) @@ -183,11 +183,11 @@ fn main() { quit.on('activate', menu_exit, &window) alert.on("clicked", alert_clicked, &window) -*/ + */ entry.set_text('Good Night!') btn.on('clicked', btn_clicked, &app.window) - gtk.accel_map_add_entry('GTK-Test/File/Quit', 65, 0) + gtk.accel_map_add_entry('GTK-Test/File/Quit', 65, .shift_mask) alert.on('clicked', alert_clicked, &app.window) diff --git a/examples/box.v b/examples/box.v index f9ec63e..32133f9 100644 --- a/examples/box.v +++ b/examples/box.v @@ -11,14 +11,14 @@ fn main() { window.add(box) button1 := gtk.new_button_with_label('Hello') - button1.on('clicked', on_button1_clicked, voidptr(0)) + button1.on('clicked', on_button1_clicked, unsafe { nil }) box.pack_start(button1, true, true, 0) button2 := gtk.new_button_with_label('Goodbye') - button2.on('clicked', on_button2_clicked, voidptr(0)) + button2.on('clicked', on_button2_clicked, unsafe { nil }) box.pack_start(button2, false, false, 0) - window.on('destroy', on_window_destroy, voidptr(0)) + window.on('destroy', on_window_destroy, unsafe { nil }) window.show_all() gtk.main() } diff --git a/examples/dialog.v b/examples/dialog.v index 8adab19..746b380 100644 --- a/examples/dialog.v +++ b/examples/dialog.v @@ -6,7 +6,7 @@ fn main() { window := gtk.new_window() window.set_title('Main window') window.set_default_size(500, 250) - window.on('destroy', on_window_destroy, voidptr(0)) + window.on('destroy', on_window_destroy, unsafe { nil }) dialog := gtk.new_dialog_from_parent('Dialog', window, .modal) dialog.set_default_size(150, 150) diff --git a/examples/entry.v b/examples/entry.v index 0e43556..f48fb06 100644 --- a/examples/entry.v +++ b/examples/entry.v @@ -97,14 +97,14 @@ fn on_entry_text_changed(entry gtk.Entry, data voidptr) { fn on_btn_icon_clicked(button gtk.CheckButton, data voidptr) { this := &EntryDemo(data) - icon_name := if button.get_active() {'system-search-symbolic' } else { '' } + icon_name := if button.get_active() { 'system-search-symbolic' } else { '' } this.entry.set_icon_from_icon_name(.primary, icon_name) } fn main() { entry_demo := new_entry_demo() window := &entry_demo.window - window.on('destroy', on_window_destroy, voidptr(0)) + window.on('destroy', on_window_destroy, unsafe { nil }) window.show_all() gtk.main() } diff --git a/examples/grid.v b/examples/grid.v index f543211..97c7318 100644 --- a/examples/grid.v +++ b/examples/grid.v @@ -23,7 +23,7 @@ fn main() { grid.attach(button5, 1, 2, 1, 1) grid.attach_next_to(button6, button5, .right, 1, 1) - window.on('destroy', on_destroy, voidptr(0)) + window.on('destroy', on_destroy, unsafe { nil }) window.show_all() gtk.main() } diff --git a/examples/label.v b/examples/label.v index 6e40da8..9f4f12f 100644 --- a/examples/label.v +++ b/examples/label.v @@ -11,10 +11,10 @@ fn main() { hbox := gtk.new_hbox(10) vbox_left := gtk.new_vbox(10) vbox_right := gtk.new_vbox(10) - + hbox.pack_start(vbox_left, true, true, 0) hbox.pack_start(vbox_right, true, true, 0) - + mut label := gtk.new_label('This is a normal label') vbox_left.pack_start(label, true, true, 0) @@ -27,35 +27,29 @@ fn main() { label.set_justify(.right) vbox_left.pack_start(label, true, true, 0) - label = gtk.new_label("This is an example of a line-wrapped label. It " + - "should not be taking up the entire " + - "width allocated to it, but automatically " + - "wraps the words to fit.\n" + - " It supports multiple paragraphs correctly, " + - "and correctly adds " + - "many extra spaces. ") + label = gtk.new_label('This is an example of a line-wrapped label. It ' + + 'should not be taking up the entire ' + + 'width allocated to it, but automatically ' + 'wraps the words to fit.\n' + + ' It supports multiple paragraphs correctly, ' + 'and correctly adds ' + + 'many extra spaces. ') label.set_line_wrap(true) vbox_right.pack_start(label, true, true, 0) - label = gtk.new_label("This is an example of a line-wrapped, filled label. " + - "It should be taking " + - "up the entire width allocated to it. " + - "Here is a sentence to prove " + - "my point. Here is another sentence. " + - "Here comes the sun, do de do de do.\n" + - " This is a new paragraph.\n" + - " This is another newer, longer, better " + - "paragraph. It is coming to an end, " + - "unfortunately.") + label = gtk.new_label('This is an example of a line-wrapped, filled label. ' + + 'It should be taking ' + 'up the entire width allocated to it. ' + + 'Here is a sentence to prove ' + 'my point. Here is another sentence. ' + + 'Here comes the sun, do de do de do.\n' + ' This is a new paragraph.\n' + + ' This is another newer, longer, better ' + 'paragraph. It is coming to an end, ' + + 'unfortunately.') label.set_line_wrap(true) label.set_justify(.fill) vbox_right.pack_start(label, true, true, 0) label = gtk.new_empty_label() - label.set_markup( "Text can be small, big, " + - "bold, italic and even point to " + - "somewhere in the internets.") + label.set_markup('Text can be small, big, ' + + 'bold, italic and even point to ' + + "somewhere in the internets.") label.set_line_wrap(true) vbox_left.pack_start(label, true, true, 0) diff --git a/glib/_cdefs.v b/glib/_cdefs.v index d565b1b..5bfd0a9 100644 --- a/glib/_cdefs.v +++ b/glib/_cdefs.v @@ -2,6 +2,7 @@ module glib #include #include + [typedef] pub struct C.GList { data voidptr @@ -85,9 +86,9 @@ fn C.g_array_remove_index_fast(&C.GArray, u32) &C.GArray fn C.g_array_remove_range(&C.GArray, u32, u32) &C.GArray -fn C.g_array_sort(&C.GArray, int) +fn C.g_array_sort(&C.GArray, voidptr) -fn C.g_array_sort_with_data(&C.GArray, int, voidptr) +fn C.g_array_sort_with_data(&C.GArray, voidptr, voidptr) fn C.g_array_binary_search(&C.GArray, voidptr, int, &u32) bool @@ -108,13 +109,13 @@ fn C.g_string_sized_new(int) &C.GString fn C.g_string_assign(&C.GString, charptr) &C.GString -fn C.g_string_vprintf(&C.GString, charptr, va_list) +fn C.g_string_vprintf(&C.GString, charptr, voidptr va_list) -fn C.g_string_append_vprintf(&C.GString, charptr, va_list) +fn C.g_string_append_vprintf(&C.GString, charptr, voidptr va_list) -fn C.g_string_printf(&C.GString, charptr) +// fn C.g_string_printf(&C.GString, charptr) -fn C.g_string_append_printf(&C.GString, charptr) +// fn C.g_string_append_printf(&C.GString, charptr) fn C.g_string_append(&C.GString, charptr) &C.GString @@ -154,7 +155,7 @@ fn C.g_string_set_size(&C.GString, int) &C.GString fn C.g_string_free(&C.GString, bool) charptr -fn C.g_string_free_to_bytes(&C.GString) &GBytes +fn C.g_string_free_to_bytes(&C.GString) &C.GBytes fn C.g_string_up(&C.GString) &C.GString @@ -175,7 +176,7 @@ fn C.g_slist_insert(&C.GSList, voidptr, int) &C.GSList fn C.g_slist_insert_before(&C.GSList, &C.GSList, voidptr) &C.GSList -fn C.g_slist_insert_sorted(&C.GSList, voidptr, int) &C.GSList +fn C.g_slist_insert_sorted(&C.GSList, voidptr, voidptr) &C.GSList fn C.g_slist_remove(&C.GSList, voidptr) &C.GSList @@ -195,19 +196,19 @@ fn C.g_slist_length(&C.GSList) u32 fn C.g_slist_copy(&C.GSList) &C.GSList -fn C.g_slist_copy_deep(&C.GSList, int, voidptr) &C.GSList +fn C.g_slist_copy_deep(&C.GSList, voidptr, voidptr) &C.GSList fn C.g_slist_reverse(&C.GSList) &C.GSList -fn C.g_slist_insert_sorted_with_data(&C.GSList, voidptr, int, voidptr) &C.GSList +fn C.g_slist_insert_sorted_with_data(&C.GSList, voidptr, voidptr, voidptr) &C.GSList -fn C.g_slist_sort(&C.GSList, int) &C.GSList +fn C.g_slist_sort(&C.GSList, voidptr) &C.GSList -fn C.g_slist_sort_with_data(&C.GSList, int, voidptr) &C.GSList +fn C.g_slist_sort_with_data(&C.GSList, voidptr, voidptr) &C.GSList fn C.g_slist_concat(&C.GSList, &C.GSList) &C.GSList -fn C.g_slist_foreach(&C.GSList, int, voidptr) +fn C.g_slist_foreach(&C.GSList, voidptr, voidptr) fn C.g_slist_last(&C.GSList) &C.GSList @@ -219,7 +220,7 @@ fn C.g_slist_nth_data(&C.GSList, u32) voidptr fn C.g_slist_find(&C.GSList, voidptr) &C.GSList -fn C.g_slist_find_custom(&C.GSList, voidptr, int) &C.GSList +fn C.g_slist_find_custom(&C.GSList, voidptr, voidptr) &C.GSList fn C.g_slist_position(&C.GSList, &C.GSList) int @@ -258,15 +259,15 @@ fn C.g_list_length(&C.GList) u32 fn C.g_list_copy(&C.GList) &C.GList -fn C.g_list_copy_deep(&C.GList, int, voidptr) &C.GList +fn C.g_list_copy_deep(&C.GList, voidptr, voidptr) &C.GList fn C.g_list_reverse(&C.GList) &C.GList -fn C.g_list_sort(&C.GList, int) &C.GList +fn C.g_list_sort(&C.GList, voidptr) &C.GList -fn C.g_list_insert_sorted_with_data(&C.GList, voidptr, int, voidptr) &C.GList +fn C.g_list_insert_sorted_with_data(&C.GList, voidptr, voidptr, voidptr) &C.GList -fn C.g_list_sort_with_data(&C.GList, int, voidptr) &C.GList +fn C.g_list_sort_with_data(&C.GList, voidptr, voidptr) &C.GList fn C.g_list_concat(&C.GList, &C.GList) &C.GList @@ -288,7 +289,7 @@ fn C.g_list_nth_prev(&C.GList, u32) &C.GList fn C.g_list_find(&C.GList, voidptr) &C.GList -fn C.g_list_find_custom(&C.GList, voidptr, int) &C.GList +fn C.g_list_find_custom(&C.GList, voidptr, voidptr) &C.GList fn C.g_list_position(&C.GList, &C.GList) int diff --git a/glib/array.v b/glib/array.v index da7a793..ce7211a 100644 --- a/glib/array.v +++ b/glib/array.v @@ -82,6 +82,7 @@ pub fn (a Array) sort_with_data(compare_fn CompareDataFunc, user_data voidptr) { // pub fn (a Array) binary_search(target voidptr, compare_fn CompareFunc, out_match_index &u32) bool { // return C.g_array_binary_search(a.c, target, compare_fn, out_match_index) // } + pub fn (a Array) set_size(len u32) Array { cptr := C.g_array_set_size(a.c, len) return Array{cptr} @@ -91,6 +92,6 @@ pub fn (a Array) set_clear_func(clear_fn DestroyNotify) { C.g_array_set_clear_func(a.c, clear_fn) } -pub fn (a Array) free(free_segment bool) { - C.g_array_free(a.c, free_segment) +pub fn (mut a Array) free() { + C.g_array_free(a.c, true) } diff --git a/glib/list.v b/glib/list.v index 6056cd7..f1b312e 100644 --- a/glib/list.v +++ b/glib/list.v @@ -1,6 +1,7 @@ module glib #include + pub type Func = fn (voidptr, voidptr) pub struct List { @@ -55,7 +56,7 @@ pub fn (l List) remove_all(data voidptr) List { return List{C.g_list_remove_all(l.c, data)} } -pub fn (l List) free() { +pub fn (mut l List) free() { C.g_list_free(l.c) } diff --git a/glib/slist.v b/glib/slist.v index 64bf144..569b636 100644 --- a/glib/slist.v +++ b/glib/slist.v @@ -52,7 +52,7 @@ pub fn (s SList) remove_all(data voidptr) SList { return SList{C.g_slist_remove_all(s.c, data)} } -pub fn (s SList) free() { +pub fn (mut s SList) free() { C.g_slist_free(s.c) } diff --git a/glib/string.v b/glib/string.v index 9be366a..3278925 100644 --- a/glib/string.v +++ b/glib/string.v @@ -23,22 +23,22 @@ pub fn (s String) assign(rval string) String { return String{cptr} } -pub fn (s String) vprintf(format string, args VAList) { - C.g_string_vprintf(s.c, format.str, args) -} +// pub fn (s String) vprintf(format string, args VAList) { +// C.g_string_vprintf(s.c, format.str, args) +// } -pub fn (s String) append_vprintf(format string, args VAList) { - C.g_string_append_vprintf(s.c, format.str, args) -} +// pub fn (s String) append_vprintf(format string, args VAList) { +// C.g_string_append_vprintf(s.c, format.str, args) +// } // TODO: Fix this after V suppor variadic with multiple types -pub fn (s String) printf(format string, params voidptr) { - C.g_string_printf(s.c, format.str, params) -} +// pub fn (s String) printf(format string, params voidptr) { +// C.g_string_printf(s.c, format.str, params) +// } -pub fn (s String) append_printf(format string, params voidptr) { - C.g_string_append_printf(s.c, format.str, params) -} +// pub fn (s String) append_printf(format string, params voidptr) { +// C.g_string_append_printf(s.c, format.str, params) +// } pub fn (s String) append(val string) String { cptr := C.g_string_append(s.c, val.str) @@ -131,9 +131,8 @@ pub fn (s String) set_size(len i64) String { return String{cptr} } -pub fn (s String) free(free_segment bool) string { - cptr := C.g_string_free(s.c, free_segment) - return tos3(cptr) +pub fn (mut s String) free() { + C.g_string_free(s.c, false) } pub fn (s String) free_to_bytes() byteptr { @@ -157,5 +156,7 @@ pub fn (s String) len() i64 { } pub fn (s String) str() string { - return tos3(s.c.str) + unsafe { + return tos3(s.c.str) + } } diff --git a/gtk/_cdefs.v b/gtk/_cdefs.v index ab65261..79442fa 100644 --- a/gtk/_cdefs.v +++ b/gtk/_cdefs.v @@ -1,6 +1,7 @@ module gtk import gdk +import gio struct C.GtkLabel { } @@ -108,7 +109,7 @@ fn C.gtk_main() fn C.gtk_main_quit() // Bin -fn C.gtk_bin_get_child(&C.GtkBin) &C.GtkWidget +fn C.gtk_bin_get_child(&C.GtkWidget) &C.GtkWidget // ColorChooser fn C.gtk_color_chooser_get_rgba(&C.GtkColorChooser, &C.GdkRGBA) @@ -122,7 +123,7 @@ fn C.gtk_color_chooser_set_use_alpha(&C.GtkColorChooser, bool) fn C.gtk_color_chooser_add_palette(&C.GtkColorChooser, int, int, int, &C.GdkRGBA) // WINDOW -fn C.gtk_window_new(int) &C.GtkWidget +fn C.gtk_window_new(WindowType) &C.GtkWidget fn C.gtk_window_set_title(&C.GtkWidget, charptr) @@ -147,7 +148,7 @@ fn C.gtk_window_set_default_geometry(&C.GtkWidget, int, int) // !DEPRECATED // fn C.gtk_window_set_geometry_hints(&C.GtkWidget, &C.GtkWidget, &GdkGeometry, GdkWindowHints) -fn C.gtk_window_set_gravity(&C.GtkWidget, int) +fn C.gtk_window_set_gravity(&C.GtkWidget, gdk.Gravity) fn C.gtk_window_get_gravity(&C.GtkWidget) gdk.Gravity @@ -169,7 +170,7 @@ fn C.gtk_window_is_maximized(&C.GtkWidget) bool fn C.gtk_window_has_toplevel_focus(&C.GtkWidget) bool -// fn C.gtk_window_list_toplevels() &GList +// fn C.gtk_window_list_toplevels() &C.GList fn C.gtk_window_add_mnemonic(&C.GtkWidget, u32, &C.GtkWidget) fn C.gtk_window_remove_mnemonic(&C.GtkWidget, u32, &C.GtkWidget) @@ -239,7 +240,7 @@ fn C.gtk_window_get_decorated(&C.GtkWidget) bool fn C.gtk_window_get_deletable(&C.GtkWidget) bool -// fn C.gtk_window_get_default_icon_list() &GList +// fn C.gtk_window_get_default_icon_list() &C.GList fn C.gtk_window_get_default_icon_name() fn C.gtk_window_get_default_size(&C.GtkWidget, &int, &int) @@ -249,7 +250,7 @@ fn C.gtk_window_get_destroy_with_parent(&C.GtkWidget) bool fn C.gtk_window_get_hide_titlebar_when_maximized(&C.GtkWidget) bool // fn C.gtk_window_get_icon(&C.GtkWidget) &GdkPixbuf -// fn C.gtk_window_get_icon_list(&C.GtkWidget) &GList +// fn C.gtk_window_get_icon_list(&C.GtkWidget) &C.GList fn C.gtk_window_get_icon_name(&C.GtkWidget) // fn C.gtk_window_get_mnemonic_modifier(&C.GtkWidget) GdkModifierType @@ -281,7 +282,7 @@ fn C.gtk_window_get_focus_on_map(&C.GtkWidget) bool // fn C.gtk_window_get_group(&C.GtkWidget) &WidgetGroup fn C.gtk_window_has_group(&C.GtkWidget) bool -fn C.gtk_window_get_window_type(&C.GtkWidget) int +fn C.gtk_window_get_window_type(&C.GtkWidget) WindowType fn C.gtk_window_move(&C.GtkWidget, int, int) @@ -293,14 +294,14 @@ fn C.gtk_window_resize(&C.GtkWidget, int, int) fn C.gtk_window_resize_to_geometry(&C.GtkWidget, int, int) -// fn C.gtk_window_set_default_icon_list(&GList) +// fn C.gtk_window_set_default_icon_list(&C.GList) // fn C.gtk_window_set_default_icon(&GdkPixbuf) fn C.gtk_window_set_default_icon_from_file(charptr, &GError) bool fn C.gtk_window_set_default_icon_name(charptr) // fn C.gtk_window_set_icon(&C.GtkWidget, &GdkPixbuf) -// fn C.gtk_window_set_icon_list(&C.GtkWidget, &GList) +// fn C.gtk_window_set_icon_list(&C.GtkWidget, &C.GList) fn C.gtk_window_set_icon_from_file(&C.GtkWidget, charptr, &GError) bool fn C.gtk_window_set_icon_name(&C.GtkWidget, charptr) @@ -326,9 +327,9 @@ fn C.gtk_window_get_has_resize_grip(&C.GtkWidget) bool fn C.gtk_window_resize_grip_is_visible(&C.GtkWidget) bool // fn C.gtk_window_get_resize_grip_area(&C.GtkWidget, &GdkRectangle) bool -fn C.gtk_window_get_application(&C.GtkWidget) &C.GtkApplication +fn C.gtk_window_get_application(&C.GtkWidget) &C.GtkWidget -fn C.gtk_window_set_application(&C.GtkWidget, &C.GtkApplication) +fn C.gtk_window_set_application(&C.GtkWidget, &C.GtkWidget) fn C.gtk_window_set_has_user_ref_count(&C.GtkWidget, bool) @@ -341,25 +342,25 @@ fn C.gtk_window_set_interactive_debugging(bool) // DIALOG fn C.gtk_dialog_new() &C.GtkWidget -fn C.gtk_dialog_new_with_buttons(x &charptr, y &C.GtkWindow, z int, a C.GtkDialogFlags, b charptr, c int) &C.GtkWidget +fn C.gtk_dialog_new_with_buttons(&charptr, &C.GtkWidget, DialogFlags, charptr, int) &C.GtkWidget -fn C.gtk_dialog_run(&C.GtkWidget) int +fn C.gtk_dialog_run(&C.GtkWidget) ResponseType -fn C.gtk_dialog_response(&C.GtkWidget, int) +fn C.gtk_dialog_response(&C.GtkWidget, ResponseType) -fn C.gtk_dialog_add_button(&C.GtkWidget, &charptr, int) &C.GtkWidget +fn C.gtk_dialog_add_button(&C.GtkWidget, &charptr, ResponseType) &C.GtkWidget fn C.gtk_dialog_add_buttons(&C.GtkWidget, &charptr) -fn C.gtk_dialog_add_action_widget(&C.GtkWidget, &C.GtkWidget, int) +fn C.gtk_dialog_add_action_widget(&C.GtkWidget, &C.GtkWidget, ResponseType) -fn C.gtk_dialog_set_default_response(&C.GtkWidget, int) +fn C.gtk_dialog_set_default_response(&C.GtkWidget, ResponseType) -fn C.gtk_dialog_set_response_sensitive(&C.GtkWidget, int, bool) +fn C.gtk_dialog_set_response_sensitive(&C.GtkWidget, ResponseType, bool) fn C.gtk_dialog_get_response_for_widget(&C.GtkWidget, &C.GtkWidget) int -fn C.gtk_dialog_get_widget_for_response(&C.GtkWidget, int) &C.GtkWidget +fn C.gtk_dialog_get_widget_for_response(&C.GtkWidget, ResponseType) &C.GtkWidget fn C.gtk_dialog_get_action_area(&C.GtkWidget) &C.GtkWidget @@ -387,7 +388,7 @@ fn C.gtk_text_buffer_new(tt &C.GtkWidget) &C.GtkWidget fn C.gtk_text_buffer_set_text(t &C.GtkWidget, b byteptr, len int) -fn C.gtk_text_buffer_get_text(t &C.GtkWidget, start &GtkTextIter, end &GtkTextIter) byteptr +fn C.gtk_text_buffer_get_text(&C.GtkWidget, &GtkTextIter, &GtkTextIter, bool) byteptr fn C.gtk_text_buffer_get_bounds(b &C.GtkWidget, start &GtkTextIter, end &GtkTextIter) @@ -408,9 +409,9 @@ fn C.gtk_text_view_get_buffer(t &C.GtkWidget) &C.GtkWidget // PANED fn C.gtk_paned_new(o Orientation) &C.GtkWidget -fn C.gtk_paned_add1(p &C.GtkWidget, wgt IWidget) +fn C.gtk_paned_add1(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_paned_add2(p &C.GtkWidget, wgt IWidget) +fn C.gtk_paned_add2(&C.GtkWidget, &C.GtkWidget) fn C.gtk_paned_set_wide_handle(p &C.GtkWidget, wide bool) @@ -434,7 +435,7 @@ fn C.gtk_button_new_with_label(charptr) &C.GtkWidget fn C.gtk_button_new_with_mnemonic(charptr) &C.GtkWidget -fn C.gtk_button_new_from_icon_name(charptr, int) &C.GtkWidget +fn C.gtk_button_new_from_icon_name(charptr, IconSize) &C.GtkWidget fn C.gtk_button_new_from_stock(charptr) &C.GtkWidget @@ -448,9 +449,9 @@ fn C.gtk_button_enter(&C.GtkWidget) fn C.gtk_button_leave(&C.GtkWidget) -fn C.gtk_button_set_relief(&C.GtkWidget, int) +fn C.gtk_button_set_relief(&C.GtkWidget, ReliefStyle) -fn C.gtk_button_get_relief(&C.GtkWidget) int +fn C.gtk_button_get_relief(&C.GtkWidget) ReliefStyle fn C.gtk_button_get_label(&C.GtkWidget) charptr @@ -476,9 +477,9 @@ fn C.gtk_button_set_image(&C.GtkWidget, &C.GtkWidget) fn C.gtk_button_get_image(&C.GtkWidget) &C.GtkWidget -fn C.gtk_button_set_image_position(&C.GtkWidget, int) +fn C.gtk_button_set_image_position(&C.GtkWidget, Position) -fn C.gtk_button_get_image_position(&C.GtkWidget) int +fn C.gtk_button_get_image_position(&C.GtkWidget) Position fn C.gtk_button_set_always_show_image(&C.GtkWidget, bool) @@ -501,7 +502,7 @@ fn C.gtk_entry_get_text_length(&C.GtkWidget) u32 // fn C.gtk_entry_get_text_area(&C.GtkWidget, &GdkRectangle) fn C.gtk_entry_set_visibility(&C.GtkWidget, bool) -fn C.gtk_entry_set_invisible_char(&C.GtkWidget, byte, x, gunichar) +fn C.gtk_entry_set_invisible_char(&C.GtkWidget, charptr) fn C.gtk_entry_unset_invisible_char(&C.GtkWidget) @@ -578,58 +579,58 @@ fn C.gtk_entry_reset_im_context(&C.GtkWidget) // fn C.gtk_entry_set_icon_from_pixbuf(&C.GtkWidget, C.GtkEntryIconPosition, &GdkPixbuf) fn C.gtk_entry_set_icon_from_stock(x &C.GtkWidget, y int, z C.GtkEntryIconPosition, a &charptr) -fn C.gtk_entry_set_icon_from_icon_name(&C.GtkWidget, int, C.GtkEntryIconPosition, &charptr) +fn C.gtk_entry_set_icon_from_icon_name(&C.GtkWidget, EntryIconPosition, &charptr) // fn C.gtk_entry_set_icon_from_gicon(&C.GtkWidget, int /* C.GtkEntryIconPosition */, &GIcon) -fn C.gtk_entry_get_icon_storage_type(&C.GtkWidget, int, C.GtkEntryIconPosition) int +fn C.gtk_entry_get_icon_storage_type(&C.GtkWidget, EntryIconPosition) ImageType // C.GtkImageType // fn C.gtk_entry_get_icon_pixbuf(&C.GtkWidget, int /* C.GtkEntryIconPosition */) &GdkPixbuf -fn C.gtk_entry_get_icon_stock(&C.GtkWidget, int, C.GtkEntryIconPosition) charptr +fn C.gtk_entry_get_icon_stock(&C.GtkWidget, EntryIconPosition) charptr -fn C.gtk_entry_get_icon_name(&C.GtkWidget, int, C.GtkEntryIconPosition) charptr +fn C.gtk_entry_get_icon_name(&C.GtkWidget, EntryIconPosition) charptr // fn C.gtk_entry_get_icon_gicon(&C.GtkWidget, int /* C.GtkEntryIconPosition */) &GIcon -fn C.gtk_entry_set_icon_activatable(&C.GtkWidget, int, C.GtkEntryIconPosition, bool) +fn C.gtk_entry_set_icon_activatable(&C.GtkWidget, EntryIconPosition, bool) -fn C.gtk_entry_get_icon_activatable(&C.GtkWidget, int, C.GtkEntryIconPosition) bool +fn C.gtk_entry_get_icon_activatable(&C.GtkWidget, EntryIconPosition) bool -fn C.gtk_entry_set_icon_sensitive(&C.GtkWidget, int, C.GtkEntryIconPosition, bool) +fn C.gtk_entry_set_icon_sensitive(&C.GtkWidget, EntryIconPosition, bool) -fn C.gtk_entry_get_icon_sensitive(&C.GtkWidget, int, C.GtkEntryIconPosition) bool +fn C.gtk_entry_get_icon_sensitive(&C.GtkWidget, EntryIconPosition) bool fn C.gtk_entry_get_icon_at_pos(&C.GtkWidget, int, int) int -fn C.gtk_entry_set_icon_tooltip_text(&C.GtkWidget, int, C.GtkEntryIconPosition, &charptr) +fn C.gtk_entry_set_icon_tooltip_text(&C.GtkWidget, EntryIconPosition, &charptr) -fn C.gtk_entry_get_icon_tooltip_text(&C.GtkWidget, int, C.GtkEntryIconPosition) charptr +fn C.gtk_entry_get_icon_tooltip_text(&C.GtkWidget, EntryIconPosition) charptr -fn C.gtk_entry_set_icon_tooltip_markup(&C.GtkWidget, int, C.GtkEntryIconPosition, &charptr) +fn C.gtk_entry_set_icon_tooltip_markup(&C.GtkWidget, EntryIconPosition, &charptr) -fn C.gtk_entry_get_icon_tooltip_markup(&C.GtkWidget, int, C.GtkEntryIconPosition) charptr +fn C.gtk_entry_get_icon_tooltip_markup(&C.GtkWidget, EntryIconPosition) charptr // fn C.gtk_entry_set_icon_drag_source(&C.GtkWidget, int /* C.GtkEntryIconPosition */, &C.GtkTargetList, GdkDragAction) fn C.gtk_entry_get_current_icon_drag_source(&C.GtkWidget) int // fn C.gtk_entry_get_icon_area(&C.GtkWidget, int /* C.GtkEntryIconPosition */, &GdkRectangle) -fn C.gtk_entry_set_input_purpose(&C.GtkWidget, int, C.GtkInputPurpose) +fn C.gtk_entry_set_input_purpose(&C.GtkWidget, InputPurpose) -fn C.gtk_entry_get_input_purpose(&C.GtkWidget) int +fn C.gtk_entry_get_input_purpose(&C.GtkWidget) InputPurpose // C.GtkInputPurpose -fn C.gtk_entry_set_input_hints(&C.GtkWidget, int, C.GtkInputHints) +fn C.gtk_entry_set_input_hints(&C.GtkWidget, InputHints) -fn C.gtk_entry_get_input_hints(&C.GtkWidget) int +fn C.gtk_entry_get_input_hints(&C.GtkWidget) InputHints // C.GtkInputHints fn C.gtk_entry_grab_focus_without_selecting(&C.GtkWidget) // ACCEL MAP -fn C.gtk_accel_map_add_entry(charptr, u32, C.GdkModifierType) +fn C.gtk_accel_map_add_entry(charptr, u32, gdk.ModifierType) fn C.gtk_accel_map_lookup_entry(charptr, &C.GtkAccelKey) bool -fn C.gtk_accel_map_change_entry(charptr, u32, C.GdkModifierType, bool) bool +fn C.gtk_accel_map_change_entry(charptr, u32, gdk.ModifierType, bool) bool fn C.gtk_accel_map_load(charptr) @@ -677,10 +678,10 @@ fn C.gtk_box_query_child_packing(&C.GtkWidget, &C.GtkWidget, &bool, &bool, &u32, fn C.gtk_box_set_child_packing(&C.GtkWidget, &C.GtkWidget, bool, bool, u32, int, C.GtkPackType) -fn C.gtk_box_get_baseline_position(&C.GtkWidget) int +fn C.gtk_box_get_baseline_position(&C.GtkWidget) BaselinePosition // C.GtkBaselinePosition -fn C.gtk_box_set_baseline_position(&C.GtkWidget, int, C.GtkBaselinePosition) +fn C.gtk_box_set_baseline_position(&C.GtkWidget, BaselinePosition) fn C.gtk_box_get_center_widget(&C.GtkWidget) &C.GtkWidget @@ -772,7 +773,7 @@ fn C.gtk_label_set_selectable(&C.GtkWidget, bool) fn C.gtk_label_set_text_with_mnemonic(&C.GtkWidget, charptr) // fn C.gtk_label_get_attributes(&C.GtkWidget) &PangoAttrList -fn C.gtk_label_get_justify(&C.GtkWidget) int +fn C.gtk_label_get_justify(&C.GtkWidget) Justification fn C.gtk_label_get_xalign(&C.GtkWidget) f32 @@ -820,183 +821,183 @@ fn C.gtk_label_set_track_visited_links(&C.GtkWidget, bool) fn C.gtk_label_get_track_visited_links(&C.GtkWidget) bool // APPLICATION -fn C.gtk_application_new(charptr, int, C.GApplicationFlags) &C.GtkApplication +fn C.gtk_application_new(charptr, gio.GApplicationFlags) &C.GtkWidget -fn C.g_application_run(&C.GtkApplication, int, charptr) int +fn C.g_application_run(&C.GtkWidget, int, charptr) int -fn C.gtk_application_add_window(&C.GtkApplication, &C.GtkWindow) +fn C.gtk_application_add_window(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_application_remove_window(&C.GtkApplication, &C.GtkWindow) +fn C.gtk_application_remove_window(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_application_get_windows(&C.GtkApplication) &GList +fn C.gtk_application_get_windows(&C.GtkWidget) &C.GList -fn C.gtk_application_get_window_by_id(&C.GtkApplication, u32) &C.GtkWindow +fn C.gtk_application_get_window_by_id(&C.GtkWidget, u32) &C.GtkWidget -fn C.gtk_application_get_active_window(&C.GtkApplication) &C.GtkWindow +fn C.gtk_application_get_active_window(&C.GtkWidget) &C.GtkWidget -fn C.gtk_application_inhibit(&C.GtkApplication, &C.GtkWindow, int, C.GtkApplicationInhibitFlags, charptr) u32 +fn C.gtk_application_inhibit(&C.GtkWidget, &C.GtkWidget, int, C.GtkApplicationInhibitFlags, charptr) u32 -fn C.gtk_application_uninhibit(&C.GtkApplication, u32) +fn C.gtk_application_uninhibit(&C.GtkWidget, u32) -fn C.gtk_application_is_inhibited(&C.GtkApplication, int, C.GtkApplicationInhibitFlags) bool +fn C.gtk_application_is_inhibited(&C.GtkWidget, int, C.GtkApplicationInhibitFlags) bool -fn C.gtk_application_prefers_app_menu(&C.GtkApplication) bool +fn C.gtk_application_prefers_app_menu(&C.GtkWidget) bool -fn C.gtk_application_get_app_menu(&C.GtkApplication) &C.GMenuModel +fn C.gtk_application_get_app_menu(&C.GtkWidget) &C.GMenuModel -fn C.gtk_application_set_app_menu(&C.GtkApplication, &C.GMenuModel) +fn C.gtk_application_set_app_menu(&C.GtkWidget, &C.GMenuModel) -fn C.gtk_application_get_menubar(&C.GtkApplication) &C.GMenuModel +fn C.gtk_application_get_menubar(&C.GtkWidget) &C.GMenuModel -fn C.gtk_application_set_menubar(&C.GtkApplication, &C.GMenuModel) +fn C.gtk_application_set_menubar(&C.GtkWidget, &C.GMenuModel) -fn C.gtk_application_get_menu_by_id(&C.GtkApplication, charptr) &C.GMenu +fn C.gtk_application_get_menu_by_id(&C.GtkWidget, charptr) &C.GMenu -fn C.gtk_application_add_accelerator(&C.GtkApplication, charptr, &charptr, &C.GVariant) +fn C.gtk_application_add_accelerator(&C.GtkWidget, charptr, &charptr, &C.GVariant) -fn C.gtk_application_remove_accelerator(&C.GtkApplication, &charptr, &C.GVariant) +fn C.gtk_application_remove_accelerator(&C.GtkWidget, &charptr, &C.GVariant) -fn C.gtk_application_list_action_descriptions(&C.GtkApplication) &charptr +fn C.gtk_application_list_action_descriptions(&C.GtkWidget) &charptr -fn C.gtk_application_get_accels_for_action(&C.GtkApplication, &charptr) &charptr +fn C.gtk_application_get_accels_for_action(&C.GtkWidget, &charptr) &charptr -fn C.gtk_application_set_accels_for_action(&C.GtkApplication, &charptr, &charptr) +fn C.gtk_application_set_accels_for_action(&C.GtkWidget, &charptr, &charptr) -fn C.gtk_application_get_actions_for_accel(&C.GtkApplication, &charptr) &charptr +fn C.gtk_application_get_actions_for_accel(&C.GtkWidget, &charptr) &charptr // ApplicationWindow -fn C.gtk_application_window_new(&C.GtkApplication) &C.GtkWidget +fn C.gtk_application_window_new(&C.GtkWidget) &C.GtkWidget -fn C.gtk_application_window_set_show_menubar(&C.GtkApplicationWindow, bool) +fn C.gtk_application_window_set_show_menubar(&C.GtkWidget, bool) -fn C.gtk_application_window_get_show_menubar(&C.GtkApplicationWindow) bool +fn C.gtk_application_window_get_show_menubar(&C.GtkWidget) bool -fn C.gtk_application_window_get_id(&C.GtkApplicationWindow) u32 +fn C.gtk_application_window_get_id(&C.GtkWidget) u32 -fn C.gtk_application_window_set_help_overlay(&C.GtkApplicationWindow, &C.GtkShortcutsWindow) +fn C.gtk_application_window_set_help_overlay(&C.GtkWidget, &C.GtkShortcutsWindow) -fn C.gtk_application_window_get_help_overlay(&C.GtkApplicationWindow) &C.GtkShortcutsWindow +fn C.gtk_application_window_get_help_overlay(&C.GtkWidget) &C.GtkShortcutsWindow // CONTAINER -fn C.gtk_container_add(&C.GtkContainer, &C.GtkWidget) +fn C.gtk_container_add(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_container_remove(&C.GtkContainer, &C.GtkWidget) +fn C.gtk_container_remove(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_container_add_with_properties(&C.GtkContainer, &C.GtkWidget, &charptr) +fn C.gtk_container_add_with_properties(&C.GtkWidget, &C.GtkWidget, &charptr) -fn C.gtk_container_get_resize_mode(&C.GtkContainer) int +fn C.gtk_container_get_resize_mode(&C.GtkWidget) int // C.GtkResizeMode -fn C.gtk_container_set_resize_mode(&C.GtkContainer, int, C.GtkResizeMode) +fn C.gtk_container_set_resize_mode(&C.GtkWidget, int, C.GtkResizeMode) -fn C.gtk_container_check_resize(&C.GtkContainer) +fn C.gtk_container_check_resize(&C.GtkWidget) -fn C.gtk_container_foreach(&C.GtkContainer, fn (), C.GtkCallback, voidptr, gpointer) +fn C.gtk_container_foreach(&C.GtkWidget, fn (), C.GtkCallback, voidptr, gpointer) -fn C.gtk_container_get_children(&C.GtkContainer) &GList +fn C.gtk_container_get_children(&C.GtkWidget) &C.GList -fn C.gtk_container_get_path_for_child(&C.GtkContainer, &C.GtkWidget) &C.GtkWidgetPath +fn C.gtk_container_get_path_for_child(&C.GtkWidget, &C.GtkWidget) &C.GtkWidgetPath -fn C.gtk_container_set_reallocate_redraws(&C.GtkContainer, bool) +fn C.gtk_container_set_reallocate_redraws(&C.GtkWidget, bool) -fn C.gtk_container_get_focus_child(&C.GtkContainer) &C.GtkWidget +fn C.gtk_container_get_focus_child(&C.GtkWidget) &C.GtkWidget -fn C.gtk_container_set_focus_child(&C.GtkContainer, &C.GtkWidget) +fn C.gtk_container_set_focus_child(&C.GtkWidget, &C.GtkWidget) -fn C.gtk_container_get_focus_vadjustment(&C.GtkContainer) &C.GtkAdjustment +fn C.gtk_container_get_focus_vadjustment(&C.GtkWidget) &C.GtkAdjustment -fn C.gtk_container_set_focus_vadjustment(&C.GtkContainer, &C.GtkAdjustment) +fn C.gtk_container_set_focus_vadjustment(&C.GtkWidget, &C.GtkAdjustment) -fn C.gtk_container_get_focus_hadjustment(&C.GtkContainer) &C.GtkAdjustment +fn C.gtk_container_get_focus_hadjustment(&C.GtkWidget) &C.GtkAdjustment -fn C.gtk_container_set_focus_hadjustment(&C.GtkContainer, &C.GtkAdjustment) +fn C.gtk_container_set_focus_hadjustment(&C.GtkWidget, &C.GtkAdjustment) -fn C.gtk_container_resize_children(&C.GtkContainer) +fn C.gtk_container_resize_children(&C.GtkWidget) -fn C.gtk_container_child_type(&C.GtkContainer) C.GType +fn C.gtk_container_child_type(&C.GtkWidget) C.GType -fn C.gtk_container_child_get(&C.GtkContainer, &C.GtkWidget, &charptr) +fn C.gtk_container_child_get(&C.GtkWidget, &C.GtkWidget, &charptr) -fn C.gtk_container_child_set(&C.GtkContainer, &C.GtkWidget, &charptr) +fn C.gtk_container_child_set(&C.GtkWidget, &C.GtkWidget, &charptr) -fn C.gtk_container_child_get_property(&C.GtkContainer, &C.GtkWidget, &charptr, &C.GValue) +fn C.gtk_container_child_get_property(&C.GtkWidget, &C.GtkWidget, &charptr, &C.GValue) -fn C.gtk_container_child_set_property(&C.GtkContainer, &C.GtkWidget, &charptr, &C.GValue) +fn C.gtk_container_child_set_property(&C.GtkWidget, &C.GtkWidget, &charptr, &C.GValue) -fn C.gtk_container_child_get_valist(&C.GtkContainer, &C.GtkWidget, &charptr, va_list) +fn C.gtk_container_child_get_valist(&C.GtkWidget, &C.GtkWidget, &charptr, va_list) -fn C.gtk_container_child_set_valist(&C.GtkContainer, &C.GtkWidget, &charptr, va_list) +fn C.gtk_container_child_set_valist(&C.GtkWidget, &C.GtkWidget, &charptr, va_list) -fn C.gtk_container_child_notify(&C.GtkContainer, &C.GtkWidget, &charptr) +fn C.gtk_container_child_notify(&C.GtkWidget, &C.GtkWidget, &charptr) -fn C.gtk_container_child_notify_by_pspec(&C.GtkContainer, &C.GtkWidget, &GParamSpec) +fn C.gtk_container_child_notify_by_pspec(&C.GtkWidget, &C.GtkWidget, &C.GParamSpec) -fn C.gtk_container_forall(&C.GtkContainer, fn (), C.GtkCallback, voidptr, gpointer) +fn C.gtk_container_forall(&C.GtkWidget, fn (), C.GtkCallback, voidptr, gpointer) -fn C.gtk_container_get_border_width(&C.GtkContainer) u32 +fn C.gtk_container_get_border_width(&C.GtkWidget) u32 -fn C.gtk_container_set_border_width(&C.GtkContainer, u32) +fn C.gtk_container_set_border_width(&C.GtkWidget, u32) -// fn C.gtk_container_propagate_draw(&C.GtkContainer, &C.GtkWidget, &cairo_t) -fn C.gtk_container_get_focus_chain(&C.GtkContainer, &GList) bool +// fn C.gtk_container_propagate_draw(&C.GtkWidget, &C.GtkWidget, &cairo_t) +fn C.gtk_container_get_focus_chain(&C.GtkWidget, &C.GList) bool -fn C.gtk_container_set_focus_chain(&C.GtkContainer, &GList) +fn C.gtk_container_set_focus_chain(&C.GtkWidget, &C.GList) -fn C.gtk_container_unset_focus_chain(&C.GtkContainer) +fn C.gtk_container_unset_focus_chain(&C.GtkWidget) -fn C.gtk_container_class_find_child_property(&C._GObjectClass, &charptr) &GParamSpec +fn C.gtk_container_class_find_child_property(&C._GObjectClass, &charptr) &C.GParamSpec -fn C.gtk_container_class_install_child_property(&C.GtkContainerClass, u32, &GParamSpec) +fn C.gtk_container_class_install_child_property(&C.GtkWidgetClass, u32, &C.GParamSpec) -fn C.gtk_container_class_install_child_properties(&C.GtkContainerClass, u32, &GParamSpec) +fn C.gtk_container_class_install_child_properties(&C.GtkWidgetClass, u32, &C.GParamSpec) -fn C.gtk_container_class_list_child_properties(&C._GObjectClass, &u32) &GParamSpec +fn C.gtk_container_class_list_child_properties(&C._GObjectClass, &u32) &C.GParamSpec -fn C.gtk_container_class_handle_border_width(&C.GtkContainerClass) +fn C.gtk_container_class_handle_border_width(&C.GtkWidgetClass) // GRID fn C.gtk_grid_new() &C.GtkWidget -fn C.gtk_grid_attach(&C.GtkGrid, &C.GtkWidget, int, int, int, int) +fn C.gtk_grid_attach(&C.GtkWidget, &C.GtkWidget, int, int, int, int) -fn C.gtk_grid_attach_next_to(&C.GtkGrid, &C.GtkWidget, &C.GtkWidget, int, C.GtkPositionType, int, int) +fn C.gtk_grid_attach_next_to(&C.GtkWidget, &C.GtkWidget, &C.GtkWidget, Position, int, int) -fn C.gtk_grid_get_child_at(&C.GtkGrid, int, int) &C.GtkWidget +fn C.gtk_grid_get_child_at(&C.GtkWidget, int, int) &C.GtkWidget -fn C.gtk_grid_insert_row(&C.GtkGrid, int) +fn C.gtk_grid_insert_row(&C.GtkWidget, int) -fn C.gtk_grid_insert_column(&C.GtkGrid, int) +fn C.gtk_grid_insert_column(&C.GtkWidget, int) -fn C.gtk_grid_remove_row(&C.GtkGrid, int) +fn C.gtk_grid_remove_row(&C.GtkWidget, int) -fn C.gtk_grid_remove_column(&C.GtkGrid, int) +fn C.gtk_grid_remove_column(&C.GtkWidget, int) -fn C.gtk_grid_insert_next_to(&C.GtkGrid, &C.GtkWidget, int, C.GtkPositionType) +fn C.gtk_grid_insert_next_to(&C.GtkWidget, &C.GtkWidget, Position) -fn C.gtk_grid_set_row_homogeneous(&C.GtkGrid, bool) +fn C.gtk_grid_set_row_homogeneous(&C.GtkWidget, bool) -fn C.gtk_grid_get_row_homogeneous(&C.GtkGrid) bool +fn C.gtk_grid_get_row_homogeneous(&C.GtkWidget) bool -fn C.gtk_grid_set_row_spacing(&C.GtkGrid, u32) +fn C.gtk_grid_set_row_spacing(&C.GtkWidget, u32) -fn C.gtk_grid_get_row_spacing(&C.GtkGrid) u32 +fn C.gtk_grid_get_row_spacing(&C.GtkWidget) u32 -fn C.gtk_grid_set_column_homogeneous(&C.GtkGrid, bool) +fn C.gtk_grid_set_column_homogeneous(&C.GtkWidget, bool) -fn C.gtk_grid_get_column_homogeneous(&C.GtkGrid) bool +fn C.gtk_grid_get_column_homogeneous(&C.GtkWidget) bool -fn C.gtk_grid_set_column_spacing(&C.GtkGrid, u32) +fn C.gtk_grid_set_column_spacing(&C.GtkWidget, u32) -fn C.gtk_grid_get_column_spacing(&C.GtkGrid) u32 +fn C.gtk_grid_get_column_spacing(&C.GtkWidget) u32 -fn C.gtk_grid_get_baseline_row(&C.GtkGrid) int +fn C.gtk_grid_get_baseline_row(&C.GtkWidget) int -fn C.gtk_grid_set_baseline_row(&C.GtkGrid, int) +fn C.gtk_grid_set_baseline_row(&C.GtkWidget, int) -fn C.gtk_grid_get_row_baseline_position(&C.GtkGrid, int) int +fn C.gtk_grid_get_row_baseline_position(&C.GtkWidget, int) BaselinePosition // C.GtkBaselinePosition -fn C.gtk_grid_set_row_baseline_position(&C.GtkGrid, int, int, C.GtkBaselinePosition) +fn C.gtk_grid_set_row_baseline_position(&C.GtkWidget, int, BaselinePosition) // WIDGET // fn C.gtk_widget_new(C.GType, charptr) &C.GtkWidget @@ -1046,7 +1047,7 @@ fn C.gtk_widget_remove_tick_callback(&C.GtkWidget, u32) // fn C.gtk_widget_add_accelerator(&C.GtkWidget, charptr, &C.GtkAccelGroup, u32, GdkModifierType, C.GtkAccelFlags) // fn C.gtk_widget_remove_accelerator(&C.GtkWidget, &C.GtkAccelGroup, u32, GdkModifierType) bool // fn C.gtk_widget_set_accel_path(&C.GtkWidget, charptr, &C.GtkAccelGroup) -// fn C.gtk_widget_list_accel_closures(&C.GtkWidget) &GList +// fn C.gtk_widget_list_accel_closures(&C.GtkWidget) &C.GList fn C.gtk_widget_can_activate_accel(&C.GtkWidget, u32) bool // fn C.gtk_widget_event(&C.GtkWidget, &GdkEvent) bool @@ -1105,13 +1106,13 @@ fn C.gtk_widget_ensure_style(&C.GtkWidget) fn C.gtk_widget_reset_rc_styles(&C.GtkWidget) // fn C.gtk_widget_get_default_style() &C.GtkStyle -fn C.gtk_widget_set_direction(&C.GtkWidget, int) +fn C.gtk_widget_set_direction(&C.GtkWidget, TextDirection) -fn C.gtk_widget_get_direction(&C.GtkWidget) int +fn C.gtk_widget_get_direction(&C.GtkWidget) TextDirection -fn C.gtk_widget_set_default_direction(int) +fn C.gtk_widget_set_default_direction(TextDirection) -fn C.gtk_widget_get_default_direction() int +fn C.gtk_widget_get_default_direction() TextDirection // fn C.gtk_widget_shape_combine_region(&C.GtkWidget, &cairo_region_t) // fn C.gtk_widget_input_shape_combine_region(&C.GtkWidget, &cairo_region_t) @@ -1160,10 +1161,10 @@ fn C.gtk_widget_set_composite_name(&C.GtkWidget, charptr) fn C.gtk_widget_mnemonic_activate(&C.GtkWidget, bool) bool -// fn C.gtk_widget_class_install_style_property(&WidgetClass, &GParamSpec) -// fn C.gtk_widget_class_install_style_property_parser(&WidgetClass, &GParamSpec, C.GtkRcPropertyParser) -// fn C.gtk_widget_class_find_style_property(&WidgetClass, charptr) &GParamSpec -// fn C.gtk_widget_class_list_style_properties(&WidgetClass, &u32) &GParamSpec +// fn C.gtk_widget_class_install_style_property(&WidgetClass, &C.GParamSpec) +// fn C.gtk_widget_class_install_style_property_parser(&WidgetClass, &C.GParamSpec, C.GtkRcPropertyParser) +// fn C.gtk_widget_class_find_style_property(&WidgetClass, charptr) &C.GParamSpec +// fn C.gtk_widget_class_list_style_properties(&WidgetClass, &u32) &C.GParamSpec // fn C.gtk_widget_region_intersect(&C.GtkWidget, &cairo_region_t) &cairo_region_t // fn C.gtk_widget_send_expose(&C.GtkWidget, &GdkEvent) int // fn C.gtk_widget_send_focus_change(&C.GtkWidget, &GdkEvent) bool @@ -1176,7 +1177,7 @@ fn C.gtk_widget_style_get_property(&C.GtkWidget, charptr, &C.GValue) // fn C.gtk_widget_class_set_accessible_type(&WidgetClass, C.GType) // fn C.gtk_widget_class_set_accessible_role(&WidgetClass, AtkRole) // fn C.gtk_widget_get_accessible(&C.GtkWidget) &AtkObject -fn C.gtk_widget_child_focus(&C.GtkWidget, int) bool +fn C.gtk_widget_child_focus(&C.GtkWidget, DirectionType) bool fn C.gtk_widget_child_notify(&C.GtkWidget, charptr) @@ -1205,7 +1206,7 @@ fn C.gtk_widget_set_no_show_all(&C.GtkWidget, bool) fn C.gtk_widget_get_no_show_all(&C.GtkWidget) bool -// fn C.gtk_widget_list_mnemonic_labels(&C.GtkWidget) &GList +// fn C.gtk_widget_list_mnemonic_labels(&C.GtkWidget) &C.GList fn C.gtk_widget_add_mnemonic_label(&C.GtkWidget, &C.GtkWidget) fn C.gtk_widget_remove_mnemonic_label(&C.GtkWidget, &C.GtkWidget) @@ -1214,7 +1215,7 @@ fn C.gtk_widget_is_composited(&C.GtkWidget) bool fn C.gtk_widget_error_bell(&C.GtkWidget) -fn C.gtk_widget_keynav_failed(&C.GtkWidget, int) bool +fn C.gtk_widget_keynav_failed(&C.GtkWidget, DirectionType) bool fn C.gtk_widget_get_tooltip_markup(&C.GtkWidget) charptr @@ -1290,11 +1291,11 @@ fn C.gtk_widget_is_visible(&C.GtkWidget) bool fn C.gtk_widget_set_visible(&C.GtkWidget, bool) -fn C.gtk_widget_set_state_flags(&C.GtkWidget, int, bool) +fn C.gtk_widget_set_state_flags(&C.GtkWidget, StateFlags, bool) -fn C.gtk_widget_unset_state_flags(&C.GtkWidget, int) +fn C.gtk_widget_unset_state_flags(&C.GtkWidget, StateFlags) -fn C.gtk_widget_get_state_flags(&C.GtkWidget) int +fn C.gtk_widget_get_state_flags(&C.GtkWidget) StateFlags fn C.gtk_widget_has_default(&C.GtkWidget) bool @@ -1365,21 +1366,21 @@ fn C.gtk_widget_get_preferred_width_for_height(&C.GtkWidget, int, &int, &int) fn C.gtk_widget_get_preferred_height_and_baseline_for_width(&C.GtkWidget, int, &int, &int, &int, &int) -fn C.gtk_widget_get_request_mode(&C.GtkWidget) int +fn C.gtk_widget_get_request_mode(&C.GtkWidget) SizeRequestMode fn C.gtk_widget_get_preferred_size(&C.GtkWidget, &C.GtkRequisition, &C.GtkRequisition) fn C.gtk_distribute_natural_allocation(int, u32, &C.GtkRequestedSize) int -fn C.gtk_widget_get_halign(&C.GtkWidget) int +fn C.gtk_widget_get_halign(&C.GtkWidget) Align -fn C.gtk_widget_set_halign(&C.GtkWidget, int) +fn C.gtk_widget_set_halign(&C.GtkWidget, Align) -fn C.gtk_widget_get_valign(&C.GtkWidget) int +fn C.gtk_widget_get_valign(&C.GtkWidget) Align -fn C.gtk_widget_get_valign_with_baseline(&C.GtkWidget) int +fn C.gtk_widget_get_valign_with_baseline(&C.GtkWidget) Align -fn C.gtk_widget_set_valign(&C.GtkWidget, int) +fn C.gtk_widget_set_valign(&C.GtkWidget, Align) fn C.gtk_widget_get_margin_left(&C.GtkWidget) int @@ -1423,7 +1424,7 @@ fn C.gtk_widget_set_vexpand_set(&C.GtkWidget, bool) fn C.gtk_widget_queue_compute_expand(&C.GtkWidget) -fn C.gtk_widget_compute_expand(&C.GtkWidget, int) bool +fn C.gtk_widget_compute_expand(&C.GtkWidget, Orientation) bool fn C.gtk_widget_init_template(&C.GtkWidget) @@ -1477,13 +1478,13 @@ fn C.gtk_builder_set_translation_domain(&C.GtkBuilder, &charptr) fn C.gtk_builder_get_translation_domain(&C.GtkBuilder) charptr -fn C.gtk_builder_set_application(&C.GtkBuilder, &C.GtkApplication) +fn C.gtk_builder_set_application(&C.GtkBuilder, &C.GtkWidget) -fn C.gtk_builder_get_application(&C.GtkBuilder) &C.GtkApplication +fn C.gtk_builder_get_application(&C.GtkBuilder) &C.GtkWidget fn C.gtk_builder_get_type_from_name(&C.GtkBuilder, &char) C.GType -fn C.gtk_builder_value_from_string(&C.GtkBuilder, &GParamSpec, &charptr, &C.GValue, &GError) bool +fn C.gtk_builder_value_from_string(&C.GtkBuilder, &C.GParamSpec, &charptr, &C.GValue, &GError) bool fn C.gtk_builder_value_from_string_type(&C.GtkBuilder, C.GType, &charptr, &C.GValue, &GError) bool @@ -1511,67 +1512,67 @@ fn C.gtk_buildable_get_internal_child(&C.GtkBuildable, &C.GtkBuilder, &charptr) // AboutDialog fn C.gtk_about_dialog_new() &C.GtkWidget -fn C.gtk_about_dialog_get_program_name(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_program_name(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_program_name(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_program_name(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_version(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_version(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_version(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_version(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_copyright(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_copyright(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_copyright(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_copyright(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_comments(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_comments(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_comments(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_comments(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_license(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_license(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_license(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_license(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_wrap_license(&C.GtkAboutDialog) bool +fn C.gtk_about_dialog_get_wrap_license(&C.GtkWidget) bool -fn C.gtk_about_dialog_set_wrap_license(&C.GtkAboutDialog, bool) +fn C.gtk_about_dialog_set_wrap_license(&C.GtkWidget, bool) -fn C.gtk_about_dialog_get_license_type(&C.GtkAboutDialog) int +fn C.gtk_about_dialog_get_license_type(&C.GtkWidget) License -fn C.gtk_about_dialog_set_license_type(&C.GtkAboutDialog, int) +fn C.gtk_about_dialog_set_license_type(&C.GtkWidget, License) -fn C.gtk_about_dialog_get_website(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_website(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_website(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_website(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_website_label(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_website_label(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_website_label(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_website_label(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_authors(&C.GtkAboutDialog) &charptr +fn C.gtk_about_dialog_get_authors(&C.GtkWidget) &charptr -fn C.gtk_about_dialog_set_authors(&C.GtkAboutDialog, &charptr) +fn C.gtk_about_dialog_set_authors(&C.GtkWidget, &charptr) -fn C.gtk_about_dialog_get_artists(&C.GtkAboutDialog) &charptr +fn C.gtk_about_dialog_get_artists(&C.GtkWidget) &charptr -fn C.gtk_about_dialog_set_artists(&C.GtkAboutDialog, &charptr) +fn C.gtk_about_dialog_set_artists(&C.GtkWidget, &charptr) -fn C.gtk_about_dialog_get_documenters(&C.GtkAboutDialog) &charptr +fn C.gtk_about_dialog_get_documenters(&C.GtkWidget) &charptr -fn C.gtk_about_dialog_set_documenters(&C.GtkAboutDialog, &charptr) +fn C.gtk_about_dialog_set_documenters(&C.GtkWidget, &charptr) -fn C.gtk_about_dialog_get_translator_credits(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_translator_credits(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_translator_credits(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_translator_credits(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_get_logo(&C.GtkAboutDialog) &C.GdkPixbuf +fn C.gtk_about_dialog_get_logo(&C.GtkWidget) &C.GdkPixbuf -fn C.gtk_about_dialog_set_logo(&C.GtkAboutDialog, &C.GdkPixbuf) +fn C.gtk_about_dialog_set_logo(&C.GtkWidget, &C.GdkPixbuf) -fn C.gtk_about_dialog_get_logo_icon_name(&C.GtkAboutDialog) charptr +fn C.gtk_about_dialog_get_logo_icon_name(&C.GtkWidget) charptr -fn C.gtk_about_dialog_set_logo_icon_name(&C.GtkAboutDialog, charptr) +fn C.gtk_about_dialog_set_logo_icon_name(&C.GtkWidget, charptr) -fn C.gtk_about_dialog_add_credit_section(&C.GtkAboutDialog, charptr, &charptr) +fn C.gtk_about_dialog_add_credit_section(&C.GtkWidget, charptr, &charptr) fn C.gtk_show_about_dialog(&C.GtkWidget, charptr) @@ -1579,9 +1580,9 @@ fn C.gtk_show_about_dialog(&C.GtkWidget, charptr) fn C.g_object_unref(voidptr) // ORIENTABLE -fn C.gtk_orientable_get_orientation(&C.GtkWidget) int +fn C.gtk_orientable_get_orientation(&C.GtkWidget) Orientation -fn C.gtk_orientable_set_orientation(&C.GtkWidget, int) +fn C.gtk_orientable_set_orientation(&C.GtkWidget, Orientation) // Requisition fn C.gtk_requisition_new() &C.GtkRequisition @@ -1604,9 +1605,9 @@ fn C.gtk_actionable_set_action_target(&C.GtkWidget, &charptr) fn C.gtk_actionable_set_detailed_action_name(&C.GtkWidget, charptr) // MessageDialog -fn C.gtk_message_dialog_new(&C.GtkWindow, C.GtkDialogFlags, C.GtkMessageType, C.GtkButtonsType, charptr) &C.GtkWidget +fn C.gtk_message_dialog_new(&C.GtkWidget, DialogFlags, MessageType, ButtonsType, charptr) &C.GtkWidget -fn C.gtk_message_dialog_new_with_markup(&C.GtkWindow, C.GtkDialogFlags, C.GtkMessageType, C.GtkButtonsType, charptr) &C.GtkWidget +fn C.gtk_message_dialog_new_with_markup(&C.GtkWidget, DialogFlags, MessageType, ButtonsType, charptr) &C.GtkWidget fn C.gtk_message_dialog_set_markup(&C.GtkWidget, charptr) diff --git a/gtk/about_dialog.v b/gtk/about_dialog.v index 5d83cb1..4b5800a 100644 --- a/gtk/about_dialog.v +++ b/gtk/about_dialog.v @@ -1,6 +1,6 @@ module gtk -import gdk +// import gdk pub enum License { unknown = C.GTK_LICENSE_UNKNOWN @@ -27,20 +27,24 @@ pub struct AboutDialog { c &C.GtkWidget } -pub fn new_about_dialog() AboutDialog { - return AboutDialog{C.gtk_about_dialog_new()} -} +// pub fn new_about_dialog() AboutDialog { +// return AboutDialog{C.gtk_about_dialog_new()} +// } -pub fn (a AboutDialog) get_program_name() string { - return tos3(C.gtk_about_dialog_get_program_name(a.c)) -} +// pub fn (a AboutDialog) get_program_name() string { +// unsafe { +// return tos3(C.gtk_about_dialog_get_program_name(a.c)) +// } +// } -pub fn (a AboutDialog) set_program_name(name string) { - C.gtk_about_dialog_set_program_name(a.c, name.str) -} +// pub fn (a AboutDialog) set_program_name(name string) { +// C.gtk_about_dialog_set_program_name(a.c, name.str) +// } pub fn (a AboutDialog) get_version() string { - return tos3(C.gtk_about_dialog_get_version(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_version(a.c)) + } } pub fn (a AboutDialog) set_version(version string) { @@ -48,7 +52,9 @@ pub fn (a AboutDialog) set_version(version string) { } pub fn (a AboutDialog) get_copyright() string { - return tos3(C.gtk_about_dialog_get_copyright(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_copyright(a.c)) + } } pub fn (a AboutDialog) set_copyright(copyright string) { @@ -56,7 +62,9 @@ pub fn (a AboutDialog) set_copyright(copyright string) { } pub fn (a AboutDialog) get_comments() string { - return tos3(C.gtk_about_dialog_get_comments(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_comments(a.c)) + } } pub fn (a AboutDialog) set_comments(comments string) { @@ -64,7 +72,9 @@ pub fn (a AboutDialog) set_comments(comments string) { } pub fn (a AboutDialog) get_license() string { - return tos3(C.gtk_about_dialog_get_license(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_license(a.c)) + } } pub fn (a AboutDialog) set_license(license string) { @@ -80,7 +90,9 @@ pub fn (a AboutDialog) set_wrap_license(wrap_license bool) { } pub fn (a AboutDialog) get_license_type() License { - return License(C.gtk_about_dialog_get_license_type(a.c)) + unsafe { + return License(C.gtk_about_dialog_get_license_type(a.c)) + } } pub fn (a AboutDialog) set_license_type(license_type License) { @@ -88,7 +100,9 @@ pub fn (a AboutDialog) set_license_type(license_type License) { } pub fn (a AboutDialog) get_website() string { - return tos3(C.gtk_about_dialog_get_website(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_website(a.c)) + } } pub fn (a AboutDialog) set_website(website string) { @@ -96,7 +110,9 @@ pub fn (a AboutDialog) set_website(website string) { } pub fn (a AboutDialog) get_website_label() string { - return tos3(C.gtk_about_dialog_get_website_label(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_website_label(a.c)) + } } pub fn (a AboutDialog) set_website_label(website_label string) { @@ -128,23 +144,27 @@ pub fn (a AboutDialog) set_documenters(documenters []string) { } pub fn (a AboutDialog) get_translator_credits() string { - return tos3(C.gtk_about_dialog_get_translator_credits(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_translator_credits(a.c)) + } } pub fn (a AboutDialog) set_translator_credits(translator_credits []string) { C.gtk_about_dialog_set_translator_credits(a.c, translator_credits.data) } -pub fn (a AboutDialog) get_logo() gdk.Pixbuf { - return gdk.Pixbuf{C.gtk_about_dialog_get_logo(a.c)} -} +// pub fn (a AboutDialog) get_logo() gdk.Pixbuf { +// return gdk.Pixbuf{C.gtk_about_dialog_get_logo(a.c)} +// } -pub fn (a AboutDialog) set_logo(logo gdk.Pixbuf) { - C.gtk_about_dialog_set_logo(a.c, logo.get_cptr()) -} +// pub fn (a AboutDialog) set_logo(logo gdk.Pixbuf) { +// C.gtk_about_dialog_set_logo(a.c, logo.get_cptr()) +// } pub fn (a AboutDialog) get_logo_icon_name() string { - return tos3(C.gtk_about_dialog_get_logo_icon_name(a.c)) + unsafe { + return tos3(C.gtk_about_dialog_get_logo_icon_name(a.c)) + } } pub fn (a AboutDialog) set_logo_icon_name(icon_name string) { @@ -161,7 +181,7 @@ pub fn show_about_dialog(parent Window) { } pub fn (a AboutDialog) on_activate_link(handler fn (AboutDialog, charptr, voidptr), user_data voidptr) { - C.g_signal_connect(a.c, 'activate-link', handler, user_data) + C.g_signal_connect(a.c, 'activate-link'.str, handler, user_data) } // Inherited from Widget diff --git a/gtk/accel_map.v b/gtk/accel_map.v index c9319ca..32b2037 100644 --- a/gtk/accel_map.v +++ b/gtk/accel_map.v @@ -1,19 +1,21 @@ module gtk -pub type AccelMapForeach = fn (voidptr, charptr, u32, C.GdkModifierType, bool) +import gdk + +pub type AccelMapForeach = fn (voidptr, charptr, u32, int, C.GdkModifierType, bool) pub struct AccelMap { c &C.GtkAccelMap } -pub fn accel_map_add_entry(path string, key int, mod_type int) { +pub fn accel_map_add_entry(path string, key int, mod_type gdk.ModifierType) { C.gtk_accel_map_add_entry(path.str, key, mod_type) } // TODO pub fn accel_map_lookup_entry(accel_path string) (bool, &C.GtkAccelKey) { key := &C.GtkAccelKey(0) - res := C.gtk_accel_map_lookup_entry(accel_path.str, &key) + res := C.gtk_accel_map_lookup_entry(accel_path.str, key) return res, key } diff --git a/gtk/actionable.v b/gtk/actionable.v index aac6171..66c9739 100644 --- a/gtk/actionable.v +++ b/gtk/actionable.v @@ -1,27 +1,29 @@ module gtk -pub struct Actionable { - c &C.GtkActionable -} +// pub struct Actionable { +// c &C.GtkWidget +// } -pub fn (a Actionable) get_action_name() string { - return tos3(C.gtk_actionable_get_action_name(a.c)) -} +// pub fn (a Actionable) get_action_name() string { +// unsafe { +// return tos3(C.gtk_actionable_get_action_name(a.c)) +// } +// } -pub fn (a Actionable) set_action_name(action_name string) { - C.gtk_actionable_set_action_name(a.c, action_name.str) -} +// pub fn (a Actionable) set_action_name(action_name string) { +// C.gtk_actionable_set_action_name(a.c, action_name.str) +// } // TODO: -pub fn (a Actionable) get_action_target_value() &C.GVariant { - return C.gtk_actionable_get_action_target_value(a.c) -} +// pub fn (a Actionable) get_action_target_value() &C.GVariant { +// return C.gtk_actionable_get_action_target_value(a.c) +// } -pub fn (a Actionable) set_action_target_value(target_value &C.GVariant) { - C.gtk_actionable_set_action_target_value(a.c, target_value) -} +// pub fn (a Actionable) set_action_target_value(target_value &C.GVariant) { +// C.gtk_actionable_set_action_target_value(a.c, target_value) +// } -// TODO: void C.gtk_actionable_set_action_target (GtkActionable *actionable, const gchar *format_string, ...) -pub fn (a Actionable) set_detailed_action_name(detailed_action_name string) { - C.gtk_actionable_set_detailed_action_name(a.c, detailed_action_name.str) -} +// TODO: void C.gtk_actionable_set_action_target (GtkWidget *actionable, const gchar *format_string, ...) +// pub fn (a Actionable) set_detailed_action_name(detailed_action_name string) { +// C.gtk_actionable_set_detailed_action_name(a.c, detailed_action_name.str) +// } diff --git a/gtk/application.v b/gtk/application.v index 24baf1c..682c600 100644 --- a/gtk/application.v +++ b/gtk/application.v @@ -1,6 +1,6 @@ module gtk -import glib +// import glib import gio pub enum ApplicationInhibitFlags { @@ -11,7 +11,7 @@ pub enum ApplicationInhibitFlags { } pub struct Application { - c &C.GtkApplication + c &C.GtkWidget } pub fn new_application(app_id string, flags gio.GApplicationFlags) Application { @@ -33,9 +33,9 @@ pub fn (app Application) remove_window(window Window) { C.gtk_application_remove_window(app.c, window.c) } -pub fn (app Application) get_windows() glib.List { - return glib.List{C.gtk_application_get_windows(app.c)} -} +// pub fn (app Application) get_windows() glib.List { +// return glib.List{C.gtk_application_get_windows(app.c)} +// } pub fn (app Application) get_window_by_id(id u32) Window { window := C.gtk_application_get_window_by_id(app.c, id) @@ -47,17 +47,18 @@ pub fn (app Application) get_active_window() Window { return to_window(window) } +/* pub fn (app Application) inhibit(window Window, flags ApplicationInhibitFlags, reason string) u32 { return C.gtk_application_inhibit(app.c, window.c, flags, reason.str) -} +}*/ pub fn (app Application) uninhibit(cookie u32) { C.gtk_application_uninhibit(app.c, cookie) } -pub fn (app Application) is_inhibited(flags ApplicationInhibitFlags) bool { - return C.gtk_application_is_inhibited(app.c, flags) -} +// pub fn (app Application) is_inhibited(flags ApplicationInhibitFlags) bool { +// return C.gtk_application_is_inhibited(app.c, flags) +// } pub fn (app Application) prefers_app_menu() bool { return C.gtk_application_prefers_app_menu(app.c) diff --git a/gtk/application_window.v b/gtk/application_window.v index 4f05122..5afc8e8 100644 --- a/gtk/application_window.v +++ b/gtk/application_window.v @@ -21,7 +21,7 @@ pub fn (a ApplicationWindow) get_id() u32 { } /* -// TODO: +// TODO: pub fn (a ApplicationWindow) set_help_overlay(help_overlay &C.GtkShortcutsWindow) { C.gtk_application_window_set_help_overlay(a.c, help_overlay) } diff --git a/gtk/bin.v b/gtk/bin.v index c9ce0b1..4bf82c0 100644 --- a/gtk/bin.v +++ b/gtk/bin.v @@ -1,7 +1,7 @@ module gtk pub struct Bin { - c &C.GtkBin + c &C.GtkWidget } pub fn (b Bin) get_child() Widget { diff --git a/gtk/box.v b/gtk/box.v index 8763178..1dfa0b9 100644 --- a/gtk/box.v +++ b/gtk/box.v @@ -12,7 +12,7 @@ pub struct BoxQuery { } pub fn new_box(orientation Orientation, space int) Box { - return Box{C.gtk_box_new(orientation, space)} + return Box{C.gtk_box_new(int(orientation), space)} } pub fn new_hbox(space int) Box { @@ -54,24 +54,24 @@ pub fn (b Box) reorder_child(child IWidget, position int) { C.gtk_box_reorder_child(voidptr(b.c), voidptr(child_), position) } -pub fn (b Box) query_child_packing(child IWidget) BoxQuery { - child_ := child.get_gtk_widget() - expand := false - fill := false - padding := u32(0) - pack_type := PackType(0) - C.gtk_box_query_child_packing(voidptr(b.c), voidptr(child_), &expand, &fill, &padding, - &pack_type) - return BoxQuery{expand, fill, padding, pack_type} -} +// pub fn (b Box) query_child_packing(child IWidget) BoxQuery { +// child_ := child.get_gtk_widget() +// expand := false +// fill := false +// padding := u32(0) +// pack_type := PackType(0) +// C.gtk_box_query_child_packing(voidptr(b.c), voidptr(child_), &expand, &fill, &padding, +// &pack_type) +// return BoxQuery{expand, fill, padding, pack_type} +// } -pub fn (b Box) set_child_packing(child IWidget, expand bool, fill bool, padding u32, pack_type PackType) { - child_ := child.get_gtk_widget() - C.gtk_box_set_child_packing(b.c, child_, expand, fill, padding, pack_type) -} +// pub fn (b Box) set_child_packing(child IWidget, expand bool, fill bool, padding u32, pack_type PackType) { +// child_ := child.get_gtk_widget() +// C.gtk_box_set_child_packing(b.c, child_, expand, fill, padding, pack_type) +// } pub fn (b Box) get_baseline_position() BaselinePosition { - return BaselinePosition(C.gtk_box_get_baseline_position(b.c)) + return C.gtk_box_get_baseline_position(b.c) } pub fn (b Box) set_baseline_position(position BaselinePosition) { @@ -89,7 +89,7 @@ pub fn (b Box) set_center_widget(widget IWidget) { // Inherited from Widget pub fn (b Box) get_halign() Align { - return Align(C.gtk_widget_get_halign(b.c)) + return C.gtk_widget_get_halign(b.c) } pub fn (b Box) set_halign(align Align) { @@ -97,7 +97,7 @@ pub fn (b Box) set_halign(align Align) { } pub fn (b Box) get_valign() Align { - return Align(C.gtk_widget_get_valign(b.c)) + return C.gtk_widget_get_valign(b.c) } pub fn (b Box) set_valign(align Align) { @@ -121,10 +121,14 @@ pub fn (b Box) set_orientation(orientation Orientation) { } pub fn (b Box) get_orientation() Orientation { - return Orientation(C.gtk_orientable_get_orientation(b.c)) + return C.gtk_orientable_get_orientation(b.c) } // Implementing IWidget pub fn (b &Box) get_gtk_widget() &C.GtkWidget { return b.c } + +pub fn to_box(widget IWidget) Box { + return Box{widget.get_gtk_widget()} +} diff --git a/gtk/buildable.v b/gtk/buildable.v index 7697b28..a5b0b95 100644 --- a/gtk/buildable.v +++ b/gtk/buildable.v @@ -1,5 +1,6 @@ module gtk +/* pub struct Buildable { c &C.GtkBuildable } @@ -9,40 +10,42 @@ pub fn (b Buildable) set_name(name string) { } pub fn (b Buildable) get_name() string { - return tos3(C.gtk_buildable_get_name(b.c)) + unsafe { + return tos3(C.gtk_buildable_get_name(b.c)) + } } pub fn (b Buildable) add(builder Builder, child &C._GObject, type_ string) { C.gtk_buildable_add_child(b.c, builder.c, child, type_.str) } -pub fn (b Buildable) set_property(builder Builder, name string, value &C._GValue) { +pub fn (b Buildable) set_property(builder Builder, name string, value &C.GValue) { C.gtk_buildable_set_buildable_property(b.c, builder.c, name.str, value) } pub fn (b Buildable) construct_child(builder Builder, name string) &C._GObject { return C.gtk_buildable_construct_child(b.c, builder.c, name.str) -} - -pub fn (b Buildable) custom_tag_start(builder Builder, child &C._GObject, tagname string) (&C._GMarkupParser, voidptr) { - parser := &C._GMarkupParser(0) - data := voidptr(0) - C.gtk_buildable_custom_tag_start(b.c, builder.c, child, tagname.str, &parser, &data) - return parser, data -} - -pub fn (b Buildable) custom_tag_end(builder Builder, child &C._GObject, tagname string, data voidptr) { - C.gtk_buildable_custom_tag_end(b.c, builder.c, child, tagname.str, data) -} - -pub fn (b Buildable) custom_finished(builder Builder, child &C._GObject, tagname string, data voidptr) { - C.gtk_buildable_custom_finished(b.c, builder.c, child, tagname.str, data) -} - -pub fn (b Buildable) parser_finished(builder Builder) { - C.gtk_buildable_parser_finished(b.c, builder.c) -} - -pub fn (b Buildable) get_internal_child(builder Builder, childname string) &C._GObject { - return C.gtk_buildable_get_internal_child(b.c, builder.c, childname.str) -} +}*/ + +// pub fn (b Buildable) custom_tag_start(builder Builder, child &C._GObject, tagname string) (&C._GMarkupParser, voidptr) { +// parser := &C._GMarkupParser(0) +// data := voidptr(0) +// C.gtk_buildable_custom_tag_start(b.c, builder.c, child, tagname.str, &parser, &data) +// return parser, data +// } + +// pub fn (b Buildable) custom_tag_end(builder Builder, child &C._GObject, tagname string, data voidptr) { +// C.gtk_buildable_custom_tag_end(b.c, builder.c, child, tagname.str, data) +// } + +// pub fn (b Buildable) custom_finished(builder Builder, child &C._GObject, tagname string, data voidptr) { +// C.gtk_buildable_custom_finished(b.c, builder.c, child, tagname.str, data) +// } + +// pub fn (b Buildable) parser_finished(builder Builder) { +// C.gtk_buildable_parser_finished(b.c, builder.c) +// } + +// pub fn (b Buildable) get_internal_child(builder Builder, childname string) &C._GObject { +// return C.gtk_buildable_get_internal_child(b.c, builder.c, childname.str) +// } diff --git a/gtk/builder.v b/gtk/builder.v index 60ff8f5..1db108a 100644 --- a/gtk/builder.v +++ b/gtk/builder.v @@ -1,5 +1,6 @@ module gtk +/* import glib pub enum BuilderError { @@ -47,7 +48,9 @@ pub fn (b Builder) add_from_file(filename string) ?u32 { err := &C._GError{0} ret := C.gtk_builder_add_from_file(b.c, filename.str, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -56,7 +59,9 @@ pub fn (b Builder) add_from_resource(resource_path string) ?u32 { err := &C._GError{0} ret := C.gtk_builder_add_from_resource(b.c, resource_path.str, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -65,7 +70,9 @@ pub fn (b Builder) add_from_string(buffer string) ?u32 { err := &C._GError{0} ret := C.gtk_builder_add_from_string(b.c, buffer.str, buffer.len, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -74,7 +81,9 @@ pub fn (b Builder) add_objects_from_file(filename string, object_ids []string) ? err := &C._GError{0} ret := C.gtk_builder_add_objects_from_file(b.c, filename.str, object_ids.data, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -84,7 +93,9 @@ pub fn (b Builder) add_objects_from_string(buffer string, object_ids []string) ? ret := C.gtk_builder_add_objects_from_string(b.c, buffer.str, buffer.len, object_ids.data, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -94,7 +105,9 @@ pub fn (b Builder) add_objects_from_resource(resource_path string, object_ids [] ret := C.gtk_builder_add_objects_from_resource(b.c, resource_path.str, object_ids.data, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -105,7 +118,9 @@ pub fn (b Builder) extend_with_template(widget IWidget, template_type C.GType, b wgt := widget.get_gtk_widget() ret := C.gtk_builder_extend_with_template(b.c, wgt, template_type, buffer.str, buffer.len, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -133,7 +148,9 @@ pub fn (b Builder) set_translation_domain(domain string) { } pub fn (b Builder) get_translation_domain() string { - return tos3(C.gtk_builder_get_translation_domain(b.c)) + unsafe { + return tos3(C.gtk_builder_get_translation_domain(b.c)) + } } pub fn (b Builder) set_application(application Application) { @@ -142,7 +159,7 @@ pub fn (b Builder) set_application(application Application) { pub fn (b Builder) get_application() Application { return Application{C.gtk_builder_get_application(b.c)} -} +}*/ /* pub fn (b Builder) get_type_from_name(type_name string) C.GType { @@ -153,7 +170,9 @@ pub fn (b Builder) value_from_string(pspec &C.GParamSpec, str string, value &C.G err := &C._GError{0} ret := C.gtk_builder_value_from_string(b.c, pspec, str.str, value, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } @@ -162,7 +181,9 @@ pub fn (b Builder) value_from_string_type(type_ C.GType, str string, value &C.GV err := &C._GError{0} ret := C.gtk_builder_value_from_string_type(b.c, type_, str.str, value, &err) if err != 0 { - return error(tos3(err.message)) + unsafe { + return error(tos3(err.message)) + } } return ret } diff --git a/gtk/button.v b/gtk/button.v index c04cfc8..116db00 100644 --- a/gtk/button.v +++ b/gtk/button.v @@ -1,6 +1,6 @@ module gtk -import gdk +// import gdk pub struct Button { c &C.GtkWidget @@ -31,11 +31,13 @@ pub fn (b Button) set_relief(relief ReliefStyle) { } pub fn (b Button) get_relief() ReliefStyle { - return ReliefStyle(C.gtk_button_get_relief(b.c)) + return C.gtk_button_get_relief(b.c) } pub fn (b Button) get_label() string { - return tos3(C.gtk_button_get_label(b.c)) + unsafe { + return tos3(C.gtk_button_get_label(b.c)) + } } pub fn (b Button) set_label(label string) { @@ -76,7 +78,7 @@ pub fn (b Button) set_image_position(pos Position) { } pub fn (b Button) get_image_position() Position { - return Position(C.gtk_button_get_image_position(b.c)) + return C.gtk_button_get_image_position(b.c) } pub fn (b Button) set_always_show_image(always_show bool) { @@ -87,10 +89,10 @@ pub fn (b Button) get_always_show_image() bool { return C.gtk_button_get_always_show_image(b.c) } -pub fn (b Button) get_event_window() gdk.Window { - cptr := C.gtk_button_get_event_window(b.c) - return gdk.Window{cptr} -} +// pub fn (b Button) get_event_window() gdk.Window { +// cptr := C.gtk_button_get_event_window(b.c) +// return gdk.Window{cptr} +// } // INHERITED FROM WIDGET pub fn (b &Button) show() { diff --git a/gtk/check_button.v b/gtk/check_button.v index 9bd48df..6fc9fec 100644 --- a/gtk/check_button.v +++ b/gtk/check_button.v @@ -1,6 +1,6 @@ module gtk -import gdk +// import gdk pub struct CheckButton { c &C.GtkWidget @@ -57,11 +57,13 @@ pub fn (c CheckButton) set_relief(relief ReliefStyle) { } pub fn (c CheckButton) get_relief() ReliefStyle { - return ReliefStyle(C.gtk_button_get_relief(c.c)) + return C.gtk_button_get_relief(c.c) } pub fn (c CheckButton) get_label() string { - return tos3(C.gtk_button_get_label(c.c)) + unsafe { + return tos3(C.gtk_button_get_label(c.c)) + } } pub fn (c CheckButton) set_label(label string) { @@ -102,7 +104,7 @@ pub fn (c CheckButton) set_image_position(pos Position) { } pub fn (c CheckButton) get_image_position() Position { - return Position(C.gtk_button_get_image_position(c.c)) + return C.gtk_button_get_image_position(c.c) } pub fn (c CheckButton) set_always_show_image(always_show bool) { @@ -113,9 +115,9 @@ pub fn (c CheckButton) get_always_show_image() bool { return C.gtk_button_get_always_show_image(c.c) } -pub fn (c CheckButton) get_event_window() gdk.Window { - return gdk.Window{C.gtk_button_get_event_window(c.c)} -} +// pub fn (c CheckButton) get_event_window() gdk.Window { +// return gdk.Window{C.gtk_button_get_event_window(c.c)} +// } pub fn (c &CheckButton) on(event_name string, handler fn (CheckButton, voidptr), data voidptr) int { return int(C.g_signal_connect(c.c, event_name.str, handler, data)) diff --git a/gtk/color_chooser.v b/gtk/color_chooser.v index 42d6509..a0a94a7 100644 --- a/gtk/color_chooser.v +++ b/gtk/color_chooser.v @@ -1,30 +1,30 @@ module gtk -pub struct ColorChooser { - c &C.GtkColorChooser -} +// pub struct ColorChooser { +// c &C.GtkColorChooser +// } -// TODO -pub fn (c ColorChooser) get_rgba() &C.GdkRGBA { - color := &C.GdkRGBA(0) - C.gtk_color_chooser_get_rgba(c.c, &color) - return color -} +// // TODO +// pub fn (c ColorChooser) get_rgba() &C.GdkRGBA { +// color := &C.GdkRGBA(0) +// C.gtk_color_chooser_get_rgba(c.c, &color) +// return color +// } -// TODO -pub fn (c ColorChooser) set_rgba(color &C.GdkRGBA) { - C.gtk_color_chooser_set_rgba(c.c, color) -} +// // TODO +// pub fn (c ColorChooser) set_rgba(color &C.GdkRGBA) { +// C.gtk_color_chooser_set_rgba(c.c, color) +// } -pub fn (c ColorChooser) get_use_alpha() bool { - return C.gtk_color_chooser_get_use_alpha(c.c) -} +// pub fn (c ColorChooser) get_use_alpha() bool { +// return C.gtk_color_chooser_get_use_alpha(c.c) +// } -pub fn (c ColorChooser) set_use_alpha(use_alpha bool) { - C.gtk_color_chooser_set_use_alpha(c.c, use_alpha) -} +// pub fn (c ColorChooser) set_use_alpha(use_alpha bool) { +// C.gtk_color_chooser_set_use_alpha(c.c, use_alpha) +// } -// TODO -pub fn (c ColorChooser) add_palette(orientation Orientation, colors_per_line int, colors []&C.GdkRGBA) { - C.gtk_color_chooser_add_palette(c.c, orientation, colors_per_line, colors.len, colors.data) -} +// // TODO +// pub fn (c ColorChooser) add_palette(orientation int/* Orientation */, colors_per_line int, colors []&C.GdkRGBA) { +// C.gtk_color_chooser_add_palette(c.c, orientation, colors_per_line, colors.len, colors.data) +// } diff --git a/gtk/container.v b/gtk/container.v index ee2af0c..10e1a9e 100644 --- a/gtk/container.v +++ b/gtk/container.v @@ -7,7 +7,7 @@ pub enum ResizeMode { } pub struct Container { - c &C.GtkContainer + c &C.GtkWidget //&C.GtkContainer } pub fn (c &Container) add(widget IWidget) { diff --git a/gtk/dialog.v b/gtk/dialog.v index cfe7aba..cf6c3c9 100644 --- a/gtk/dialog.v +++ b/gtk/dialog.v @@ -35,7 +35,7 @@ pub fn new_dialog_from_parent(title string, parent Window, flags DialogFlags) Di // TODO: GtkWidget * C.gtk_dialog_new_with_buttons (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, const gchar *first_button_text, ...) pub fn (d Dialog) run() ResponseType { - return ResponseType(C.gtk_dialog_run(d.c)) + return C.gtk_dialog_run(d.c) } pub fn (d Dialog) response(response_id ResponseType) { @@ -236,7 +236,7 @@ pub fn (d Dialog) set_direction(direction TextDirection) { } pub fn (d Dialog) get_direction() TextDirection { - return TextDirection(C.gtk_widget_get_direction(d.c)) + return C.gtk_widget_get_direction(d.c) } pub fn (d Dialog) set_default_direction(direction TextDirection) { @@ -244,7 +244,7 @@ pub fn (d Dialog) set_default_direction(direction TextDirection) { } pub fn (d Dialog) get_default_direction() TextDirection { - return TextDirection(C.gtk_widget_get_default_direction()) + return C.gtk_widget_get_default_direction() } // INHERITED FROM WINDOW @@ -253,7 +253,9 @@ pub fn (d Dialog) set_default_size(width int, height int) { } pub fn (d Dialog) get_title() string { - return tos3(C.gtk_window_get_title(d.c)) + unsafe { + return tos3(C.gtk_window_get_title(d.c)) + } } // IMPLEMENTING IWidget diff --git a/gtk/entry.v b/gtk/entry.v index 2dae6f4..f4eab33 100644 --- a/gtk/entry.v +++ b/gtk/entry.v @@ -47,7 +47,9 @@ pub fn (e Entry) set_text(text string) { } pub fn (e Entry) get_text() string { - return tos3(C.gtk_entry_get_text(e.c)) + unsafe { + return tos3(C.gtk_entry_get_text(e.c)) + } } pub fn (e Entry) get_text_length() u16 { @@ -80,7 +82,7 @@ pub fn (e Entry) gtk_entry_get_has_frame() bool { } // WARNING: Has been deprecated since version 3.4 -// TODO: const GtkBorder * C.gtk_entry_get_inner_border (GtkEntry *entry) +// TODO: const GtkBorder * C.gtk_entry_get_inner_border (GtkEntry *entry) pub fn (e Entry) get_width_chars() int { return int(C.gtk_entry_get_width_chars(e.c)) } @@ -123,7 +125,9 @@ pub fn (e Entry) set_placeholder_text(text string) { } pub fn (e Entry) get_placeholder_text() string { - return tos3(C.gtk_entry_get_placeholder_text(e.c)) + unsafe { + return tos3(C.gtk_entry_get_placeholder_text(e.c)) + } } pub fn (e Entry) set_overwrite_mode(setting bool) { @@ -201,12 +205,14 @@ pub fn (e Entry) set_icon_from_icon_name(icon_pos EntryIconPosition, icon_name s // TODO: void C.gtk_entry_set_icon_from_gicon (GtkEntry *entry, GtkEntryIconPosition icon_pos, GIcon *icon) pub fn (e Entry) get_icon_storage_type(icon_pos EntryIconPosition) ImageType { - return ImageType(C.gtk_entry_get_icon_storage_type(e.c, icon_pos)) + return C.gtk_entry_get_icon_storage_type(e.c, icon_pos) } // TODO: GdkPixbuf * C.gtk_entry_get_icon_pixbuf (GtkEntry *entry, GtkEntryIconPosition icon_pos) pub fn (e Entry) get_icon_name(icon_pos EntryIconPosition) string { - return tos3(C.gtk_entry_get_icon_name(e.c, icon_pos)) + unsafe { + return tos3(C.gtk_entry_get_icon_name(e.c, icon_pos)) + } } // TODO: GIcon * C.gtk_entry_get_icon_gicon (GtkEntry *entry, GtkEntryIconPosition icon_pos) @@ -239,7 +245,9 @@ pub fn (e Entry) set_icon_tooltip_text(icon_pos EntryIconPosition, tooltip strin pub fn (e Entry) get_icon_tooltip_text(icon_pos EntryIconPosition) string { res := C.gtk_entry_get_icon_tooltip_text(e.c, icon_pos) - return tos3(res) + unsafe { + return tos3(res) + } } pub fn (e Entry) set_icon_tooltip_markup(icon_pos EntryIconPosition, tooltip string) { @@ -251,7 +259,9 @@ pub fn (e Entry) set_icon_tooltip_markup(icon_pos EntryIconPosition, tooltip str pub fn (e Entry) get_icon_tooltip_markup(icon_pos EntryIconPosition) string { res := C.gtk_entry_get_icon_tooltip_markup(e.c, icon_pos) - return tos3(res) + unsafe { + return tos3(res) + } } // TODO: void C.gtk_entry_set_icon_drag_source (GtkEntry *entry, GtkEntryIconPosition icon_pos, GtkTargetList *target_list, GdkDragAction actions) @@ -265,7 +275,7 @@ pub fn (e Entry) set_input_purpose(purpose InputPurpose) { } pub fn (e Entry) get_input_purpose() InputPurpose { - return InputPurpose(C.gtk_entry_get_input_purpose(e.c)) + return C.gtk_entry_get_input_purpose(e.c) } pub fn (e Entry) set_input_hints(hints InputHints) { @@ -273,7 +283,7 @@ pub fn (e Entry) set_input_hints(hints InputHints) { } pub fn (e Entry) get_input_hints() InputHints { - return InputHints(C.gtk_entry_get_input_hints(e.c)) + return C.gtk_entry_get_input_hints(e.c) } pub fn (e Entry) grab_focus_without_selecting() { diff --git a/gtk/grid.v b/gtk/grid.v index c396678..0b6f59b 100644 --- a/gtk/grid.v +++ b/gtk/grid.v @@ -85,32 +85,32 @@ pub fn (g Grid) set_baseline_row(row int) { } pub fn (g Grid) get_row_baseline_position(row int) BaselinePosition { - return BaselinePosition(C.gtk_grid_get_row_baseline_position(g.c, row)) + return C.gtk_grid_get_row_baseline_position(g.c, row) } pub fn (g Grid) set_row_baseline_position(row int, pos BaselinePosition) { C.gtk_grid_set_row_baseline_position(g.c, row, pos) } -// INHERITED FROM CONTAINER +// // INHERITED FROM CONTAINER pub fn (g Grid) add(widget IWidget) { wgt := widget.get_gtk_widget() C.gtk_container_add(g.c, wgt) } -pub fn (g Grid) remove(widget IWidget) { - wgt := widget.get_gtk_widget() - C.gtk_container_remove(g.c, wgt) -} +// pub fn (g Grid) remove(widget IWidget) { +// wgt := widget.get_gtk_widget() +// C.gtk_container_remove(g.c, wgt) +// } -// IMPLEMENTING GtkOrientable -pub fn (g Grid) set_orientation(orientation Orientation) { - C.gtk_orientable_set_orientation(g.c, orientation) -} +// // IMPLEMENTING GtkOrientable +// pub fn (g Grid) set_orientation(orientation Orientation) { +// C.gtk_orientable_set_orientation(g.c, orientation) +// } -pub fn (g Grid) get_orientation() Orientation { - return Orientation(C.gtk_orientable_get_orientation(g.c)) -} +// pub fn (g Grid) get_orientation() Orientation { +// return Orientation(C.gtk_orientable_get_orientation(g.c)) +// } // IMPLEMENTING IWidget pub fn (g &Grid) get_gtk_widget() &C.GtkWidget { diff --git a/gtk/label.v b/gtk/label.v index 37a4e07..6a69bd0 100644 --- a/gtk/label.v +++ b/gtk/label.v @@ -30,7 +30,7 @@ pub fn (l Label) set_pattern(pattern string) { } pub fn (l Label) set_justify(jtype Justification) { - C.gtk_label_set_justify(l.c, jtype) + C.gtk_label_set_justify(l.c, int(jtype)) } pub fn (l Label) set_xalign(xalign f32) { @@ -81,7 +81,9 @@ pub fn (l Label) get_selectable() bool { } pub fn (l Label) get_text() string { - return tos3(C.gtk_label_get_text(l.c)) + unsafe { + return tos3(C.gtk_label_get_text(l.c)) + } } pub fn new_label_with_mnemonic(label string) Label { @@ -106,7 +108,7 @@ pub fn (l Label) set_text_with_mnemonic(str string) { } pub fn (l Label) get_justify() Justification { - return Justification(C.gtk_label_get_justify(l.c)) + return C.gtk_label_get_justify(l.c) } pub fn (l Label) get_xalign() f32 { @@ -127,7 +129,9 @@ pub fn (l Label) get_max_width_chars() int { } pub fn (l Label) get_label() string { - return tos3(C.gtk_label_get_label(l.c)) + unsafe { + return tos3(C.gtk_label_get_label(l.c)) + } } // TODO: PangoLayout * C.gtk_label_get_layout (GtkLabel *label) @@ -188,7 +192,9 @@ pub fn (l Label) set_angle(angle f64) { } pub fn (l Label) get_current_uri() string { - return tos3(C.gtk_label_get_current_uri(l.c)) + unsafe { + return tos3(C.gtk_label_get_current_uri(l.c)) + } } pub fn (l Label) set_track_visited_links(setting bool) { diff --git a/gtk/menu.v b/gtk/menu.v index 6c40cb8..deaf81e 100644 --- a/gtk/menu.v +++ b/gtk/menu.v @@ -65,7 +65,9 @@ pub fn (mi MenuItem) set_label(label string) { } pub fn (mi MenuItem) get_label() string { - return tos3(C.gtk_menu_item_get_label(mi.c)) + unsafe { + return tos3(C.gtk_menu_item_get_label(mi.c)) + } } pub fn (mi MenuItem) get_use_underline() bool { @@ -81,7 +83,9 @@ pub fn (mi MenuItem) set_accel_path(label string) { } pub fn (mi MenuItem) get_accel_path() string { - return tos3(C.gtk_menu_item_get_accel_path(mi.c)) + unsafe { + return tos3(C.gtk_menu_item_get_accel_path(mi.c)) + } } pub fn (mi &MenuItem) get_gtk_widget() &C.GtkWidget { diff --git a/gtk/message_dialog.v b/gtk/message_dialog.v index cb369ad..86aa9bd 100644 --- a/gtk/message_dialog.v +++ b/gtk/message_dialog.v @@ -49,7 +49,7 @@ pub fn (m MessageDialog) get_message_area() Widget { // Inherited from Dialog pub fn (m MessageDialog) run() ResponseType { - return ResponseType(C.gtk_dialog_run(m.c)) + return C.gtk_dialog_run(m.c) } pub fn (m MessageDialog) response(response_id ResponseType) { @@ -102,6 +102,7 @@ pub fn (m MessageDialog) get_header_bar() &Widget { // Inherited from Window // TODO + // Inherited from Widget pub fn (m MessageDialog) destroy() { C.gtk_widget_destroy(m.c) diff --git a/gtk/radio_button.v b/gtk/radio_button.v index b5fb6f2..6e9d663 100644 --- a/gtk/radio_button.v +++ b/gtk/radio_button.v @@ -1,45 +1,45 @@ module gtk -import glib +// import glib -pub struct RadioButton { - c &C.GtkWidget -} +// pub struct RadioButton { +// c &C.GtkWidget +// } -pub fn new_radio_button(group glib.SList) RadioButton { - return RadioButton{C.gtk_radio_button_new(group.get_cptr())} -} +// pub fn new_radio_button(group glib.SList) RadioButton { +// return RadioButton{C.gtk_radio_button_new(group.get_cptr())} +// } -pub fn new_radio_button_from_widget(radio_group_member RadioButton) RadioButton { - return RadioButton{C.gtk_radio_button_new_from_widget(radio_group_member.c)} -} +// pub fn new_radio_button_from_widget(radio_group_member RadioButton) RadioButton { +// return RadioButton{C.gtk_radio_button_new_from_widget(radio_group_member.c)} +// } -pub fn new_radio_button_with_label(group glib.SList, label string) RadioButton { - return RadioButton{C.gtk_radio_button_new_with_label(group.get_cptr(), label.str)} -} +// pub fn new_radio_button_with_label(group glib.SList, label string) RadioButton { +// return RadioButton{C.gtk_radio_button_new_with_label(group.get_cptr(), label.str)} +// } -pub fn new_radio_button_with_label_from_widget(radio_group_member RadioButton, label string) RadioButton { - return RadioButton{C.gtk_radio_button_new_with_label_from_widget(radio_group_member.c, - label.str)} -} +// pub fn new_radio_button_with_label_from_widget(radio_group_member RadioButton, label string) RadioButton { +// return RadioButton{C.gtk_radio_button_new_with_label_from_widget(radio_group_member.c, +// label.str)} +// } -pub fn new_radio_button_with_mnemonic(group glib.SList, label string) RadioButton { - return RadioButton{C.gtk_radio_button_new_with_mnemonic(group.get_cptr(), label.str)} -} +// pub fn new_radio_button_with_mnemonic(group glib.SList, label string) RadioButton { +// return RadioButton{C.gtk_radio_button_new_with_mnemonic(group.get_cptr(), label.str)} +// } -pub fn new_radio_button_with_mnemonic_from_widget(radio_group_member RadioButton, label string) RadioButton { - return RadioButton{C.gtk_radio_button_new_with_mnemonic_from_widget(radio_group_member.c, - label.str)} -} +// pub fn new_radio_button_with_mnemonic_from_widget(radio_group_member RadioButton, label string) RadioButton { +// return RadioButton{C.gtk_radio_button_new_with_mnemonic_from_widget(radio_group_member.c, +// label.str)} +// } -pub fn (r RadioButton) set_group(group glib.SList) { - C.gtk_radio_button_set_group(r.c, group.get_cptr()) -} +// pub fn (r RadioButton) set_group(group glib.SList) { +// C.gtk_radio_button_set_group(r.c, group.get_cptr()) +// } -pub fn (r RadioButton) get_group() glib.SList { - return glib.SList{C.gtk_radio_button_get_group(r.c)} -} +// pub fn (r RadioButton) get_group() glib.SList { +// return glib.SList{C.gtk_radio_button_get_group(r.c)} +// } -pub fn (r RadioButton) join_group(group_source RadioButton) { - C.gtk_radio_button_join_group(r.c, group_source.c) -} +// pub fn (r RadioButton) join_group(group_source RadioButton) { +// C.gtk_radio_button_join_group(r.c, group_source.c) +// } diff --git a/gtk/requisition.v b/gtk/requisition.v index 5dbf2d9..c4723fa 100644 --- a/gtk/requisition.v +++ b/gtk/requisition.v @@ -13,6 +13,6 @@ pub fn (r Requisition) copy() Requisition { } [unsafe] -pub fn (r Requisition) free() { +pub fn (mut r Requisition) free() { C.gtk_requisition_free(r.c) } diff --git a/gtk/text_view.v b/gtk/text_view.v index 3dc7459..ce6687b 100644 --- a/gtk/text_view.v +++ b/gtk/text_view.v @@ -27,7 +27,9 @@ pub fn (tv TextView) get_text() string { C.gtk_text_buffer_get_bounds(b, &start, &end) text := C.gtk_text_buffer_get_text(b, &start, &end, false) if text != 0 { - return tos2(text) + unsafe { + return tos2(text) + } } return '' } diff --git a/gtk/utils.v b/gtk/utils.v index ef641c7..0d3e462 100644 --- a/gtk/utils.v +++ b/gtk/utils.v @@ -11,7 +11,7 @@ fn carray_string_to_array_string(arr &charptr) []string { if elem == 0 { break } - arr_str << tos_clone(elem) + unsafe { arr_str << tos_clone(elem) } i++ } unsafe { free(arr) } diff --git a/gtk/widget.v b/gtk/widget.v index 43b6e6c..8b7cce6 100644 --- a/gtk/widget.v +++ b/gtk/widget.v @@ -1,7 +1,7 @@ module gtk -import gdk -import gio +// import gdk +// import gio pub struct Widget { c &C.GtkWidget @@ -175,7 +175,7 @@ pub fn (w Widget) set_direction(direction TextDirection) { } pub fn (w Widget) get_direction() TextDirection { - return TextDirection(C.gtk_widget_get_direction(w.c)) + return C.gtk_widget_get_direction(w.c) } pub fn (w Widget) set_default_direction(direction TextDirection) { @@ -183,7 +183,7 @@ pub fn (w Widget) set_default_direction(direction TextDirection) { } pub fn (w Widget) get_default_direction() TextDirection { - return TextDirection(C.gtk_widget_get_default_direction()) + return C.gtk_widget_get_default_direction() } // TODO: void C.gtk_widget_shape_combine_region (GtkWidget *widget, cairo_region_t *region) @@ -220,7 +220,7 @@ pub fn (w Widget) mnemonic_activate(group_cycling bool) bool { // TODO: void C.gtk_widget_style_get (GtkWidget *widget, const gchar *first_property_name, ...) pub fn (w Widget) style_get_property(property_name string) voidptr { // TODO: ret is GValue, fix this after Gobject is implemented - ret := voidptr(0) + ret := unsafe { nil } C.gtk_widget_style_get_property(w.c, property_name.str, &ret) return ret } @@ -305,7 +305,9 @@ pub fn (w Widget) keynav_failed(direction DirectionType) bool { } pub fn (w Widget) get_tooltip_markup() string { - return tos3(C.gtk_widget_get_tooltip_markup(w.c)) + unsafe { + return tos3(C.gtk_widget_get_tooltip_markup(w.c)) + } } pub fn (w Widget) set_tooltip_markup(markup string) { @@ -313,7 +315,9 @@ pub fn (w Widget) set_tooltip_markup(markup string) { } pub fn (w Widget) get_tooltip_text() string { - return tos3(C.gtk_widget_get_tooltip_text(w.c)) + unsafe { + return tos3(C.gtk_widget_get_tooltip_text(w.c)) + } } pub fn (w Widget) set_tooltip_text(tooltip string) { @@ -342,20 +346,20 @@ pub fn (w Widget) trigger_tooltip_query() { C.gtk_widget_trigger_tooltip_query(w.c) } -pub fn (w Widget) get_window() gdk.Window { - window := C.gtk_widget_get_window(w.c) - return gdk.Window{window} -} +// pub fn (w Widget) get_window() gdk.Window { +// window := C.gtk_widget_get_window(w.c) +// return gdk.Window{window} +// } -pub fn (w Widget) register_window(window gdk.Window) { - window_ := window.get_cptr() - C.gtk_widget_register_window(w.c, window_) -} +// pub fn (w Widget) register_window(window gdk.Window) { +// window_ := window.get_cptr() +// C.gtk_widget_register_window(w.c, window_) +// } -pub fn (w Widget) unregister_window(window gdk.Window) { - window_ := window.get_cptr() - C.gtk_widget_unregister_window(w.c, window_) -} +// pub fn (w Widget) unregister_window(window gdk.Window) { +// window_ := window.get_cptr() +// C.gtk_widget_unregister_window(w.c, window_) +// } // TODO: gboolean C.gtk_cairo_should_draw_window (cairo_t *cr, GdkWindow *window) // TODO: void C.gtk_cairo_transform_to_window (cairo_t *cr, GtkWidget *widget, GdkWindow *window) @@ -369,7 +373,7 @@ pub fn (w Widget) get_allocated_height() int { pub fn (w Widget) get_allocation() Allocation { allocation := &C.GtkAllocation(0) - C.gtk_widget_get_allocation(w.c, &allocation) + C.gtk_widget_get_allocation(w.c, allocation) return Allocation{allocation} } @@ -385,13 +389,13 @@ pub fn (w Widget) get_allocated_baseline() int { pub fn (w Widget) get_allocated_size() (Allocation, int) { allocation := &C.GtkAllocation(0) baseline := 0 - C.gtk_widget_get_allocated_size(w.c, &allocation, &baseline) + C.gtk_widget_get_allocated_size(w.c, allocation, &baseline) return Allocation{allocation}, baseline } pub fn (w Widget) get_clip() Allocation { allocation := &C.GtkAllocation(0) - C.gtk_widget_get_clip(w.c, &allocation) + C.gtk_widget_get_clip(w.c, allocation) return Allocation{allocation} } @@ -488,10 +492,10 @@ pub fn (w Widget) is_toplevel() bool { return C.gtk_widget_is_toplevel(w.c) } -pub fn (w Widget) set_window(window gdk.Window) { - window_ := window.get_cptr() - C.gtk_widget_set_window(w.c, window_) -} +// pub fn (w Widget) set_window(window gdk.Window) { +// window_ := window.get_cptr() +// C.gtk_widget_set_window(w.c, window_) +// } pub fn (w Widget) set_receives_default(receives_default bool) { C.gtk_widget_set_receives_default(w.c, receives_default) @@ -525,19 +529,19 @@ pub fn (w Widget) get_mapped() bool { return C.gtk_widget_get_mapped(w.c) } -pub fn (w Widget) device_is_shadowed(device gdk.Device) bool { - device_ := device.get_cptr() - return C.gtk_widget_device_is_shadowed(w.c, device_) -} +// pub fn (w Widget) device_is_shadowed(device gdk.Device) bool { +// device_ := device.get_cptr() +// return C.gtk_widget_device_is_shadowed(w.c, device_) +// } -pub fn (w Widget) get_modifier_mask(intent gdk.ModifierIntent) gdk.ModifierType { - return gdk.ModifierType(C.gtk_widget_get_modifier_mask(w.c, intent)) -} +// pub fn (w Widget) get_modifier_mask(intent gdk.ModifierIntent) gdk.ModifierType { +// return gdk.ModifierType(C.gtk_widget_get_modifier_mask(w.c, intent)) +// } -pub fn (w Widget) insert_action_group(name string, group gio.ActionGroup) { - group_ := group.get_cptr() - C.gtk_widget_insert_action_group(w.c, name.str, group_) -} +// pub fn (w Widget) insert_action_group(name string, group gio.ActionGroup) { +// group_ := group.get_cptr() +// C.gtk_widget_insert_action_group(w.c, name.str, group_) +// } pub fn (w Widget) get_opacity() f32 { return f32(C.gtk_widget_get_opacity(w.c)) @@ -553,10 +557,10 @@ pub fn (w Widget) list_action_prefixes() []string { return v_arr_str } -pub fn (w Widget) get_action_group(prefix string) gio.ActionGroup { - cptr := C.gtk_widget_get_action_group(w.c, prefix.str) - return gio.ActionGroup{cptr} -} +// pub fn (w Widget) get_action_group(prefix string) gio.ActionGroup { +// cptr := C.gtk_widget_get_action_group(w.c, prefix.str) +// return gio.ActionGroup{cptr} +// } pub fn (w Widget) get_path() WidgetPath { cptr := C.gtk_widget_get_path(w.c) @@ -604,18 +608,18 @@ pub fn (w Widget) get_preferred_height_and_baseline_for_width(width int) (int, i } pub fn (w Widget) get_request_mode() SizeRequestMode { - return SizeRequestMode(C.gtk_widget_get_request_mode(w.c)) + return C.gtk_widget_get_request_mode(w.c) } pub fn (w Widget) get_preferred_size() (Requisition, Requisition) { minimum_size := &C.GtkRequisition(0) natural_size := &C.GtkRequisition(0) - C.gtk_widget_get_preferred_size(w.c, &minimum_size, &natural_size) + C.gtk_widget_get_preferred_size(w.c, minimum_size, natural_size) return Requisition{minimum_size}, Requisition{natural_size} } pub fn (w Widget) get_halign() Align { - return Align(C.gtk_widget_get_halign(w.c)) + return C.gtk_widget_get_halign(w.c) } pub fn (w Widget) set_halign(align Align) { @@ -623,11 +627,11 @@ pub fn (w Widget) set_halign(align Align) { } pub fn (w Widget) get_valign() Align { - return Align(C.gtk_widget_get_valign(w.c)) + return C.gtk_widget_get_valign(w.c) } pub fn (w Widget) get_valign_with_baseline() Align { - return Align(C.gtk_widget_get_valign_with_baseline(w.c)) + return C.gtk_widget_get_valign_with_baseline(w.c) } pub fn (w Widget) set_valign(align Align) { @@ -710,6 +714,10 @@ pub fn (w Widget) init_template() { C.gtk_widget_init_template(w.c) } +pub fn (mut w Widget) get_gtk_widget() &C.GtkWidget { + return w.c +} + // TODO: GObject * C.gtk_widget_get_template_child (GtkWidget *widget, GType widget_type, const gchar *name) // Functions fn distribute_natural_allocation(extra_space int, n_requested_sizes u32, sizes RequestedSize) int { diff --git a/gtk/window.v b/gtk/window.v index e2e94f9..ff90ab1 100644 --- a/gtk/window.v +++ b/gtk/window.v @@ -20,7 +20,7 @@ pub struct Window { } pub fn new_window() Window { - return Window{C.gtk_window_new(C.GTK_WINDOW_TOPLEVEL)} + return Window{C.gtk_window_new(.toplevel)} } pub fn new_window_type(type_ WindowType) Window { @@ -67,12 +67,12 @@ pub fn (w Window) set_gravity(gravity gdk.Gravity) { C.gtk_window_set_gravity(w.c, gravity) } -pub fn (w Window) get_gravity() gdk.Gravity { - return C.gtk_window_get_gravity(w.c) -} +// pub fn (w Window) get_gravity() gdk.Gravity { +// return C.gtk_window_get_gravity(w.c) +// } pub fn (w Window) set_position(position WindowPosition) { - C.gtk_window_set_position(w.c, position) + C.gtk_window_set_position(w.c, int(position)) } pub fn (w Window) set_transient_for(parrent Window) { @@ -100,11 +100,13 @@ pub fn (w Window) get_default_size() (int, int) { } pub fn (w Window) center() { - C.gtk_window_set_position(w.c, WindowPosition.center) + C.gtk_window_set_position(w.c, int(WindowPosition.center)) } pub fn (w Window) get_title() string { - return tos3(C.gtk_window_get_title(w.c)) + unsafe { + return tos3(C.gtk_window_get_title(w.c)) + } } // GdkWindowTypeHint C.gtk_window_get_type_hint (GtkWindow *window) @@ -134,7 +136,7 @@ pub fn (w Window) has_group() bool { } pub fn (w Window) get_window_type() WindowType { - return WindowType(C.gtk_window_get_window_type(w.c)) + return C.gtk_window_get_window_type(w.c) } pub fn (w Window) move(x int, y int) { @@ -278,7 +280,6 @@ pub fn (w &Window) on(event_name string, handler fn (Window, voidptr), data void pub fn (w &Window) to_container() &Container { unsafe { - cptr := &C.GtkContainer(w.c) - return &Container{cptr} + return &Container{w.c} } } diff --git a/tests/importing_gdb_glib_and_gtk_works_test.v b/tests/importing_gdb_glib_and_gtk_works_test.v index f0803e1..27139b1 100644 --- a/tests/importing_gdb_glib_and_gtk_works_test.v +++ b/tests/importing_gdb_glib_and_gtk_works_test.v @@ -1,6 +1,8 @@ import gdk +import gio import glib import gtk +// import pango fn test_all() { assert true From c5b86553186c98ca4e3604214add349bdaf8e297 Mon Sep 17 00:00:00 2001 From: Don Alfons Nisnoni Date: Mon, 7 Nov 2022 22:50:42 +0800 Subject: [PATCH 2/3] Add clean command to makefile Signed-off-by: Don Alfons Nisnoni --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 41ef9c7..b12b5a3 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ all: fmt test examples fmt: $(V) run ./fmt.vsh +clean: + git clean -xf -- examples + test: $(V) test . @@ -20,4 +23,3 @@ examples: $(V) ./examples/entry.v $(V) ./examples/grid.v $(V) ./examples/label.v - From 6e3dbd48e2eed0641892086719c74bdfe77f3a3c Mon Sep 17 00:00:00 2001 From: Don Alfons Nisnoni Date: Mon, 7 Nov 2022 22:59:05 +0800 Subject: [PATCH 3/3] Don't need to cast to `License` Signed-off-by: Don Alfons Nisnoni --- gtk/about_dialog.v | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gtk/about_dialog.v b/gtk/about_dialog.v index 4b5800a..1353b63 100644 --- a/gtk/about_dialog.v +++ b/gtk/about_dialog.v @@ -90,9 +90,7 @@ pub fn (a AboutDialog) set_wrap_license(wrap_license bool) { } pub fn (a AboutDialog) get_license_type() License { - unsafe { - return License(C.gtk_about_dialog_get_license_type(a.c)) - } + return C.gtk_about_dialog_get_license_type(a.c) } pub fn (a AboutDialog) set_license_type(license_type License) {