Skip to content

Commit

Permalink
fixes for Gtk4 0.7 (#15)
Browse files Browse the repository at this point in the history
* fixes for Gtk4 0.7

* remove Julia 1.6
  • Loading branch information
jwahlstrand authored Sep 24, 2024
1 parent 0fa0688 commit 55c3a79
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
version: ['1.6', '1']
version: ['1']
arch: [x64, x86]
include:
- os: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
[compat]
BitFlags = "0.1.5"
CEnum = "0.4, 0.5"
Gtk4 = "0.6"
Gtk4 = "0.7"
GtkSourceView_jll = "5.1.0"
julia = "1.6"
julia = "1.10"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
10 changes: 5 additions & 5 deletions src/GtkSourceWidget.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ end

## GtkSourceSearchContext

function search_context_forward(search::GtkSourceSearchContext, iter::_GtkTextIter)
found, match_start, match_end, wrapped_around = G_.forward(search, Ref(iter))
return (found, match_start, match_end)
function search_context_forward(search::GtkSourceSearchContext, iter)
found, match_start, match_end, wrapped_around = G_.forward(search, iter)
return (found, Ref(match_start), Ref(match_end))
end

function search_context_replace(
search::GtkSourceSearchContext,
match_start::_GtkTextIter, match_end::_GtkTextIter,
match_start::GtkTextIterLike, match_end::GtkTextIterLike,
replace::String)
G_.replace(search, Ref(match_start), Ref(match_end), replace, -1)
G_.replace(search, match_start, match_end, replace, -1)
end

function search_context_replace_all(search::GtkSourceSearchContext, replace::String)
Expand Down
4 changes: 2 additions & 2 deletions src/gen/gtksourceview_consts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ quote
$(Expr(:toplevel, quote
begin
const MAJOR_VERSION = 5
const MICRO_VERSION = 0
const MINOR_VERSION = 10
const MICRO_VERSION = 1
const MINOR_VERSION = 12
begin
@cenum BackgroundPatternType::Int32 BackgroundPatternType_NONE = 0 BackgroundPatternType_GRID = 1
(GLib.g_type(::Type{T}) where T <: BackgroundPatternType) = begin
Expand Down
81 changes: 45 additions & 36 deletions src/gen/gtksourceview_methods

Large diffs are not rendered by default.

61 changes: 35 additions & 26 deletions src/gen/gtksourceview_structs

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ using Gtk4
search_context = GtkSourceSearchContext(b, search_settings)
set_search_text(search_settings, "test")

it = Gtk4._GtkTextIter(b, 1)
it = Gtk4.GtkTextIter(b, 1)
found, its, ite = search_context_forward(search_context, it)
@test found == true
@test (its:ite).text == "test"

search_context_replace(search_context, its, ite, "it worked!")
set_search_text(search_settings, "it worked!")

it = Gtk4._GtkTextIter(b, 1)
it = Gtk4.GtkTextIter(b, 1)
found, its, ite = search_context_forward(search_context, it)
@test found == true
@test (its:ite).text == "it worked!"

mark = create_mark(b, it)
scroll_to(v, mark, 0, true, 0.5, 0.5)

end


0 comments on commit 55c3a79

Please sign in to comment.