mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Move WindowSizeType to script_traits.
This commit is contained in:
parent
9cbac40f61
commit
1a96733417
7 changed files with 20 additions and 20 deletions
|
@ -19,15 +19,14 @@ use image::{DynamicImage, ImageFormat, RgbImage};
|
||||||
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||||
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
|
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId, TraversalDirection};
|
||||||
use msg::constellation_msg::{TraversalDirection, WindowSizeType};
|
|
||||||
use net_traits::image::base::{Image, PixelFormat};
|
use net_traits::image::base::{Image, PixelFormat};
|
||||||
use profile_traits::mem::{self, Reporter, ReporterRequest};
|
use profile_traits::mem::{self, Reporter, ReporterRequest};
|
||||||
use profile_traits::time::{self, ProfilerCategory, profile};
|
use profile_traits::time::{self, ProfilerCategory, profile};
|
||||||
use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg};
|
use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg};
|
||||||
use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
|
use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
|
||||||
use script_traits::{MouseEventType, StackingContextScrollState};
|
use script_traits::{MouseEventType, StackingContextScrollState};
|
||||||
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData};
|
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
|
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
|
@ -28,7 +28,6 @@ use log::{Log, LogLevel, LogLevelFilter, LogMetadata, LogRecord};
|
||||||
use msg::constellation_msg::{FrameId, FrameType, PipelineId};
|
use msg::constellation_msg::{FrameId, FrameType, PipelineId};
|
||||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||||
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
|
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
|
||||||
use msg::constellation_msg::WindowSizeType;
|
|
||||||
use net_traits::{self, IpcSend, ResourceThreads};
|
use net_traits::{self, IpcSend, ResourceThreads};
|
||||||
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
||||||
use net_traits::image_cache_thread::ImageCacheThread;
|
use net_traits::image_cache_thread::ImageCacheThread;
|
||||||
|
@ -45,7 +44,7 @@ use script_traits::{IFrameLoadInfo, IFrameSandboxState, TimerEventRequest};
|
||||||
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
|
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
|
||||||
use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg};
|
use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg};
|
||||||
use script_traits::{MozBrowserErrorType, MozBrowserEvent, WebDriverCommandMsg, WindowSizeData};
|
use script_traits::{MozBrowserErrorType, MozBrowserEvent, WebDriverCommandMsg, WindowSizeData};
|
||||||
use script_traits::{SWManagerMsg, ScopeThings};
|
use script_traits::{SWManagerMsg, ScopeThings, WindowSizeType};
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::{HashMap, VecDeque};
|
use std::collections::{HashMap, VecDeque};
|
||||||
use std::io::Error as IOError;
|
use std::io::Error as IOError;
|
||||||
|
|
|
@ -9,12 +9,6 @@ use std::cell::Cell;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
#[derive(Deserialize, Eq, PartialEq, Serialize, Copy, Clone, HeapSizeOf)]
|
|
||||||
pub enum WindowSizeType {
|
|
||||||
Initial,
|
|
||||||
Resize,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
|
#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
|
||||||
pub enum KeyState {
|
pub enum KeyState {
|
||||||
Pressed,
|
Pressed,
|
||||||
|
|
|
@ -57,7 +57,7 @@ use js::jsapi::{GCTraceKindToAscii, Heap, JSObject, JSTracer, TraceKind};
|
||||||
use js::jsval::JSVal;
|
use js::jsval::JSVal;
|
||||||
use js::rust::Runtime;
|
use js::rust::Runtime;
|
||||||
use libc;
|
use libc;
|
||||||
use msg::constellation_msg::{FrameId, FrameType, PipelineId, ReferrerPolicy, WindowSizeType};
|
use msg::constellation_msg::{FrameId, FrameType, PipelineId, ReferrerPolicy};
|
||||||
use net_traits::{Metadata, NetworkError, ResourceThreads};
|
use net_traits::{Metadata, NetworkError, ResourceThreads};
|
||||||
use net_traits::filemanager_thread::RelativePos;
|
use net_traits::filemanager_thread::RelativePos;
|
||||||
use net_traits::image::base::{Image, ImageMetadata};
|
use net_traits::image::base::{Image, ImageMetadata};
|
||||||
|
@ -73,7 +73,8 @@ use script_layout_interface::OpaqueStyleAndLayoutData;
|
||||||
use script_layout_interface::reporter::CSSErrorReporter;
|
use script_layout_interface::reporter::CSSErrorReporter;
|
||||||
use script_layout_interface::rpc::LayoutRPC;
|
use script_layout_interface::rpc::LayoutRPC;
|
||||||
use script_runtime::ScriptChan;
|
use script_runtime::ScriptChan;
|
||||||
use script_traits::{TimerEventId, TimerSource, TouchpadPressurePhase, UntrustedNodeAddress, WindowSizeData};
|
use script_traits::{TimerEventId, TimerSource, TouchpadPressurePhase};
|
||||||
|
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::boxed::FnBox;
|
use std::boxed::FnBox;
|
||||||
|
|
|
@ -49,7 +49,7 @@ use js::jsapi::{HandleObject, HandleValue, JSAutoCompartment, JSContext};
|
||||||
use js::jsapi::{JS_GC, JS_GetRuntime, SetWindowProxy};
|
use js::jsapi::{JS_GC, JS_GetRuntime, SetWindowProxy};
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::Runtime;
|
use js::rust::Runtime;
|
||||||
use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy, WindowSizeType};
|
use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy};
|
||||||
use net_traits::ResourceThreads;
|
use net_traits::ResourceThreads;
|
||||||
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
||||||
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};
|
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};
|
||||||
|
@ -70,7 +70,7 @@ use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, Runnable, Runnabl
|
||||||
use script_thread::SendableMainThreadScriptChan;
|
use script_thread::SendableMainThreadScriptChan;
|
||||||
use script_traits::{ConstellationControlMsg, LoadData, MozBrowserEvent, UntrustedNodeAddress};
|
use script_traits::{ConstellationControlMsg, LoadData, MozBrowserEvent, UntrustedNodeAddress};
|
||||||
use script_traits::{DocumentState, TimerEvent, TimerEventId};
|
use script_traits::{DocumentState, TimerEvent, TimerEventId};
|
||||||
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, WindowSizeData};
|
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
|
|
@ -71,8 +71,7 @@ use js::jsval::UndefinedValue;
|
||||||
use js::rust::Runtime;
|
use js::rust::Runtime;
|
||||||
use layout_wrapper::ServoLayoutNode;
|
use layout_wrapper::ServoLayoutNode;
|
||||||
use mem::heap_size_of_self_and_children;
|
use mem::heap_size_of_self_and_children;
|
||||||
use msg::constellation_msg::{FrameType, PipelineId, PipelineNamespace};
|
use msg::constellation_msg::{FrameType, PipelineId, PipelineNamespace, ReferrerPolicy};
|
||||||
use msg::constellation_msg::{ReferrerPolicy, WindowSizeType};
|
|
||||||
use net_traits::{AsyncResponseTarget, CoreResourceMsg, LoadConsumer, LoadContext, Metadata, ResourceThreads};
|
use net_traits::{AsyncResponseTarget, CoreResourceMsg, LoadConsumer, LoadContext, Metadata, ResourceThreads};
|
||||||
use net_traits::{IpcSend, LoadData as NetLoadData};
|
use net_traits::{IpcSend, LoadData as NetLoadData};
|
||||||
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
||||||
|
@ -87,7 +86,7 @@ use script_traits::{CompositorEvent, ConstellationControlMsg, EventResult};
|
||||||
use script_traits::{InitialScriptState, LoadData, MouseButton, MouseEventType, MozBrowserEvent};
|
use script_traits::{InitialScriptState, LoadData, MouseButton, MouseEventType, MozBrowserEvent};
|
||||||
use script_traits::{NewLayoutInfo, ScriptMsg as ConstellationMsg};
|
use script_traits::{NewLayoutInfo, ScriptMsg as ConstellationMsg};
|
||||||
use script_traits::{ScriptThreadFactory, TimerEvent, TimerEventRequest, TimerSource};
|
use script_traits::{ScriptThreadFactory, TimerEvent, TimerEventRequest, TimerSource};
|
||||||
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData};
|
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
|
use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
|
||||||
use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent};
|
use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent};
|
||||||
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
||||||
|
|
|
@ -52,8 +52,7 @@ use hyper::method::Method;
|
||||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||||
use libc::c_void;
|
use libc::c_void;
|
||||||
use msg::constellation_msg::{FrameId, FrameType, Key, KeyModifiers, KeyState};
|
use msg::constellation_msg::{FrameId, FrameType, Key, KeyModifiers, KeyState};
|
||||||
use msg::constellation_msg::{PipelineId, PipelineNamespaceId, ReferrerPolicy};
|
use msg::constellation_msg::{PipelineId, PipelineNamespaceId, ReferrerPolicy, TraversalDirection};
|
||||||
use msg::constellation_msg::{TraversalDirection, WindowSizeType};
|
|
||||||
use net_traits::{LoadOrigin, ResourceThreads};
|
use net_traits::{LoadOrigin, ResourceThreads};
|
||||||
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
use net_traits::bluetooth_thread::BluetoothMethodMsg;
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
|
@ -621,6 +620,15 @@ pub struct WindowSizeData {
|
||||||
pub device_pixel_ratio: ScaleFactor<f32, ViewportPx, DevicePixel>,
|
pub device_pixel_ratio: ScaleFactor<f32, ViewportPx, DevicePixel>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The type of window size change.
|
||||||
|
#[derive(Deserialize, Eq, PartialEq, Serialize, Copy, Clone, HeapSizeOf)]
|
||||||
|
pub enum WindowSizeType {
|
||||||
|
/// Initial load.
|
||||||
|
Initial,
|
||||||
|
/// Window resize.
|
||||||
|
Resize,
|
||||||
|
}
|
||||||
|
|
||||||
/// Messages to the constellation originating from the WebDriver server.
|
/// Messages to the constellation originating from the WebDriver server.
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
pub enum WebDriverCommandMsg {
|
pub enum WebDriverCommandMsg {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue