Skip to content
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

groovy update: regenerate #19

Merged
merged 45 commits into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e280a6
groovy update: regenerate
bilelmoussaoui Oct 9, 2020
69073bd
gir: port to new builders syntax
bilelmoussaoui Oct 9, 2020
393e856
gir: remove removed types
bilelmoussaoui Oct 9, 2020
7192518
generate window handle/controls
bilelmoussaoui Oct 9, 2020
58ed2f5
generate a18y types
bilelmoussaoui Oct 9, 2020
afd281f
generate constraints types
bilelmoussaoui Oct 9, 2020
efa1e4a
generate shortcut types
bilelmoussaoui Oct 9, 2020
0d8326a
generate popover types
bilelmoussaoui Oct 9, 2020
ed43575
generate listview types
bilelmoussaoui Oct 9, 2020
42bd1d5
generate column view types
bilelmoussaoui Oct 9, 2020
c44415d
generate grid view types
bilelmoussaoui Oct 9, 2020
46f4779
generate action types
bilelmoussaoui Oct 9, 2020
c05b682
generate filter types
bilelmoussaoui Oct 9, 2020
ba01ccb
generate missing lists
bilelmoussaoui Oct 9, 2020
6c4a683
add missing manual types
bilelmoussaoui Oct 9, 2020
e6c04f4
generate sorter types
bilelmoussaoui Oct 9, 2020
af5fb72
generate expression types
bilelmoussaoui Oct 9, 2020
bf546c9
generate missing layouts
bilelmoussaoui Oct 9, 2020
ec65823
generate emoji chooser
bilelmoussaoui Oct 9, 2020
9cdda98
generate missing drag/drop types
bilelmoussaoui Oct 9, 2020
8e6d20b
generate missing css enums
bilelmoussaoui Oct 9, 2020
8ea37c2
generate selection types
bilelmoussaoui Oct 9, 2020
2a929a7
generate bitset & native types
bilelmoussaoui Oct 9, 2020
2ca0aa3
generate more missing types
bilelmoussaoui Oct 9, 2020
35a56b8
generate missing triggers
bilelmoussaoui Oct 9, 2020
4859b13
generate more missing types
bilelmoussaoui Oct 9, 2020
dea7225
generate tree expander
bilelmoussaoui Oct 9, 2020
2471d28
generate missing builder/buildable types
bilelmoussaoui Oct 9, 2020
4707e29
add missing manual gdk type
bilelmoussaoui Oct 9, 2020
3145cf8
re-generate missing builders
bilelmoussaoui Oct 9, 2020
cfb6cdf
gir: resort & regen
bilelmoussaoui Oct 9, 2020
68c3cc8
make it compile
bilelmoussaoui Oct 11, 2020
9d8ce2f
manual: add gio::Application
bilelmoussaoui Oct 11, 2020
338f6f2
gir: fix gir_check tests
bilelmoussaoui Oct 11, 2020
6558d02
enable v2_66 features & regen
bilelmoussaoui Oct 16, 2020
efe44ef
cargo: use gdk from gtk-rs
bilelmoussaoui Oct 19, 2020
da625df
CI: use a custom image
bilelmoussaoui Oct 19, 2020
1283745
Gir: add missing manual traits
bilelmoussaoui Oct 19, 2020
563e666
rt: remove unneded unsafe blocks
bilelmoussaoui Oct 19, 2020
590ab71
Cargo: use gsk from gtk-rs
bilelmoussaoui Oct 19, 2020
a26645c
re-add gsk::ColorStop
bilelmoussaoui Oct 19, 2020
d1e7aa6
re-add ShortcutTrigger
bilelmoussaoui Oct 19, 2020
308aa93
add ShortcutsShortcut
bilelmoussaoui Oct 19, 2020
86afd71
StringObject: get_string's return isn't nullable
bilelmoussaoui Oct 21, 2020
15d018a
disable *Expression types for now
bilelmoussaoui Oct 21, 2020
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
8 changes: 8 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ generate = [
"Gtk.BorderStyle",
"Gtk.BoxLayout",
"Gtk.Buildable",
"Gtk.BuilderScope",
"Gtk.BuilderError",
"Gtk.ButtonsType",
"Gtk.CellAreaContext",
Expand Down Expand Up @@ -70,6 +71,12 @@ generate = [
"Gtk.DeleteType",
"Gtk.DialogFlags",
"Gtk.DirectionType",
"Gtk.BookmarkList",
"Gtk.BuilderListItemFactory",
"Gtk.DirectoryList",
"Gtk.SignalListItemFactory",
"Gtk.StringList",
"Gtk.TreeListRowSorter",
"Gtk.EditableProperties",
"Gtk.EntryIconPosition",
"Gtk.EventController",
Expand Down Expand Up @@ -280,6 +287,7 @@ manual = [
"Gio.MenuModel",
"Gio.MountOperation",
"Gio.Permission",
"GLib.Bytes",
"GLib.Error",
"GLib.KeyFile",
"GLib.MarkupParser",
Expand Down
201 changes: 201 additions & 0 deletions src/auto/bookmark_list.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use gio;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gtk_sys;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;

glib_wrapper! {
pub struct BookmarkList(Object<gtk_sys::GtkBookmarkList, gtk_sys::GtkBookmarkListClass, BookmarkListClass>) @implements gio::ListModel;

match fn {
get_type => || gtk_sys::gtk_bookmark_list_get_type(),
}
}

impl BookmarkList {
pub fn new(filename: Option<&str>, attributes: Option<&str>) -> BookmarkList {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gtk_sys::gtk_bookmark_list_new(
filename.to_glib_none().0,
attributes.to_glib_none().0,
))
}
}
}

pub const NONE_BOOKMARK_LIST: Option<&BookmarkList> = None;

pub trait BookmarkListExt: 'static {
fn get_attributes(&self) -> Option<GString>;

fn get_filename(&self) -> Option<GString>;

fn get_io_priority(&self) -> i32;

fn is_loading(&self) -> bool;

fn set_attributes(&self, attributes: Option<&str>);

fn set_io_priority(&self, io_priority: i32);

fn get_property_loading(&self) -> bool;

fn connect_property_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

fn connect_property_io_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

fn connect_property_loading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}

