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 GFX_WINDOW_IMPL_H_ | 5 #ifndef GFX_WINDOW_IMPL_H_ |
6 #define GFX_WINDOW_IMPL_H_ | 6 #define GFX_WINDOW_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlapp.h> | 10 #include <atlapp.h> |
11 #include <atlmisc.h> | 11 #include <atlmisc.h> |
12 #include <atlcrack.h> | 12 #include <atlcrack.h> |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/logging.h" | 16 #include "base/basictypes.h" |
17 #include "gfx/native_widget_types.h" | 17 #include "gfx/native_widget_types.h" |
18 #include "gfx/rect.h" | 18 #include "gfx/rect.h" |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 | 21 |
22 // An interface implemented by classes that use message maps. | 22 // An interface implemented by classes that use message maps. |
23 // ProcessWindowMessage is implemented by the BEGIN_MESSAGE_MAP_EX macro. | 23 // ProcessWindowMessage is implemented by the BEGIN_MESSAGE_MAP_EX macro. |
24 class MessageMapInterface { | 24 class MessageMapInterface { |
25 public: | 25 public: |
26 // Processes one message from the window's message queue. | 26 // Processes one message from the window's message queue. |
(...skipping 30 matching lines...) Expand all Loading... |
57 // Sets the window styles. This is ONLY used when the window is created. | 57 // Sets the window styles. This is ONLY used when the window is created. |
58 // In other words, if you invoke this after invoking Init, nothing happens. | 58 // In other words, if you invoke this after invoking Init, nothing happens. |
59 void set_window_style(DWORD style) { window_style_ = style; } | 59 void set_window_style(DWORD style) { window_style_ = style; } |
60 DWORD window_style() const { return window_style_; } | 60 DWORD window_style() const { return window_style_; } |
61 | 61 |
62 // Sets the extended window styles. See comment about |set_window_style|. | 62 // Sets the extended window styles. See comment about |set_window_style|. |
63 void set_window_ex_style(DWORD style) { window_ex_style_ = style; } | 63 void set_window_ex_style(DWORD style) { window_ex_style_ = style; } |
64 DWORD window_ex_style() const { return window_ex_style_; } | 64 DWORD window_ex_style() const { return window_ex_style_; } |
65 | 65 |
66 // Sets the class style to use. The default is CS_DBLCLKS. | 66 // Sets the class style to use. The default is CS_DBLCLKS. |
67 void set_initial_class_style(UINT class_style) { | 67 void set_initial_class_style(UINT class_style); |
68 // We dynamically generate the class name, so don't register it globally! | |
69 DCHECK_EQ((class_style & CS_GLOBALCLASS), 0u); | |
70 class_style_ = class_style; | |
71 } | |
72 UINT initial_class_style() const { return class_style_; } | 68 UINT initial_class_style() const { return class_style_; } |
73 | 69 |
74 // Returns true if the specified |hwnd| is a WindowImpl. | 70 // Returns true if the specified |hwnd| is a WindowImpl. |
75 static bool IsWindowImpl(HWND hwnd); | 71 static bool IsWindowImpl(HWND hwnd); |
76 | 72 |
77 protected: | 73 protected: |
78 // Handles the WndProc callback for this object. | 74 // Handles the WndProc callback for this object. |
79 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param); | 75 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param); |
80 | 76 |
81 private: | 77 private: |
(...skipping 23 matching lines...) Expand all Loading... |
105 | 101 |
106 // Our hwnd. | 102 // Our hwnd. |
107 HWND hwnd_; | 103 HWND hwnd_; |
108 | 104 |
109 DISALLOW_COPY_AND_ASSIGN(WindowImpl); | 105 DISALLOW_COPY_AND_ASSIGN(WindowImpl); |
110 }; | 106 }; |
111 | 107 |
112 } // namespace gfx | 108 } // namespace gfx |
113 | 109 |
114 #endif // GFX_WINDOW_IMPL_H_ | 110 #endif // GFX_WINDOW_IMPL_H_ |
OLD | NEW |