| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_WIDGET_WIDGET_GTK_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_GTK_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_GTK_H_ | 6 #define VIEWS_WIDGET_WIDGET_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // stored in properties for a GtkViewsFixed, or in the requisitioned | 145 // stored in properties for a GtkViewsFixed, or in the requisitioned |
| 146 // size of other kinds of widgets. | 146 // size of other kinds of widgets. |
| 147 void GetRequestedSize(gfx::Size* out) const; | 147 void GetRequestedSize(gfx::Size* out) const; |
| 148 | 148 |
| 149 // Overridden from ui::ActiveWindowWatcherX::Observer. | 149 // Overridden from ui::ActiveWindowWatcherX::Observer. |
| 150 virtual void ActiveWindowChanged(GdkWindow* active_window); | 150 virtual void ActiveWindowChanged(GdkWindow* active_window); |
| 151 | 151 |
| 152 // Overridden from Widget: | 152 // Overridden from Widget: |
| 153 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds); | 153 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds); |
| 154 virtual void InitWithWidget(Widget* parent, const gfx::Rect& bounds); | 154 virtual void InitWithWidget(Widget* parent, const gfx::Rect& bounds); |
| 155 virtual void SetBounds(const gfx::Rect& bounds); | |
| 156 virtual void MoveAbove(Widget* other); | |
| 157 virtual void SetShape(gfx::NativeRegion region); | |
| 158 virtual void Close(); | |
| 159 virtual void CloseNow(); | |
| 160 virtual void Show(); | |
| 161 virtual void Hide(); | |
| 162 virtual gfx::NativeView GetNativeView() const; | 155 virtual gfx::NativeView GetNativeView() const; |
| 163 virtual void SetOpacity(unsigned char opacity); | |
| 164 virtual void SetAlwaysOnTop(bool on_top); | |
| 165 virtual bool IsVisible() const; | |
| 166 virtual bool IsActive() const; | |
| 167 virtual bool IsAccessibleWidget() const; | |
| 168 virtual void GenerateMousePressedForView(View* view, | 156 virtual void GenerateMousePressedForView(View* view, |
| 169 const gfx::Point& point); | 157 const gfx::Point& point); |
| 170 virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); | 158 virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); |
| 171 virtual Window* GetWindow(); | 159 virtual Window* GetWindow(); |
| 172 virtual const Window* GetWindow() const; | 160 virtual const Window* GetWindow() const; |
| 173 virtual void ViewHierarchyChanged(bool is_add, View *parent, | 161 virtual void ViewHierarchyChanged(bool is_add, View *parent, |
| 174 View *child); | 162 View *child); |
| 175 | 163 |
| 176 // Clears the focus on the native widget having the focus. | 164 // Clears the focus on the native widget having the focus. |
| 177 virtual void ClearNativeFocus(); | 165 virtual void ClearNativeFocus(); |
| 178 | 166 |
| 179 // Handles a keyboard event by sending it to our focus manager. | 167 // Handles a keyboard event by sending it to our focus manager. |
| 180 // Returns true if it's handled by the focus manager. | 168 // Returns true if it's handled by the focus manager. |
| 181 bool HandleKeyboardEvent(GdkEventKey* event); | 169 bool HandleKeyboardEvent(GdkEventKey* event); |
| 182 | 170 |
| 183 // Returns the view::Event::flags for a GdkEventButton. | 171 // Returns the view::Event::flags for a GdkEventButton. |
| 184 static int GetFlagsForEventButton(const GdkEventButton& event); | 172 static int GetFlagsForEventButton(const GdkEventButton& event); |
| 185 | 173 |
| 186 // Enables debug painting. See |debug_paint_enabled_| for details. | 174 // Enables debug painting. See |debug_paint_enabled_| for details. |
| 187 static void EnableDebugPaint(); | 175 static void EnableDebugPaint(); |
| 188 | 176 |
| 189 // Overridden from NativeWidget: | 177 // Overridden from NativeWidget: |
| 190 virtual Widget* GetWidget() OVERRIDE; | 178 virtual Widget* GetWidget() OVERRIDE; |
| 191 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; | 179 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; |
| 192 virtual void* GetNativeWindowProperty(const char* name) OVERRIDE; | 180 virtual void* GetNativeWindowProperty(const char* name) OVERRIDE; |
| 193 virtual TooltipManager* GetTooltipManager() const OVERRIDE; | 181 virtual TooltipManager* GetTooltipManager() const OVERRIDE; |
| 194 virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE; | 182 virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE; |
| 195 virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE; | 183 virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE; |
| 184 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
| 185 virtual void MoveAbove(Widget* widget) OVERRIDE; |
| 186 virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; |
| 187 virtual void Close() OVERRIDE; |
| 188 virtual void CloseNow() OVERRIDE; |
| 189 virtual void Show() OVERRIDE; |
| 190 virtual void Hide() OVERRIDE; |
| 191 virtual void SetOpacity(unsigned char opacity) OVERRIDE; |
| 192 virtual void SetAlwaysOnTop(bool on_top) OVERRIDE; |
| 193 virtual bool IsVisible() const OVERRIDE; |
| 194 virtual bool IsActive() const OVERRIDE; |
| 195 virtual bool IsAccessibleWidget() const OVERRIDE; |
| 196 virtual bool ContainsNativeView(gfx::NativeView native_view) const OVERRIDE; | 196 virtual bool ContainsNativeView(gfx::NativeView native_view) const OVERRIDE; |
| 197 virtual void RunShellDrag(View* view, | 197 virtual void RunShellDrag(View* view, |
| 198 const ui::OSExchangeData& data, | 198 const ui::OSExchangeData& data, |
| 199 int operation) OVERRIDE; | 199 int operation) OVERRIDE; |
| 200 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 200 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; |
| 201 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 201 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
| 202 | 202 |
| 203 protected: | 203 protected: |
| 204 // If widget contains another widget, translates event coordinates to the | 204 // If widget contains another widget, translates event coordinates to the |
| 205 // contained widget's coordinates, else returns original event coordinates. | 205 // contained widget's coordinates, else returns original event coordinates. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // Valid for the lifetime of StartDragForViewFromMouseEvent, indicates the | 421 // Valid for the lifetime of StartDragForViewFromMouseEvent, indicates the |
| 422 // view the drag started from. | 422 // view the drag started from. |
| 423 View* dragged_view_; | 423 View* dragged_view_; |
| 424 | 424 |
| 425 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); | 425 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); |
| 426 }; | 426 }; |
| 427 | 427 |
| 428 } // namespace views | 428 } // namespace views |
| 429 | 429 |
| 430 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ | 430 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ |
| OLD | NEW |