Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / base / cocoa / appkit_utils.h
blob3f1b446349d97ba63ed9e8cc4b3f050ec7aee209
1 // Copyright 2013 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.
5 #ifndef UI_BASE_COCOA_APPKIT_UTILS_H
6 #define UI_BASE_COCOA_APPKIT_UTILS_H
8 #import <Cocoa/Cocoa.h>
10 #include "ui/base/ui_base_export.h"
12 namespace ui {
14 struct NinePartImageIds {
15 int top_left;
16 int top;
17 int top_right;
18 int left;
19 int center;
20 int right;
21 int bottom_left;
22 int bottom;
23 int bottom_right;
26 // A macro to define arrays of IDR constants used with DrawNinePartImage.
27 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \
28 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \
29 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, }
31 // Utility method to draw a nine part image using image ids.
32 UI_BASE_EXPORT void DrawNinePartImage(NSRect frame,
33 const NinePartImageIds& image_ids,
34 NSCompositingOperation operation,
35 CGFloat alpha,
36 BOOL flipped);
38 // Minimizes or zooms the window, or does nothing, depending on OS version and
39 // system configuration.
40 // |window| is the receiver of the double click.
41 // |sender| is the object that sends the action, if one is sent.
42 UI_BASE_EXPORT void WindowTitlebarReceivedDoubleClick(NSWindow* window,
43 id sender);
45 } // namespace ui
47 #endif // UI_BASE_COCOA_APPKIT_UTILS_H