From f0e708098f56fe904ed8db9c5b771fbf61b9b56f Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Mon, 30 Dec 2024 17:13:48 -0500 Subject: [PATCH] update auto-generated code for GLib and gdkpixbuf --- gen/gen_gio.jl | 9 +- gen/gen_glib.jl | 2 +- src/gen/cairo_structs | 75 ++++++++- src/gen/gdkpixbuf_consts | 4 +- src/gen/gdkpixbuf_methods | 6 +- src/gen/gio_methods | 344 +++++++++++++++++++++++++++++++++----- src/gen/glib_consts | 15 +- src/gen/glib_functions | 17 +- src/gen/glib_methods | 13 +- 9 files changed, 411 insertions(+), 74 deletions(-) diff --git a/gen/gen_gio.jl b/gen/gen_gio.jl index 5026d0c4..8596adfc 100644 --- a/gen/gen_gio.jl +++ b/gen/gen_gio.jl @@ -29,21 +29,22 @@ struct_skiplist = GI.export_struct_exprs!(ns,path, "gio", struct_skiplist, impor object_method_skiplist=[:new_for_bus,:export,:add_option_group,:make_pollfd,:get_info, :new_for_bus_sync,:new_sync,:writev,:writev_all,:flatten_tree,:changed_tree,:receive_messages,:send_message,:send_message_with_timeout,:send_messages, -:get_channel_binding_data,:lookup_certificates_issued_by,:get_default,:get_unix_fd_list,:set_unix_fd_list,:get_attribute_file_path,:set_attribute_file_path] +:get_channel_binding_data,:lookup_certificates_issued_by,:get_default,:get_unix_fd_list,:set_unix_fd_list,:get_attribute_file_path,:set_attribute_file_path,:bind_with_mapping] object_skiplist=vcat(obj_skiplist,[:AppInfoMonitor,:DBusConnection,:DBusMenuModel,:DBusProxy,:DBusMethodInvocation,:IOModule,:SimpleProxyResolver,:UnixMountMonitor]) interface_method_skiplist=[:add_action_entries,:get_info,:receive_messages,:send_messages, -:writev_nonblocking,:dup_default,:remove_action_entries,:new_build_filenamev] +:writev_nonblocking,:dup_default,:remove_action_entries,:new_build_filenamev,:copy_async,:move_async] # skips are to avoid method name collisions -interface_skiplist=[:App,:AppInfo,:DBusObjectManager,:Drive,:Icon,:Mount,:NetworkMonitor,:PollableOutputStream,:ProxyResolver,:SocketConnectable,:TlsBackend,:TlsClientConnection,:Volume,:DtlsServerConnection] +interface_skiplist=[:App,:DBusObjectManager,:Drive,:Icon,:Mount,:NetworkMonitor,:PollableOutputStream,:ProxyResolver,:SocketConnectable,:TlsBackend,:TlsClientConnection,:Volume,:DtlsServerConnection] GI.export_methods!(ns,path,"gio"; interface_method_skiplist = interface_method_skiplist, interface_skiplist = interface_skiplist, object_method_skiplist = object_method_skiplist, object_skiplist = object_skiplist, struct_skiplist = struct_skiplist) skiplist=[:bus_own_name_on_connection,:bus_own_name,:bus_watch_name_on_connection,:bus_watch_name,:dbus_annotation_info_lookup,:dbus_error_encode_gerror,:dbus_error_get_remote_error,:dbus_error_is_remote_error,:dbus_error_new_for_dbus_error, :dbus_error_strip_remote_error,:dbus_error_register_error_domain,:io_modules_load_all_in_directory_with_scope,:io_modules_scan_all_in_directory_with_scope,:dbus_gvariant_to_gvalue,:unix_mount_at,:unix_mount_copy,:unix_mount_compare,:unix_mount_for,:unix_mount_free, :unix_mount_get_device_path,:unix_mount_get_fs_type,:unix_mount_get_mount_path,:unix_mount_get_options,:unix_mount_get_root_path,:unix_mount_guess_can_eject,:unix_mount_guess_icon,:unix_mount_guess_name,:unix_mount_guess_should_display,:unix_mount_guess_symbolic_icon, -:unix_mount_is_readonly,:unix_mount_is_system_internal,:unix_mount_point_at,:unix_mount_points_changed_since,:unix_mount_points_get,:unix_mounts_get,:file_new_build_filenamev,:io_extension_point_implement,:io_extension_point_lookup,:io_extension_point_register] +:unix_mount_is_readonly,:unix_mount_is_system_internal,:unix_mount_point_at,:unix_mount_points_changed_since,:unix_mount_points_get,:unix_mounts_get,:file_new_build_filenamev,:io_extension_point_implement,:io_extension_point_lookup,:io_extension_point_register, +:unix_mount_points_get_from_file,:unix_mounts_get_from_file] GI.export_functions!(ns,path,"gio"; skiplist = skiplist) diff --git a/gen/gen_glib.jl b/gen/gen_glib.jl index e9688130..3348a055 100644 --- a/gen/gen_glib.jl +++ b/gen/gen_glib.jl @@ -105,7 +105,7 @@ skiplist=[:convert,:atomic_rc_box_release_full,:child_watch_add,:datalist_foreac :pattern_match_string,:log_structured_array,:log_writer_default,:log_writer_format_fields, :log_writer_journald,:log_writer_standard_streams,:parse_debug_string,:lstat,:stat, :child_watch_source_new,:date_strftime,:idle_source_new,:main_current_source, - :timeout_source_new,:timeout_source_new_seconds,:unix_fd_source_new, + :timeout_source_new,:timeout_source_new_seconds,:unix_fd_source_new,:async_queue_new, :unix_signal_source_new,:datalist_id_remove_multiple,:base64_encode_close, :base64_encode_step,:sequence_insert_before,:sequence_range_get_midpoint, :list_push_allocator,:node_push_allocator,:slist_push_allocator,:sequence_foreach_range,:sequence_sort_changed,:sequence_sort_changed_iter] diff --git a/src/gen/cairo_structs b/src/gen/cairo_structs index 6fbe6070..0ea0e5cb 100644 --- a/src/gen/cairo_structs +++ b/src/gen/cairo_structs @@ -257,9 +257,82 @@ $(Expr(:toplevel, quote end end end + begin + struct _cairoGlyph + index::UInt64 + x::Float64 + y::Float64 + end + mutable struct cairoGlyph <: GBoxed + handle::Ptr{_cairoGlyph} + begin + (GLib.g_type(::Type{T}) where T <: cairoGlyph) = begin + ccall(("cairo_gobject_glyph_get_type", libcairo_gobject), GType, ()) + end + function cairoGlyph(ref::Ptr{T}, own::Bool = false) where T <: Union{GBoxed, _cairoGlyph} + x = new(ref) + if own + finalizer(x) do x + GLib.delboxed(x) + end + end + x + end + push!(gboxed_types, cairoGlyph) + end + end + begin + unsafe_convert(::Type{Ptr{_cairoGlyph}}, box::cairoGlyph) = begin + convert(Ptr{_cairoGlyph}, box.handle) + end + convert(::Type{cairoGlyph}, p::Ptr{_cairoGlyph}, owns = false) = begin + cairoGlyph(p, owns) + end + const cairoGlyphLike = Union{Ref{_cairoGlyph}, cairoGlyph} + convert(::Type{cairoGlyphLike}, p, owns) = begin + convert(cairoGlyph, p, owns) + end + end + end + begin + struct _cairoTextCluster + num_bytes::Int32 + num_glyphs::Int32 + end + mutable struct cairoTextCluster <: GBoxed + handle::Ptr{_cairoTextCluster} + begin + (GLib.g_type(::Type{T}) where T <: cairoTextCluster) = begin + ccall(("cairo_gobject_text_cluster_get_type", libcairo_gobject), GType, ()) + end + function cairoTextCluster(ref::Ptr{T}, own::Bool = false) where T <: Union{GBoxed, _cairoTextCluster} + x = new(ref) + if own + finalizer(x) do x + GLib.delboxed(x) + end + end + x + end + push!(gboxed_types, cairoTextCluster) + end + end + begin + unsafe_convert(::Type{Ptr{_cairoTextCluster}}, box::cairoTextCluster) = begin + convert(Ptr{_cairoTextCluster}, box.handle) + end + convert(::Type{cairoTextCluster}, p::Ptr{_cairoTextCluster}, owns = false) = begin + cairoTextCluster(p, owns) + end + const cairoTextClusterLike = Union{Ref{_cairoTextCluster}, cairoTextCluster} + convert(::Type{cairoTextClusterLike}, p, owns) = begin + convert(cairoTextCluster, p, owns) + end + end + end gboxed_cache_init() = begin append!(GLib.gboxed_types, gboxed_types) end - export cairoContext, cairoDevice, cairoSurface, cairoMatrix, cairoPattern, cairoRegion, cairoFontOptions, cairoFontFace, cairoScaledFont, cairoPath, cairoRectangle, cairoRectangleLike, _cairoRectangle, cairoRectangleInt, cairoRectangleIntLike, _cairoRectangleInt + export cairoContext, cairoDevice, cairoSurface, cairoMatrix, cairoPattern, cairoRegion, cairoFontOptions, cairoFontFace, cairoScaledFont, cairoPath, cairoRectangle, cairoRectangleLike, _cairoRectangle, cairoRectangleInt, cairoRectangleIntLike, _cairoRectangleInt, cairoGlyph, cairoGlyphLike, _cairoGlyph, cairoTextCluster, cairoTextClusterLike, _cairoTextCluster end)) end diff --git a/src/gen/gdkpixbuf_consts b/src/gen/gdkpixbuf_consts index 702a785a..4de17c65 100644 --- a/src/gen/gdkpixbuf_consts +++ b/src/gen/gdkpixbuf_consts @@ -2,9 +2,9 @@ quote $(Expr(:toplevel, quote begin const PIXBUF_MAJOR = 2 - const PIXBUF_MICRO = 10 + const PIXBUF_MICRO = 12 const PIXBUF_MINOR = 42 - const PIXBUF_VERSION = "2.42.10" + const PIXBUF_VERSION = "2.42.12" begin @cenum Colorspace::Int32 Colorspace_RGB = 0 (GLib.g_type(::Type{T}) where T <: Colorspace) = begin diff --git a/src/gen/gdkpixbuf_methods b/src/gen/gdkpixbuf_methods index f708acab..930b2dac 100644 --- a/src/gen/gdkpixbuf_methods +++ b/src/gen/gdkpixbuf_methods @@ -2,7 +2,7 @@ quote $(Expr(:toplevel, quote function copy(instance::GdkPixbufFormatLike) ret = ccall(("gdk_pixbuf_format_copy", libgdkpixbuf), Ptr{_GdkPixbufFormat}, (Ptr{_GdkPixbufFormat},), instance) - ret2 = convert(GdkPixbufFormatLike, ret, true) + ret2 = convert_if_not_null(GdkPixbufFormat, ret, true) ret2 end function free(instance::GdkPixbufFormatLike) @@ -151,7 +151,7 @@ $(Expr(:toplevel, quote end function Pixbuf_new_from_xpm_data(_data) ret = ccall(("gdk_pixbuf_new_from_xpm_data", libgdkpixbuf), Ptr{GObject}, (Ptr{Cstring},), _data) - ret2 = GdkPixbufLeaf(ret, true) + ret2 = convert_if_not_null(GdkPixbuf, ret, true) ret2 end function calculate_rowstride(_colorspace, _has_alpha::Bool, _bits_per_sample::Integer, _width::Integer, _height::Integer) @@ -212,7 +212,7 @@ $(Expr(:toplevel, quote end function add_alpha(instance::GdkPixbuf, _substitute_color::Bool, _r::Integer, _g::Integer, _b::Integer) ret = ccall(("gdk_pixbuf_add_alpha", libgdkpixbuf), Ptr{GObject}, (Ptr{GObject}, Cint, UInt8, UInt8, UInt8), instance, _substitute_color, _r, _g, _b) - ret2 = convert(GdkPixbuf, ret, true) + ret2 = convert_if_not_null(GdkPixbuf, ret, true) ret2 end function apply_embedded_orientation(instance::GdkPixbuf) diff --git a/src/gen/gio_methods b/src/gen/gio_methods index 3411e4fa..ab60ab8b 100644 --- a/src/gen/gio_methods +++ b/src/gen/gio_methods @@ -320,8 +320,10 @@ $(Expr(:toplevel, quote end ret2 end - function get_startup_notify_id(instance::GAppLaunchContext, _info::GAppInfo, _files::GLib.LList{GLib._GList{Ptr{GObject}}}) - ret = ccall(("g_app_launch_context_get_startup_notify_id", libgio), Cstring, (Ptr{GObject}, Ptr{GObject}, Ptr{GLib._GList{Ptr{GObject}}}), instance, _info, _files) + function get_startup_notify_id(instance::GAppLaunchContext, _info::Maybe(GAppInfo), _files::Maybe(GLib.LList{GLib._GList{Ptr{GObject}}})) + _info_maybe = nothing_to_null(_info) + _files_maybe = nothing_to_null(_files) + ret = ccall(("g_app_launch_context_get_startup_notify_id", libgio), Cstring, (Ptr{GObject}, Ptr{GObject}, Ptr{GLib._GList{Ptr{GObject}}}), instance, _info_maybe, _files_maybe) ret2 = string_or_nothing(ret, true) ret2 end @@ -877,6 +879,9 @@ $(Expr(:toplevel, quote function convert(instance::GCharsetConverter, _inbuf, _outbuf, _flags) convert(GConverter(instance), _inbuf, _outbuf, _flags) end + function convert_bytes(instance::GCharsetConverter, _bytes::GBytes) + convert_bytes(GConverter(instance), _bytes) + end function reset(instance::GCharsetConverter) reset(GConverter(instance)) end @@ -6608,6 +6613,9 @@ $(Expr(:toplevel, quote function convert(instance::GZlibCompressor, _inbuf, _outbuf, _flags) convert(GConverter(instance), _inbuf, _outbuf, _flags) end + function convert_bytes(instance::GZlibCompressor, _bytes::GBytes) + convert_bytes(GConverter(instance), _bytes) + end function reset(instance::GZlibCompressor) reset(GConverter(instance)) end @@ -6624,6 +6632,9 @@ $(Expr(:toplevel, quote function convert(instance::GZlibDecompressor, _inbuf, _outbuf, _flags) convert(GConverter(instance), _inbuf, _outbuf, _flags) end + function convert_bytes(instance::GZlibDecompressor, _bytes::GBytes) + convert_bytes(GConverter(instance), _bytes) + end function reset(instance::GZlibDecompressor) reset(GConverter(instance)) end @@ -6788,6 +6799,284 @@ $(Expr(:toplevel, quote ret = ccall(("g_action_map_remove_action", libgio), Nothing, (Ptr{GObject}, Cstring), instance, _action_name) nothing end + function create_from_commandline(_commandline::Union{AbstractString, Symbol}, _application_name::Maybe(Union{AbstractString, Symbol}), _flags) + _application_name_maybe = nothing_to_null(_application_name) + err = err_buf() + ret = ccall(("g_app_info_create_from_commandline", libgio), Ptr{GObject}, (Cstring, Cstring, UInt32, Ptr{Ptr{GError}}), _commandline, _application_name_maybe, _flags, err) + check_err(err) + ret2 = begin + leaftype = GLib.find_leaf_type(ret) + convert(leaftype, ret, true) + end + ret2 + end + function get_all() + ret = ccall(("g_app_info_get_all", libgio), Ptr{GLib._GList{Ptr{GObject}}}, ()) + ret2 = GLib.GList(ret, true) + ret2 + end + function get_all_for_type(_content_type::Union{AbstractString, Symbol}) + ret = ccall(("g_app_info_get_all_for_type", libgio), Ptr{GLib._GList{Ptr{GObject}}}, (Cstring,), _content_type) + ret2 = GLib.GList(ret, true) + ret2 + end + function get_default_for_type(_content_type::Union{AbstractString, Symbol}, _must_support_uris::Bool) + ret = ccall(("g_app_info_get_default_for_type", libgio), Ptr{GObject}, (Cstring, Cint), _content_type, _must_support_uris) + ret2 = GLib.find_leaf_type_if_not_null(ret, true) + ret2 + end + function get_default_for_type_async(_content_type::Union{AbstractString, Symbol}, _must_support_uris::Bool, _cancellable::Maybe(GCancellable), _callback::Maybe(Function)) + _cancellable_maybe = nothing_to_null(_cancellable) + if _callback === nothing + _callback_cfunc = C_NULL + _callback_closure = C_NULL + else + _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) + _callback_closure = GLib.gc_ref(_callback) + end + ret = ccall(("g_app_info_get_default_for_type_async", libgio), Nothing, (Cstring, Cint, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}), _content_type, _must_support_uris, _cancellable_maybe, _callback_cfunc, _callback_closure) + nothing + end + function get_default_for_type_finish(_result::GAsyncResult) + err = err_buf() + ret = ccall(("g_app_info_get_default_for_type_finish", libgio), Ptr{GObject}, (Ptr{GObject}, Ptr{Ptr{GError}}), _result, err) + check_err(err) + ret2 = begin + leaftype = GLib.find_leaf_type(ret) + convert(leaftype, ret, true) + end + ret2 + end + function get_default_for_uri_scheme(_uri_scheme::Union{AbstractString, Symbol}) + ret = ccall(("g_app_info_get_default_for_uri_scheme", libgio), Ptr{GObject}, (Cstring,), _uri_scheme) + ret2 = GLib.find_leaf_type_if_not_null(ret, true) + ret2 + end + function get_default_for_uri_scheme_async(_uri_scheme::Union{AbstractString, Symbol}, _cancellable::Maybe(GCancellable), _callback::Maybe(Function)) + _cancellable_maybe = nothing_to_null(_cancellable) + if _callback === nothing + _callback_cfunc = C_NULL + _callback_closure = C_NULL + else + _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) + _callback_closure = GLib.gc_ref(_callback) + end + ret = ccall(("g_app_info_get_default_for_uri_scheme_async", libgio), Nothing, (Cstring, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}), _uri_scheme, _cancellable_maybe, _callback_cfunc, _callback_closure) + nothing + end + function get_default_for_uri_scheme_finish(_result::GAsyncResult) + err = err_buf() + ret = ccall(("g_app_info_get_default_for_uri_scheme_finish", libgio), Ptr{GObject}, (Ptr{GObject}, Ptr{Ptr{GError}}), _result, err) + check_err(err) + ret2 = begin + leaftype = GLib.find_leaf_type(ret) + convert(leaftype, ret, true) + end + ret2 + end + function get_fallback_for_type(_content_type::Union{AbstractString, Symbol}) + ret = ccall(("g_app_info_get_fallback_for_type", libgio), Ptr{GLib._GList{Ptr{GObject}}}, (Cstring,), _content_type) + ret2 = GLib.GList(ret, true) + ret2 + end + function get_recommended_for_type(_content_type::Union{AbstractString, Symbol}) + ret = ccall(("g_app_info_get_recommended_for_type", libgio), Ptr{GLib._GList{Ptr{GObject}}}, (Cstring,), _content_type) + ret2 = GLib.GList(ret, true) + ret2 + end + function launch_default_for_uri(_uri::Union{AbstractString, Symbol}, _context::Maybe(GAppLaunchContext)) + _context_maybe = nothing_to_null(_context) + err = err_buf() + ret = ccall(("g_app_info_launch_default_for_uri", libgio), Cint, (Cstring, Ptr{GObject}, Ptr{Ptr{GError}}), _uri, _context_maybe, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function launch_default_for_uri_async(_uri::Union{AbstractString, Symbol}, _context::Maybe(GAppLaunchContext), _cancellable::Maybe(GCancellable), _callback::Maybe(Function)) + _context_maybe = nothing_to_null(_context) + _cancellable_maybe = nothing_to_null(_cancellable) + if _callback === nothing + _callback_cfunc = C_NULL + _callback_closure = C_NULL + else + _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) + _callback_closure = GLib.gc_ref(_callback) + end + ret = ccall(("g_app_info_launch_default_for_uri_async", libgio), Nothing, (Cstring, Ptr{GObject}, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}), _uri, _context_maybe, _cancellable_maybe, _callback_cfunc, _callback_closure) + nothing + end + function launch_default_for_uri_finish(_result::GAsyncResult) + err = err_buf() + ret = ccall(("g_app_info_launch_default_for_uri_finish", libgio), Cint, (Ptr{GObject}, Ptr{Ptr{GError}}), _result, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function reset_type_associations(_content_type::Union{AbstractString, Symbol}) + ret = ccall(("g_app_info_reset_type_associations", libgio), Nothing, (Cstring,), _content_type) + nothing + end + function add_supports_type(instance::GAppInfo, _content_type::Union{AbstractString, Symbol}) + err = err_buf() + ret = ccall(("g_app_info_add_supports_type", libgio), Cint, (Ptr{GObject}, Cstring, Ptr{Ptr{GError}}), instance, _content_type, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function can_delete(instance::GAppInfo) + ret = ccall(("g_app_info_can_delete", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end + function can_remove_supports_type(instance::GAppInfo) + ret = ccall(("g_app_info_can_remove_supports_type", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end + function delete(instance::GAppInfo) + ret = ccall(("g_app_info_delete", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end + function dup(instance::GAppInfo) + ret = ccall(("g_app_info_dup", libgio), Ptr{GObject}, (Ptr{GObject},), instance) + ret2 = begin + leaftype = GLib.find_leaf_type(ret) + convert(leaftype, ret, true) + end + ret2 + end + function equal(instance::GAppInfo, _appinfo2::GAppInfo) + ret = ccall(("g_app_info_equal", libgio), Cint, (Ptr{GObject}, Ptr{GObject}), instance, _appinfo2) + ret2 = convert(Bool, ret) + ret2 + end + function get_commandline(instance::GAppInfo) + ret = ccall(("g_app_info_get_commandline", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_description(instance::GAppInfo) + ret = ccall(("g_app_info_get_description", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_display_name(instance::GAppInfo) + ret = ccall(("g_app_info_get_display_name", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_executable(instance::GAppInfo) + ret = ccall(("g_app_info_get_executable", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_icon(instance::GAppInfo) + ret = ccall(("g_app_info_get_icon", libgio), Ptr{GObject}, (Ptr{GObject},), instance) + ret2 = GLib.find_leaf_type_if_not_null(ret, false) + ret2 + end + function get_id(instance::GAppInfo) + ret = ccall(("g_app_info_get_id", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_name(instance::GAppInfo) + ret = ccall(("g_app_info_get_name", libgio), Cstring, (Ptr{GObject},), instance) + ret2 = string_or_nothing(ret, false) + ret2 + end + function get_supported_types(instance::GAppInfo) + ret = ccall(("g_app_info_get_supported_types", libgio), Ptr{Cstring}, (Ptr{GObject},), instance) + ret2 = begin + _len = length_zt(ret) + arrtemp = bytestring.(unsafe_wrap(Vector{Cstring}, ret, _len)) + arrtemp + end + ret2 + end + function launch(instance::GAppInfo, _files::Maybe(GLib.LList{GLib._GList{Ptr{GObject}}}), _context::Maybe(GAppLaunchContext)) + _files_maybe = nothing_to_null(_files) + _context_maybe = nothing_to_null(_context) + err = err_buf() + ret = ccall(("g_app_info_launch", libgio), Cint, (Ptr{GObject}, Ptr{GLib._GList{Ptr{GObject}}}, Ptr{GObject}, Ptr{Ptr{GError}}), instance, _files_maybe, _context_maybe, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function launch_uris(instance::GAppInfo, _uris::Maybe(GLib.LList{GLib._GList{String}}), _context::Maybe(GAppLaunchContext)) + _uris_maybe = nothing_to_null(_uris) + _context_maybe = nothing_to_null(_context) + err = err_buf() + ret = ccall(("g_app_info_launch_uris", libgio), Cint, (Ptr{GObject}, Ptr{GLib._GList{String}}, Ptr{GObject}, Ptr{Ptr{GError}}), instance, _uris_maybe, _context_maybe, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function launch_uris_async(instance::GAppInfo, _uris::Maybe(GLib.LList{GLib._GList{String}}), _context::Maybe(GAppLaunchContext), _cancellable::Maybe(GCancellable), _callback::Maybe(Function)) + _uris_maybe = nothing_to_null(_uris) + _context_maybe = nothing_to_null(_context) + _cancellable_maybe = nothing_to_null(_cancellable) + if _callback === nothing + _callback_cfunc = C_NULL + _callback_closure = C_NULL + else + _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) + _callback_closure = GLib.gc_ref(_callback) + end + ret = ccall(("g_app_info_launch_uris_async", libgio), Nothing, (Ptr{GObject}, Ptr{GLib._GList{String}}, Ptr{GObject}, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}), instance, _uris_maybe, _context_maybe, _cancellable_maybe, _callback_cfunc, _callback_closure) + nothing + end + function launch_uris_finish(instance::GAppInfo, _result::GAsyncResult) + err = err_buf() + ret = ccall(("g_app_info_launch_uris_finish", libgio), Cint, (Ptr{GObject}, Ptr{GObject}, Ptr{Ptr{GError}}), instance, _result, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function remove_supports_type(instance::GAppInfo, _content_type::Union{AbstractString, Symbol}) + err = err_buf() + ret = ccall(("g_app_info_remove_supports_type", libgio), Cint, (Ptr{GObject}, Cstring, Ptr{Ptr{GError}}), instance, _content_type, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function set_as_default_for_extension(instance::GAppInfo, _extension::Union{AbstractString, Symbol}) + err = err_buf() + ret = ccall(("g_app_info_set_as_default_for_extension", libgio), Cint, (Ptr{GObject}, Cstring, Ptr{Ptr{GError}}), instance, _extension, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function set_as_default_for_type(instance::GAppInfo, _content_type::Union{AbstractString, Symbol}) + err = err_buf() + ret = ccall(("g_app_info_set_as_default_for_type", libgio), Cint, (Ptr{GObject}, Cstring, Ptr{Ptr{GError}}), instance, _content_type, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function set_as_last_used_for_type(instance::GAppInfo, _content_type::Union{AbstractString, Symbol}) + err = err_buf() + ret = ccall(("g_app_info_set_as_last_used_for_type", libgio), Cint, (Ptr{GObject}, Cstring, Ptr{Ptr{GError}}), instance, _content_type, err) + check_err(err) + ret2 = convert(Bool, ret) + ret2 + end + function should_show(instance::GAppInfo) + ret = ccall(("g_app_info_should_show", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end + function supports_files(instance::GAppInfo) + ret = ccall(("g_app_info_supports_files", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end + function supports_uris(instance::GAppInfo) + ret = ccall(("g_app_info_supports_uris", libgio), Cint, (Ptr{GObject},), instance) + ret2 = convert(Bool, ret) + ret2 + end function init_async(instance::GAsyncInitable, _io_priority::Integer, _cancellable::Maybe(GCancellable), _callback::Maybe(Function)) _cancellable_maybe = nothing_to_null(_cancellable) if _callback === nothing @@ -6852,6 +7141,13 @@ $(Expr(:toplevel, quote _bytes_written = m_bytes_written[] (ret2, _bytes_read, _bytes_written) end + function convert_bytes(instance::GConverter, _bytes::GBytes) + err = err_buf() + ret = ccall(("g_converter_convert_bytes", libgio), Ptr{GBytes}, (Ptr{GObject}, Ptr{GBytes}, Ptr{Ptr{GError}}), instance, _bytes, err) + check_err(err) + ret2 = convert(GBytes, ret, true) + ret2 + end function reset(instance::GConverter) ret = ccall(("g_converter_reset", libgio), Nothing, (Ptr{GObject},), instance) nothing @@ -7257,28 +7553,6 @@ $(Expr(:toplevel, quote ret2 = convert(Bool, ret) ret2 end - function copy_async(instance::GFile, _destination::GFile, _flags, _io_priority::Integer, _cancellable::Maybe(GCancellable), _progress_callback::Maybe(Function), _callback::Maybe(Function)) - _cancellable_maybe = nothing_to_null(_cancellable) - if _progress_callback === nothing - _progress_callback_cfunc = C_NULL - begin - _progress_callback_closure = C_NULL - _progress_callback_notify = C_NULL - end - else - _progress_callback_cfunc = @cfunction(GFileProgressCallback, Nothing, (Int64, Int64, Ref{Function})) - (_progress_callback_closure, _progress_callback_notify) = GLib.gc_ref_closure(_progress_callback) - end - if _callback === nothing - _callback_cfunc = C_NULL - _callback_closure = C_NULL - else - _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) - _callback_closure = GLib.gc_ref(_callback) - end - ret = ccall(("g_file_copy_async", libgio), Nothing, (Ptr{GObject}, Ptr{GObject}, UInt32, Int32, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}, Ptr{Cvoid}, Ptr{Nothing}), instance, _destination, _flags, _io_priority, _cancellable_maybe, _progress_callback_cfunc, _progress_callback_closure, _callback_cfunc, _callback_closure) - nothing - end function copy_attributes(instance::GFile, _destination::GFile, _flags, _cancellable::Maybe(GCancellable)) _cancellable_maybe = nothing_to_null(_cancellable) err = err_buf() @@ -7833,28 +8107,6 @@ $(Expr(:toplevel, quote ret2 = convert(Bool, ret) ret2 end - function move_async(instance::GFile, _destination::GFile, _flags, _io_priority::Integer, _cancellable::Maybe(GCancellable), _progress_callback::Maybe(Function), _callback::Maybe(Function)) - _cancellable_maybe = nothing_to_null(_cancellable) - if _progress_callback === nothing - _progress_callback_cfunc = C_NULL - _progress_callback_closure = C_NULL - else - _progress_callback_cfunc = @cfunction(GFileProgressCallback, Nothing, (Int64, Int64, Ref{Function})) - begin - ref = Ref{Any}(_progress_callback) - _progress_callback_closure = unsafe_load(convert(Ptr{Ptr{Nothing}}, Base.unsafe_convert(Ptr{Any}, ref))) - end - end - if _callback === nothing - _callback_cfunc = C_NULL - _callback_closure = C_NULL - else - _callback_cfunc = @cfunction(GAsyncReadyCallback, Nothing, (Ptr{GObject}, Ptr{GObject}, Ref{Function})) - _callback_closure = GLib.gc_ref(_callback) - end - ret = ccall(("g_file_move_async", libgio), Nothing, (Ptr{GObject}, Ptr{GObject}, UInt32, Int32, Ptr{GObject}, Ptr{Cvoid}, Ptr{Nothing}, Ptr{Cvoid}, Ptr{Nothing}), instance, _destination, _flags, _io_priority, _cancellable_maybe, _progress_callback_cfunc, _progress_callback_closure, _callback_cfunc, _callback_closure) - nothing - end function move_finish(instance::GFile, _result::GAsyncResult) err = err_buf() ret = ccall(("g_file_move_finish", libgio), Cint, (Ptr{GObject}, Ptr{GObject}, Ptr{Ptr{GError}}), instance, _result, err) diff --git a/src/gen/glib_consts b/src/gen/glib_consts index 2618014e..49af9aac 100644 --- a/src/gen/glib_consts +++ b/src/gen/glib_consts @@ -82,12 +82,12 @@ $(Expr(:toplevel, quote const MAXUINT32 = 0xffffffff const MAXUINT64 = 0xffffffffffffffff const MAXUINT8 = 0xff - const MICRO_VERSION = 3 + const MICRO_VERSION = 2 const MININT16 = -32768 const MININT32 = -2147483648 const MININT64 = -9223372036854775808 const MININT8 = -128 - const MINOR_VERSION = 80 + const MINOR_VERSION = 82 const MODULE_SUFFIX = "so" const OPTION_REMAINING = "" const PDP_ENDIAN = 3412 @@ -190,14 +190,21 @@ $(Expr(:toplevel, quote @bitflag UriParamsFlags::UInt32 UriParamsFlags_NONE = 0 UriParamsFlags_CASE_INSENSITIVE = 1 UriParamsFlags_WWW_FORM = 2 UriParamsFlags_PARSE_RELAXED = 4 @doc "See the [GTK docs](https://docs.gtk.org/glib/const.ASCII_DTOSTR_BUF_SIZE.html)." ASCII_DTOSTR_BUF_SIZE @doc "See the [GTK docs](https://docs.gtk.org/glib/const.ATOMIC_REF_COUNT_INIT.html)." ATOMIC_REF_COUNT_INIT + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.BIG_ENDIAN.html)." BIG_ENDIAN @doc "See the [GTK docs](https://docs.gtk.org/glib/const.CSET_A_2_Z.html)." CSET_A_2_Z @doc "See the [GTK docs](https://docs.gtk.org/glib/const.CSET_DIGITS.html)." CSET_DIGITS @doc "See the [GTK docs](https://docs.gtk.org/glib/const.CSET_a_2_z.html)." CSET_a_2_z + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.C_STD_VERSION.html)." C_STD_VERSION @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DATALIST_FLAGS_MASK.html)." DATALIST_FLAGS_MASK @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DATE_BAD_DAY.html)." DATE_BAD_DAY @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DATE_BAD_JULIAN.html)." DATE_BAD_JULIAN @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DATE_BAD_YEAR.html)." DATE_BAD_YEAR + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DIR_SEPARATOR.html)." DIR_SEPARATOR + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.DIR_SEPARATOR_S.html)." DIR_SEPARATOR_S + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.HAVE_GNUC_VISIBILITY.html)." HAVE_GNUC_VISIBILITY @doc "See the [GTK docs](https://docs.gtk.org/glib/const.HOOK_FLAG_USER_SHIFT.html)." HOOK_FLAG_USER_SHIFT + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.IEEE754_DOUBLE_BIAS.html)." IEEE754_DOUBLE_BIAS + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.IEEE754_FLOAT_BIAS.html)." IEEE754_FLOAT_BIAS @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_GROUP.html)." KEY_FILE_DESKTOP_GROUP @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_KEY_ACTIONS.html)." KEY_FILE_DESKTOP_KEY_ACTIONS @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_KEY_CATEGORIES.html)." KEY_FILE_DESKTOP_KEY_CATEGORIES @@ -223,6 +230,7 @@ $(Expr(:toplevel, quote @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_TYPE_APPLICATION.html)." KEY_FILE_DESKTOP_TYPE_APPLICATION @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_TYPE_DIRECTORY.html)." KEY_FILE_DESKTOP_TYPE_DIRECTORY @doc "See the [GTK docs](https://docs.gtk.org/glib/const.KEY_FILE_DESKTOP_TYPE_LINK.html)." KEY_FILE_DESKTOP_TYPE_LINK + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.LITTLE_ENDIAN.html)." LITTLE_ENDIAN @doc "See the [GTK docs](https://docs.gtk.org/glib/const.LOG_DOMAIN.html)." LOG_DOMAIN @doc "See the [GTK docs](https://docs.gtk.org/glib/const.LOG_FATAL_MASK.html)." LOG_FATAL_MASK @doc "See the [GTK docs](https://docs.gtk.org/glib/const.LOG_LEVEL_USER_SHIFT.html)." LOG_LEVEL_USER_SHIFT @@ -234,6 +242,7 @@ $(Expr(:toplevel, quote @doc "See the [GTK docs](https://docs.gtk.org/glib/const.MININT8.html)." MININT8 @doc "See the [GTK docs](https://docs.gtk.org/glib/const.MINOR_VERSION.html)." MINOR_VERSION @doc "See the [GTK docs](https://docs.gtk.org/glib/const.OPTION_REMAINING.html)." OPTION_REMAINING + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.PDP_ENDIAN.html)." PDP_ENDIAN @doc "See the [GTK docs](https://docs.gtk.org/glib/const.PID_FORMAT.html)." PID_FORMAT @doc "See the [GTK docs](https://docs.gtk.org/glib/const.POLLFD_FORMAT.html)." POLLFD_FORMAT @doc "See the [GTK docs](https://docs.gtk.org/glib/const.PRIORITY_DEFAULT.html)." PRIORITY_DEFAULT @@ -242,6 +251,8 @@ $(Expr(:toplevel, quote @doc "See the [GTK docs](https://docs.gtk.org/glib/const.PRIORITY_HIGH_IDLE.html)." PRIORITY_HIGH_IDLE @doc "See the [GTK docs](https://docs.gtk.org/glib/const.PRIORITY_LOW.html)." PRIORITY_LOW @doc "See the [GTK docs](https://docs.gtk.org/glib/const.REF_COUNT_INIT.html)." REF_COUNT_INIT + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.SEARCHPATH_SEPARATOR.html)." SEARCHPATH_SEPARATOR + @doc "See the [GTK docs](https://docs.gtk.org/glib/const.SEARCHPATH_SEPARATOR_S.html)." SEARCHPATH_SEPARATOR_S @doc "See the [GTK docs](https://docs.gtk.org/glib/const.SOURCE_CONTINUE.html)." SOURCE_CONTINUE @doc "See the [GTK docs](https://docs.gtk.org/glib/const.SOURCE_REMOVE.html)." SOURCE_REMOVE @doc "See the [GTK docs](https://docs.gtk.org/glib/const.STR_DELIMITERS.html)." STR_DELIMITERS diff --git a/src/gen/glib_functions b/src/gen/glib_functions index cc774a60..7022b3e5 100644 --- a/src/gen/glib_functions +++ b/src/gen/glib_functions @@ -1548,17 +1548,6 @@ $(Expr(:toplevel, quote _dest = m_dest[] _dest end - function qsort_with_data(_pbase::Nothing, _total_elems::Integer, _size::Integer, _compare_func::Function) - begin - _compare_func_cfunc = @cfunction(GCompareDataFunc, Int32, (Ptr{Nothing}, Ptr{Nothing}, Ref{Function})) - begin - ref = Ref{Any}(_compare_func) - _compare_func_closure = unsafe_load(convert(Ptr{Ptr{Nothing}}, Base.unsafe_convert(Ptr{Any}, ref))) - end - end - ret = ccall(("g_qsort_with_data", libglib), Nothing, (Ptr{Nothing}, Int32, UInt64, Ptr{Cvoid}, Ptr{Nothing}), _pbase, _total_elems, _size, _compare_func_cfunc, _compare_func_closure) - nothing - end function quark_from_static_string(_string::Maybe(Union{AbstractString, Symbol})) _string_maybe = nothing_to_null(_string) ret = ccall(("g_quark_from_static_string", libglib), UInt32, (Cstring,), _string_maybe) @@ -2029,12 +2018,12 @@ $(Expr(:toplevel, quote end function strrstr(_haystack::Union{AbstractString, Symbol}, _needle::Union{AbstractString, Symbol}) ret = ccall(("g_strrstr", libglib), Cstring, (Cstring, Cstring), _haystack, _needle) - ret2 = string_or_nothing(ret, true) + ret2 = string_or_nothing(ret, false) ret2 end function strrstr_len(_haystack::Union{AbstractString, Symbol}, _haystack_len::Integer, _needle::Union{AbstractString, Symbol}) ret = ccall(("g_strrstr_len", libglib), Cstring, (Cstring, Int64, Cstring), _haystack, _haystack_len, _needle) - ret2 = string_or_nothing(ret, true) + ret2 = string_or_nothing(ret, false) ret2 end function strsignal(_signum::Integer) @@ -2064,7 +2053,7 @@ $(Expr(:toplevel, quote end function strstr_len(_haystack::Union{AbstractString, Symbol}, _haystack_len::Integer, _needle::Union{AbstractString, Symbol}) ret = ccall(("g_strstr_len", libglib), Cstring, (Cstring, Int64, Cstring), _haystack, _haystack_len, _needle) - ret2 = string_or_nothing(ret, true) + ret2 = string_or_nothing(ret, false) ret2 end function strtod(_nptr::Union{AbstractString, Symbol}) diff --git a/src/gen/glib_methods b/src/gen/glib_methods index 05ca0df6..f9143097 100644 --- a/src/gen/glib_methods +++ b/src/gen/glib_methods @@ -1292,7 +1292,7 @@ $(Expr(:toplevel, quote end function get_contents(instance::GMappedFile) ret = ccall(("g_mapped_file_get_contents", libglib), Cstring, (Ptr{GMappedFile},), instance) - ret2 = string_or_nothing(ret, true) + ret2 = string_or_nothing(ret, false) ret2 end function get_length(instance::GMappedFile) @@ -1804,6 +1804,17 @@ $(Expr(:toplevel, quote ret = ccall(("g_strv_builder_unref", libglib), Nothing, (Ptr{GStrvBuilder},), reffed_instance) nothing end + function unref_to_strv(instance::GStrvBuilder) + reffed_instance = GLib.glib_ref(instance) + ret = ccall(("g_strv_builder_unref_to_strv", libglib), Ptr{Cstring}, (Ptr{GStrvBuilder},), reffed_instance) + ret2 = begin + _len = length_zt(ret) + arrtemp = bytestring.(unsafe_wrap(Vector{Cstring}, ret, _len)) + GLib.g_strfreev(ret) + arrtemp + end + ret2 + end function TimeZone_new_identifier(_identifier::Maybe(Union{AbstractString, Symbol})) _identifier_maybe = nothing_to_null(_identifier) ret = ccall(("g_time_zone_new_identifier", libglib), Ptr{GTimeZone}, (Cstring,), _identifier_maybe)