Browse Source

GTRANS module skeleton

Joel Bodenmann 4 years ago
parent
commit
6b07b2af74

+ 3 - 0
demos/modules/gtrans/basic/demo.mk

@@ -0,0 +1,3 @@
1
+DEMODIR = $(GFXLIB)/demos/modules/gtrans/basic
2
+GFXINC +=   $(DEMODIR)
3
+GFXSRC +=	$(DEMODIR)/main.c

+ 66 - 0
demos/modules/gtrans/basic/gfxconf.h

@@ -0,0 +1,66 @@
1
+/*
2
+ * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
3
+ * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket
4
+ *
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ *    * Redistributions of source code must retain the above copyright
10
+ *      notice, this list of conditions and the following disclaimer.
11
+ *    * Redistributions in binary form must reproduce the above copyright
12
+ *      notice, this list of conditions and the following disclaimer in the
13
+ *      documentation and/or other materials provided with the distribution.
14
+ *    * Neither the name of the <organization> nor the
15
+ *      names of its contributors may be used to endorse or promote products
16
+ *      derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ */
29
+
30
+#ifndef _GFXCONF_H
31
+#define _GFXCONF_H
32
+
33
+/* The operating system to use. One of these must be defined - preferably in your Makefile */
34
+//#define GFX_USE_OS_CHIBIOS	FALSE
35
+//#define GFX_USE_OS_WIN32		FALSE
36
+//#define GFX_USE_OS_LINUX		FALSE
37
+//#define GFX_USE_OS_OSX		FALSE
38
+
39
+#define GFX_USE_GTRANS          TRUE
40
+#define GFX_USE_GDISP			TRUE
41
+
42
+#define GDISP_NEED_VALIDATION	TRUE
43
+#define GDISP_NEED_CLIP			TRUE
44
+#define GDISP_NEED_TEXT			TRUE
45
+#define GDISP_NEED_ANTIALIAS	TRUE
46
+
47
+#define GDISP_INCLUDE_USER_FONTS				FALSE
48
+#define GDISP_INCLUDE_FONT_UI1					FALSE
49
+#define GDISP_INCLUDE_FONT_UI2					FALSE
50
+#define GDISP_INCLUDE_FONT_LARGENUMBERS			FALSE
51
+#define GDISP_INCLUDE_FONT_DEJAVUSANS10			FALSE
52
+#define GDISP_INCLUDE_FONT_DEJAVUSANS12			FALSE
53
+#define GDISP_INCLUDE_FONT_DEJAVUSANS16			TRUE
54
+#define GDISP_INCLUDE_FONT_DEJAVUSANS24			FALSE
55
+#define GDISP_INCLUDE_FONT_DEJAVUSANS32			FALSE
56
+#define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12		FALSE
57
+#define GDISP_INCLUDE_FONT_FIXED_10x20			FALSE
58
+#define GDISP_INCLUDE_FONT_FIXED_7x14			FALSE
59
+#define GDISP_INCLUDE_FONT_FIXED_5x8			FALSE
60
+#define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA		FALSE
61
+#define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA		FALSE
62
+#define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA		FALSE
63
+#define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA		FALSE
64
+#define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA	FALSE
65
+
66
+#endif /* _GFXCONF_H */

+ 42 - 0
demos/modules/gtrans/basic/main.c

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
3
+ * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket
4
+ *
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ *    * Redistributions of source code must retain the above copyright
10
+ *      notice, this list of conditions and the following disclaimer.
11
+ *    * Redistributions in binary form must reproduce the above copyright
12
+ *      notice, this list of conditions and the following disclaimer in the
13
+ *      documentation and/or other materials provided with the distribution.
14
+ *    * Neither the name of the <organization> nor the
15
+ *      names of its contributors may be used to endorse or promote products
16
+ *      derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ */
29
+
30
+#include "gfx.h"
31
+ 
32
+int main(void)
33
+{
34
+    gfxInit();
35
+
36
+	while (TRUE) {
37
+		gfxSleepMilliseconds(500);
38
+	}
39
+
40
+	return 0;
41
+}
42
+

+ 1 - 0
gfx.mk

@@ -21,6 +21,7 @@ else
21 21
 	include $(GFXLIB)/src/gaudio/gaudio.mk
22 22
 	include $(GFXLIB)/src/gmisc/gmisc.mk
23 23
 	include $(GFXLIB)/src/gfile/gfile.mk
24
+	include $(GFXLIB)/src/gtrans/gtrans.mk
24 25
 endif
25 26
 
26 27
 # Include the boards and drivers

+ 6 - 0
gfxconf.example.h

@@ -208,6 +208,12 @@
208 208
 //        #define GWIN_TABSET_TABHEIGHT                18
209 209
 
210 210
 
