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

Implement viewport stuffs for window #1718 #6875

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
40ff6cf
viewport
farodin91 Jul 31, 2015
a33ad54
Merge remote-tracking branch 'upstream/master' into window
farodin91 Jul 31, 2015
a9df5f2
[WIP] Implement viewport stuffs for window #1718
farodin91 Jul 31, 2015
43d6d5e
[WIP] Implement viewport stuffs for window #1718
farodin91 Jul 31, 2015
cbaf83b
Merge branch 'window' of github.com:farodin91/servo into window
farodin91 Aug 4, 2015
bb393cd
Merging conflict
farodin91 Aug 4, 2015
4557a5d
Merging conflict 2
farodin91 Aug 4, 2015
d289878
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 4, 2015
a5944c7
last Conflict
farodin91 Aug 4, 2015
8d2008e
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 5, 2015
6dabb5d
review changes
farodin91 Aug 7, 2015
a800294
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 7, 2015
225d2ee
current state
farodin91 Aug 7, 2015
cc7fc18
most changes to the last review
farodin91 Aug 9, 2015
96ae3d4
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 9, 2015
9a80339
init support of smooth
farodin91 Aug 9, 2015
c4213b4
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 14, 2015
c0e028e
review changes
farodin91 Aug 14, 2015
36d318b
Merging and fix review
farodin91 Aug 16, 2015
10597e2
fix tidy
farodin91 Aug 16, 2015
38f318a
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 19, 2015
a9d703a
fixing borrow_mut
farodin91 Aug 19, 2015
3f3b176
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 20, 2015
5274eab
Merge remote-tracking branch 'upstream/master' into window
farodin91 Aug 27, 2015
f655800
Merge remote-tracking branch 'upstream/master' into window
farodin91 Sep 1, 2015
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

review changes

  • Loading branch information
farodin91 committed Aug 7, 2015
commit 6dabb5dfc63adb0971aaaf907c2f9d018747a47a
@@ -11,11 +11,11 @@ use scrolling::ScrollingTimerProxy;
use windowing;
use windowing::{MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};

use euclid::Matrix4;
use euclid::point::{Point2D, TypedPoint2D};
use euclid::rect::{Rect, TypedRect};
use euclid::{Size2D, Point2D, Rect, Matrix4};
use euclid::point::TypedPoint2D;
use euclid::rect::TypedRect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
use euclid::size::TypedSize2D;
use gfx_traits::color;
use gfx::paint_task::{ChromeToPaintMsg, PaintRequest};
use gleam::gl::types::{GLint, GLsizei};
@@ -388,7 +388,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.send_buffer_requests_for_all_layers();
}

(Msg::GetNativeDisplay(chan), ShutdownState::NotShuttingDown) => {
(Msg::GetNativeDisplay(chan),
ShutdownState::NotShuttingDown) => {
chan.send(Some(self.native_display.clone())).unwrap();
}

@@ -428,7 +429,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.window.set_inner_size(size);
}

