Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Side by Side Diff: ui/gfx/win/hwnd_util.h

Issue 1061733002: Remove windows/mac/ios specific code from //ui (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix default try set Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/test/ui_cocoa_test_helper.mm ('k') | ui/gfx/win/hwnd_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_WIN_HWND_UTIL_H_
6 #define UI_GFX_WIN_HWND_UTIL_H_
7
8 #include <windows.h>
9
10 #include "base/strings/string16.h"
11 #include "ui/gfx/gfx_export.h"
12
13 namespace gfx {
14 class Point;
15 class Size;
16
17 // A version of the GetClassNameW API that returns the class name in an
18 // base::string16. An empty result indicates a failure to get the class name.
19 GFX_EXPORT base::string16 GetClassName(HWND hwnd);
20
21 // Useful for subclassing a HWND. Returns the previous window procedure.
22 GFX_EXPORT WNDPROC SetWindowProc(HWND hwnd, WNDPROC wndproc);
23
24 // Pointer-friendly wrappers around Get/SetWindowLong(..., GWLP_USERDATA, ...)
25 // Returns the previously set value.
26 GFX_EXPORT void* SetWindowUserData(HWND hwnd, void* user_data);
27 GFX_EXPORT void* GetWindowUserData(HWND hwnd);
28
29 // Returns true if the specified window is the current active top window or one
30 // of its children.
31 GFX_EXPORT bool DoesWindowBelongToActiveWindow(HWND window);
32
33 // Sizes the window to have a window size of |pref|, then centers the window
34 // over |parent|, ensuring the window fits on screen.
35 GFX_EXPORT void CenterAndSizeWindow(HWND parent,
36 HWND window,
37 const gfx::Size& pref);
38
39 // If |hwnd| is NULL logs various thing and CHECKs. Invoke right after calling
40 // CreateWindow.
41 GFX_EXPORT void CheckWindowCreated(HWND hwnd);
42
43 // Shows |window|'s system menu (at a specified |point| in screen coordinates).
44 GFX_EXPORT void ShowSystemMenu(HWND window);
45 GFX_EXPORT void ShowSystemMenuAtPoint(HWND window, const gfx::Point& point);
46
47 // Returns the window you can use to parent a top level window.
48 // Note that in some cases we create child windows not parented to its final
49 // container so in those cases you should pass true in |get_real_hwnd|.
50 GFX_EXPORT HWND GetWindowToParentTo(bool get_real_hwnd);
51
52 } // namespace gfx
53
54 #endif // UI_GFX_WIN_HWND_UTIL_H_
OLDNEW
« no previous file with comments | « ui/gfx/test/ui_cocoa_test_helper.mm ('k') | ui/gfx/win/hwnd_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698