Skip to content

Commit

Permalink
add some missing Pango auto-generated methods, support GtkFontDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed Jan 15, 2024
1 parent bd9e385 commit 2c7132c
Show file tree
Hide file tree
Showing 6 changed files with 407 additions and 7 deletions.
7 changes: 7 additions & 0 deletions examples/font_dialog.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Gtk4

cb(dlg, resobj) = println("you chose "*Gtk4.font(dlg, resobj))

dlg = GtkFontDialog()
Gtk4.choose_font(cb, dlg)

7 changes: 3 additions & 4 deletions gen/gen_pango.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ GI.write_to_file(path,"pango_consts",toplevel)

toplevel, exprs, exports = GI.output_exprs()

struct_skiplist=Symbol[]

first_list=[:Language,:Color,:AttrClass,:Rectangle,:FontDescription,:Attribute,:Analysis,:Item,:GlyphVisAttr,:GlyphGeometry,:GlyphInfo,:GlyphString,:GlyphItem]
GI.struct_cache_expr!(exprs)
GI.struct_exprs!(exprs,exports,ns,first_list)

struct_skiplist=vcat(first_list,struct_skiplist)
struct_skiplist,c = GI.all_struct_exprs!(exprs,exports,ns;excludelist=first_list)

struct_skiplist,c = GI.all_struct_exprs!(exprs,exports,ns;excludelist=struct_skiplist)
# we want the methods from first_list
struct_skiplist=Symbol[]

## objects

Expand Down
1 change: 1 addition & 0 deletions src/Pango/Pango.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ eltype(::Type{PangoFontFamily}) = PangoFontFace
Base.keys(ff::PangoFontFamily) = 1:length(ff)

PangoFontDescription(s::AbstractString) = G_.font_description_from_string(s)
Base.show(io::IO, pfd::PangoFontDescription) = print(io, "PangoFontDescription(" * G_.to_string(pfd) * ")")

PangoLayout(cr::cairoContext) = G_.create_layout(cr)

Expand Down
6 changes: 3 additions & 3 deletions src/gen/pango_consts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ $(Expr(:toplevel, quote
const GLYPH_UNKNOWN_FLAG = 0x10000000
const SCALE = 1024
const VERSION_MAJOR = 1
const VERSION_MICRO = 14
const VERSION_MINOR = 50
const VERSION_STRING = "1.50.14"
const VERSION_MICRO = 0
const VERSION_MINOR = 51
const VERSION_STRING = "1.51.0"
begin
@cenum Alignment::Int32 Alignment_LEFT = 0 Alignment_CENTER = 1 Alignment_RIGHT = 2
(GLib.g_type(::Type{T}) where T <: Alignment) = begin
Expand Down
Loading

0 comments on commit 2c7132c

Please sign in to comment.