Index: ui/views/win/hwnd_message_handler.h |
=================================================================== |
--- ui/views/win/hwnd_message_handler.h (revision 153487) |
+++ ui/views/win/hwnd_message_handler.h (working copy) |
@@ -16,12 +16,14 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
+#include "ui/base/accessibility/accessibility_types.h" |
#include "ui/base/ui_base_types.h" |
#include "ui/gfx/rect.h" |
#include "ui/views/ime/input_method_delegate.h" |
#include "ui/views/views_export.h" |
namespace gfx { |
+class Canvas; |
class Insets; |
} |
@@ -54,9 +56,11 @@ |
gfx::Rect GetRestoredBounds() const; |
void GetWindowPlacement(gfx::Rect* bounds, |
ui::WindowShowState* show_state) const; |
+ gfx::Rect GetWorkAreaBoundsInScreen() const; |
void SetBounds(const gfx::Rect& bounds); |
void SetSize(const gfx::Size& size); |
+ void CenterWindow(const gfx::Size& size); |
void SetRegion(HRGN rgn); |
@@ -80,6 +84,8 @@ |
bool IsMinimized() const; |
bool IsMaximized() const; |
+ bool RunMoveLoop(const gfx::Point& drag_offset); |
+ |
// Tells the HWND its client area has changed. |
void SendFrameChanged(); |
@@ -98,6 +104,20 @@ |
InputMethod* CreateInputMethod(); |
+ void SendNativeAccessibilityEvent(int id, |
+ ui::AccessibilityTypes::Event event_type); |
+ |
+ void SetCursor(HCURSOR cursor); |
+ |
+ void FrameTypeChanged(); |
+ |
+ // Disable Layered Window updates by setting to false. |
+ void set_can_update_layered_window(bool can_update_layered_window) { |
+ can_update_layered_window_ = can_update_layered_window; |
+ } |
+ void SchedulePaintInRect(const gfx::Rect& rect); |
+ void SetOpacity(BYTE opacity); |
+ |
// Message Handlers. |
void OnActivate(UINT action, BOOL minimized, HWND window); |
// TODO(beng): Once this object becomes the WindowImpl, these methods can |
@@ -135,9 +155,11 @@ |
LRESULT OnNCActivate(BOOL active); |
LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); |
LRESULT OnNCHitTest(const CPoint& point); |
+ void OnNCPaint(HRGN rgn); |
LRESULT OnNCUAHDrawCaption(UINT message, WPARAM w_param, LPARAM l_param); |
LRESULT OnNCUAHDrawFrame(UINT message, WPARAM w_param, LPARAM l_param); |
LRESULT OnNotify(int w_param, NMHDR* l_param); |
+ void OnPaint(HDC dc); |
LRESULT OnPowerBroadcast(DWORD power_event, DWORD data); |
LRESULT OnReflectedMessage(UINT message, WPARAM w_param, LPARAM l_param); |
LRESULT OnSetCursor(UINT message, WPARAM w_param, LPARAM l_param); |
@@ -164,6 +186,11 @@ |
// frame windows. |
void ResetWindowRegion(bool force); |
+ // TODO(beng): This won't be a style violation once this object becomes the |
+ // WindowImpl. |
+ HWND hwnd(); |
+ HWND hwnd() const; |
+ |
private: |
typedef std::set<DWORD> TouchIDs; |
@@ -207,11 +234,13 @@ |
// Stops ignoring SetWindowPos() requests (see below). |
void StopIgnoringPosChanges() { ignore_window_pos_changes_ = false; } |
- // TODO(beng): This won't be a style violation once this object becomes the |
- // WindowImpl. |
- HWND hwnd(); |
- HWND hwnd() const; |
+ // Synchronously paints the invalid contents of the Widget. |
+ void RedrawInvalidRect(); |
+ // Synchronously updates the invalid contents of the Widget. Valid for |
+ // layered windows only. |
+ void RedrawLayeredWindowContents(); |
+ |
// TODO(beng): Remove once this class becomes the WindowImpl. |
void SetMsgHandled(BOOL handled); |
@@ -221,6 +250,10 @@ |
bool remove_standard_frame_; |
+ // The last cursor that was active before the current one was selected. Saved |
+ // so that we can restore it. |
+ HCURSOR previous_cursor_; |
+ |
// Event handling ------------------------------------------------------------ |
// The flags currently being used with TrackMouseEvent to track mouse |
@@ -262,6 +295,43 @@ |
HMONITOR last_monitor_; |
gfx::Rect last_monitor_rect_, last_work_area_; |
+ // Layered windows ----------------------------------------------------------- |
+ |
+ // Should we keep an off-screen buffer? This is false by default, set to true |
+ // when WS_EX_LAYERED is specified before the native window is created. |
+ // |
+ // NOTE: this is intended to be used with a layered window (a window with an |
+ // extended window style of WS_EX_LAYERED). If you are using a layered window |
+ // and NOT changing the layered alpha or anything else, then leave this value |
+ // alone. OTOH if you are invoking SetLayeredWindowAttributes then you'll |
+ // most likely want to set this to false, or after changing the alpha toggle |
+ // the extended style bit to false than back to true. See MSDN for more |
+ // details. |
+ bool use_layered_buffer_; |
+ |
+ // The default alpha to be applied to the layered window. |
+ BYTE layered_alpha_; |
+ |
+ // A canvas that contains the window contents in the case of a layered |
+ // window. |
+ scoped_ptr<gfx::Canvas> layered_window_contents_; |
+ |
+ // We must track the invalid rect ourselves, for two reasons: |
+ // For layered windows, Windows will not do this properly with |
+ // InvalidateRect()/GetUpdateRect(). (In fact, it'll return misleading |
+ // information from GetUpdateRect()). |
+ // We also need to keep track of the invalid rectangle for the RootView should |
+ // we need to paint the non-client area. The data supplied to WM_NCPAINT seems |
+ // to be insufficient. |
+ gfx::Rect invalid_rect_; |
+ |
+ // A factory that allows us to schedule a redraw for layered windows. |
+ base::WeakPtrFactory<HWNDMessageHandler> paint_layered_window_factory_; |
+ |
+ // True if we are allowed to update the layered window from the DIB backing |
+ // store if necessary. |
+ bool can_update_layered_window_; |
+ |
DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); |
}; |