Skip to content

Improve texture builder APIs #2046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions gdk4/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,19 @@ status = "generate"
name = "region"
const = true
[[object.function]]
pattern = "set_(color_state|display|fd|fourcc|height|modifier|n_planes|offset|premultiplied|stride|update_region|update_texture|width)"
# Take by value and return self
manual = true
[[object.function]]
pattern = "get_fd"
# Use BorrowedFd
manual = true
[[object.function]]
name = "build"
manual = true # Can't be auto-generated
[[object.property]]
pattern = "(color-state|display|fourcc|height|modifier|n-planes|premultiplied|update-region|update-texture|width)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are certain props here i would probably keep their getters as it can be quite useful for some cases. Eg, https://gitlab.gnome.org/GNOME/libmks/-/blob/main/lib/mks-dmabuf-paintable.c#L194

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The properties were just used for the notify signals. update-region (and everything else) has proper getters that are still there

generate = [] # ignore get/set/notify

[[object]]
name = "Gdk.Drag"
Expand Down Expand Up @@ -527,7 +538,8 @@ generate_builder = false
name = "region"
const = true
[[object.function]]
pattern = "set_(context|format|has_mipmap|height|id|update_region|update_texture|width)"
pattern = "set_(color_state|context|format|has_mipmap|height|id|update_region|update_texture|width)"
# Take by value and return self
manual = true
[[object.function]]
pattern = "(set|get)_sync"
Expand All @@ -536,7 +548,7 @@ generate_builder = false
name = "build"
manual = true
[[object.property]]
pattern = "(context|format|has-mipmap|height|id|sync|update-region|update-texture|width)"
pattern = "(color-state|context|format|has-mipmap|height|id|sync|update-region|update-texture|width)"
generate = [] # ignore get/set/notify

[[object]]
Expand Down Expand Up @@ -576,6 +588,13 @@ concurrency = "send+sync"
[[object.function.parameter]]
name = "region"
const = true
[[object.function]]
pattern = "set_(bytes|color_state|format|height|offset|stride|stride_for_plane|update_region|update_texture|width)"
# Take by value and return self
manual = true
[[object.property]]
pattern = "(bytes|color-state|format|height|stride|update-region|update-texture|width)"
generate = [] # ignore get/set/notify

[[object]]
name = "Gdk.Monitor"
Expand Down
Loading
Loading