| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ | 5 #ifndef WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ |
| 6 #define WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ | 6 #define WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // remains with the caller. | 47 // remains with the caller. |
| 48 virtual void AddPanel(Panel* panel, PanelSource source) = 0; | 48 virtual void AddPanel(Panel* panel, PanelSource source) = 0; |
| 49 | 49 |
| 50 // Remove a panel from this container. Ownership remains with the | 50 // Remove a panel from this container. Ownership remains with the |
| 51 // caller. Note that this may be a panel that's currently being dragged. | 51 // caller. Note that this may be a panel that's currently being dragged. |
| 52 virtual void RemovePanel(Panel* panel) = 0; | 52 virtual void RemovePanel(Panel* panel) = 0; |
| 53 | 53 |
| 54 // Is the passed-in panel (which isn't currently in any container) being | 54 // Is the passed-in panel (which isn't currently in any container) being |
| 55 // dragged to a position such that it should be added to this container? | 55 // dragged to a position such that it should be added to this container? |
| 56 virtual bool ShouldAddDraggedPanel(const Panel* panel, | 56 virtual bool ShouldAddDraggedPanel(const Panel* panel, |
| 57 int drag_x, | 57 const Point& drag_pos) = 0; |
| 58 int drag_y) = 0; | |
| 59 | 58 |
| 60 // Handle pointer events occurring in the container's input windows. | 59 // Handle pointer events occurring in the container's input windows. |
| 61 virtual void HandleInputWindowButtonPress(XWindow xid, | 60 virtual void HandleInputWindowButtonPress(XWindow xid, |
| 62 int x, int y, | 61 const Point& relative_pos, |
| 63 int x_root, int y_root, | 62 const Point& absolute_pos, |
| 64 int button, | 63 int button, |
| 65 XTime timestamp) = 0; | 64 XTime timestamp) = 0; |
| 66 virtual void HandleInputWindowButtonRelease(XWindow xid, | 65 virtual void HandleInputWindowButtonRelease(XWindow xid, |
| 67 int x, int y, | 66 const Point& relative_pos, |
| 68 int x_root, int y_root, | 67 const Point& absolute_pos, |
| 69 int button, | 68 int button, |
| 70 XTime timestamp) = 0; | 69 XTime timestamp) = 0; |
| 71 virtual void HandleInputWindowPointerEnter(XWindow xid, | 70 virtual void HandleInputWindowPointerEnter(XWindow xid, |
| 72 int x, int y, | 71 const Point& relative_pos, |
| 73 int x_root, int y_root, | 72 const Point& absolute_pos, |
| 74 XTime timestamp) = 0; | 73 XTime timestamp) = 0; |
| 75 virtual void HandleInputWindowPointerLeave(XWindow xid, | 74 virtual void HandleInputWindowPointerLeave(XWindow xid, |
| 76 int x, int y, | 75 const Point& relative_pos, |
| 77 int x_root, int y_root, | 76 const Point& absolute_pos, |
| 78 XTime timestamp) = 0; | 77 XTime timestamp) = 0; |
| 79 | 78 |
| 80 // Handle a button press or pointer enter in a panel. | 79 // Handle a button press or pointer enter in a panel. |
| 81 virtual void HandlePanelButtonPress(Panel* panel, | 80 virtual void HandlePanelButtonPress(Panel* panel, |
| 82 int button, | 81 int button, |
| 83 XTime timestamp) = 0; | 82 XTime timestamp) = 0; |
| 84 virtual void HandlePanelTitlebarPointerEnter(Panel* panel, | 83 virtual void HandlePanelTitlebarPointerEnter(Panel* panel, |
| 85 XTime timestamp) = 0; | 84 XTime timestamp) = 0; |
| 86 | 85 |
| 87 // Handle a message asking us to expand or collapse one of our panels. | 86 // Handle a message asking us to expand or collapse one of our panels. |
| 88 virtual void HandleSetPanelStateMessage(Panel* panel, bool expand) = 0; | 87 virtual void HandleSetPanelStateMessage(Panel* panel, bool expand) = 0; |
| 89 | 88 |
| 90 // Handle a message from Chrome telling us that a panel has been dragged | 89 // Handle a message from Chrome telling us that a panel has been dragged |
| 91 // to a particular location. If false is returned, it indicates that the | 90 // to a particular location. If false is returned, it indicates that the |
| 92 // panel should be removed from this container (i.e. it's been dragged | 91 // panel should be removed from this container (i.e. it's been dragged |
| 93 // too far away) -- the container's RemovePanel() method will be invoked | 92 // too far away) -- the container's RemovePanel() method will be invoked |
| 94 // to accomplish this. | 93 // to accomplish this. |
| 95 virtual bool HandleNotifyPanelDraggedMessage(Panel* panel, | 94 virtual bool HandleNotifyPanelDraggedMessage(Panel* panel, |
| 96 int drag_x, | 95 const Point& drag_pos) = 0; |
| 97 int drag_y) = 0; | |
| 98 | 96 |
| 99 // Handle a message from Chrome telling us that a panel drag is complete. | 97 // Handle a message from Chrome telling us that a panel drag is complete. |
| 100 virtual void HandleNotifyPanelDragCompleteMessage(Panel* panel) = 0; | 98 virtual void HandleNotifyPanelDragCompleteMessage(Panel* panel) = 0; |
| 101 | 99 |
| 102 // Handle a message asking us to focus one of our panels. | 100 // Handle a message asking us to focus one of our panels. |
| 103 virtual void HandleFocusPanelMessage(Panel* panel, XTime timestamp) = 0; | 101 virtual void HandleFocusPanelMessage(Panel* panel, XTime timestamp) = 0; |
| 104 | 102 |
| 105 // Handle a ConfigureRequest event that asks for a panel's content window | 103 // Handle a ConfigureRequest event that asks for a panel's content window |
| 106 // to be resized. | 104 // to be resized. |
| 107 virtual void HandlePanelResizeRequest(Panel* panel, | 105 virtual void HandlePanelResizeRequest(Panel* panel, |
| 108 int req_width, int req_height) = 0; | 106 const Size& requested_size) = 0; |
| 109 | 107 |
| 110 // Handle the user resizing the panel by dragging one of its resize | 108 // Handle the user resizing the panel by dragging one of its resize |
| 111 // borders. This method is invoked at the end of the resize. | 109 // borders. This method is invoked at the end of the resize. |
| 112 virtual void HandlePanelResizeByUser(Panel* panel) = 0; | 110 virtual void HandlePanelResizeByUser(Panel* panel) = 0; |
| 113 | 111 |
| 114 // Handle the screen being resized. | 112 // Handle the screen being resized. |
| 115 virtual void HandleScreenResize() = 0; | 113 virtual void HandleScreenResize() = 0; |
| 116 | 114 |
| 117 // Handle a change to a panel's urgency hint. | 115 // Handle a change to a panel's urgency hint. |
| 118 virtual void HandlePanelUrgencyChange(Panel* panel) = 0; | 116 virtual void HandlePanelUrgencyChange(Panel* panel) = 0; |
| 119 | 117 |
| 120 // Take the input focus if possible. Returns false if it doesn't make | 118 // Take the input focus if possible. Returns false if it doesn't make |
| 121 // sense to take the focus (suppose there are no panels, or only | 119 // sense to take the focus (suppose there are no panels, or only |
| 122 // collapsed panels). | 120 // collapsed panels). |
| 123 virtual bool TakeFocus(XTime timestamp) = 0; | 121 virtual bool TakeFocus(XTime timestamp) = 0; |
| 124 | 122 |
| 125 DISALLOW_COPY_AND_ASSIGN(PanelContainer); | 123 DISALLOW_COPY_AND_ASSIGN(PanelContainer); |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 } // namespace window_manager | 126 } // namespace window_manager |
| 129 | 127 |
| 130 #endif // WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ | 128 #endif // WINDOW_MANAGER_PANELS_PANEL_CONTAINER_H_ |
| OLD | NEW |