1
1
/* gcompris - gcompris.h
3
* Copyright (C) 2000,2001,2002 Bruno Coudoin
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, see <http://www.gnu.org/licenses/>.
3
* Copyright (C) 2000, 2008 Bruno Coudoin
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, see <http://www.gnu.org/licenses/>.
81
83
void gc_board_end(void);
83
85
/* Control Bar methods */
84
void gc_bar_start (GnomeCanvas *theCanvas);
86
void gc_bar_start (GooCanvas *theCanvas);
86
GnomeCanvasItem *gc_set_background(GnomeCanvasGroup *parent, gchar *file);
88
/** Set the default background of your activity.
89
* Always set the background in your activity startup.
91
* @param[in] parent is the canvas root item
93
void gc_set_default_background(GooCanvasItem *parent);
94
/** Set the given background of your activity.
95
* Always set the background in your activity startup.
97
* @param[in] parent is the canvas root item
98
* @param[in] file is a relative file. It can be svg, png or jpg.
100
void gc_set_background(GooCanvasItem *parent, gchar *file);
101
/** Set the given rsvg image as the activity background.
102
* Always set the background in your activity startup.
103
* @param[in] parent is the canvas root item
104
* @param[in] rsvg_handle is the svg background
105
* @param[in] id is the id of the item to display in rsvg_handle.
106
* Set id to NULL to display all the image.
108
void gc_set_background_by_id(GooCanvasItem *parent,
109
RsvgHandle *rsvg_handle,
111
/** Update the bar to display the current level
112
* You must maintain the current level in your GcomprisBoard->level.
113
* @param[in] gcomprisBoard is your activity handle
87
115
void gc_bar_set_level (GcomprisBoard *gcomprisBoard);
88
void gc_bar_set_repeat_icon (GdkPixbuf *pixmap);
116
/** The repeat icon as set with the flag GC_BAR_REPEAT can be
117
* overrided with your specific icon. Use this if the default
118
* repeat icon does not match your action.
119
* @param[in] svg_handle is the handle to the svg image.
121
void gc_bar_set_repeat_icon (RsvgHandle *svg_handle);
90
123
/* Status bar control */
93
126
GC_BAR_LEVEL = 1 << 0,
95
GC_BAR_REPEAT = 1 << 2,
96
GC_BAR_CONFIG = 1 << 3,
97
GC_BAR_ABOUT = 1 << 4,
98
GC_BAR_REPEAT_ICON = 1 << 5,
127
GC_BAR_REPEAT = 1 << 1,
128
GC_BAR_CONFIG = 1 << 2,
129
GC_BAR_ABOUT = 1 << 3,
130
GC_BAR_REPEAT_ICON = 1 << 4,
132
GC_BAR_HOME = 1 << 5,
133
GC_BAR_EXIT = 1 << 6,
134
GC_BAR_LEVEL_DOWN = 1 << 7,
135
GC_BAR_HELP = 1 << 8,
100
136
} GComprisBarFlags;
102
138
/* Difficulty filtering */
106
142
GCOMPRIS_FILTER_UNDER,
107
143
GCOMPRIS_FILTER_ABOVE,
108
144
} GcomprisFilterType;
145
/** Set the different option that must be present in the control bar.
146
* @param[in} glags is a bit mask of GComprisBarFlags.
110
148
void gc_bar_set (const GComprisBarFlags flags);
149
/** Hide of show the control bar.
150
* @param[in] hide set to true to hide the bar.
111
152
void gc_bar_hide (gboolean hide);
153
/** Specify where in your activity must be set the control bar
154
* @param[in] x is the x coordinate. Set to -1 to keep the default.
155
* @param[in] y is the x coordinate Set to -1 to keep the default.
156
* @param[in] zoom is the zoom factor. Set to -1 to keep the default.
158
void gc_bar_location (int x, int y, double zoom);
114
GnomeCanvas *gc_get_canvas(void);
161
GooCanvas *gc_get_canvas(void);
115
162
GtkWidget *gc_get_window(void);
116
void gc_ignore_next_focus_out(void);
118
164
const gchar *gc_locale_get(void);
119
165
void gc_locale_set(gchar *locale);
123
169
void gc_cursor_set(guint gdk_cursor_type);
125
typedef void (*ImageSelectorCallBack) (gchar* image);
171
typedef void (*ImageSelectorCallBack) (gchar* image,
126
173
void gc_selector_images_start (GcomprisBoard *gcomprisBoard,
128
ImageSelectorCallBack imscb);
175
ImageSelectorCallBack imscb,
129
177
void gc_selector_images_stop (void);
131
typedef void (*FileSelectorCallBack) (gchar *file, gchar *file_type); /* file_type is one string from file_types in the save */
179
typedef void (*FileSelectorCallBack) (gchar *file, gchar *file_type,
180
void *user_context); /* file_type is one string from file_types in the save */
132
181
void gc_selector_file_load (GcomprisBoard *gcomprisBoard,
134
gchar *file_types, /* A Comma separated text explaining the different file types */
135
FileSelectorCallBack fscb);
182
gchar *rootdir, /* Relative to property->user_dir */
183
gchar *file_types, /* A Comma separated text explaining the different file types */
184
FileSelectorCallBack fscb,
136
186
void gc_selector_file_save (GcomprisBoard *gcomprisBoard,
138
gchar *file_types, /* A Comma separated text explaining the different file types */
139
FileSelectorCallBack fscb);
187
gchar *rootdir, /* Relative to property->user_dir */
188
gchar *file_types, /* A Comma separated text explaining the different file types */
189
FileSelectorCallBack fscb,
140
191
void gc_selector_file_stop (void);
142
193
gchar *gc_db_get_filename();
158
209
void gc_confirm_box_stop (void);
160
/* Use these instead of the gnome_canvas ones for proper fullscreen mousegrab
211
/* Use these instead of the goo_canvas ones for proper fullscreen mousegrab
162
int gc_canvas_item_grab (GnomeCanvasItem *item, unsigned int event_mask,
213
int gc_canvas_item_grab (GooCanvasItem *item, unsigned int event_mask,
163
214
GdkCursor *cursor, guint32 etime);
164
void gc_canvas_item_ungrab (GnomeCanvasItem *item, guint32 etime);
215
void gc_canvas_item_ungrab (GooCanvasItem *item, guint32 etime);
166
217
/* Use it to tell the teacher where the kid failed */
167
218
void gc_log_set_comment (GcomprisBoard *gcomprisBoard, gchar *expected, gchar* got);
183
234
#define COLOR_SUBTITLE 0xB00400FF
184
235
#define COLOR_SHADOW 0x000000FF
186
#define FONT_TITLE "Sans 20"
187
#define FONT_TITLE_FALLBACK "Sans 12"
188
#define FONT_SUBTITLE "Sans 16"
189
#define FONT_SUBTITLE_FALLBACK "Sans 12"
190
#define FONT_CONTENT "Sans 12"
191
#define FONT_CONTENT_FALLBACK "Sans 12"
237
#define FONT_TITLE "sans 20"
238
#define FONT_TITLE_FALLBACK "sans 12"
239
#define FONT_SUBTITLE "sans 16"
240
#define FONT_SUBTITLE_FALLBACK "sans 12"
241
#define FONT_CONTENT "sans 12"
242
#define FONT_CONTENT_FALLBACK "sans 12"
193
#define FONT_BOARD_TINY "Sans 10"
194
#define FONT_BOARD_SMALL "Sans 12"
195
#define FONT_BOARD_MEDIUM "Sans 14"
196
#define FONT_BOARD_BIG "Sans 16"
197
#define FONT_BOARD_BIG_BOLD "Sans bold 16"
198
#define FONT_BOARD_FIXED "Fixed 12"
199
#define FONT_BOARD_TITLE "Sans 20"
200
#define FONT_BOARD_TITLE_BOLD "Sans bold 20"
201
#define FONT_BOARD_HUGE "Sans 28"
202
#define FONT_BOARD_HUGE_BOLD "Sans bold 28"
244
#define FONT_BOARD_TINY "sans 10"
245
#define FONT_BOARD_SMALL "sans 12"
246
#define FONT_BOARD_MEDIUM "sans 14"
247
#define FONT_BOARD_BIG "sans 16"
248
#define FONT_BOARD_BIG_BOLD "sans bold 16"
249
#define FONT_BOARD_FIXED "fixed 12"
250
#define FONT_BOARD_TITLE "sans 20"
251
#define FONT_BOARD_TITLE_BOLD "sans bold 20"
252
#define FONT_BOARD_HUGE "sans 28"
253
#define FONT_BOARD_HUGE_BOLD "sans bold 28"
204
255
/*=========================================================*/
205
256
// These are gcompris defined cursors