This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Gen more things #239
Merged
Merged
Gen more things #239
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gir
updated
5 files
+8 −0 | src/analysis/object.rs | |
+13 −0 | src/codegen/object.rs | |
+3 −0 | src/codegen/record.rs | |
+2 −1 | src/codegen/trampoline.rs | |
+134 −3 | src/library.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Generated by gir (https://github.com/gtk-rs/gir @ 464833e) | ||
Generated by gir (https://github.com/gtk-rs/gir @ d3116ca) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ b8f5ef1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2013-2018, The Gtk-rs Project Developers. | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> | ||
|
||
use libc; | ||
|
||
#[derive(Clone, Copy, Debug, PartialEq)] | ||
pub enum ChangeData<'a> { | ||
UChars(&'a [u8]), | ||
UShorts(&'a [u16]), | ||
ULongs(&'a [libc::c_ulong]), | ||
UChar(u8), | ||
UShort(u16), | ||
ULong(libc::c_ulong), | ||
} | ||
|
||
#[doc(hidden)] | ||
impl<'a> ChangeData<'a> { | ||
pub fn to_glib(&'a self) -> *const u8 { | ||
match *self { | ||
ChangeData::UChars(d) => d.as_ptr() as *const _, | ||
ChangeData::UShorts(d) => d.as_ptr() as *const _, | ||
ChangeData::ULongs(d) => d.as_ptr() as *const _, | ||
ChangeData::UChar(d) => &d as *const _ as *const _, | ||
ChangeData::UShort(d) => &d as *const _ as *const _, | ||
ChangeData::ULong(d) => &d as *const _ as *const _, | ||
} | ||
} | ||
|
||
pub fn len(&'a self) -> usize { | ||
match *self { | ||
ChangeData::UChars(d) => d.len(), | ||
ChangeData::UShorts(d) => d.len(), | ||
ChangeData::ULongs(d) => d.len(), | ||
ChangeData::UChar(_) | | ||
ChangeData::UShort(_) | | ||
ChangeData::ULong(_) => 1, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inner types don't need have
pub
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here no
u32
casesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u32/guint is not mentioned in the documentation of the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through uses of it, there seem to be more types possible than documented though:
https://sources.debian.org/src/gtk+2.0/2.24.31-2/gtk/gtkselection.c/?hl=2466#L2466
https://sources.debian.org/src/gtk+3.0/3.24.0-1/gdk/mir/gdkmirwindowimpl.c/?hl=1934#L1934
https://sources.debian.org/src/nautilus/3.26.3.1-1/src/nautilus-canvas-dnd.c/?hl=503#L503
This seems to allow arbitrary types, I'm not sure how this function is supposed to work safely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By limiting the number of entries. If we need more, we can always add them afterwards.
Woups... Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok then. Do we know of any code actually using this binding? How do they use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least I don't. I'll ask around.