Skip to content

Commit

Permalink
Merge pull request #45 from vhdirk/master
Browse files Browse the repository at this point in the history
Regenerate with latest gir
  • Loading branch information
antoyo committed Jan 17, 2019
2 parents d940bc2 + 9ad94f5 commit 5937d58
Show file tree
Hide file tree
Showing 55 changed files with 1,956 additions and 1,380 deletions.
8 changes: 5 additions & 3 deletions examples/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern crate webkit2gtk;
#[cfg(feature = "v2_4")]
use glib::ToVariant;
use gtk::{ContainerExt, Inhibit, WidgetExt, Window, WindowType};
use webkit2gtk::{SettingsExt, WebContext, WebContextExt, WebView, WebViewExt, WebViewExtManual};
use webkit2gtk::{SettingsExt, WebContext, WebContextExt, WebView, WebViewExt};
#[cfg(feature = "v2_6")]
use webkit2gtk::UserContentManager;

Expand All @@ -53,8 +53,10 @@ fn main() {

window.show_all();

webview.run_javascript("alert('Hello');");
webview.run_javascript_with_callback("42", |result| {
webview.run_javascript("alert('Hello');", None::<&gio::Cancellable>, |_result|{});

let cancellable = gio::Cancellable::new();
webview.run_javascript("42", Some(&cancellable), |result| {
match result {
Ok(result) => {
let context = result.get_global_context().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion gir
Submodule gir updated 58 files
+11 −0 .travis.yml
+0 −53 Gir_Gio.toml
+0 −285 Gir_Gtk.toml
+20 −2 README.md
+37 −20 src/analysis/bounds.rs
+2 −2 src/analysis/child_properties.rs
+1 −0 src/analysis/conversion_type.rs
+2 −2 src/analysis/ffi_type.rs
+9 −16 src/analysis/function_parameters.rs
+28 −22 src/analysis/functions.rs
+1 −1 src/analysis/general.rs
+15 −21 src/analysis/object.rs
+6 −1 src/analysis/out_parameters.rs
+13 −9 src/analysis/properties.rs
+10 −9 src/analysis/record.rs
+1 −1 src/analysis/return_value.rs
+5 −3 src/analysis/rust_type.rs
+7 −6 src/analysis/signals.rs
+2 −2 src/analysis/signatures.rs
+1 −2 src/analysis/supertypes.rs
+1 −0 src/analysis/trampoline_parameters.rs
+2 −2 src/analysis/trampolines.rs
+18 −9 src/analysis/types.rs
+1 −1 src/chunk/mod.rs
+4 −3 src/codegen/child_properties.rs
+1 −1 src/codegen/doc/mod.rs
+33 −2 src/codegen/enums.rs
+2 −1 src/codegen/flags.rs
+13 −3 src/codegen/function.rs
+6 −20 src/codegen/function_body_chunk.rs
+92 −33 src/codegen/general.rs
+37 −32 src/codegen/object.rs
+2 −1 src/codegen/objects.rs
+73 −20 src/codegen/properties.rs
+26 −8 src/codegen/property_body.rs
+8 −5 src/codegen/return_value.rs
+3 −5 src/codegen/signal.rs
+9 −0 src/codegen/sys/build.rs
+1 −2 src/codegen/sys/cargo_toml.rs
+10 −4 src/codegen/sys/ffi_type.rs
+24 −1 src/codegen/sys/fields.rs
+18 −1 src/codegen/sys/functions.rs
+23 −15 src/codegen/sys/lib_.rs
+1 −1 src/codegen/sys/statics.rs
+54 −24 src/codegen/sys/tests.rs
+1 −1 src/codegen/trampoline.rs
+1 −1 src/codegen/trampoline_from_glib.rs
+6 −14 src/codegen/translate_from_glib.rs
+9 −2 src/codegen/translate_to_glib.rs
+9 −2 src/config/config.rs
+31 −4 src/config/gobjects.rs
+1 −1 src/config/mod.rs
+5 −6 src/lib.rs
+27 −14 src/library.rs
+0 −4 src/main.rs
+16 −1 src/nameutil.rs
+6 −3 src/parser.rs
+1 −1 src/writer/to_code.rs
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 5 files
+66 −66 Gtk-3.0.gir
+3 −3 PangoCairo-1.0.gir
+1 −1 cairo-1.0.gir
+1 −1 dl.sh
+10 −9 fix.sh
56 changes: 32 additions & 24 deletions src/auto/authentication_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,43 @@ use AuthenticationScheme;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use Credential;
use ffi;
use glib;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use glib::object::Downcast;
use glib::GString;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use glib::object::Cast;
use glib::object::IsA;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use glib::signal::SignalHandlerId;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use glib::signal::connect;
use glib::signal::connect_raw;
use glib::translate::*;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use glib_ffi;
use gobject_ffi;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use std::boxed::Box as Box_;
use std::mem;
use std::fmt;
#[cfg(any(feature = "v2_2", feature = "dox"))]
use std::mem::transmute;
use std::ptr;

glib_wrapper! {
pub struct AuthenticationRequest(Object<ffi::WebKitAuthenticationRequest, ffi::WebKitAuthenticationRequestClass>);
pub struct AuthenticationRequest(Object<ffi::WebKitAuthenticationRequest, ffi::WebKitAuthenticationRequestClass, AuthenticationRequestClass>);

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

pub trait AuthenticationRequestExt {
pub const NONE_AUTHENTICATION_REQUEST: Option<&AuthenticationRequest> = None;

pub trait AuthenticationRequestExt: 'static {
#[cfg(any(feature = "v2_2", feature = "dox"))]
fn can_save_credentials(&self) -> bool;

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn cancel(&self);

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_host(&self) -> Option<String>;
fn get_host(&self) -> Option<GString>;

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_port(&self) -> u32;
Expand All @@ -50,7 +52,7 @@ pub trait AuthenticationRequestExt {
fn get_proposed_credential(&self) -> Option<Credential>;

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_realm(&self) -> Option<String>;
fn get_realm(&self) -> Option<GString>;

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_scheme(&self) -> AuthenticationScheme;
Expand All @@ -65,75 +67,75 @@ pub trait AuthenticationRequestExt {
fn connect_cancelled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}

impl<O: IsA<AuthenticationRequest> + IsA<glib::object::Object>> AuthenticationRequestExt for O {
impl<O: IsA<AuthenticationRequest>> AuthenticationRequestExt for O {
#[cfg(any(feature = "v2_2", feature = "dox"))]
fn can_save_credentials(&self) -> bool {
unsafe {
from_glib(ffi::webkit_authentication_request_can_save_credentials(self.to_glib_none().0))
from_glib(ffi::webkit_authentication_request_can_save_credentials(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn cancel(&self) {
unsafe {
ffi::webkit_authentication_request_cancel(self.to_glib_none().0);
ffi::webkit_authentication_request_cancel(self.as_ref().to_glib_none().0);
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_host(&self) -> Option<String> {
fn get_host(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::webkit_authentication_request_get_host(self.to_glib_none().0))
from_glib_none(ffi::webkit_authentication_request_get_host(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_port(&self) -> u32 {
unsafe {
ffi::webkit_authentication_request_get_port(self.to_glib_none().0)
ffi::webkit_authentication_request_get_port(self.as_ref().to_glib_none().0)
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_proposed_credential(&self) -> Option<Credential> {
unsafe {
from_glib_full(ffi::webkit_authentication_request_get_proposed_credential(self.to_glib_none().0))
from_glib_full(ffi::webkit_authentication_request_get_proposed_credential(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_realm(&self) -> Option<String> {
fn get_realm(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::webkit_authentication_request_get_realm(self.to_glib_none().0))
from_glib_none(ffi::webkit_authentication_request_get_realm(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn get_scheme(&self) -> AuthenticationScheme {
unsafe {
from_glib(ffi::webkit_authentication_request_get_scheme(self.to_glib_none().0))
from_glib(ffi::webkit_authentication_request_get_scheme(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn is_for_proxy(&self) -> bool {
unsafe {
from_glib(ffi::webkit_authentication_request_is_for_proxy(self.to_glib_none().0))
from_glib(ffi::webkit_authentication_request_is_for_proxy(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn is_retry(&self) -> bool {
unsafe {
from_glib(ffi::webkit_authentication_request_is_retry(self.to_glib_none().0))
from_glib(ffi::webkit_authentication_request_is_retry(self.as_ref().to_glib_none().0))
}
}

#[cfg(any(feature = "v2_2", feature = "dox"))]
fn connect_cancelled<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, "cancelled",
connect_raw(self.as_ptr() as *mut _, b"cancelled\0".as_ptr() as *const _,
transmute(cancelled_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
Expand All @@ -143,5 +145,11 @@ impl<O: IsA<AuthenticationRequest> + IsA<glib::object::Object>> AuthenticationRe
unsafe extern "C" fn cancelled_trampoline<P>(this: *mut ffi::WebKitAuthenticationRequest, f: glib_ffi::gpointer)
where P: IsA<AuthenticationRequest> {
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&AuthenticationRequest::from_glib_borrow(this).downcast_unchecked())
f(&AuthenticationRequest::from_glib_borrow(this).unsafe_cast())
}

impl fmt::Display for AuthenticationRequest {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "AuthenticationRequest")
}
}
35 changes: 20 additions & 15 deletions src/auto/back_forward_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ use BackForwardListItem;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
use std::fmt;

glib_wrapper! {
pub struct BackForwardList(Object<ffi::WebKitBackForwardList, ffi::WebKitBackForwardListClass>);
pub struct BackForwardList(Object<ffi::WebKitBackForwardList, ffi::WebKitBackForwardListClass, BackForwardListClass>);

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

pub trait BackForwardListExt {
pub const NONE_BACK_FORWARD_LIST: Option<&BackForwardList> = None;

pub trait BackForwardListExt: 'static {
fn get_back_item(&self) -> Option<BackForwardListItem>;

fn get_back_list(&self) -> Vec<BackForwardListItem>;
Expand All @@ -44,59 +43,65 @@ pub trait BackForwardListExt {
impl<O: IsA<BackForwardList>> BackForwardListExt for O {
fn get_back_item(&self) -> Option<BackForwardListItem> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_get_back_item(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_get_back_item(self.as_ref().to_glib_none().0))
}
}

fn get_back_list(&self) -> Vec<BackForwardListItem> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_back_list(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_back_list(self.as_ref().to_glib_none().0))
}
}

fn get_back_list_with_limit(&self, limit: u32) -> Vec<BackForwardListItem> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_back_list_with_limit(self.to_glib_none().0, limit))
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_back_list_with_limit(self.as_ref().to_glib_none().0, limit))
}
}

fn get_current_item(&self) -> Option<BackForwardListItem> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_get_current_item(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_get_current_item(self.as_ref().to_glib_none().0))
}
}

fn get_forward_item(&self) -> Option<BackForwardListItem> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_get_forward_item(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_get_forward_item(self.as_ref().to_glib_none().0))
}
}

fn get_forward_list(&self) -> Vec<BackForwardListItem> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_forward_list(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_forward_list(self.as_ref().to_glib_none().0))
}
}

fn get_forward_list_with_limit(&self, limit: u32) -> Vec<BackForwardListItem> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_forward_list_with_limit(self.to_glib_none().0, limit))
FromGlibPtrContainer::from_glib_container(ffi::webkit_back_forward_list_get_forward_list_with_limit(self.as_ref().to_glib_none().0, limit))
}
}

fn get_length(&self) -> u32 {
unsafe {
ffi::webkit_back_forward_list_get_length(self.to_glib_none().0)
ffi::webkit_back_forward_list_get_length(self.as_ref().to_glib_none().0)
}
}

fn get_nth_item(&self, index: i32) -> Option<BackForwardListItem> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_get_nth_item(self.to_glib_none().0, index))
from_glib_none(ffi::webkit_back_forward_list_get_nth_item(self.as_ref().to_glib_none().0, index))
}
}

//fn connect_changed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Unimplemented items_removed: *.Pointer
//}
}

impl fmt::Display for BackForwardList {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "BackForwardList")
}
}
36 changes: 21 additions & 15 deletions src/auto/back_forward_list_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,51 @@
// DO NOT EDIT

use ffi;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
use std::fmt;

glib_wrapper! {
pub struct BackForwardListItem(Object<ffi::WebKitBackForwardListItem, ffi::WebKitBackForwardListItemClass>);
pub struct BackForwardListItem(Object<ffi::WebKitBackForwardListItem, ffi::WebKitBackForwardListItemClass, BackForwardListItemClass>);

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

pub trait BackForwardListItemExt {
fn get_original_uri(&self) -> Option<String>;
pub const NONE_BACK_FORWARD_LIST_ITEM: Option<&BackForwardListItem> = None;

fn get_title(&self) -> Option<String>;
pub trait BackForwardListItemExt: 'static {
fn get_original_uri(&self) -> Option<GString>;

fn get_uri(&self) -> Option<String>;
fn get_title(&self) -> Option<GString>;

fn get_uri(&self) -> Option<GString>;
}

impl<O: IsA<BackForwardListItem>> BackForwardListItemExt for O {
fn get_original_uri(&self) -> Option<String> {
fn get_original_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_item_get_original_uri(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_item_get_original_uri(self.as_ref().to_glib_none().0))
}
}

fn get_title(&self) -> Option<String> {
fn get_title(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_item_get_title(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_item_get_title(self.as_ref().to_glib_none().0))
}
}

fn get_uri(&self) -> Option<String> {
fn get_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::webkit_back_forward_list_item_get_uri(self.to_glib_none().0))
from_glib_none(ffi::webkit_back_forward_list_item_get_uri(self.as_ref().to_glib_none().0))
}
}
}

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

0 comments on commit 5937d58

Please sign in to comment.