Skip to content

Commit

Permalink
enable libgsk methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed Nov 2, 2024
1 parent a8533a2 commit 5ad7e8c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 613 deletions.
11 changes: 7 additions & 4 deletions gen/gen_gsk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ GI.export_consts!(ns, path, "gsk4"; doc_xml = d, export_constants = false)

# These are marked as "disguised" and what this means is not documentated AFAICT.
disguised = Symbol[]
struct_skiplist=disguised
struct_skiplist=vcat(disguised, [:Path, :PathMeasure, :PathBuilder, :PathPoint, :Stroke])

GI.export_struct_exprs!(ns,path, "gsk4", struct_skiplist, [:RoundedRect]; doc_xml = d, output_boxed_cache_init = false, output_boxed_types_def = false, output_object_cache_define = false, output_object_cache_init = false, output_callbacks = false)
GI.export_methods!(ns,path,"gsk4"; struct_skiplist = struct_skiplist)
GI.export_functions!(ns,path,"gsk4")
object_skiplist=[:FillNode, :StrokeNode, :SubsurfaceNode]

GI.export_struct_exprs!(ns,path, "gsk4", struct_skiplist, [:RoundedRect]; doc_xml = d, output_boxed_cache_init = false, output_boxed_types_def = false, output_object_cache_define = false, output_object_cache_init = false, output_callbacks = false, object_skiplist = object_skiplist)

GI.export_methods!(ns,path,"gsk4"; struct_skiplist = struct_skiplist, object_skiplist = object_skiplist, object_method_skiplist = [:deserialize])
GI.export_functions!(ns,path,"gsk4"; skiplist = [:path_parse])
2 changes: 1 addition & 1 deletion gen/gen_gtk4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ obj_constructor_skiplist=[:new_from_resource,:new_with_mnemonic,:new_with_text,:
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)

## object methods
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]
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]

object_skiplist=vcat(object_skiplist,[:CellRenderer,:MnemonicAction,:NeverTrigger,:NothingAction,:PrintJob,:PrintSettings,:RecentManager])

Expand Down
4 changes: 3 additions & 1 deletion src/Gtk4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using Preferences

using Reexport
@reexport using Graphics
import .Graphics: width, height, getgc, scale
import .Graphics: width, height, getgc, scale, center, clip
import Cairo: destroy, text, status

eval(include("gen/gdk4_consts"))
Expand All @@ -54,6 +54,8 @@ using ..Gtk4

eval(include("gen/gdk4_methods"))
eval(include("gen/gdk4_functions"))
eval(include("gen/gsk4_methods"))
eval(include("gen/gsk4_functions"))
eval(include("gen/gtk4_methods"))
eval(include("gen/gtk4_functions"))

