File: themes.h

package info (click to toggle)
teg 0.11.2%2Bdebian-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 11,484 kB
  • ctags: 7,112
  • sloc: ansic: 16,775; sh: 8,559; python: 1,442; xml: 490; makefile: 399
file content (179 lines) | stat: -rw-r--r-- 4,864 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*	$Id: themes.h,v 1.18 2003/09/08 06:18:12 edomat Exp $	*/
/* Tenes Empanadas Graciela
 *
 * Copyright (C) 2001 Ricardo Quesada
 *
 * Author: Ricardo Calixto Quesada <rquesada@core-sdi.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; only version 2 of the License
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 */
/**
 * @file themes.h
 * File that parse the theme stuff
 */


#ifndef __TEGC_THEMES_H
#define __TEGC_THEMES_H

#define THEME_CONTINENT_MAX	(30)
#define THEME_COUNTRY_MAX	(30)
#define THEME_MAX_NAME		(50)

#include <libxml/parser.h>

/* country */
typedef struct _theme_country {
	xmlChar *name;		/**< name of the country */
	xmlChar *file;		/**< name of the file .png */
	xmlChar *pos_x;
	xmlChar *pos_y;
	xmlChar *army_x;
	xmlChar *army_y;
} Country, *pCountry;

typedef struct _tcountry {
	char	*name;		/**< name of the country */
	char	*file;		/**< name of the file .png */
	int	pos_x;
	int	pos_y;
	int	army_x;
	int	army_y;
} TCountry, *pTCountry;

/* continent */
typedef struct _theme_continent {
	xmlChar *name;
	xmlChar *pos_x;
	xmlChar *pos_y;
	int	i_country;
	pCountry countries[THEME_COUNTRY_MAX];
} Continent, *pContinent;

typedef struct _tcontinent {
	char	*name;
	int	pos_x;
	int	pos_y;
} TContinent, *pTContinent;

/* cards */
typedef struct _theme_cards {
	xmlChar *jocker;	/**< the jocker figure */
	xmlChar *balloon;	/**< the balloon ship */
	xmlChar *cannon;	/**< the cannon ship */
	xmlChar *ship;		/**< the ship figure */
	xmlChar *pos_y;		/**< position Y of the name in the card */
} Cards, *pCards;

typedef struct _tcards {
	char	* jocker;
	char	* balloon;
	char	* cannon;
	char	* ship;
	int	pos_y;
} TCards, *pTCards;

/* theme */
typedef struct _theme {
	xmlChar	*author;	/**< author of the theme */
	xmlChar	*email;		/**< email of the author */
	xmlChar	*version;	/**< version of the theme */
	xmlChar *screen_size_x;	/**< screen height */
	xmlChar *screen_size_y;	/**< screen width */
	xmlChar	*board;		/**< board file name */
	xmlChar *board_x;	/**< board x position */
	xmlChar *board_y;	/**< board y position */
	xmlChar	*armies_x;
	xmlChar	*armies_y;
	xmlChar *armies_background;
	xmlChar *armies_dragable;
	xmlChar *choose_colors_custom;
	xmlChar *choose_colors_prefix;
	xmlChar *toolbar_custom;
	xmlChar *toolbar_name;
	xmlChar *toolbar_text_color;
	xmlChar	*toolbar_offset_right;
	xmlChar	*toolbar_offset_left;
	xmlChar	*dices_x;
	xmlChar	*dices_y;
	xmlChar	*dices_ext_x[6];	/**< extended dices support */
	xmlChar	*dices_ext_y[6];
	xmlChar	*dices_ext_text_x[2];
	xmlChar	*dices_ext_text_y[2];
	xmlChar *dices_file[DICES_CANT];	/**< 6 dices */
	xmlChar	*dices_color;
	xmlChar	*screenshot;
	int	i_continent;
	pCards	cards;
	pContinent continents[THEME_CONTINENT_MAX];
} Theme, *pTheme;

typedef struct _ttheme {
	char	*author;	/**< author of the theme */
	char	*email;		/**< email of the author */
	char	*version;	/**< version of the theme */
	int	screen_size_x;	/**< screen height */
	int	screen_size_y;	/**< screen width */
	char	*board;		/**< board file name */
	int	board_x;	/**< board x position */
	int	board_y;	/**< board y position */
	int	armies_x;
	int	armies_y;
	int	armies_background;
	int	armies_dragable;
	int	choose_colors_custom;
	char	*choose_colors_prefix;
	int	toolbar_custom;
	char	*toolbar_name;
	char	*toolbar_text_color;
	int	toolbar_offset_right;
	int	toolbar_offset_left;
	int	dices_x;
	int	dices_y;
	int	dices_ext_x[6];	/**< extended dices support */
	int	dices_ext_y[6];
	int	dices_ext_text_x[2];
	int	dices_ext_text_y[2];
	char	*dices_file[DICES_CANT];
	char	*dices_color;
	char	*screenshot;
} TTheme, *pTTheme;

/* Theme Info */
typedef struct _tinfo {
	struct _tinfo *next;
	char *name;
	char *author;
	char *email;
	char *version;
} TInfo, *pTInfo;


/* prototypes */
TEG_STATUS theme_load( char *file );
void theme_unload();
TEG_STATUS theme_giveme_cards(pTCards pC);
TEG_STATUS theme_giveme_continent(pTContinent pC, int n);
TEG_STATUS theme_giveme_country(pTCountry pC, int cont, int n);
TEG_STATUS theme_giveme_theme(pTTheme pT);
TEG_STATUS theme_enum_themes( pTInfo pTI );
TEG_STATUS theme_init();
void theme_free();
char * theme_load_file( char *name );
char * theme_load_fake_file( char *name, char *theme );

/**! returns 1 if dices extended are being used */
int theme_using_extended_dices();

#endif /* __TEGC_THEMES_H */