Skip to content

Commit

Permalink
Version 0.7 (#74)
Browse files Browse the repository at this point in the history
* require julia 1.10

* minor stuff

* improve test coverage (#70)

* Use new dialogs (breaking) (#49)

In the newer versions of GTK v4, new dialogs were introduced and the old ones were deprecated, including GtkDialog and GtkMessageDialog. There isn't much difference in user-facing behavior, but since the old ones were deprecated it's less likely bugs will be fixed. This PR migrates to the new dialogs and cleans up our API a little.

I left the file dialogs alone after looking in the C code and realizing that the new dialogs are based on GtkFileChooserNative, like the old code.

* GtkTextView: use pointer or Ref instead of _GtkTextIter struct (breaking) (#62)

* GtkTextView: use pointer or ref instead of _GtkTextIter struct

This is more consistent with everything else in the package

* random stuff

* support adding widgets to gutter

* fix GtkTextIter auto-generated methods, better support methods for all non-opaque structs

* a bit of tidying

* remove unneeded version check

* add simple TextView example

* update auto-generated code for Adwaita

* simplify generation script for Adwaita

* update auto-generated code

* regenerate code
  • Loading branch information
jwahlstrand authored Sep 21, 2024
1 parent 0f65bbc commit c499462
Show file tree
Hide file tree
Showing 80 changed files with 11,137 additions and 3,730 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
fail-fast: false
matrix:
julia-version:
- "1.6"
- "1"
#- "nightly"
os:
Expand Down
2 changes: 1 addition & 1 deletion Adwaita/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Adwaita.jl

Module for using [libadwaita](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.2/).
Module for using [libadwaita](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.3/) version 1.3.

Requires and works with Gtk4.jl. This package is not currently registered, nor is there documentation yet. It is mostly autogenerated by GObject introspection, so it works very much like Gtk4.jl.
64 changes: 32 additions & 32 deletions Adwaita/src/gen/adw_consts
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
quote
$(Expr(:toplevel, quote
begin
DURATION_INFINITE = 0xffffffff
MAJOR_VERSION = 1
MICRO_VERSION = 4
MINOR_VERSION = 2
VERSION_S = "1.2.4"
const DURATION_INFINITE = 0xffffffff
const MAJOR_VERSION = 1
const MICRO_VERSION = 3
const MINOR_VERSION = 5
const VERSION_S = "1.5.3"
begin
@cenum AnimationState::Int32 AnimationState_IDLE = 0 AnimationState_PAUSED = 1 AnimationState_PLAYING = 2 AnimationState_FINISHED = 3
(GLib.g_type(::Type{T}) where T <: AnimationState) = begin
ccall(("adw_animation_state_get_type", libadwaita), GType, ())
end
end
begin
@cenum CenteringPolicy::Int32 CenteringPolicy_LOOSE = 0 CenteringPolicy_STRICT = 1
(GLib.g_type(::Type{T}) where T <: CenteringPolicy) = begin
ccall(("adw_centering_policy_get_type", libadwaita), GType, ())
@cenum BreakpointConditionLengthType::Int32 BreakpointConditionLengthType_MIN_WIDTH = 0 BreakpointConditionLengthType_MAX_WIDTH = 1 BreakpointConditionLengthType_MIN_HEIGHT = 2 BreakpointConditionLengthType_MAX_HEIGHT = 3
(GLib.g_type(::Type{T}) where T <: BreakpointConditionLengthType) = begin
ccall(("adw_breakpoint_condition_length_type_get_type", libadwaita), GType, ())
end
end
begin
@cenum ColorScheme::Int32 ColorScheme_DEFAULT = 0 ColorScheme_FORCE_LIGHT = 1 ColorScheme_PREFER_LIGHT = 2 ColorScheme_PREFER_DARK = 3 ColorScheme_FORCE_DARK = 4
(GLib.g_type(::Type{T}) where T <: ColorScheme) = begin
ccall(("adw_color_scheme_get_type", libadwaita), GType, ())
@cenum BreakpointConditionRatioType::Int32 BreakpointConditionRatioType_MIN_ASPECT_RATIO = 0 BreakpointConditionRatioType_MAX_ASPECT_RATIO = 1
(GLib.g_type(::Type{T}) where T <: BreakpointConditionRatioType) = begin
ccall(("adw_breakpoint_condition_ratio_type_get_type", libadwaita), GType, ())
end
end
begin
@cenum Easing::Int32 Easing_LINEAR = 0 Easing_EASE_IN_QUAD = 1 Easing_EASE_OUT_QUAD = 2 Easing_EASE_IN_OUT_QUAD = 3 Easing_EASE_IN_CUBIC = 4 Easing_EASE_OUT_CUBIC = 5 Easing_EASE_IN_OUT_CUBIC = 6 Easing_EASE_IN_QUART = 7 Easing_EASE_OUT_QUART = 8 Easing_EASE_IN_OUT_QUART = 9 Easing_EASE_IN_QUINT = 10 Easing_EASE_OUT_QUINT = 11 Easing_EASE_IN_OUT_QUINT = 12 Easing_EASE_IN_SINE = 13 Easing_EASE_OUT_SINE = 14 Easing_EASE_IN_OUT_SINE = 15 Easing_EASE_IN_EXPO = 16 Easing_EASE_OUT_EXPO = 17 Easing_EASE_IN_OUT_EXPO = 18 Easing_EASE_IN_CIRC = 19 Easing_EASE_OUT_CIRC = 20 Easing_EASE_IN_OUT_CIRC = 21 Easing_EASE_IN_ELASTIC = 22 Easing_EASE_OUT_ELASTIC = 23 Easing_EASE_IN_OUT_ELASTIC = 24 Easing_EASE_IN_BACK = 25 Easing_EASE_OUT_BACK = 26 Easing_EASE_IN_OUT_BACK = 27 Easing_EASE_IN_BOUNCE = 28 Easing_EASE_OUT_BOUNCE = 29 Easing_EASE_IN_OUT_BOUNCE = 30
(GLib.g_type(::Type{T}) where T <: Easing) = begin
ccall(("adw_easing_get_type", libadwaita), GType, ())
@cenum CenteringPolicy::Int32 CenteringPolicy_LOOSE = 0 CenteringPolicy_STRICT = 1
(GLib.g_type(::Type{T}) where T <: CenteringPolicy) = begin
ccall(("adw_centering_policy_get_type", libadwaita), GType, ())
end
end
begin
@cenum FlapFoldPolicy::Int32 FlapFoldPolicy_NEVER = 0 FlapFoldPolicy_ALWAYS = 1 FlapFoldPolicy_AUTO = 2
(GLib.g_type(::Type{T}) where T <: FlapFoldPolicy) = begin
ccall(("adw_flap_fold_policy_get_type", libadwaita), GType, ())
@cenum ColorScheme::Int32 ColorScheme_DEFAULT = 0 ColorScheme_FORCE_LIGHT = 1 ColorScheme_PREFER_LIGHT = 2 ColorScheme_PREFER_DARK = 3 ColorScheme_FORCE_DARK = 4
(GLib.g_type(::Type{T}) where T <: ColorScheme) = begin
ccall(("adw_color_scheme_get_type", libadwaita), GType, ())
end
end
begin
@cenum FlapTransitionType::Int32 FlapTransitionType_OVER = 0 FlapTransitionType_UNDER = 1 FlapTransitionType_SLIDE = 2
(GLib.g_type(::Type{T}) where T <: FlapTransitionType) = begin
ccall(("adw_flap_transition_type_get_type", libadwaita), GType, ())
@cenum DialogPresentationMode::Int32 DialogPresentationMode_AUTO = 0 DialogPresentationMode_FLOATING = 1 DialogPresentationMode_BOTTOM_SHEET = 2
(GLib.g_type(::Type{T}) where T <: DialogPresentationMode) = begin
ccall(("adw_dialog_presentation_mode_get_type", libadwaita), GType, ())
end
end
begin
@cenum FoldThresholdPolicy::Int32 FoldThresholdPolicy_MINIMUM = 0 FoldThresholdPolicy_NATURAL = 1
(GLib.g_type(::Type{T}) where T <: FoldThresholdPolicy) = begin
ccall(("adw_fold_threshold_policy_get_type", libadwaita), GType, ())
@cenum Easing::Int32 Easing_LINEAR = 0 Easing_EASE_IN_QUAD = 1 Easing_EASE_OUT_QUAD = 2 Easing_EASE_IN_OUT_QUAD = 3 Easing_EASE_IN_CUBIC = 4 Easing_EASE_OUT_CUBIC = 5 Easing_EASE_IN_OUT_CUBIC = 6 Easing_EASE_IN_QUART = 7 Easing_EASE_OUT_QUART = 8 Easing_EASE_IN_OUT_QUART = 9 Easing_EASE_IN_QUINT = 10 Easing_EASE_OUT_QUINT = 11 Easing_EASE_IN_OUT_QUINT = 12 Easing_EASE_IN_SINE = 13 Easing_EASE_OUT_SINE = 14 Easing_EASE_IN_OUT_SINE = 15 Easing_EASE_IN_EXPO = 16 Easing_EASE_OUT_EXPO = 17 Easing_EASE_IN_OUT_EXPO = 18 Easing_EASE_IN_CIRC = 19 Easing_EASE_OUT_CIRC = 20 Easing_EASE_IN_OUT_CIRC = 21 Easing_EASE_IN_ELASTIC = 22 Easing_EASE_OUT_ELASTIC = 23 Easing_EASE_IN_OUT_ELASTIC = 24 Easing_EASE_IN_BACK = 25 Easing_EASE_OUT_BACK = 26 Easing_EASE_IN_OUT_BACK = 27 Easing_EASE_IN_BOUNCE = 28 Easing_EASE_OUT_BOUNCE = 29 Easing_EASE_IN_OUT_BOUNCE = 30
(GLib.g_type(::Type{T}) where T <: Easing) = begin
ccall(("adw_easing_get_type", libadwaita), GType, ())
end
end
begin
@cenum LeafletTransitionType::Int32 LeafletTransitionType_OVER = 0 LeafletTransitionType_UNDER = 1 LeafletTransitionType_SLIDE = 2
(GLib.g_type(::Type{T}) where T <: LeafletTransitionType) = begin
ccall(("adw_leaflet_transition_type_get_type", libadwaita), GType, ())
@cenum LengthUnit::Int32 LengthUnit_PX = 0 LengthUnit_PT = 1 LengthUnit_SP = 2
(GLib.g_type(::Type{T}) where T <: LengthUnit) = begin
ccall(("adw_length_unit_get_type", libadwaita), GType, ())
end
end
begin
Expand All @@ -66,18 +66,18 @@ $(Expr(:toplevel, quote
ccall(("adw_response_appearance_get_type", libadwaita), GType, ())
end
end
begin
@cenum SqueezerTransitionType::Int32 SqueezerTransitionType_NONE = 0 SqueezerTransitionType_CROSSFADE = 1
(GLib.g_type(::Type{T}) where T <: SqueezerTransitionType) = begin
ccall(("adw_squeezer_transition_type_get_type", libadwaita), GType, ())
end
end
begin
@cenum ToastPriority::Int32 ToastPriority_NORMAL = 0 ToastPriority_HIGH = 1
(GLib.g_type(::Type{T}) where T <: ToastPriority) = begin
ccall(("adw_toast_priority_get_type", libadwaita), GType, ())
end
end
begin
@cenum ToolbarStyle::Int32 ToolbarStyle_FLAT = 0 ToolbarStyle_RAISED = 1 ToolbarStyle_RAISED_BORDER = 2
(GLib.g_type(::Type{T}) where T <: ToolbarStyle) = begin
ccall(("adw_toolbar_style_get_type", libadwaita), GType, ())
end
end
begin
@cenum ViewSwitcherPolicy::Int32 ViewSwitcherPolicy_NARROW = 0 ViewSwitcherPolicy_WIDE = 1
(GLib.g_type(::Type{T}) where T <: ViewSwitcherPolicy) = begin
Expand Down
10 changes: 10 additions & 0 deletions Adwaita/src/gen/adw_functions
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ $(Expr(:toplevel, quote
ret2 = convert(Bool, ret)
ret2
end
function length_unit_from_px(_unit, _value::Real, _settings::Maybe(GtkSettings))
_settings_maybe = nothing_to_null(_settings)
ret = ccall(("adw_length_unit_from_px", libadwaita), Float64, (UInt32, Float64, Ptr{GObject}), _unit, _value, _settings_maybe)
ret
end
function length_unit_to_px(_unit, _value::Real, _settings::Maybe(GtkSettings))
_settings_maybe = nothing_to_null(_settings)
ret = ccall(("adw_length_unit_to_px", libadwaita), Float64, (UInt32, Float64, Ptr{GObject}), _unit, _value, _settings_maybe)
ret
end
function lerp(_a::Real, _b::Real, _t::Real)
ret = ccall(("adw_lerp", libadwaita), Float64, (Float64, Float64, Float64), _a, _b, _t)
ret
Expand Down
Loading

0 comments on commit c499462

Please sign in to comment.