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

Rollup of changes #515

Merged
merged 25 commits into from Jun 14, 2013
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a53a7f6
Add link following and refactor the profiler.
Jun 6, 2013
9085b88
Implement scrolling and better zooming
Jun 6, 2013
abe6a06
Update rust-layers for GL_LINEAR zooming
pcwalton Jun 6, 2013
bf4df24
Provide an interface to the engine for the script task
Jun 6, 2013
ff1178f
handle relative url's when clicking
Jun 6, 2013
0bbf2fc
Refactor flow tree construction and actually use display property.
Jun 8, 2013
1fbfd7d
Implement horizontal scrolling and pinch-to-zoom
pcwalton Jun 9, 2013
7b28462
Send status messages to the compositor
Jun 7, 2013
a9ed2d8
Spin the event loop every 50 ms to allow Rust channels to be processed.
pcwalton Jun 10, 2013
e50cee9
Resolve relative URLs that begin with '//'
pcwalton Jun 10, 2013
f3ad95f
Added a command-line argument for rendering tiles at higher resolutions
Jun 11, 2013
1aa8d64
Fix URL relativization so that links on Wikipedia work
pcwalton Jun 11, 2013
96b9be6
Add a cheesy progress indicator
pcwalton Jun 11, 2013
204c5b6
Add a spinner for layout
pcwalton Jun 11, 2013
aad5113
Update submodules
pcwalton Jun 12, 2013
162ba83
Fix merge fallout
pcwalton Jun 12, 2013
aee2611
Make script and style display:none
pcwalton Jun 12, 2013
e1b9e01
Fix merge fallout which was disabling all CSS classes.
pcwalton Jun 12, 2013
327e799
test: Add a box model smoketest
pcwalton Jun 12, 2013
b75b2de
Compute percent widths/margins properly and fix numerous small visual…
Jun 4, 2013
4017839
Fix padding
Jun 4, 2013
badf1b8
Vertical margins now contribute to content height.
Jun 4, 2013
f3cdbaf
Stop sorting after every profiler datum comes in.
pcwalton Jun 13, 2013
2ec3412
Fix submodules and test_slam_layout
pcwalton Jun 13, 2013
c35abb2
Update rust-glut
pcwalton Jun 14, 2013
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Add a cheesy progress indicator

  • Loading branch information
pcwalton committed Jun 12, 2013
commit 96b9be6c335f526162664e2072ff81d80970acd8
@@ -150,13 +150,7 @@ fn run_main_loop(port: Port<Msg>,
match port.recv() {
Exit => *done = true,

ChangeReadyState(ready_state) => {
let window_title = match ready_state {
compositor_interface::FinishedLoading => ~"Servo",
_ => fmt!("%? — Servo", ready_state),
};
window.set_title(window_title);
}
ChangeReadyState(ready_state) => window.set_ready_state(ready_state),

Paint(new_layer_buffer_set, new_size) => {
debug!("osmain: received new frame");
@@ -19,6 +19,9 @@ use geom::size::Size2D;
use glut::glut::{ACTIVE_CTRL, DOUBLE, HAVE_PRECISE_MOUSE_WHEEL, WindowHeight, WindowWidth};
use glut::glut;
use glut::machack;
use script::compositor_interface::{FinishedLoading, Loading, Rendering, ReadyState};

static THROBBER: [char, ..8] = [ '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' ];

/// A structure responsible for setting up and tearing down the entire windowing system.
pub struct Application;
@@ -46,6 +49,9 @@ pub struct Window {

mouse_down_button: @mut c_int,
mouse_down_point: @mut Point2D<c_int>,

ready_state: ReadyState,
throbber_frame: u8,
}

impl WindowMethods<Application> for Window {
@@ -70,6 +76,9 @@ impl WindowMethods<Application> for Window {

mouse_down_button: @mut 0,
mouse_down_point: @mut Point2D(0, 0),

ready_state: FinishedLoading,
throbber_frame: 0,
};

// Spin the event loop every 50 ms to allow the Rust channels to be polled.
@@ -80,6 +89,8 @@ impl WindowMethods<Application> for Window {
let register_timer_callback: @mut @fn() = @mut ||{};
*register_timer_callback = || {
glut::timer_func(50, *register_timer_callback);
window.throbber_frame = (window.throbber_frame + 1) % (THROBBER.len() as u8);
window.update_window_title()
};

// Register event handlers.
@@ -174,12 +185,28 @@ impl WindowMethods<Application> for Window {
glut::post_redisplay()
}

pub fn set_title(@mut self, title: &str) {
glut::set_window_title(self.glut_window, title);
/// Sets the ready state.
pub fn set_ready_state(@mut self, ready_state: ReadyState) {
self.ready_state = ready_state;
self.update_window_title()
}
}

impl Window {
/// Helper function to set the window title in accordance with the ready state.
fn update_window_title(&self) {
let throbber = THROBBER[self.throbber_frame];
match self.ready_state {
Loading => {
glut::set_window_title(self.glut_window, fmt!("%c Loading — Servo", throbber))
}
Rendering => {
glut::set_window_title(self.glut_window, fmt!("%c Rendering — Servo", throbber))
}
FinishedLoading => glut::set_window_title(self.glut_window, "Servo"),
}
}

/// Helper function to handle keyboard events.
fn handle_key(&self, key: u8) {
debug!("got key: %d", key as int);
@@ -6,6 +6,7 @@

use geom::point::Point2D;
use geom::size::Size2D;
use script::compositor_interface::ReadyState;

pub enum WindowMouseEvent {
WindowClickEvent(uint, Point2D<f32>),
@@ -61,7 +62,7 @@ pub trait WindowMethods<A> {
pub fn check_loop(@mut self);
/// Schedules a redisplay at the next turn of the event loop.
pub fn set_needs_display(@mut self);
/// Sets the title of the window
pub fn set_title(@mut self, title: &str);
/// Sets the ready state of the current page.
pub fn set_ready_state(@mut self, ready_state: ReadyState);
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.