This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #746 from pbor/backport-0.15
Backport stuff for 0.15
- Loading branch information
Showing
25 changed files
with
127 additions
and
23 deletions.
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
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
Submodule gir
updated
27 files
+6 −6 | Cargo.lock | |
+4 −0 | book/book.toml | |
+5 −0 | book/src/config_api.md | |
+5 −5 | book/src/tutorial/high_level_rust_api.md | |
+4 −4 | book/src/tutorial/sys_library.md | |
+1 −1 | src/analysis/enums.rs | |
+1 −1 | src/analysis/flags.rs | |
+17 −5 | src/analysis/functions.rs | |
+1 −1 | src/analysis/mod.rs | |
+7 −7 | src/analysis/object.rs | |
+1 −1 | src/analysis/record.rs | |
+2 −2 | src/analysis/special_functions.rs | |
+1 −1 | src/codegen/doc/format.rs | |
+77 −23 | src/codegen/doc/gi_docgen.rs | |
+6 −0 | src/codegen/doc/mod.rs | |
+20 −0 | src/codegen/enums.rs | |
+21 −0 | src/codegen/flags.rs | |
+2 −1 | src/codegen/function.rs | |
+64 −1 | src/codegen/mod.rs | |
+11 −0 | src/codegen/object.rs | |
+2 −0 | src/codegen/signal_body.rs | |
+2 −0 | src/codegen/sys/tests.rs | |
+8 −0 | src/config/gobjects.rs | |
+1 −0 | src/library.rs | |
+1 −1 | src/library_postprocessing.rs | |
+4 −4 | src/nameutil.rs | |
+3 −0 | src/parser.rs |
Submodule gir-files
updated
14 files
+3 −3 | Atk-1.0.gir | |
+542 −142 | GLib-2.0.gir | |
+2 −2 | GModule-2.0.gir | |
+74 −20 | GObject-2.0.gir | |
+16 −1 | Gdk-3.0.gir | |
+46 −2 | Gdk-4.0.gir | |
+2 −2 | GdkPixbuf-2.0.gir | |
+3 −0 | GdkX11-3.0.gir | |
+251 −104 | Gio-2.0.gir | |
+6 −0 | Graphene-1.0.gir | |
+4 −4 | Gsk-4.0.gir | |
+4 −4 | Gtk-3.0.gir | |
+190 −76 | Gtk-4.0.gir | |
+2 −2 | Pango-1.0.gir |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Take a look at the license at the top of the repository in the LICENSE file. | ||
|
||
use glib::subclass::prelude::*; | ||
use glib::translate::*; | ||
use glib::Cast; | ||
|
||
use super::widget::WidgetImpl; | ||
use crate::Entry; | ||
use crate::Widget; | ||
|
||
pub trait EntryImpl: EntryImplExt + WidgetImpl { | ||
fn populate_popup(&self, entry: &Self::Type, popup: &Widget) { | ||
self.parent_populate_popup(entry, popup) | ||
} | ||
|
||
fn activate(&self, entry: &Self::Type) { | ||
self.parent_activate(entry) | ||
} | ||
} | ||
|
||
pub trait EntryImplExt: ObjectSubclass { | ||
fn parent_populate_popup(&self, entry: &Self::Type, popup: &Widget); | ||
fn parent_activate(&self, entry: &Self::Type); | ||
} | ||
|
||
impl<T: EntryImpl> EntryImplExt for T { | ||
fn parent_populate_popup(&self, entry: &Self::Type, popup: &Widget) { | ||
unsafe { | ||
let data = T::type_data(); | ||
let parent_class = data.as_ref().parent_class() as *mut ffi::GtkEntryClass; | ||
if let Some(f) = (*parent_class).populate_popup { | ||
f( | ||
entry.unsafe_cast_ref::<Entry>().to_glib_none().0, | ||
popup.to_glib_none().0, | ||
) | ||
} | ||
} | ||
} | ||
|
||
fn parent_activate(&self, entry: &Self::Type) { | ||
unsafe { | ||
let data = T::type_data(); | ||
let parent_class = data.as_ref().parent_class() as *mut ffi::GtkEntryClass; | ||
if let Some(f) = (*parent_class).activate { | ||
f(entry.unsafe_cast_ref::<Entry>().to_glib_none().0) | ||
} | ||
} | ||
} | ||
} | ||
|
||
unsafe impl<T: EntryImpl> IsSubclassable<T> for Entry { | ||
fn class_init(class: &mut glib::Class<Self>) { | ||
Self::parent_class_init::<T>(class); | ||
|
||
if !crate::rt::is_initialized() { | ||
panic!("GTK has to be initialized first"); | ||
} | ||
|
||
let klass = class.as_mut(); | ||
klass.populate_popup = Some(entry_populate_popup::<T>); | ||
klass.activate = Some(entry_activate::<T>); | ||
} | ||
} | ||
|
||
unsafe extern "C" fn entry_populate_popup<T: EntryImpl>( | ||
ptr: *mut ffi::GtkEntry, | ||
popupptr: *mut ffi::GtkWidget, | ||
) { | ||
let instance = &*(ptr as *mut T::Instance); | ||
let imp = instance.imp(); | ||
let wrap: Borrowed<Entry> = from_glib_borrow(ptr); | ||
let popup: Borrowed<Widget> = from_glib_borrow(popupptr); | ||
|
||
imp.populate_popup(wrap.unsafe_cast_ref(), &popup) | ||
} | ||
|
||
unsafe extern "C" fn entry_activate<T: EntryImpl>(ptr: *mut ffi::GtkEntry) { | ||
let instance = &*(ptr as *mut T::Instance); | ||
let imp = instance.imp(); | ||
let wrap: Borrowed<Entry> = from_glib_borrow(ptr); | ||
|
||
imp.activate(wrap.unsafe_cast_ref()) | ||
} |
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 @ 78e3d3c22343) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 68003b4b40e5) | ||
Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d) | ||
from gir-files (https://github.com/gtk-rs/gir-files @ 75db22efb234) |
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 @@ | ||
edition = "2021" |