impl<O: IsA<BookmarkList>> BookmarkListExt for O {
fn get_attributes(&self) -> Option<GString> {
unsafe {
from_glib_none(gtk_sys::gtk_bookmark_list_get_attributes(
self.as_ref().to_glib_none().0,
))
}
}

fn get_filename(&self) -> Option<GString> {
unsafe {
from_glib_none(gtk_sys::gtk_bookmark_list_get_filename(
self.as_ref().to_glib_none().0,
))
}
}

fn get_io_priority(&self) -> i32 {
unsafe { gtk_sys::gtk_bookmark_list_get_io_priority(self.as_ref().to_glib_none().0) }
}

fn is_loading(&self) -> bool {
unsafe {
from_glib(gtk_sys::gtk_bookmark_list_is_loading(
self.as_ref().to_glib_none().0,
))
}
}

fn set_attributes(&self, attributes: Option<&str>) {
unsafe {
gtk_sys::gtk_bookmark_list_set_attributes(
self.as_ref().to_glib_none().0,
attributes.to_glib_none().0,
);
}
}

fn set_io_priority(&self, io_priority: i32) {
unsafe {
gtk_sys::gtk_bookmark_list_set_io_priority(self.as_ref().to_glib_none().0, io_priority);
}
}

fn get_property_loading(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"loading\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `loading` getter")
.unwrap()
}
}

