1 /*
2 	This file is part of Warzone 2100.
3 	Copyright (C) 1999-2004  Eidos Interactive
4 	Copyright (C) 2005-2020  Warzone 2100 Project
5 
6 	Warzone 2100 is free software; you can redistribute it and/or modify
7 	it under the terms of the GNU General Public License as published by
8 	the Free Software Foundation; either version 2 of the License, or
9 	(at your option) any later version.
10 
11 	Warzone 2100 is distributed in the hope that it will be useful,
12 	but WITHOUT ANY WARRANTY; without even the implied warranty of
13 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 	GNU General Public License for more details.
15 
16 	You should have received a copy of the GNU General Public License
17 	along with Warzone 2100; if not, write to the Free Software
18 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 #ifndef __INCLUDED_INTIMAGE__
21 #define __INCLUDED_INTIMAGE__
22 
23 #include "intfac.h" // Interface image id's.
24 #include "lib/widget/listwidget.h"
25 #include "lib/ivis_opengl/pieblitfunc.h"
26 
27 #define FILLRED 16
28 #define FILLGREEN 16
29 #define FILLBLUE 128
30 #define FILLTRANS 128
31 
32 /** Frame type */
33 enum FRAMETYPE
34 {
35 	FRAME_NORMAL, FRAME_RADAR
36 };
37 
38 struct TABDEF
39 {
40 	SWORD MajorUp;			//< Index of image to use for tab not pressed.
41 	SWORD MajorDown;		//< Index of image to use for tab pressed.
42 	SWORD MajorHilight;		//< Index of image to use for tab hilighted by mouse.
43 	SWORD MajorSelected;		//< Index of image to use for tab selected (same as pressed).
44 };
45 
46 class IntListTabWidget : public ListTabWidget
47 {
48 protected:
IntListTabWidget()49 	IntListTabWidget(): ListTabWidget() {}
50 	virtual void initialize() override;
51 
52 public:
make()53 	static std::shared_ptr<IntListTabWidget> make()
54 	{
55 		class make_shared_enabler: public IntListTabWidget {};
56 		auto widget = std::make_shared<make_shared_enabler>();
57 		widget->initialize();
58 		return widget;
59 	}
60 };
61 
62 extern IMAGEFILE *IntImages;	//< All the 2d graphics for the user interface.
63 
64 bool imageInitBitmaps();
65 
66 /** Draws a transparent window. */
67 void RenderWindowFrame(FRAMETYPE frame, uint32_t x, uint32_t y, uint32_t Width, uint32_t Heig, const glm::mat4 &modelViewProjection = defaultProjectionMatrix());
68 
69 #endif
70