Skip to content

Commit 2e31153

Browse files
committed
add docstrings
1 parent fbe280c commit 2e31153

File tree

13 files changed

+180
-26
lines changed

13 files changed

+180
-26
lines changed

docs/src/manual/textwidgets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ ent.visibility = false
6767
```
6868
To get notified by changes to the entry one can listen to the "changed" event.
6969

70+
The `GtkEntry` widget includes a progress bar. Methods `fraction`, `pulse`, and `pulse_step` control its appearance and work the same as for [GtkProgressBar](@ref).
71+
7072
## [GtkSearchEntry](https://docs.gtk.org/gtk4/class.SearchEntry.html)
7173

7274
A special variant of the entry that can be used as a search box is `GtkSearchEntry`. It is equipped

gen/gen_gtk4.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ constructor_skiplist=[:new_first]
1414
object_skiplist=[:CClosureExpression,:ClosureExpression,:ParamSpecExpression,:PrintUnixDialog,:PageSetupUnixDialog]
1515
obj_constructor_skiplist=[:new_from_resource,:new_with_mnemonic,:new_with_text,:new_with_entry,:new_with_model_and_entry,:new_for_resource,:new_from_icon_name]
1616

17-
GI.export_struct_exprs!(ns,path, "gtk4", struct_skiplist, [:BitsetIter,:BuildableParser]; doc_xml = d, object_skiplist = object_skiplist, constructor_skiplist = constructor_skiplist, output_boxed_cache_init = false, output_boxed_types_def = false, output_object_cache_define = false, output_object_cache_init = false, object_constructor_skiplist = obj_constructor_skiplist, doc_skiplist = [:Builder], exclude_deprecated = false)
17+
GI.export_struct_exprs!(ns,path, "gtk4", struct_skiplist, [:BitsetIter,:BuildableParser]; doc_xml = d, object_skiplist = object_skiplist, constructor_skiplist = constructor_skiplist, output_boxed_cache_init = false, output_boxed_types_def = false, output_object_cache_define = false, output_object_cache_init = false, object_constructor_skiplist = obj_constructor_skiplist, doc_skiplist = [:Builder, :Notebook, :Grid, :Stack, :StackSwitcher, :SpinButton, :StackSidebar, :Image, :Picture, :ProgressBar, :Spinner], exclude_deprecated = false)
1818

1919
## object methods
2020
skiplist=[:create_closure,:activate_cell,:event,:start_editing,:filter_keypress,:append_node,:im_context_filter_keypress,:get_backlog,:get,:get_default,:get_for_display,:get_current_event_state,:get_axes,:append_fill,:append_stroke,:push_fill,:push_stroke]

src/buttons.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ end
5353

5454
## GtkSwitch
5555

56+
"""
57+
GtkSwitch(active = false; kwargs...)
58+
59+
Create a `GtkSwitch` widget set to the on position if `active` is `true`.
60+
"""
5661
function GtkSwitch(active::Bool; kwargs...)
5762
b = GtkSwitch(; kwargs...)
5863
G_.set_active(b, active)

src/displays.jl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,46 @@ end
2323

2424
# GtkImage (for fixed-size images, such as icons)
2525

26+
@doc """
27+
GtkImage(; kwargs...)
28+
GtkImage(image::GdkPixbuf; kwargs...)
29+
GtkImage(image::GdkPaintable; kwargs...)
30+
GtkImage(image::GIcon; kwargs...)
31+
32+
Create a `GtkImage` widget, which displays an image as an icon. If an `image`
33+
is provided it will be displayed. Keyword arguments allow you to set GObject
34+
properties.
35+
36+
GtkImage(filename::AbstractString; kwargs...)
37+
38+
Try to load an image from a file and create a `GtkImage` displaying it.
39+
40+
See also the [GTK docs](https://docs.gtk.org/gtk4/class.Picture.html).
41+
""" GtkImage
42+
2643
GtkImage(::Nothing; kwargs...) = error("Ambiguous argument for constructor, please directly call one of the constructors in G_.")
2744
empty!(img::GtkImage) = (G_.clear(img); img)
2845

2946
# GtkPicture (for displaying an image at its natural size)
3047

48+
@doc """
49+
GtkPicture(; kwargs...)
50+
GtkPicture(image::GdkPixbuf; kwargs...)
51+
GtkPicture(image::GdkPaintable; kwargs...)
52+
53+
Create a `GtkPicture` widget, which displays an image at its natural size. If
54+
an `image` is provided it will be displayed. Keyword arguments allow you to
55+
set GObject properties.
56+
57+
GtkPicture(filename::AbstractString; kwargs...)
58+
GtkPicture(file::GFile; kwargs...)
59+
60+
Try to load an image from a file and create a `GtkPicture` displaying it.
61+
62+
See also the [GTK docs](https://docs.gtk.org/gtk4/class.Picture.html).
63+
""" GtkPicture
64+
65+
3166
GtkPicture(::Nothing; kwargs...) = error("Ambiguous argument for constructor, please directly call one of the constructors in G_.")
3267

3368
GtkVideo(::Nothing; kwargs...) = error("Ambiguous argument for constructor, please directly call one of the constructors in G_.")
@@ -36,10 +71,33 @@ GtkVideo(::Nothing; kwargs...) = error("Ambiguous argument for constructor, plea
3671

3772
## GtkProgressBar
3873

74+
@doc """
75+
GtkProgressBar(; kwargs...)
76+
77+
Create a `GtkProgressBar`, which shows a progress bar and optionally a text
78+
label. Keyword arguments allow you to set GObject properties.
79+
80+
The method or property `fraction` can be used to set or get the fraction of
81+
the operation that is complete (it must be between 0 and 1).
82+
83+
See also the [GTK docs](https://docs.gtk.org/gtk4/class.ProgressBar.html).
84+
""" GtkProgressBar
85+
3986
pulse(progress::GtkProgressBar) = G_.pulse(progress)
4087

4188
## GtkSpinner
4289

90+
@doc """
91+
GtkSpinner(; kwargs...)
92+
93+
Create a `GtkSpinner`, which optionally shows a spinning icon to indicate to
94+
the user that some operation is running. The state of the widget can be
95+
controlled through the property "spinning" or using the methods `start` and
96+
`stop`. Keyword arguments allow you to set GObject properties.
97+
98+
See also the [GTK docs](https://docs.gtk.org/gtk4/class.Spinner.html).
99+
""" GtkSpinner
100+
43101
"""
44102
start(spinner::GtkSpinner)
45103

src/gen/gdk4_methods

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,9 +2129,8 @@ begin
21292129
ret = ccall(("gdk_memory_texture_builder_set_bytes", libgtk4), Nothing, (Ptr{GObject}, Ptr{GBytes}), instance, _bytes_maybe)
21302130
nothing
21312131
end
2132-
function set_color_state(instance::GdkMemoryTextureBuilder, _color_state::Maybe(GdkColorState))
2133-
_color_state_maybe = nothing_to_null(_color_state)
2134-
ret = ccall(("gdk_memory_texture_builder_set_color_state", libgtk4), Nothing, (Ptr{GObject}, Ptr{GdkColorState}), instance, _color_state_maybe)
2132+
function set_color_state(instance::GdkMemoryTextureBuilder, _color_state::GdkColorState)
2133+
ret = ccall(("gdk_memory_texture_builder_set_color_state", libgtk4), Nothing, (Ptr{GObject}, Ptr{GdkColorState}), instance, _color_state)
21352134
nothing
21362135
end
21372136
function set_format(instance::GdkMemoryTextureBuilder, _format)

src/gen/glib_consts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const MAXUINT16 = 0xffff
7979
const MAXUINT32 = 0xffffffff
8080
const MAXUINT64 = 0xffffffffffffffff
8181
const MAXUINT8 = 0xff
82-
const MICRO_VERSION = 2
82+
const MICRO_VERSION = 3
8383
const MININT16 = -32768
8484
const MININT32 = -2147483648
8585
const MININT64 = -9223372036854775808

src/gen/gtk4_consts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ const ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS = "title-caps"
3434
const ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE = "unicase"
3535
const ACCESSIBLE_ATTRIBUTE_WEIGHT = "weight"
3636
const ACCESSIBLE_VALUE_UNDEFINED = -1
37-
const BINARY_AGE = 1805
37+
const BINARY_AGE = 1806
3838
const IM_MODULE_EXTENSION_POINT_NAME = "gtk-im-module"
3939
const INPUT_ERROR = -1
40-
const INTERFACE_AGE = 5
40+
const INTERFACE_AGE = 6
4141
const INVALID_LIST_POSITION = 0xffffffff
4242
const LEVEL_BAR_OFFSET_FULL = "full"
4343
const LEVEL_BAR_OFFSET_HIGH = "high"
4444
const LEVEL_BAR_OFFSET_LOW = "low"
4545
const MAJOR_VERSION = 4
4646
const MAX_COMPOSE_LEN = 7
4747
const MEDIA_FILE_EXTENSION_POINT_NAME = "gtk-media-file"
48-
const MICRO_VERSION = 5
48+
const MICRO_VERSION = 6
4949
const MINOR_VERSION = 18
5050
const PAPER_NAME_A3 = "iso_a3"
5151
const PAPER_NAME_A4 = "iso_a4"

src/gen/gtk4_structs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6947,7 +6947,6 @@ begin
69476947
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GestureSwipe.html)." GtkGestureSwipe
69486948
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GestureZoom.html)." GtkGestureZoom
69496949
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GraphicsOffload.html)." GtkGraphicsOffload
6950-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Grid.html)." GtkGrid
69516950
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GridLayout.html)." GtkGridLayout
69526951
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GridLayoutChild.html)." GtkGridLayoutChild
69536952
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.GridView.html)." GtkGridView
@@ -6958,7 +6957,6 @@ begin
69586957
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.IconPaintable.html)." GtkIconPaintable
69596958
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.IconTheme.html)." GtkIconTheme
69606959
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.IconView.html)." GtkIconView
6961-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Image.html)." GtkImage
69626960
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.InfoBar.html)." GtkInfoBar
69636961
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Inscription.html)." GtkInscription
69646962
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.KeyvalTrigger.html)." GtkKeyvalTrigger
@@ -6992,7 +6990,6 @@ begin
69926990
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NativeDialog.html)." GtkNativeDialog
69936991
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NeverTrigger.html)." GtkNeverTrigger
69946992
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NoSelection.html)." GtkNoSelection
6995-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Notebook.html)." GtkNotebook
69966993
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NotebookPage.html)." GtkNotebookPage
69976994
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NothingAction.html)." GtkNothingAction
69986995
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.NumericSorter.html)." GtkNumericSorter
@@ -7005,7 +7002,6 @@ begin
70057002
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Paned.html)." GtkPaned
70067003
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PasswordEntry.html)." GtkPasswordEntry
70077004
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PasswordEntryBuffer.html)." GtkPasswordEntryBuffer
7008-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Picture.html)." GtkPicture
70097005
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Popover.html)." GtkPopover
70107006
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PopoverMenu.html)." GtkPopoverMenu
70117007
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PopoverMenuBar.html)." GtkPopoverMenuBar
@@ -7015,7 +7011,6 @@ begin
70157011
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PrintOperation.html)." GtkPrintOperation
70167012
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PrintSettings.html)." GtkPrintSettings
70177013
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Printer.html)." GtkPrinter
7018-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.ProgressBar.html)." GtkProgressBar
70197014
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.PropertyExpression.html)." GtkPropertyExpression
70207015
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Range.html)." GtkRange
70217016
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.RecentManager.html)." GtkRecentManager
@@ -7046,12 +7041,7 @@ begin
70467041
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Snapshot.html)." GtkSnapshot
70477042
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.SortListModel.html)." GtkSortListModel
70487043
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Sorter.html)." GtkSorter
7049-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.SpinButton.html)." GtkSpinButton
7050-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Spinner.html)." GtkSpinner
7051-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Stack.html)." GtkStack
70527044
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.StackPage.html)." GtkStackPage
7053-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.StackSidebar.html)." GtkStackSidebar
7054-
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.StackSwitcher.html)." GtkStackSwitcher
70557045
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.Statusbar.html)." GtkStatusbar
70567046
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.StringFilter.html)." GtkStringFilter
70577047
@doc "See the [GTK docs](https://docs.gtk.org/gtk4/class.StringList.html)." GtkStringList

src/gen/pango_consts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const GLYPH_INVALID_INPUT = 0xffffffff
88
const GLYPH_UNKNOWN_FLAG = 0x10000000
99
const SCALE = 1024
1010
const VERSION_MAJOR = 1
11-
const VERSION_MICRO = 3
11+
const VERSION_MICRO = 4
1212
const VERSION_MINOR = 56
13-
const VERSION_STRING = "1.56.3"
13+
const VERSION_STRING = "1.56.4"
1414
@cenum(Alignment::Int32, Alignment_LEFT = 0, Alignment_CENTER = 1, Alignment_RIGHT = 2)
1515
(GLib.g_type(::Type{T}) where T <: Alignment) = ccall(("pango_alignment_get_type", libpango), GType, ())
1616
@cenum(AttrType::Int32, AttrType_INVALID = 0, AttrType_LANGUAGE = 1, AttrType_FAMILY = 2, AttrType_STYLE = 3, AttrType_WEIGHT = 4, AttrType_VARIANT = 5, AttrType_STRETCH = 6, AttrType_SIZE = 7, AttrType_FONT_DESC = 8, AttrType_FOREGROUND = 9, AttrType_BACKGROUND = 10, AttrType_UNDERLINE = 11, AttrType_STRIKETHROUGH = 12, AttrType_RISE = 13, AttrType_SHAPE = 14, AttrType_SCALE = 15, AttrType_FALLBACK = 16, AttrType_LETTER_SPACING = 17, AttrType_UNDERLINE_COLOR = 18, AttrType_STRIKETHROUGH_COLOR = 19, AttrType_ABSOLUTE_SIZE = 20, AttrType_GRAVITY = 21, AttrType_GRAVITY_HINT = 22, AttrType_FONT_FEATURES = 23, AttrType_FOREGROUND_ALPHA = 24, AttrType_BACKGROUND_ALPHA = 25, AttrType_ALLOW_BREAKS = 26, AttrType_SHOW = 27, AttrType_INSERT_HYPHENS = 28, AttrType_OVERLINE = 29, AttrType_OVERLINE_COLOR = 30, AttrType_LINE_HEIGHT = 31, AttrType_ABSOLUTE_LINE_HEIGHT = 32, AttrType_TEXT_TRANSFORM = 33, AttrType_WORD = 34, AttrType_SENTENCE = 35, AttrType_BASELINE_SHIFT = 36, AttrType_FONT_SCALE = 37)

src/gen/pango_functions

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,17 @@ begin
221221
_attrs = collect(unsafe_wrap(Vector{_PangoLogAttr}, _attrs, m_attrs_len[]))
222222
_attrs
223223
end
224-
function extents_to_pixels(_inclusive::Maybe(PangoRectangleLike), _nearest::Maybe(PangoRectangleLike))
225-
_inclusive_maybe = nothing_to_null(_inclusive)
226-
_nearest_maybe = nothing_to_null(_nearest)
227-
ret = ccall(("pango_extents_to_pixels", libpango), Nothing, (Ptr{_PangoRectangle}, Ptr{_PangoRectangle}), _inclusive_maybe, _nearest_maybe)
228-
nothing
224+
function extents_to_pixels(_inclusive::_PangoRectangle, _nearest::_PangoRectangle)
225+
m_inclusive = Ref{_PangoRectangle}()
226+
m_inclusive[] = Base.cconvert(_PangoRectangle, _inclusive)
227+
m_nearest = Ref{_PangoRectangle}()
228+
m_nearest[] = Base.cconvert(_PangoRectangle, _nearest)
229+
ret = ccall(("pango_extents_to_pixels", libpango), Nothing, (Ptr{_PangoRectangle}, Ptr{_PangoRectangle}), m_inclusive, m_nearest)
230+
_inclusive = m_inclusive[]
231+
_inclusive = convert(_PangoRectangle, _inclusive)
232+
_nearest = m_nearest[]
233+
_nearest = convert(_PangoRectangle, _nearest)
234+
(_inclusive, _nearest)
229235
end
230236
function find_base_dir(_text::Union{AbstractString, Symbol}, _length::Integer)
231237
ret = ccall(("pango_find_base_dir", libpango), UInt32, (Cstring, Int32), _text, _length)

0 commit comments

Comments
 (0)