(Msg::GetClientWindow(send), ShutdownState::NotShuttingDown) => {
(Msg::GetClientWindow(send),
ShutdownState::NotShuttingDown) => {
let rect = self.window.client_window();
send.send(rect).unwrap();
}
@@ -11,9 +11,7 @@ use compositor;
use headless;
use windowing::{WindowEvent, WindowMethods};

use euclid::point::Point2D;
use euclid::size::Size2D;
use euclid::rect::Rect;
use euclid::{Size2D, Point2D, Rect};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use layers::platform::surface::{NativeDisplay, NativeSurface};
use layers::layers::{BufferRequest, LayerBufferSet};
@@ -214,9 +212,12 @@ pub enum Msg {
CollectMemoryReports(mem::ReportsChan),
/// A status message to be displayed by the browser chrome.
Status(Option<String>),
GetClientWindow(IpcSender<Rect<i32>>),
/// Get Window Informations size and position
GetClientWindow(IpcSender<(Size2D<u32>, Point2D<i32>)>),
/// Move the window to a point
MoveTo(Point2D<i32>),
ResizeTo(Size2D<i32>),
/// Resize the window to size
ResizeTo(Size2D<u32>),
}

impl Debug for Msg {
@@ -5,8 +5,8 @@
use compositor_task::{CompositorEventListener, CompositorReceiver, Msg};
use windowing::WindowEvent;

use euclid::{Size2D, Point2D};
use euclid::scale_factor::ScaleFactor;
use euclid::size::Size2D;
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, WindowSizeData};
use profile_traits::mem;
@@ -88,6 +88,10 @@ impl CompositorEventListener for NullCompositor {
response_chan.send(()).unwrap();
}

Msg::GetClientWindow(send) => {
let rect = (Size2D::zero(), Point2D::zero());
send.send(rect).unwrap();
}
// Explicitly list ignored messages so that when we add a new one,
// we'll notice and think about whether it needs a response, like
// SetFrameTree.
@@ -109,7 +113,6 @@ impl CompositorEventListener for NullCompositor {
Msg::ViewportConstrained(..) => {}
Msg::CreatePng(..) |
Msg::PaintTaskExited(..) |
Msg::GetClientWindow(..) |
Msg::MoveTo(..) |
Msg::ResizeTo(..) |
Msg::IsReadyToSaveImageReply(..) => {}
@@ -6,10 +6,10 @@

use compositor_task::{CompositorProxy, CompositorReceiver};

use euclid::rect::Rect;
use euclid::point::{TypedPoint2D, Point2D};
use euclid::{Size2D, Point2D};
use euclid::point::TypedPoint2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::{TypedSize2D, Size2D};
use euclid::size::TypedSize2D;
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeDisplay;
use msg::constellation_msg::{Key, KeyState, KeyModifiers};
@@ -104,11 +104,11 @@ pub trait WindowMethods {
/// Presents the window to the screen (perhaps by page flipping).
fn present(&self);

/// Return outersize and position values
fn client_window(&self) -> Rect<i32>;

fn set_inner_size(&self, size: Size2D<i32>);

/// Return the size of the window with head and borders and position of the window values
fn client_window(&self) -> (Size2D<u32>, Point2D<i32>);
/// Set the size inside of borders and head
fn set_inner_size(&self, size: Size2D<u32>);
/// Set the window position
fn set_position(&self, point: Point2D<i32>);

/// Sets the page title for the current page.
@@ -4,9 +4,7 @@

use azure::azure_hl::Color;
use constellation_msg::{Key, KeyState, KeyModifiers};
use euclid::point::Point2D;
use euclid::size::Size2D;
use euclid::rect::Rect;
use euclid::{Size2D, Point2D, Rect};
use euclid::Matrix4;
use ipc_channel::ipc::IpcSender;
use layers::platform::surface::NativeDisplay;
@@ -122,9 +120,9 @@ pub enum ScriptToCompositorMsg {
ScrollFragmentPoint(PipelineId, LayerId, Point2D<f32>),
SetTitle(PipelineId, Option<String>),
SendKeyEvent(Key, KeyState, KeyModifiers),
GetClientWindow(IpcSender<Rect<i32>>),
GetClientWindow(IpcSender<(Size2D<u32>, Point2D<i32>)>),
MoveTo(Point2D<i32>),
ResizeTo(Size2D<i32>),
ResizeTo(Size2D<u32>),
Exit,
}

@@ -147,15 +145,15 @@ impl ScriptListener {
.unwrap()
}

pub fn client_window(&mut self, send: IpcSender<Rect<i32>>) {
pub fn client_window(&mut self, send: IpcSender<(Size2D<u32>, Point2D<i32>)>) {
self.0.send(ScriptToCompositorMsg::GetClientWindow(send)).unwrap()
}

pub fn move_window(&mut self, point: Point2D<i32>) {
self.0.send(ScriptToCompositorMsg::MoveTo(point)).unwrap()
}

pub fn resize_window(&mut self, size: Size2D<i32>) {
pub fn resize_window(&mut self, size: Size2D<u32>) {
self.0.send(ScriptToCompositorMsg::ResizeTo(size)).unwrap()
}

@@ -132,11 +132,11 @@ partial interface Window {
readonly attribute long scrollY;
readonly attribute long pageYOffset;
void scroll(optional ScrollToOptions options);
void scroll(unrestricted double x, unrestricted double y, optional ScrollOptions options);
void scroll(unrestricted double x, unrestricted double y);
void scrollTo(optional ScrollToOptions options);
void scrollTo(unrestricted double x, unrestricted double y, optional ScrollOptions options);
void scrollTo(unrestricted double x, unrestricted double y);
void scrollBy(optional ScrollToOptions options);
void scrollBy(unrestricted double x, unrestricted double y, optional ScrollOptions options);
void scrollBy(unrestricted double x, unrestricted double y);

// client
readonly attribute long screenX;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.