Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #604 from GuillaumeGomez/new-types
Browse files Browse the repository at this point in the history
Generate new types
  • Loading branch information
GuillaumeGomez authored Dec 9, 2017
2 parents 6726936 + d793e7b commit 3172c37
Show file tree
Hide file tree
Showing 213 changed files with 2,551 additions and 226 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ git = "https://github.com/gtk-rs/gdk-pixbuf"

[dependencies.pango]
version = "0.3.0"
git = "https://github.com/gtk-rs/pango"
git = "https://github.com/gtk-rs/pango"
34 changes: 34 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ generate = [
"Gtk.Adjustment",
"Gtk.Align",
"Gtk.Alignment",
"Gtk.AppChooserButton",
"Gtk.AppChooserWidget",
"Gtk.ApplicationInhibitFlags",
"Gtk.ApplicationWindow",
Expand All @@ -23,6 +24,7 @@ generate = [
"Gtk.AssistantPageType",
"Gtk.BaselinePosition",
"Gtk.Bin",
"Gtk.BorderStyle",
"Gtk.BuilderError",
"Gtk.Button",
"Gtk.ButtonBox",
Expand Down Expand Up @@ -65,6 +67,7 @@ generate = [
"Gtk.FileChooserConfirmation",
"Gtk.FileChooserDialog",
"Gtk.FileChooserError",
"Gtk.FileChooserNative",
"Gtk.FileChooserWidget",
"Gtk.FileFilter",
"Gtk.FileFilterFlags",
Expand Down Expand Up @@ -94,6 +97,7 @@ generate = [
"Gtk.ImageMenuItem",
"Gtk.ImageType",
"Gtk.InfoBar",
"Gtk.Invisible",
"Gtk.IMMulticontext",
"Gtk.IMPreeditStyle",
"Gtk.IMStatusStyle",
Expand All @@ -106,6 +110,7 @@ generate = [
"Gtk.License",
"Gtk.ListBox",
"Gtk.ListBoxRow",
"Gtk.LockButton",
"Gtk.MenuBar",
"Gtk.MenuButton",
"Gtk.MenuDirectionType",
Expand All @@ -114,11 +119,17 @@ generate = [
"Gtk.MessageType",
"Gtk.Misc",
"Gtk.ModelButton",
"Gtk.MountOperation",
"Gtk.MovementStep",
"Gtk.NativeDialog",
"Gtk.NotebookTab",
"Gtk.NumberUpLayout",
"Gtk.OffscreenWindow",
"Gtk.Orientable",
"Gtk.Orientation",
# "Gtk.PadActionEntry", <- Missing memory management functions
"Gtk.PadActionType",
"Gtk.PadController",
"Gtk.PackDirection",
"Gtk.PackType",
"Gtk.PageOrientation",
Expand Down Expand Up @@ -194,6 +205,7 @@ generate = [
"Gtk.TextMark",
"Gtk.TextSearchFlags",
"Gtk.TextTagTable",
"Gtk.TextViewLayer",
"Gtk.TextWindowType",
"Gtk.ToggleButton",
"Gtk.ToggleToolButton",
Expand Down Expand Up @@ -273,6 +285,7 @@ manual = [
"Gio.Icon",
"Gio.Menu",
"Gio.MenuModel",
"Gio.MountOperation",
"Gio.Permission",
"GLib.Error",
"GLib.KeyFile",
Expand All @@ -282,6 +295,7 @@ manual = [
"GObject.Value",
"Gtk.Allocation",
"Gtk.AppChooser",
"Gtk.Border",
"Gtk.EntryBuffer",
"Gtk.RecentData",
"Gtk.Requisition",
Expand All @@ -306,6 +320,7 @@ manual = [
"Pango.Underline",
"Pango.Variant",
"Pango.WrapMode",
"xlib.Window",
]

[[object]]
Expand Down Expand Up @@ -615,6 +630,15 @@ status = "generate"
name = "path"
transformation = "treepath"

[[object]]
name = "Gtk.CellView"
status = "generate"
[[object.function]]
name = "set_displayed_row"
[[object.function.parameter]]
name = "path"
nullable = false

[[object]]
name = "Gtk.Clipboard"
status = "generate"
Expand Down Expand Up @@ -1113,6 +1137,11 @@ status = "generate"
#[gio::File]
ignore = true

[[object]]
name = "Gtk.Plug"
status = "generate"
cfg_condition = "not(windows)"

[[object]]
name = "Gtk.PrintContext"
status = "generate"
Expand Down Expand Up @@ -1288,6 +1317,11 @@ status = "generate"
#array without length
ignore = true

[[object]]
name = "Gtk.Socket"
status = "generate"
cfg_condition = "not(windows)"

[[object]]
name = "Gtk.SpinButton"
status = "generate"
Expand Down
2 changes: 1 addition & 1 deletion gir
2 changes: 1 addition & 1 deletion src/auto/about_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Bin;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/accel_group.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use ffi;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/action_bar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Bin;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/actionable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Buildable;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/adjustment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use ffi;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/alignment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Bin;
Expand Down
187 changes: 187 additions & 0 deletions src/auto/app_chooser_button.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use AppChooser;
use Bin;
use Buildable;
use CellEditable;
use CellLayout;
use ComboBox;
use Container;
use Widget;
use ffi;
use gio;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use libc;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use std::ptr;

glib_wrapper! {
pub struct AppChooserButton(Object<ffi::GtkAppChooserButton, ffi::GtkAppChooserButtonClass>): ComboBox, Bin, Container, Widget, Buildable, CellEditable, CellLayout, AppChooser;

match fn {
get_type => || ffi::gtk_app_chooser_button_get_type(),
}
}

impl AppChooserButton {
pub fn new(content_type: &str) -> AppChooserButton {
assert_initialized_main_thread!();
unsafe {
Widget::from_glib_none(ffi::gtk_app_chooser_button_new(content_type.to_glib_none().0)).downcast_unchecked()
}
}
}

pub trait AppChooserButtonExt {
fn append_custom_item<P: IsA<gio::Icon>>(&self, name: &str, label: &str, icon: &P);

fn append_separator(&self);

fn get_heading(&self) -> Option<String>;

fn get_show_default_item(&self) -> bool;

fn get_show_dialog_item(&self) -> bool;

fn set_active_custom_item(&self, name: &str);

fn set_heading(&self, heading: &str);

fn set_show_default_item(&self, setting: bool);

fn set_show_dialog_item(&self, setting: bool);

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

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

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

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

impl<O: IsA<AppChooserButton> + IsA<glib::object::Object>> AppChooserButtonExt for O {
fn append_custom_item<P: IsA<gio::Icon>>(&self, name: &str, label: &str, icon: &P) {
unsafe {
ffi::gtk_app_chooser_button_append_custom_item(self.to_glib_none().0, name.to_glib_none().0, label.to_glib_none().0, icon.to_glib_none().0);
}
}

fn append_separator(&self) {
unsafe {
ffi::gtk_app_chooser_button_append_separator(self.to_glib_none().0);
}
}

fn get_heading(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gtk_app_chooser_button_get_heading(self.to_glib_none().0))
}
}

fn get_show_default_item(&self) -> bool {
unsafe {
from_glib(ffi::gtk_app_chooser_button_get_show_default_item(self.to_glib_none().0))
}
}

fn get_show_dialog_item(&self) -> bool {
unsafe {
from_glib(ffi::gtk_app_chooser_button_get_show_dialog_item(self.to_glib_none().0))
}
}

fn set_active_custom_item(&self, name: &str) {
unsafe {
ffi::gtk_app_chooser_button_set_active_custom_item(self.to_glib_none().0, name.to_glib_none().0);
}
}

fn set_heading(&self, heading: &str) {
unsafe {
ffi::gtk_app_chooser_button_set_heading(self.to_glib_none().0, heading.to_glib_none().0);
}
}

fn set_show_default_item(&self, setting: bool) {
unsafe {
ffi::gtk_app_chooser_button_set_show_default_item(self.to_glib_none().0, setting.to_glib());
}
}

fn set_show_dialog_item(&self, setting: bool) {
unsafe {
ffi::gtk_app_chooser_button_set_show_dialog_item(self.to_glib_none().0, setting.to_glib());
}
}

fn connect_custom_item_activated<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &str) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "custom-item-activated",
transmute(custom_item_activated_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

fn connect_property_heading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::heading",
transmute(notify_heading_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

fn connect_property_show_default_item_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::show-default-item",
transmute(notify_show_default_item_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

fn connect_property_show_dialog_item_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::show-dialog-item",
transmute(notify_show_dialog_item_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}

unsafe extern "C" fn custom_item_activated_trampoline<P>(this: *mut ffi::GtkAppChooserButton, item_name: *mut libc::c_char, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P, &str) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(item_name))
}

unsafe extern "C" fn notify_heading_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_show_default_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}

unsafe extern "C" fn notify_show_dialog_item_trampoline<P>(this: *mut ffi::GtkAppChooserButton, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<AppChooserButton> {
callback_guard!();
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AppChooserButton::from_glib_borrow(this).downcast_unchecked())
}
2 changes: 1 addition & 1 deletion src/auto/app_chooser_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use AppChooser;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/app_chooser_widget.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use AppChooser;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/application.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use ApplicationInhibitFlags;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/application_window.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Application;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/arrow.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use ArrowType;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/aspect_frame.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (38add47) from gir-files (469db10)
// This file was generated by gir (8080733) from gir-files (469db10)
// DO NOT EDIT

use Bin;
Expand Down
Loading

0 comments on commit 3172c37

Please sign in to comment.