mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement viewport functions for window #1718
This commit is contained in:
parent
9f85370885
commit
f0987380dd
14 changed files with 466 additions and 63 deletions
|
@ -11,11 +11,11 @@ use surface_map::SurfaceMap;
|
|||
use windowing;
|
||||
use windowing::{MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
|
||||
|
||||
use euclid::Matrix4;
|
||||
use euclid::point::{Point2D, TypedPoint2D};
|
||||
use euclid::rect::{Rect, TypedRect};
|
||||
use euclid::point::TypedPoint2D;
|
||||
use euclid::rect::TypedRect;
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::size::{Size2D, TypedSize2D};
|
||||
use euclid::size::TypedSize2D;
|
||||
use euclid::{Size2D, Point2D, Rect, Matrix4};
|
||||
use gfx::paint_task::{ChromeToPaintMsg, PaintRequest};
|
||||
use gfx_traits::color;
|
||||
use gleam::gl;
|
||||
|
@ -390,7 +390,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();
|
||||
}
|
||||
|
||||
|
@ -415,11 +416,27 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.surface_map.insert_surfaces(&self.native_display, native_surfaces);
|
||||
}
|
||||
|
||||
(Msg::ScrollFragmentPoint(pipeline_id, layer_id, point),
|
||||
(Msg::ScrollFragmentPoint(pipeline_id, layer_id, point, _),
|
||||
ShutdownState::NotShuttingDown) => {
|
||||
self.scroll_fragment_to_point(pipeline_id, layer_id, point);
|
||||
}
|
||||
|
||||
(Msg::MoveTo(point),
|
||||
ShutdownState::NotShuttingDown) => {
|
||||
self.window.set_position(point);
|
||||
}
|
||||
|
||||
(Msg::ResizeTo(size),
|
||||
ShutdownState::NotShuttingDown) => {
|
||||
self.window.set_inner_size(size);
|
||||
}
|
||||
|
||||
(Msg::GetClientWindow(send),
|
||||
ShutdownState::NotShuttingDown) => {
|
||||
let rect = self.window.client_window();
|
||||
send.send(rect).unwrap();
|
||||
}
|
||||
|
||||
(Msg::Status(message), ShutdownState::NotShuttingDown) => {
|
||||
self.window.status(message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue