~ml-launchpad/ubuntu/natty/gcompris/fix-for-777349

« back to all changes in this revision

Viewing changes to src/gcompris/gcompris.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Gariepy, Marc Gariepy, Stephane Graber
  • Date: 2010-01-04 17:42:49 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104174249-7bupatd9dtxyhvs4
Tags: 9.0-0ubuntu1
[Marc Gariepy]
* New upstream release (9.0).
* Remove cache.c from POTFILES to avoid FTBFS
* Remove unneeded rm in debian/rules (file no longer exists upstream)

[Stephane Graber]
* Bump Debian standards to 3.8.3
* Add patch system (dpatch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* gcompris - gcompris.h
2
2
 *
3
 
 * Copyright (C) 2000,2001,2002 Bruno Coudoin
4
 
 *
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.
9
 
 *
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.
14
 
 *
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
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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/>.
17
17
 */
18
18
 
19
19
#ifndef _MAIN_H_
23
23
#  include <config.h>
24
24
#endif
25
25
 
26
 
#include <libgnomecanvas/libgnomecanvas.h>
 
26
#include <goocanvas.h>
27
27
 
28
28
#include <gtk/gtk.h>
29
29
#include <gdk/gdkkeysyms.h>
62
62
#include "dmalloc.h"
63
63
#endif
64
64
 
 
65
#include <librsvg/rsvg.h>
 
66
 
65
67
#define BOARDWIDTH  800
66
68
#define BOARDHEIGHT 520
67
 
#define BARHEIGHT   80
 
69
#define BARHEIGHT   40
68
70
 
69
71
#define DEFAULT_SKIN "gartoon"
70
72
 
81
83
void             gc_board_end(void);
82
84
 
83
85
/* Control Bar methods */
84
 
void             gc_bar_start (GnomeCanvas *theCanvas);
 
86
void             gc_bar_start (GooCanvas *theCanvas);
85
87
 
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.
 
90
 *  activity startup.
 
91
 *  @param[in] parent is the canvas root item
 
92
 */
 
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.
 
96
 *  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.
 
99
 */
 
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.
 
107
 */
 
108
void             gc_set_background_by_id(GooCanvasItem *parent,
 
109
                                         RsvgHandle *rsvg_handle,
 
110
                                         gchar *id);
 
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
 
114
 */
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.
 
120
 */
 
121
void             gc_bar_set_repeat_icon (RsvgHandle *svg_handle);
89
122
 
90
123
/* Status bar control */
91
124
typedef enum
92
125
{
93
126
  GC_BAR_LEVEL     = 1 << 0,
94
 
  GC_BAR_OK        = 1 << 1,
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,
99
 
  GC_BAR_QUIT      = 1 << 6,
 
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,
 
131
  /* Internal use */
 
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;
101
137
 
102
138
/* Difficulty filtering */
106
142
  GCOMPRIS_FILTER_UNDER,
107
143
  GCOMPRIS_FILTER_ABOVE,
108
144
} GcomprisFilterType;
109
 
 
 
145
/** Set the different option that must be present in the control bar.
 
146
 *  @param[in} glags is a bit mask of GComprisBarFlags.
 
147
 */
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.
 
151
 */
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.
 
157
 */
 
158
void             gc_bar_location (int x, int y, double zoom);
112
159
 
113
160
/* General */
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);
117
163
 
118
164
const gchar     *gc_locale_get(void);
119
165
void             gc_locale_set(gchar *locale);
122
168
 
123
169
void             gc_cursor_set(guint gdk_cursor_type);
124
170
 
125
 
typedef void     (*ImageSelectorCallBack)     (gchar* image);
 
171
typedef void     (*ImageSelectorCallBack)     (gchar* image,
 
172
                                               void *user_context);
126
173
void             gc_selector_images_start (GcomprisBoard *gcomprisBoard,
127
 
                                                 gchar *dataset,
128
 
                                                 ImageSelectorCallBack imscb);
 
174
                                           gchar *dataset,
 
175
                                           ImageSelectorCallBack imscb,
 
176
                                           void *user_context);
129
177
void             gc_selector_images_stop (void);
130
178
 
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,
133
 
                                              gchar *rootdir,
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,
 
185
                                        void *user_contact);
136
186
void             gc_selector_file_save (GcomprisBoard *gcomprisBoard,
137
 
                                              gchar *rootdir,
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,
 
190
                                        void *user_context);
140
191
void             gc_selector_file_stop (void);
141
192
 
142
193
gchar           *gc_db_get_filename();
157
208
 
158
209
void             gc_confirm_box_stop (void);
159
210
 
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
161
212
   handling. */
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);
165
216
 
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
185
236
 
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"
192
243
 
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"
203
254
 
204
255
/*=========================================================*/
205
256
// These are gcompris defined cursors