fn connect_property_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_attributes_trampoline<P, F: Fn(&P) + 'static>(
this: *mut gtk_sys::GtkBookmarkList,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BookmarkList>,
{
let f: &F = &*(f as *const F);
f(&BookmarkList::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::attributes\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_attributes_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

fn connect_property_io_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_io_priority_trampoline<P, F: Fn(&P) + 'static>(
this: *mut gtk_sys::GtkBookmarkList,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BookmarkList>,
{
let f: &F = &*(f as *const F);
f(&BookmarkList::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::io-priority\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_io_priority_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}

fn connect_property_loading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_loading_trampoline<P, F: Fn(&P) + 'static>(
this: *mut gtk_sys::GtkBookmarkList,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BookmarkList>,
{
let f: &F = &*(f as *const F);
f(&BookmarkList::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::loading\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_loading_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

impl fmt::Display for BookmarkList {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "BookmarkList")
}
}
18 changes: 12 additions & 6 deletions src/auto/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
use std::ptr;
use BuilderScope;

glib_wrapper! {
pub struct Builder(Object<gtk_sys::GtkBuilder, gtk_sys::GtkBuilderClass, BuilderClass>);
Expand Down Expand Up @@ -183,9 +184,9 @@ impl Builder {
}
}

//pub fn get_scope(&self) -> /*Ignored*/Option<BuilderScope> {
// unsafe { TODO: call gtk_sys:gtk_builder_get_scope() }
//}
pub fn get_scope(&self) -> Option<BuilderScope> {
unsafe { from_glib_none(gtk_sys::gtk_builder_get_scope(self.to_glib_none().0)) }
}

pub fn get_translation_domain(&self) -> Option<GString> {
unsafe {
Expand Down Expand Up @@ -213,9 +214,14 @@ impl Builder {
}
}

//pub fn set_scope(&self, scope: /*Ignored*/Option<&BuilderScope>) {
// unsafe { TODO: call gtk_sys:gtk_builder_set_scope() }
//}
pub fn set_scope<P: IsA<BuilderScope>>(&self, scope: Option<&P>) {
unsafe {
gtk_sys::gtk_builder_set_scope(
self.to_glib_none().0,
scope.map(|p| p.as_ref()).to_glib_none().0,
);
}
}

pub fn set_translation_domain(&self, domain: Option<&str>) {
unsafe {
Expand Down
83 changes: 83 additions & 0 deletions src/auto/builder_list_item_factory.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gtk_sys;
use std::fmt;
use BuilderScope;
use ListItemFactory;

glib_wrapper! {
pub struct BuilderListItemFactory(Object<gtk_sys::GtkBuilderListItemFactory, gtk_sys::GtkBuilderListItemFactoryClass, BuilderListItemFactoryClass>) @extends ListItemFactory;

match fn {
get_type => || gtk_sys::gtk_builder_list_item_factory_get_type(),
}
}

impl BuilderListItemFactory {
pub fn from_bytes<P: IsA<BuilderScope>>(
scope: Option<&P>,
bytes: &glib::Bytes,
) -> BuilderListItemFactory {
assert_initialized_main_thread!();
unsafe {
ListItemFactory::from_glib_full(gtk_sys::gtk_builder_list_item_factory_new_from_bytes(
scope.map(|p| p.as_ref()).to_glib_none().0,
bytes.to_glib_none().0,
))
.unsafe_cast()
}
}

pub fn from_resource<P: IsA<BuilderScope>>(
scope: Option<&P>,
resource_path: &str,
) -> BuilderListItemFactory {
assert_initialized_main_thread!();
unsafe {
ListItemFactory::from_glib_full(
gtk_sys::gtk_builder_list_item_factory_new_from_resource(
scope.map(|p| p.as_ref()).to_glib_none().0,
resource_path.to_glib_none().0,
),
)
.unsafe_cast()
}
}

pub fn get_bytes(&self) -> Option<glib::Bytes> {
unsafe {
from_glib_none(gtk_sys::gtk_builder_list_item_factory_get_bytes(
self.to_glib_none().0,
))
}
}

pub fn get_resource(&self) -> Option<GString> {
unsafe {
from_glib_none(gtk_sys::gtk_builder_list_item_factory_get_resource(
self.to_glib_none().0,
))
}
}

pub fn get_scope(&self) -> Option<BuilderScope> {
unsafe {
from_glib_none(gtk_sys::gtk_builder_list_item_factory_get_scope(
self.to_glib_none().0,
))
}
}
}

impl fmt::Display for BuilderListItemFactory {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "BuilderListItemFactory")
}
}
28 changes: 28 additions & 0 deletions src/auto/builder_scope.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::object::IsA;
use glib::translate::*;
use gtk_sys;
use std::fmt;

glib_wrapper! {
pub struct BuilderScope(Interface<gtk_sys::GtkBuilderScope>);
bilelmoussaoui marked this conversation as resolved.
Show resolved Hide resolved

match fn {
get_type => || gtk_sys::gtk_builder_scope_get_type(),
}
}

pub const NONE_BUILDER_SCOPE: Option<&BuilderScope> = None;

pub trait BuilderScopeExt: 'static {}

impl<O: IsA<BuilderScope>> BuilderScopeExt for O {}

impl fmt::Display for BuilderScope {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "BuilderScope")
}
}
Loading