211
+///////////////////////////////////////////////////////////////////////////
212
+// GTRANS                                                                //
213
+///////////////////////////////////////////////////////////////////////////
214
+//#define GFX_USE_GTRANS                               FALSE
215
+
216
+
211 217
 ///////////////////////////////////////////////////////////////////////////
212 218
 // GEVENT                                                                //
213 219
 ///////////////////////////////////////////////////////////////////////////

+ 10 - 0
src/gfx.c

@@ -73,6 +73,10 @@ extern void _gosDeinit(void);
73 73
 	extern void _gmiscInit(void);
74 74
 	extern void _gmiscDeinit(void);
75 75
 #endif
76
+#if GFX_USE_GTRANS
77
+	extern void _gtransInit(void);
78
+	extern void _gtransDeinit(void);
79
+#endif
76 80
 
77 81
 void gfxInit(void)
78 82
 {
@@ -96,6 +100,9 @@ void gfxInit(void)
96 100
 	#if GFX_USE_GMISC
97 101
 		_gmiscInit();
98 102
 	#endif
103
+	#if GFX_USE_GTRANS
104
+		_gtransInit();
105
+	#endif
99 106
 	#if GFX_USE_GEVENT
100 107
 		_geventInit();
101 108
 	#endif
@@ -159,6 +166,9 @@ void gfxDeinit(void)
159 166
 	#if GFX_USE_GEVENT
160 167
 		_geventDeinit();
161 168
 	#endif
169
+	#if GFX_USE_GTRANS
170
+		_gtransDeinit();
171
+	#endif
162 172
 	#if GFX_USE_GMISC
163 173
 		_gmiscDeinit();
164 174
 	#endif

+ 1 - 0
src/gfx_mk.c

@@ -18,3 +18,4 @@
18 18
 #include "gaudio/gaudio_mk.c"
19 19
 #include "gmisc/gmisc_mk.c"
20 20
 #include "gfile/gfile_mk.c"
21
+#include "gtrans/gtrans_mk.c"

+ 20 - 0
src/gtrans/gtrans.c

@@ -0,0 +1,20 @@
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+#include "../../gfx.h"
9
+
10
+#if GFX_USE_GTRANS
11
+
12
+void _gtransInit(void)
13
+{
14
+}
15
+
16
+void _gtransDeinit(void)
17
+{
18
+}
19
+
20
+#endif /* GFX_USE_GTRANS */

+ 39 - 0
src/gtrans/gtrans.h

@@ -0,0 +1,39 @@
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+/**
9
+ * @file    src/gtrans/gtrans.h
10
+ *
11
+ * @addtogroup GTRANS
12
+ *
13
+ * @brief	Module to allow changing the language of an application dynamically during run-time.
14
+ *
15
+ * @{
16
+ */
17
+
18
+#ifndef _TRANS_H
19
+#define _TRANS_H
20
+
21
+#include "../../gfx.h"
22
+
23
+#if GFX_USE_GTRANS || defined(__DOXYGEN__)
24
+
25
+#ifdef __cplusplus
26
+extern "C" {
27
+#endif
28
+
29
+
30
+
31
+#ifdef __cplusplus
32
+}
33
+#endif
34
+
35
+#endif /* GFX_USE_GTRANS */
36
+
37
+#endif /* _TRANS_H */
38
+/** @} */
39
+

+ 6 - 0
src/gtrans/gtrans.mk

@@ -0,0 +1,6 @@
1
+# This file is subject to the terms of the GFX License. If a copy of
2
+# the license was not distributed with this file, you can obtain one at:
3
+#
4
+#              http://ugfx.org/license.html
5
+
6
+GFXSRC +=   $(GFXLIB)/src/gtrans/gtrans.c

+ 8 - 0
src/gtrans/gtrans_mk.c

@@ -0,0 +1,8 @@
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+#include "gtrans.c"

+ 21 - 0
src/gtrans/gtrans_options.h

@@ -0,0 +1,21 @@
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+/**
9
+ * @file    src/gtrans/gtrans_options.h
10
+ *
11
+ * @addtogroup GTRANS
12
+ * @{
13
+ */
14
+
15
+#ifndef _GTRANS_OPTIONS_H
16
+#define _GTRANS_OPTIONS_H
17
+
18
+
19
+
20
+#endif /* _GTRANS_OPTIONS_H */
21
+/** @} */

+ 22 - 0
src/gtrans/gtrans_rules.h

@@ -0,0 +1,22 @@
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+/**
9
+ * @file    src/gtrans/gtrans_rules.h
10
+ *
11
+ * @addtogroup GTRANS
12
+ * @{
13
+ */
14
+
15
+#ifndef _GTRANS_RULES_H
16
+#define _GTRANS_RULES_H
17
+
18
+#if GFX_USE_GTRANS
19
+#endif
20
+
21
+#endif /* _GTRANS_RULES_H */
22
+/** @} */