1 /*
2 Copyright 2020, Dirk Krause. All rights reserved.
3 SPDX-License-Identifier:	BSD-3-Clause
4 */
5 
6 #ifndef	DK4ALIGN_H_INCLUDED
7 /**	Protection against multiple inclusions. */
8 #define	DK4ALIGN_H_INCLUDED 1
9 
10 /**	@file	dk4align.h	Definitions for horizontal and vertical
11 	alignment.
12 */
13 
14 /**	How to align a text horizontally.
15 */
16 typedef enum {
17 							/**	Text origin is at left side of text.
18 							*/
19 	DK4_TEXT_ALIGN_H_LEFT	= 0,
20 
21 							/**	Text origin is at center of text.
22 							*/
23 	DK4_TEXT_ALIGN_H_CENTERED ,
24 
25 							/** Text origin is at right side of text.
26 							*/
27 	DK4_TEXT_ALIGN_H_RIGHT ,
28 
29 } dk4_text_align_h_t;
30 
31 
32 /**	How to align a text vertically.
33 */
34 typedef enum {
35 								/**	Text origin is at top of text.
36 								*/
37 	DK4_TEXT_ALIGN_V_TOP		= 0,
38 
39 								/**	Text origin is at center of text.
40 								*/
41 	DK4_TEXT_ALIGN_V_CENTERED ,
42 
43 								/**	Text origin is at bottom of text.
44 								*/
45 	DK4_TEXT_ALIGN_V_BOTTOM ,
46 
47 								/**	Text origin is at text base line.
48 								*/
49 	DK4_TEXT_ALIGN_V_BASELINE
50 
51 } dk4_text_align_v_t;
52 
53 
54 /**	How to align an image horizontally within the available room.
55 */
56 typedef enum {
57 								/**	Place image on the left.
58 								*/
59 	DK4_IMAGE_ALIGN_H_LEFT		= DK4_TEXT_ALIGN_H_LEFT ,
60 
61 								/**	Place image centered.
62 								*/
63 	DK4_IMAGE_ALIGN_H_CENTERED	= DK4_TEXT_ALIGN_H_CENTERED ,
64 
65 								/**	Place image on the right.
66 								*/
67 	DK4_IMAGE_ALIGN_H_RIGHT		= DK4_TEXT_ALIGN_H_RIGHT ,
68 
69 								/**	Stretch image to use room completely.
70 								*/
71 	DK4_IMAGE_ALIGN_H_STRETCH	= (DK4_IMAGE_ALIGN_H_RIGHT + 1)
72 
73 } dk4_image_align_h_t;
74 
75 
76 /**	How to align an image vertically in the available room.
77 */
78 typedef enum {
79 								/**	Place image on top.
80 								*/
81 	DK4_IMAGE_ALIGN_V_TOP		= DK4_TEXT_ALIGN_V_TOP ,
82 
83 								/**	Place image centered.
84 								*/
85 	DK4_IMAGE_ALIGN_V_CENTERED	= DK4_TEXT_ALIGN_V_CENTERED ,
86 
87 								/**	Place image on bottom.
88 								*/
89 	DK4_IMAGE_ALIGN_V_BOTTOM	= DK4_TEXT_ALIGN_V_BOTTOM ,
90 
91 								/**	Stretch image to fill room.
92 								*/
93 	DK4_IMAGE_ALIGN_V_STRETCH	= DK4_TEXT_ALIGN_V_BASELINE
94 
95 } dk4_image_align_v_t;
96 
97 
98 /* vim: set ai sw=4 ts=4 : */
99 
100 #endif
101 
102