OSDN Git Service

Add facility for control of child window placement.
[mingw/wtklite.git] / wtkalign.h
1 #ifndef WTKALIGN_H
2 /*
3  * wtkalign.h
4  *
5  * ---------------------------------------------------------------------------
6  *
7  * Implementation of an AlignWindow() function, to complement the
8  * Microsoft Windows Application Programming Interface.
9  *
10  * $Id$
11  *
12  * This header file is to be included by all users of AlignWindow().
13  *
14  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
15  * Copyright (C) 2013, MinGW.org Project.
16  *
17  * ---------------------------------------------------------------------------
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining a
20  * copy of this software and associated documentation files (the "Software"),
21  * to deal in the Software without restriction, including without limitation
22  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
23  * and/or sell copies of the Software, and to permit persons to whom the
24  * Software is furnished to do so, subject to the following conditions:
25  *
26  * The above copyright notice, this permission notice, and the following
27  * disclaimer shall be included in all copies or substantial portions of
28  * the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
31  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
33  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
35  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
36  * DEALINGS IN THE SOFTWARE.
37  *
38  * ---------------------------------------------------------------------------
39  *
40  */
41 #define WTKALIGN_H  1
42
43 /* AlignWindow() is written in C, but for C++ clients we subsume
44  * it into the WTK namespace.
45  */
46 #include "wtkdefs.h"
47
48 BEGIN_NAMESPACE( WTK )
49
50 /* Specify reference bounds for child window alignment.
51  * By default, child windows are aligned within the frame of their parent.
52  * Adding this bit-flag, (by bit-wise OR), to the alignment parameter which
53  * is passed to the WTK::AlignWindow function, will override this default,
54  * so alignment becomes relative to the screen bounds.
55  */
56 #define WTK_ALIGN_ONSCREEN        0x0100
57
58 /* Define the individual component flags, for specification of window
59  * placement relative to each of the four alignment boundaries.
60  */
61 #define WTK_ALIGN_LEFT            0x0001
62 #define WTK_ALIGN_RIGHT           0x0002
63 #define WTK_ALIGN_HCENTRE         0x0003
64 #define WTK_ALIGN_TOP             0x0010
65 #define WTK_ALIGN_BOTTOM          0x0020
66 #define WTK_ALIGN_VCENTRE         0x0030
67
68 /* Combine these, to define the nine logical placement classes.
69  */
70 #define WTK_ALIGN_TOPLEFT       ( WTK_ALIGN_TOP      |  WTK_ALIGN_LEFT    )
71 #define WTK_ALIGN_TOPRIGHT      ( WTK_ALIGN_TOP      |  WTK_ALIGN_RIGHT   )
72 #define WTK_ALIGN_CENTRETOP     ( WTK_ALIGN_TOP      |  WTK_ALIGN_HCENTRE )
73 #define WTK_ALIGN_CENTRELEFT    ( WTK_ALIGN_LEFT     |  WTK_ALIGN_VCENTRE )
74 #define WTK_ALIGN_CENTRERIGHT   ( WTK_ALIGN_RIGHT    |  WTK_ALIGN_VCENTRE )
75 #define WTK_ALIGN_CENTRED       ( WTK_ALIGN_HCENTRE  |  WTK_ALIGN_VCENTRE )
76 #define WTK_ALIGN_CENTREBOTTOM  ( WTK_ALIGN_BOTTOM   |  WTK_ALIGN_HCENTRE )
77 #define WTK_ALIGN_BOTTOMRIGHT   ( WTK_ALIGN_BOTTOM   |  WTK_ALIGN_RIGHT   )
78 #define WTK_ALIGN_BOTTOMLEFT    ( WTK_ALIGN_BOTTOM   |  WTK_ALIGN_LEFT    )
79
80 /* Provide a set of aliases to suit American users, (and any others
81  * who can't spell "centre").
82  */
83 #define WTK_ALIGN_CENTERED        WTK_ALIGN_CENTRED
84 #define WTK_ALIGN_CENTERTOP       WTK_ALIGN_CENTRETOP
85 #define WTK_ALIGN_CENTERLEFT      WTK_ALIGN_CENTRELEFT
86 #define WTK_ALIGN_CENTERBOTTOM    WTK_ALIGN_CENTREBOTTOM
87 #define WTK_ALIGN_CENTERRIGHT     WTK_ALIGN_CENTRERIGHT
88
89 /* Declare the prototype for the alignmemnt function.
90  */
91 EXTERN_C void AlignWindow( HWND child, unsigned int alignment );
92
93 END_NAMESPACE( WTK )
94
95 #endif /* WTKALIGN_H: $RCSfile$: end of file */