1 /** @file ui_main.h  Graphical User Interface (obsolete).
2  *
3  * Has ties to the console routines.
4  *
5  * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
6  * @authors Copyright © 2005-2014 Daniel Swanson <danij@dengine.net>
7  *
8  * @par License
9  * GPL: http://www.gnu.org/licenses/gpl.html
10  *
11  * <small>This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by the
13  * Free Software Foundation; either version 2 of the License, or (at your
14  * option) any later version. This program is distributed in the hope that it
15  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details. You should have received a copy of the GNU
18  * General Public License along with this program; if not, see:
19  * http://www.gnu.org/licenses</small>
20  */
21 
22 #ifndef LIBDENG_UI_MAIN_H
23 #define LIBDENG_UI_MAIN_H
24 
25 #include <de/rect.h>
26 #include "ddevent.h"
27 #ifdef __CLIENT__
28 #  include "MaterialVariantSpec"
29 #endif
30 
31 /*enum fontstyle_t {
32     FS_NORMAL,
33     FS_BOLD,
34     FS_LIGHT,
35     FONTSTYLE_COUNT
36 };*/
37 
38 /// Numeric identifiers of predefined colors.
39 /// @ingroup infine
40 enum {
41     UIC_TEXT,
42     UIC_TITLE,
43     /*
44     UIC_SHADOW,
45     UIC_BG_LIGHT,
46     UIC_BG_MEDIUM,
47     UIC_BG_DARK,
48     UIC_BRD_HI,
49     UIC_BRD_MED,
50     UIC_BRD_LOW,
51     UIC_HELP,
52     */
53     NUM_UI_COLORS
54 };
55 
56 /// Standard dimensions.
57 #define UI_WIDTH            (1000.0f)
58 #define UI_HEIGHT           (1000.0f)
59 //#define UI_BORDER           (UI_WIDTH/120) /// All borders are this wide.
60 #define UI_SHADOW_OFFSET    (MIN_OF(3, UI_WIDTH/320))
61 #define UI_SHADOW_STRENGTH  (.6f)
62 //#define UI_BUTTON_BORDER    (UI_BORDER)
63 //#define UI_BAR_WDH          (UI_BORDER * 3)
64 //#define UI_BAR_BORDER       (UI_BORDER / 2)
65 //#define UI_BAR_BUTTON_BORDER (3 * UI_BAR_BORDER / 2)
66 #define UI_MAX_COLUMNS      10 /// Maximum columns for list box.
67 
68 typedef struct {
69     float red, green, blue;
70 } ui_color_t;
71 
72 DENG_EXTERN_C fontid_t fontFixed; //, fontVariable[FONTSTYLE_COUNT];
73 
74 //void UI_Register(void);
75 
76 void UI_LoadFonts(void);
77 
78 char const *UI_ChooseFixedFont(void);
79 //char const *UI_ChooseVariableFont(fontstyle_t style);
80 
81 /// @param id  Id number of the color to return e.g. "UIC_TEXT".
82 ui_color_t* UI_Color(uint id);
83 
84 /// @return  Height of the current UI font.
85 //int UI_FontHeight(void);
86 
87 /**
88  * Background with the "The Doomsday Engine" text superimposed.
89  *
90  * @param origin  Screen-space coordinate origin (top left).
91  * @param size  Screen-space dimensions of the cursor in pixels.
92  * @param alpha  Alpha level to use when drawing the background.
93  */
94 void UI_DrawDDBackground(Point2Raw const &origin, Size2Raw const &size, float alpha);
95 
96 void UI_MixColors(ui_color_t* a, ui_color_t* b, ui_color_t* dest, float amount);
97 void UI_SetColorA(ui_color_t* color, float alpha);
98 void UI_SetColor(ui_color_t* color);
99 //void UI_Gradient(const Point2Raw* origin, const Size2Raw* size, ui_color_t* top, ui_color_t* bottom, float topAlpha, float bottomAlpha);
100 //void UI_GradientEx(const Point2Raw* origin, const Size2Raw* size, int border, ui_color_t* top, ui_color_t* bottom, float topAlpha, float bottomAlpha);
101 //void UI_DrawRectEx(const Point2Raw* origin, const Size2Raw* size, int brd, dd_bool filled, ui_color_t* top, ui_color_t* bottom, float alpha, float bottomAlpha);
102 
103 /// Draw shadowed text.
104 void UI_TextOutEx(const char* text, const Point2Raw* origin, ui_color_t* color, float alpha);
105 void UI_TextOutEx2(const char* text, const Point2Raw* origin, ui_color_t* color, float alpha, int alignFlags, short textFlags);
106 
107 //de::MaterialVariantSpec const &UI_MaterialSpec(int texSpecFlags = 0);
108 
109 #endif
110