Expand Down
5 changes: 0 additions & 5 deletions src/gen/gsk4_functions
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
quote
$(Expr(:toplevel, quote
function path_parse(_string::Union{AbstractString, Symbol})
ret = ccall(("gsk_path_parse", libgtk4), Ptr{GskPath}, (Cstring,), _string)
ret2 = convert_if_not_null(GskPath, ret, true)
ret2
end
function serialization_error_quark()
ret = ccall(("gsk_serialization_error_quark", libgtk4), UInt32, ())
ret
Expand Down
427 changes: 0 additions & 427 deletions src/gen/gsk4_methods

Large diffs are not rendered by default.

157 changes: 1 addition & 156 deletions src/gen/gsk4_structs
Original file line number Diff line number Diff line change
Expand Up @@ -39,90 +39,6 @@ $(Expr(:toplevel, quote
const GskParseLocationLike = Union{Ref{_GskParseLocation}, GskParseLocation}
end
end
begin
mutable struct GskPath <: GBoxed
handle::Ptr{GskPath}
begin
(GLib.g_type(::Type{T}) where T <: GskPath) = begin
ccall(("gsk_path_get_type", libgtk4), GType, ())
end
function GskPath(ref::Ptr{T}, own::Bool = false) where T <: GBoxed
x = new(ref)
if own
finalizer(x) do x
GLib.delboxed(x)
end
end
x
end
push!(gboxed_types, GskPath)
end
end
const GskPathLike = GskPath
end
begin
mutable struct GskPathBuilder <: GBoxed
handle::Ptr{GskPathBuilder}
begin
(GLib.g_type(::Type{T}) where T <: GskPathBuilder) = begin
ccall(("gsk_path_builder_get_type", libgtk4), GType, ())
end
function GskPathBuilder(ref::Ptr{T}, own::Bool = false) where T <: GBoxed
x = new(ref)
if own
finalizer(x) do x
GLib.delboxed(x)
end
end
x
end
push!(gboxed_types, GskPathBuilder)
end
end
const GskPathBuilderLike = GskPathBuilder
end
begin
mutable struct GskPathMeasure <: GBoxed
handle::Ptr{GskPathMeasure}
begin
(GLib.g_type(::Type{T}) where T <: GskPathMeasure) = begin
ccall(("gsk_path_measure_get_type", libgtk4), GType, ())
end
function GskPathMeasure(ref::Ptr{T}, own::Bool = false) where T <: GBoxed
x = new(ref)
if own
finalizer(x) do x
GLib.delboxed(x)
end
end
x
end
push!(gboxed_types, GskPathMeasure)
end
end
const GskPathMeasureLike = GskPathMeasure
end
begin
mutable struct GskPathPoint <: GBoxed
handle::Ptr{GskPathPoint}
begin
(GLib.g_type(::Type{T}) where T <: GskPathPoint) = begin
ccall(("gsk_path_point_get_type", libgtk4), GType, ())
end
function GskPathPoint(ref::Ptr{T}, own::Bool = false) where T <: GBoxed
x = new(ref)
if own
finalizer(x) do x
GLib.delboxed(x)
end
end
x
end
push!(gboxed_types, GskPathPoint)
end
end
const GskPathPointLike = GskPathPoint
end
begin
mutable struct GskRoundedRect
handle::Ptr{GskRoundedRect}
Expand Down Expand Up @@ -171,27 +87,6 @@ $(Expr(:toplevel, quote
const GskShadowLike = Union{Ref{_GskShadow}, GskShadow}
end
end
begin
mutable struct GskStroke <: GBoxed
handle::Ptr{GskStroke}
begin
(GLib.g_type(::Type{T}) where T <: GskStroke) = begin
ccall(("gsk_stroke_get_type", libgtk4), GType, ())
end
function GskStroke(ref::Ptr{T}, own::Bool = false) where T <: GBoxed
x = new(ref)
if own
finalizer(x) do x
GLib.delboxed(x)
end
end
x
end
push!(gboxed_types, GskStroke)
end
end
const GskStrokeLike = GskStroke
end
begin
mutable struct GskTransform <: GBoxed
handle::Ptr{GskTransform}
Expand All @@ -215,14 +110,9 @@ $(Expr(:toplevel, quote
end
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.ColorStop.html)." GskColorStop
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.ParseLocation.html)." GskParseLocation
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.Path.html)." GskPath
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.PathBuilder.html)." GskPathBuilder
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.PathMeasure.html)." GskPathMeasure
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.PathPoint.html)." GskPathPoint
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.RoundedRect.html)." GskRoundedRect
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.ShaderArgsBuilder.html)." GskShaderArgsBuilder
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.Shadow.html)." GskShadow
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.Stroke.html)." GskStroke
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/struct.Transform.html)." GskTransform
begin
abstract type GskRenderNode <: GTypeInstance end
Expand Down Expand Up @@ -392,14 +282,6 @@ $(Expr(:toplevel, quote
handle::Ptr{GskRenderNode}
end
end
begin
abstract type GskFillNode <: GskRenderNode end
end
begin
mutable struct GskFillNodeLeaf <: GskFillNode
handle::Ptr{GskRenderNode}
end
end
begin
abstract type GskGLRenderer <: GskRenderer end
mutable struct GskGLRendererLeaf <: GskGLRenderer
Expand Down Expand Up @@ -562,22 +444,6 @@ $(Expr(:toplevel, quote
handle::Ptr{GskRenderNode}
end
end
begin
abstract type GskStrokeNode <: GskRenderNode end
end
begin
mutable struct GskStrokeNodeLeaf <: GskStrokeNode
handle::Ptr{GskRenderNode}
end
end
begin
abstract type GskSubsurfaceNode <: GskRenderNode end
end
begin
mutable struct GskSubsurfaceNodeLeaf <: GskSubsurfaceNode
handle::Ptr{GskRenderNode}
end
end
begin
abstract type GskTextNode <: GskRenderNode end
end
Expand Down Expand Up @@ -671,9 +537,6 @@ $(Expr(:toplevel, quote
function GskDebugNode(_child::GskRenderNode, _message::Union{AbstractString, Symbol})
G_.DebugNode_new(_child, _message)
end
function GskFillNode(_child::GskRenderNode, _path::GskPath, _fill_rule)
G_.FillNode_new(_child, _path, _fill_rule)
end
function GskGLRenderer()
G_.GLRenderer_new()
end
Expand Down Expand Up @@ -731,9 +594,6 @@ $(Expr(:toplevel, quote
function GskShadowNode(_child::GskRenderNode, _shadows)
G_.ShadowNode_new(_child, _shadows)
end
function GskStrokeNode(_child::GskRenderNode, _path::GskPath, _stroke::GskStroke)
G_.StrokeNode_new(_child, _path, _stroke)
end
function GskTextNode(_font::PangoFont, _glyphs::PangoGlyphStringLike, _color::GdkRGBALike, _offset::GraphenePointLike)
G_.TextNode_new(_font, _glyphs, _color, _offset)
end
Expand All @@ -749,21 +609,9 @@ $(Expr(:toplevel, quote
function GskVulkanRenderer()
G_.VulkanRenderer_new()
end
function GskPathBuilder()
G_.PathBuilder_new()
end
function GskPathMeasure(_path::GskPath)
G_.PathMeasure_new(_path)
end
function GskPathMeasure(_path::GskPath, _tolerance::Real)
G_.PathMeasure_new_with_tolerance(_path, _tolerance)
end
function GskShaderArgsBuilder(_shader::GskGLShader, _initial_values::Maybe(GBytes))
G_.ShaderArgsBuilder_new(_shader, _initial_values)
end
function GskStroke(_line_width::Real)
G_.Stroke_new(_line_width)
end
function GskTransform()
G_.Transform_new()
end
Expand All @@ -779,7 +627,6 @@ $(Expr(:toplevel, quote
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.ContainerNode.html)." GskContainerNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.CrossFadeNode.html)." GskCrossFadeNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.DebugNode.html)." GskDebugNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.FillNode.html)." GskFillNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.GLShader.html)." GskGLShader
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.GLShaderNode.html)." GskGLShaderNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.InsetShadowNode.html)." GskInsetShadowNode
Expand All @@ -795,13 +642,11 @@ $(Expr(:toplevel, quote
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.RepeatingRadialGradientNode.html)." GskRepeatingRadialGradientNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.RoundedClipNode.html)." GskRoundedClipNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.ShadowNode.html)." GskShadowNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.StrokeNode.html)." GskStrokeNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.SubsurfaceNode.html)." GskSubsurfaceNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.TextNode.html)." GskTextNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.TextureNode.html)." GskTextureNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.TextureScaleNode.html)." GskTextureScaleNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.TransformNode.html)." GskTransformNode
@doc "See the [GTK docs](https://docs.gtk.org/gsk4/class.VulkanRenderer.html)." GskVulkanRenderer
export GskColorStop, GskColorStopLike, _GskColorStop, GskParseLocation, GskParseLocationLike, _GskParseLocation, GskPath, GskPathBuilder, GskPathMeasure, GskPathPoint, GskRoundedRect, GskRoundedRectLike, _GskRoundedRect, GskShaderArgsBuilder, GskShadow, GskShadowLike, _GskShadow, GskStroke, GskTransform, GskBlendNode, GskBlendNodeLeaf, GskBlurNode, GskBlurNodeLeaf, GskBorderNode, GskBorderNodeLeaf, GskBroadwayRenderer, GskBroadwayRendererLeaf, GskCairoNode, GskCairoNodeLeaf, GskCairoRenderer, GskCairoRendererLeaf, GskClipNode, GskClipNodeLeaf, GskColorMatrixNode, GskColorMatrixNodeLeaf, GskColorNode, GskColorNodeLeaf, GskConicGradientNode, GskConicGradientNodeLeaf, GskContainerNode, GskContainerNodeLeaf, GskCrossFadeNode, GskCrossFadeNodeLeaf, GskDebugNode, GskDebugNodeLeaf, GskFillNode, GskFillNodeLeaf, GskGLRenderer, GskGLRendererLeaf, GskGLShader, GskGLShaderLeaf, GskGLShaderNode, GskGLShaderNodeLeaf, GskInsetShadowNode, GskInsetShadowNodeLeaf, GskLinearGradientNode, GskLinearGradientNodeLeaf, GskMaskNode, GskMaskNodeLeaf, GskNglRenderer, GskNglRendererLeaf, GskOpacityNode, GskOpacityNodeLeaf, GskOutsetShadowNode, GskOutsetShadowNodeLeaf, GskRadialGradientNode, GskRadialGradientNodeLeaf, GskRenderNode, GskRenderer, GskRepeatNode, GskRepeatNodeLeaf, GskRepeatingLinearGradientNode, GskRepeatingLinearGradientNodeLeaf, GskRepeatingRadialGradientNode, GskRepeatingRadialGradientNodeLeaf, GskRoundedClipNode, GskRoundedClipNodeLeaf, GskShadowNode, GskShadowNodeLeaf, GskStrokeNode, GskStrokeNodeLeaf, GskSubsurfaceNode, GskSubsurfaceNodeLeaf, GskTextNode, GskTextNodeLeaf, GskTextureNode, GskTextureNodeLeaf, GskTextureScaleNode, GskTextureScaleNodeLeaf, GskTransformNode, GskTransformNodeLeaf, GskVulkanRenderer, GskVulkanRendererLeaf
export GskColorStop, GskColorStopLike, _GskColorStop, GskParseLocation, GskParseLocationLike, _GskParseLocation, GskRoundedRect, GskRoundedRectLike, _GskRoundedRect, GskShaderArgsBuilder, GskShadow, GskShadowLike, _GskShadow, GskTransform, GskBlendNode, GskBlendNodeLeaf, GskBlurNode, GskBlurNodeLeaf, GskBorderNode, GskBorderNodeLeaf, GskBroadwayRenderer, GskBroadwayRendererLeaf, GskCairoNode, GskCairoNodeLeaf, GskCairoRenderer, GskCairoRendererLeaf, GskClipNode, GskClipNodeLeaf, GskColorMatrixNode, GskColorMatrixNodeLeaf, GskColorNode, GskColorNodeLeaf, GskConicGradientNode, GskConicGradientNodeLeaf, GskContainerNode, GskContainerNodeLeaf, GskCrossFadeNode, GskCrossFadeNodeLeaf, GskDebugNode, GskDebugNodeLeaf, GskGLRenderer, GskGLRendererLeaf, GskGLShader, GskGLShaderLeaf, GskGLShaderNode, GskGLShaderNodeLeaf, GskInsetShadowNode, GskInsetShadowNodeLeaf, GskLinearGradientNode, GskLinearGradientNodeLeaf, GskMaskNode, GskMaskNodeLeaf, GskNglRenderer, GskNglRendererLeaf, GskOpacityNode, GskOpacityNodeLeaf, GskOutsetShadowNode, GskOutsetShadowNodeLeaf, GskRadialGradientNode, GskRadialGradientNodeLeaf, GskRenderNode, GskRenderer, GskRepeatNode, GskRepeatNodeLeaf, GskRepeatingLinearGradientNode, GskRepeatingLinearGradientNodeLeaf, GskRepeatingRadialGradientNode, GskRepeatingRadialGradientNodeLeaf, GskRoundedClipNode, GskRoundedClipNodeLeaf, GskShadowNode, GskShadowNodeLeaf, GskTextNode, GskTextNodeLeaf, GskTextureNode, GskTextureNodeLeaf, GskTextureScaleNode, GskTextureScaleNodeLeaf, GskTransformNode, GskTransformNodeLeaf, GskVulkanRenderer, GskVulkanRendererLeaf
end))
end
6 changes: 3 additions & 3 deletions src/gen/gtk4_consts
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ $(Expr(:toplevel, quote
const ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE = "unicase"
const ACCESSIBLE_ATTRIBUTE_WEIGHT = "weight"
const ACCESSIBLE_VALUE_UNDEFINED = -1
const BINARY_AGE = 1404
const BINARY_AGE = 1405
const IM_MODULE_EXTENSION_POINT_NAME = "gtk-im-module"
const INPUT_ERROR = -1
const INTERFACE_AGE = 4
const INTERFACE_AGE = 5
const INVALID_LIST_POSITION = 0xffffffff
const LEVEL_BAR_OFFSET_FULL = "full"
const LEVEL_BAR_OFFSET_HIGH = "high"
const LEVEL_BAR_OFFSET_LOW = "low"
const MAJOR_VERSION = 4
const MAX_COMPOSE_LEN = 7
const MEDIA_FILE_EXTENSION_POINT_NAME = "gtk-media-file"
const MICRO_VERSION = 4
const MICRO_VERSION = 5
const MINOR_VERSION = 14
const PAPER_NAME_A3 = "iso_a3"
const PAPER_NAME_A4 = "iso_a4"
Expand Down
Loading

0 comments on commit 5ad7e8c

Please sign in to comment.