Remove rust-alert as it's broken on mac, and unimplemented on other platforms.

This commit is contained in:
Glenn Watson 2014-11-19 14:19:40 +10:00
parent f5c6146de0
commit c39852a3f4
14 changed files with 5 additions and 117 deletions

17
Cargo.lock generated
View file

@ -16,15 +16,6 @@ dependencies = [
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "alert"
version = "0.1.0"
source = "git+https://github.com/servo/rust-alert#9bd18fc406683bae448bc6f5d546872970af252e"
dependencies = [
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
]
[[package]] [[package]]
name = "android_glue" name = "android_glue"
version = "0.0.1" version = "0.0.1"
@ -71,11 +62,6 @@ name = "cocoa"
version = "0.1.1" version = "0.1.1"
source = "git+https://github.com/DavidPartouche/rust-cocoa#0a951a6cdd5f1a175b929754c134f9443b105642" source = "git+https://github.com/DavidPartouche/rust-cocoa#0a951a6cdd5f1a175b929754c134f9443b105642"
[[package]]
name = "cocoa"
version = "0.1.1"
source = "git+https://github.com/servo/rust-cocoa#f926323d306401df33f528c9aeca8e582cad063b"
[[package]] [[package]]
name = "compile_msg" name = "compile_msg"
version = "0.1.1" version = "0.1.1"
@ -85,7 +71,6 @@ source = "git+https://github.com/huonw/compile_msg#f526abe54b49642bc1e969e6c2af1
name = "compositing" name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
@ -294,7 +279,6 @@ source = "git+https://github.com/servo/glfw?ref=cargo-3.0.4#765dace7e4125b87c764
name = "glfw_app" name = "glfw_app"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"compositing 0.0.1", "compositing 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
@ -322,7 +306,6 @@ dependencies = [
name = "glutin_app" name = "glutin_app"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"compositing 0.0.1", "compositing 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",

View file

@ -31,9 +31,6 @@ path = "../devtools"
[dependencies.devtools_traits] [dependencies.devtools_traits]
path = "../devtools_traits" path = "../devtools_traits"
[dependencies.alert]
git = "https://github.com/servo/rust-alert"
[dependencies.azure] [dependencies.azure]
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"

View file

@ -13,7 +13,6 @@
#[phase(plugin, link)] #[phase(plugin, link)]
extern crate log; extern crate log;
extern crate alert;
extern crate azure; extern crate azure;
extern crate devtools_traits; extern crate devtools_traits;
extern crate geom; extern crate geom;

View file

@ -2,7 +2,6 @@
name = "glut_app" name = "glut_app"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"compositing 0.0.1", "compositing 0.0.1",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
@ -13,15 +12,6 @@ dependencies = [
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "alert"
version = "0.1.0"
source = "git+https://github.com/servo/rust-alert#9bd18fc406683bae448bc6f5d546872970af252e"
dependencies = [
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
]
[[package]] [[package]]
name = "azure" name = "azure"
version = "0.1.0" version = "0.1.0"
@ -55,16 +45,10 @@ dependencies = [
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
] ]
[[package]]
name = "cocoa"
version = "0.1.1"
source = "git+https://github.com/servo/rust-cocoa#f926323d306401df33f528c9aeca8e582cad063b"
[[package]] [[package]]
name = "compositing" name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",

View file

@ -8,9 +8,6 @@ name = "glut_app"
path = "lib.rs" path = "lib.rs"
crate-type = ["dylib"] crate-type = ["dylib"]
[dependencies.alert]
git = "https://github.com/servo/rust-alert"
[dependencies.compositing] [dependencies.compositing]
path = "../../../components/compositing" path = "../../../components/compositing"

View file

@ -9,7 +9,6 @@
#![deny(unused_imports)] #![deny(unused_imports)]
#![deny(unused_variables)] #![deny(unused_variables)]
extern crate alert;
extern crate compositing; extern crate compositing;
extern crate egl; extern crate egl;
extern crate geom; extern crate geom;

View file

@ -6,12 +6,11 @@
use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver}; use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods}; use compositing::windowing::{WindowEvent, WindowMethods};
use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, LoadUrlWindowEvent, MouseWindowEventClass}; use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, MouseWindowEventClass};
use compositing::windowing::{ScrollWindowEvent, ZoomWindowEvent, NavigationWindowEvent, FinishedWindowEvent}; use compositing::windowing::{ScrollWindowEvent, ZoomWindowEvent, NavigationWindowEvent, FinishedWindowEvent};
use compositing::windowing::{MouseWindowClickEvent, MouseWindowMouseDownEvent, MouseWindowMouseUpEvent}; use compositing::windowing::{MouseWindowClickEvent, MouseWindowMouseDownEvent, MouseWindowMouseUpEvent};
use compositing::windowing::{Forward, Back}; use compositing::windowing::{Forward, Back};
use alert::{Alert, AlertMethods};
use libc::{c_int, c_uchar}; use libc::{c_int, c_uchar};
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::rc::Rc; use std::rc::Rc;
@ -238,7 +237,6 @@ impl Window {
debug!("got key: {}", key); debug!("got key: {}", key);
let modifiers = glut::get_modifiers(); let modifiers = glut::get_modifiers();
match key { match key {
42 => self.load_url(),
43 => self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1)), 43 => self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1)),
45 => self.event_queue.borrow_mut().push(ZoomWindowEvent(0.909090909)), 45 => self.event_queue.borrow_mut().push(ZoomWindowEvent(0.909090909)),
56 => self.event_queue.borrow_mut().push(ScrollWindowEvent(TypedPoint2D(0.0f32, 5.0f32), 56 => self.event_queue.borrow_mut().push(ScrollWindowEvent(TypedPoint2D(0.0f32, 5.0f32),
@ -284,19 +282,6 @@ impl Window {
}; };
self.event_queue.borrow_mut().push(MouseWindowEventClass(event)); self.event_queue.borrow_mut().push(MouseWindowEventClass(event));
} }
/// Helper function to pop up an alert box prompting the user to load a URL.
fn load_url(&self) {
let mut alert: Alert = AlertMethods::new("Navigate to:");
alert.add_prompt();
alert.run();
let value = alert.prompt_value();
if "" == value.as_slice() { // To avoid crashing on Linux.
self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string()))
} else {
self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone()))
}
}
} }
struct GlutCompositorProxy { struct GlutCompositorProxy {

16
ports/cef/Cargo.lock generated
View file

@ -23,15 +23,6 @@ dependencies = [
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "alert"
version = "0.1.0"
source = "git+https://github.com/servo/rust-alert#9bd18fc406683bae448bc6f5d546872970af252e"
dependencies = [
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
]
[[package]] [[package]]
name = "azure" name = "azure"
version = "0.1.0" version = "0.1.0"
@ -65,16 +56,10 @@ dependencies = [
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
] ]
[[package]]
name = "cocoa"
version = "0.1.1"
source = "git+https://github.com/servo/rust-cocoa#f926323d306401df33f528c9aeca8e582cad063b"
[[package]] [[package]]
name = "compositing" name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
@ -283,7 +268,6 @@ source = "git+https://github.com/servo/glfw?ref=cargo-3.0.4#765dace7e4125b87c764
name = "glfw_app" name = "glfw_app"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"alert 0.1.0 (git+https://github.com/servo/rust-alert)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"compositing 0.0.1", "compositing 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",

View file

@ -7,9 +7,6 @@ authors = ["The Servo Project Developers"]
name = "glfw_app" name = "glfw_app"
path = "lib.rs" path = "lib.rs"
[dependencies.alert]
git = "https://github.com/servo/rust-alert"
[dependencies.compositing] [dependencies.compositing]
path = "../../components/compositing" path = "../../components/compositing"

View file

@ -8,7 +8,6 @@
#![feature(macro_rules)] #![feature(macro_rules)]
#![deny(unused_imports, unused_variables)] #![deny(unused_imports, unused_variables)]
extern crate alert;
#[cfg(target_os="macos")] #[cfg(target_os="macos")]
extern crate cgl; extern crate cgl;
extern crate compositing; extern crate compositing;

View file

@ -6,10 +6,9 @@
use NestedEventLoopListener; use NestedEventLoopListener;
use alert::{Alert, AlertMethods};
use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver}; use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
use compositing::windowing::{Forward, Back}; use compositing::windowing::{Forward, Back};
use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, LoadUrlWindowEvent}; use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent};
use compositing::windowing::{KeyEvent, MouseWindowClickEvent, MouseWindowMouseDownEvent}; use compositing::windowing::{KeyEvent, MouseWindowClickEvent, MouseWindowMouseDownEvent};
use compositing::windowing::{MouseWindowEventClass, MouseWindowMoveEventClass}; use compositing::windowing::{MouseWindowEventClass, MouseWindowMoveEventClass};
use compositing::windowing::{MouseWindowMouseUpEvent, RefreshWindowEvent}; use compositing::windowing::{MouseWindowMouseUpEvent, RefreshWindowEvent};
@ -326,7 +325,6 @@ impl Window {
fn handle_key(&self, key: glfw::Key, mods: glfw::Modifiers) { fn handle_key(&self, key: glfw::Key, mods: glfw::Modifiers) {
match key { match key {
glfw::KeyEscape => self.glfw_window.set_should_close(true), glfw::KeyEscape => self.glfw_window.set_should_close(true),
glfw::KeyL if mods.contains(glfw::Control) => self.load_url(), // Ctrl+L
glfw::KeyEqual if mods.contains(glfw::Control) => { // Ctrl-+ glfw::KeyEqual if mods.contains(glfw::Control) => { // Ctrl-+
self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1)); self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1));
} }
@ -383,19 +381,6 @@ impl Window {
}; };
self.event_queue.borrow_mut().push(MouseWindowEventClass(event)); self.event_queue.borrow_mut().push(MouseWindowEventClass(event));
} }
/// Helper function to pop up an alert box prompting the user to load a URL.
fn load_url(&self) {
let mut alert: Alert = AlertMethods::new("Navigate to:");
alert.add_prompt();
alert.run();
let value = alert.prompt_value();
if "" == value.as_slice() { // To avoid crashing on Linux.
self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string()))
} else {
self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone()))
}
}
} }
struct GlfwCompositorProxy { struct GlfwCompositorProxy {

View file

@ -7,9 +7,6 @@ authors = ["The Servo Project Developers"]
name = "glutin_app" name = "glutin_app"
path = "lib.rs" path = "lib.rs"
[dependencies.alert]
git = "https://github.com/servo/rust-alert"
[dependencies.compositing] [dependencies.compositing]
path = "../../components/compositing" path = "../../components/compositing"

View file

@ -6,9 +6,8 @@
#![license = "MPL"] #![license = "MPL"]
#![feature(macro_rules)] #![feature(macro_rules)]
#![deny(unused_imports, unused_variable)] #![deny(unused_imports, unused_variables)]
extern crate alert;
#[cfg(target_os="macos")] #[cfg(target_os="macos")]
extern crate cgl; extern crate cgl;
extern crate compositing; extern crate compositing;

View file

@ -2,12 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! A windowing implementation using GLFW. //! A windowing implementation using glutin.
use alert::{Alert, AlertMethods};
use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver}; use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods}; use compositing::windowing::{WindowEvent, WindowMethods};
use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, LoadUrlWindowEvent}; use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent};
use compositing::windowing::{MouseWindowEventClass, MouseWindowMoveEventClass, ScrollWindowEvent}; use compositing::windowing::{MouseWindowEventClass, MouseWindowMoveEventClass, ScrollWindowEvent};
use compositing::windowing::{ZoomWindowEvent, PinchZoomWindowEvent, NavigationWindowEvent}; use compositing::windowing::{ZoomWindowEvent, PinchZoomWindowEvent, NavigationWindowEvent};
use compositing::windowing::{FinishedWindowEvent, QuitWindowEvent, MouseWindowClickEvent}; use compositing::windowing::{FinishedWindowEvent, QuitWindowEvent, MouseWindowClickEvent};
@ -339,9 +338,6 @@ impl Window {
fn handle_key(&self, key: glutin::VirtualKeyCode) -> bool { fn handle_key(&self, key: glutin::VirtualKeyCode) -> bool {
match key { match key {
glutin::Escape => return true, glutin::Escape => return true,
glutin::L if self.ctrl_pressed() => {
self.load_url(); // Ctrl+L
}
glutin::Equals if self.ctrl_pressed() => { // Ctrl-+ glutin::Equals if self.ctrl_pressed() => { // Ctrl-+
self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1)); self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1));
} }
@ -398,19 +394,6 @@ impl Window {
self.event_queue.borrow_mut().push(MouseWindowEventClass(event)); self.event_queue.borrow_mut().push(MouseWindowEventClass(event));
} }
/// Helper function to pop up an alert box prompting the user to load a URL.
fn load_url(&self) {
let mut alert: Alert = AlertMethods::new("Navigate to:");
alert.add_prompt();
alert.run();
let value = alert.prompt_value();
if "" == value.as_slice() { // To avoid crashing on Linux.
self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string()))
} else {
self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone()))
}
}
pub unsafe fn set_nested_event_loop_listener( pub unsafe fn set_nested_event_loop_listener(
&self, &self,
_listener: *mut NestedEventLoopListener + 'static) { _listener: *mut NestedEventLoopListener + 'static) {