Skip to content

Commit

Permalink
Merge pull request tauri-apps#22 from antoyo/master
Browse files Browse the repository at this point in the history
Add new types
  • Loading branch information
GuillaumeGomez authored Sep 15, 2017
2 parents 85f0804 + f2784e1 commit d1e31c2
Show file tree
Hide file tree
Showing 55 changed files with 1,097 additions and 251 deletions.
14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webkit2gtk"
version = "0.2.1"
version = "0.2.2"
authors = ["The Gtk-rs Project Developers"]

categories = ["api-bindings", "gui"]
Expand Down Expand Up @@ -32,6 +32,18 @@ v2_16 = ["v2_14", "webkit2gtk-sys/v2_16"]
bitflags = "^0.9"
libc = "^0.2"

[dependencies.cairo-rs]
git = "https://github.com/gtk-rs/cairo"
version = "^0.2.0"

[dependencies.gdk]
git = "https://github.com/gtk-rs/gdk"
version = "^0.6.0"

[dependencies.gdk-sys]
git = "https://github.com/gtk-rs/sys"
version = "^0.4.0"

[dependencies.gio]
git = "https://github.com/gtk-rs/gio"
version = "^0.2.0"
Expand Down
43 changes: 41 additions & 2 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ external_libraries = [
]

generate = [
"WebKit2.AuthenticationRequest",
"WebKit2.AuthenticationScheme",
"WebKit2.BackForwardList",
"WebKit2.BackForwardListItem",
Expand All @@ -24,6 +23,7 @@ generate = [
"WebKit2.CookieAcceptPolicy",
"WebKit2.CookieManager",
"WebKit2.CookiePersistentStorage",
"WebKit2.Credential",
"WebKit2.CredentialPersistence",
"WebKit2.Download",
"WebKit2.DownloadError",
Expand All @@ -36,16 +36,19 @@ generate = [
"WebKit2.FindOptions",
"WebKit2.FormSubmissionRequest",
"WebKit2.GeolocationPermissionRequest",
"WebKit2.HardwareAccelerationPolicy",
"WebKit2.HitTestResult",
"WebKit2.HitTestResultContext",
"WebKit2.InsecureContentEvent",
"WebKit2.InstallMissingMediaPluginsPermissionRequest",
"WebKit2.JavascriptError",
"WebKit2.JavascriptResult",
"WebKit2.LoadEvent",
"WebKit2.MimeInfo",
"WebKit2.NavigationPolicyDecision",
"WebKit2.NavigationType",
"WebKit2.NetworkError",
"WebKit2.NetworkProxyMode",
"WebKit2.Notification",
"WebKit2.NotificationPermissionRequest",
"WebKit2.PermissionRequest",
Expand All @@ -55,13 +58,15 @@ generate = [
"WebKit2.PolicyDecisionType",
"WebKit2.PolicyError",
"WebKit2.ProcessModel",
"WebKit2.PrintCustomWidget",
"WebKit2.PrintError",
"WebKit2.PrintOperation",
"WebKit2.PrintOperationResponse",
"WebKit2.ResponsePolicyDecision",
"WebKit2.SaveMode",
"WebKit2.ScriptDialogType",
"WebKit2.SecurityManager",
"WebKit2.SecurityOrigin",
"WebKit2.Settings",
"WebKit2.SnapshotError",
"WebKit2.SnapshotOptions",
Expand All @@ -74,18 +79,31 @@ generate = [
"WebKit2.UserScriptInjectionTime",
"WebKit2.UserStyleLevel",
"WebKit2.UserStyleSheet",
"WebKit2.WebContext",
"WebKit2.WebInspector",
"WebKit2.WebResource",
"WebKit2.WebsiteDataTypes",
"WebKit2.WebViewBase",
"WebKit2.WebViewSessionState",
"WebKit2.WebsiteDataManager",
"WebKit2.WindowProperties",
]

manual = [
"cairo.Surface",
"Gdk.Event",
"Gdk.Rectangle",
"Gdk.RGBA",
"Gio.Cancellable",
"Gio.TlsCertificate",
"Gio.TlsCertificateFlags",
"GLib.Bytes",
"GLib.Error",
"GLib.List",
"GLib.Variant",
"GObject.Object",
#"Gtk.Action",
"Gtk.Container",
"Gtk.FileFilter",
"Gtk.PageSetup",
"Gtk.PrintSettings",
"Gtk.Widget",
Expand All @@ -95,6 +113,27 @@ manual = [
"WebKit2.ScriptDialog",
]

[[object]]
name = "WebKit2.AuthenticationRequest"
status = "generate"
[[object.function]]
name = "authenticate"
ignore = true

[[object]]
name = "WebKit2.WebContext"
status = "generate"
[[object.function]]
name = "set_network_proxy_settings"
ignore = true

[[object]]
name = "WebKit2.NetworkProxySettings"
status = "generate"
[[object.function]]
name = "new"
ignore = true

[[object]]
name = "WebKit2.URISchemeRequest"
status = "generate"
Expand Down
26 changes: 11 additions & 15 deletions src/auto/authentication_request.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

#[cfg(feature = "v2_2")]
use AuthenticationScheme;
#[cfg(feature = "v2_2")]
use Credential;
use ffi;
use glib;
#[cfg(feature = "v2_2")]
Expand Down Expand Up @@ -31,9 +33,6 @@ glib_wrapper! {
}

pub trait AuthenticationRequestExt {
//#[cfg(feature = "v2_2")]
//fn authenticate<'a, P: Into<Option<&'a /*Ignored*/Credential>>>(&self, credential: P);

#[cfg(feature = "v2_2")]
fn can_save_credentials(&self) -> bool;

Expand All @@ -46,8 +45,8 @@ pub trait AuthenticationRequestExt {
#[cfg(feature = "v2_2")]
fn get_port(&self) -> u32;

//#[cfg(feature = "v2_2")]
//fn get_proposed_credential(&self) -> /*Ignored*/Option<Credential>;
#[cfg(feature = "v2_2")]
fn get_proposed_credential(&self) -> Option<Credential>;

#[cfg(feature = "v2_2")]
fn get_realm(&self) -> Option<String>;
Expand All @@ -66,11 +65,6 @@ pub trait AuthenticationRequestExt {
}

impl<O: IsA<AuthenticationRequest> + IsA<glib::object::Object>> AuthenticationRequestExt for O {
//#[cfg(feature = "v2_2")]
//fn authenticate<'a, P: Into<Option<&'a /*Ignored*/Credential>>>(&self, credential: P) {
// unsafe { TODO: call ffi::webkit_authentication_request_authenticate() }
//}

#[cfg(feature = "v2_2")]
fn can_save_credentials(&self) -> bool {
unsafe {
Expand Down Expand Up @@ -99,10 +93,12 @@ impl<O: IsA<AuthenticationRequest> + IsA<glib::object::Object>> AuthenticationRe
}
}

//#[cfg(feature = "v2_2")]
//fn get_proposed_credential(&self) -> /*Ignored*/Option<Credential> {
// unsafe { TODO: call ffi::webkit_authentication_request_get_proposed_credential() }
//}
#[cfg(feature = "v2_2")]
fn get_proposed_credential(&self) -> Option<Credential> {
unsafe {
from_glib_full(ffi::webkit_authentication_request_get_proposed_credential(self.to_glib_none().0))
}
}

#[cfg(feature = "v2_2")]
fn get_realm(&self) -> Option<String> {
Expand Down
2 changes: 1 addition & 1 deletion src/auto/back_forward_list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use BackForwardListItem;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/back_forward_list_item.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use ffi;
Expand Down
86 changes: 49 additions & 37 deletions src/auto/color_chooser_request.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use ffi;
use gdk;
use glib;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
Expand Down Expand Up @@ -30,18 +32,18 @@ pub trait ColorChooserRequestExt {
#[cfg(feature = "v2_8")]
fn finish(&self);

//#[cfg(feature = "v2_8")]
//fn get_element_rectangle(&self, rect: /*Ignored*/gdk::Rectangle);
#[cfg(feature = "v2_8")]
fn get_element_rectangle(&self) -> gdk::Rectangle;

//#[cfg(feature = "v2_8")]
//fn get_rgba(&self, rgba: /*Ignored*/gdk::RGBA);
#[cfg(feature = "v2_8")]
fn get_rgba(&self) -> gdk::RGBA;

//#[cfg(feature = "v2_8")]
//fn set_rgba(&self, rgba: /*Ignored*/&gdk::RGBA);
#[cfg(feature = "v2_8")]
fn set_rgba(&self, rgba: &gdk::RGBA);

//fn get_property_rgba(&self) -> /*Ignored*/Option<gdk::RGBA>;
fn get_property_rgba(&self) -> Option<gdk::RGBA>;

//fn set_property_rgba(&self, rgba: /*Ignored*/Option<&gdk::RGBA>);
fn set_property_rgba(&self, rgba: Option<&gdk::RGBA>);

#[cfg(feature = "v2_8")]
fn connect_finished<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
Expand All @@ -64,34 +66,44 @@ impl<O: IsA<ColorChooserRequest> + IsA<glib::object::Object>> ColorChooserReques
}
}

//#[cfg(feature = "v2_8")]
//fn get_element_rectangle(&self, rect: /*Ignored*/gdk::Rectangle) {
// unsafe { TODO: call ffi::webkit_color_chooser_request_get_element_rectangle() }
//}

//#[cfg(feature = "v2_8")]
//fn get_rgba(&self, rgba: /*Ignored*/gdk::RGBA) {
// unsafe { TODO: call ffi::webkit_color_chooser_request_get_rgba() }
//}

//#[cfg(feature = "v2_8")]
//fn set_rgba(&self, rgba: /*Ignored*/&gdk::RGBA) {
// unsafe { TODO: call ffi::webkit_color_chooser_request_set_rgba() }
//}

//fn get_property_rgba(&self) -> /*Ignored*/Option<gdk::RGBA> {
// let mut value = Value::from(None::<&/*Ignored*/gdk::RGBA>);
// unsafe {
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "rgba".to_glib_none().0, value.to_glib_none_mut().0);
// }
// value.get()
//}

//fn set_property_rgba(&self, rgba: /*Ignored*/Option<&gdk::RGBA>) {
// unsafe {
// gobject_ffi::g_object_set_property(self.to_glib_none().0, "rgba".to_glib_none().0, Value::from(rgba).to_glib_none().0);
// }
//}
#[cfg(feature = "v2_8")]
fn get_element_rectangle(&self) -> gdk::Rectangle {
unsafe {
let mut rect = gdk::Rectangle::uninitialized();
ffi::webkit_color_chooser_request_get_element_rectangle(self.to_glib_none().0, rect.to_glib_none_mut().0);
rect
}
}

#[cfg(feature = "v2_8")]
fn get_rgba(&self) -> gdk::RGBA {
unsafe {
let mut rgba = gdk::RGBA::uninitialized();
ffi::webkit_color_chooser_request_get_rgba(self.to_glib_none().0, rgba.to_glib_none_mut().0);
rgba
}
}

#[cfg(feature = "v2_8")]
fn set_rgba(&self, rgba: &gdk::RGBA) {
unsafe {
ffi::webkit_color_chooser_request_set_rgba(self.to_glib_none().0, rgba.to_glib_none().0);
}
}

fn get_property_rgba(&self) -> Option<gdk::RGBA> {
let mut value = Value::from(None::<&gdk::RGBA>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "rgba".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}

fn set_property_rgba(&self, rgba: Option<&gdk::RGBA>) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "rgba".to_glib_none().0, Value::from(rgba).to_glib_none().0);
}
}

#[cfg(feature = "v2_8")]
fn connect_finished<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
Expand Down
2 changes: 1 addition & 1 deletion src/auto/context_menu.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use ContextMenuItem;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/context_menu_item.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use ContextMenu;
Expand Down
10 changes: 5 additions & 5 deletions src/auto/cookie_manager.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (e95e5d8) from gir-files (857b8f5)
// This file was generated by gir (7484d29) from gir-files (71d73f0)
// DO NOT EDIT

use CookieAcceptPolicy;
Expand Down Expand Up @@ -30,11 +30,11 @@ pub trait CookieManagerExt {

fn delete_cookies_for_domain(&self, domain: &str);

//fn get_accept_policy<'a, 'b, P: Into<Option<&'a /*Ignored*/gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R);
//fn get_accept_policy<'a, 'b, P: Into<Option<&'a gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R);

//fn get_accept_policy_finish<P: IsA</*Ignored*/gio::AsyncResult>>(&self, result: &P) -> Result<CookieAcceptPolicy, Error>;

//fn get_domains_with_cookies<'a, 'b, P: Into<Option<&'a /*Ignored*/gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R);
//fn get_domains_with_cookies<'a, 'b, P: Into<Option<&'a gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R);

//fn get_domains_with_cookies_finish<P: IsA</*Ignored*/gio::AsyncResult>>(&self, result: &P) -> Result<Vec<String>, Error>;

Expand All @@ -58,15 +58,15 @@ impl<O: IsA<CookieManager> + IsA<glib::object::Object>> CookieManagerExt for O {
}
}

//fn get_accept_policy<'a, 'b, P: Into<Option<&'a /*Ignored*/gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R) {
//fn get_accept_policy<'a, 'b, P: Into<Option<&'a gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R) {
// unsafe { TODO: call ffi::webkit_cookie_manager_get_accept_policy() }
//}

//fn get_accept_policy_finish<P: IsA</*Ignored*/gio::AsyncResult>>(&self, result: &P) -> Result<CookieAcceptPolicy, Error> {
// unsafe { TODO: call ffi::webkit_cookie_manager_get_accept_policy_finish() }
//}

//fn get_domains_with_cookies<'a, 'b, P: Into<Option<&'a /*Ignored*/gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R) {
//fn get_domains_with_cookies<'a, 'b, P: Into<Option<&'a gio::Cancellable>>, Q: Into<Option<&'b /*Ignored*/gio::AsyncReadyCallback>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, cancellable: P, callback: Q, user_data: R) {
// unsafe { TODO: call ffi::webkit_cookie_manager_get_domains_with_cookies() }
//}

Expand Down
Loading

0 comments on commit d1e31c2

Please sign in to comment.