~ubuntu-branches/ubuntu/natty/gtkboard/natty

« back to all changes in this revision

Viewing changes to .pc/debian-changes-0.11pre0+cvs.2003.11.02-2/src/prefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Barak A. Pearlmutter
  • Date: 2011-02-28 11:25:02 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20110228112502-e9aah248wxelm7ao
Tags: 0.11pre0+cvs.2003.11.02-2
autotools tweaks, most notably -lSDL to supplement -lSDL_mixer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This file is a part of gtkboard, a board games system.
 
2
    Copyright (C) 2003, Arvind Narayanan <arvindn@users.sourceforge.net>
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
 
17
 
 
18
*/
 
19
#ifndef _PREFS_H_
 
20
#define _PREFS_H_
 
21
 
 
22
#include <glib.h>
 
23
#include <gdk/gdk.h>
 
24
#include <gtk/gtk.h>
 
25
#include "game.h"
 
26
 
 
27
#define MAX_HIGHSCORES 10
 
28
 
 
29
#define NUM_RECENT_GAMES 3
 
30
 
 
31
typedef void (*PrefsCallbackFunc) (gchar * key, gchar *value);
 
32
 
 
33
 
 
34
typedef struct
 
35
{
 
36
        char name[32];
 
37
        char score[32];
 
38
        int time;
 
39
        int date;
 
40
} Score;
 
41
 
 
42
//! An entry in the config file. See #prefs_config_vars
 
43
typedef struct
 
44
{
 
45
        //! name of the variable
 
46
        char *key;
 
47
 
 
48
        //! description, perhaps to present to the user?
 
49
        char *description;
 
50
 
 
51
        //! comment in the config file
 
52
        char *comment;
 
53
 
 
54
        //! default value
 
55
        char *def_val;
 
56
 
 
57
        //! current value
 
58
        char *cur_val;
 
59
 
 
60
        //! callback function to call when the value changes
 
61
        PrefsCallbackFunc callback;
 
62
} ConfigVar;
 
63
 
 
64
 
 
65
extern SCORE_FIELD prefs_score_fields_def[];
 
66
extern gchar* prefs_score_field_names_def[];
 
67
 
 
68
gboolean prefs_load_scores (gchar *);
 
69
gboolean prefs_save_scores (gchar *);
 
70
void prefs_show_scores ();
 
71
void prefs_zap_highscores ();
 
72
gboolean prefs_add_highscore (gchar *, int);
 
73
int prefs_scorecmp_dscore (gchar *, int, gchar*, int);
 
74
int prefs_scorecmp_iscore (gchar *, int, gchar*, int);
 
75
int prefs_scorecmp_time (gchar *, int, gchar*, int);
 
76
void prefs_read_config_file ();
 
77
gchar *prefs_get_config_val (gchar *key);
 
78
void prefs_set_config_val (gchar *key, gchar *value);
 
79
void prefs_write_config_file ();
 
80
gboolean prefs_get_bool_val (gchar *value);
 
81
extern int (*game_scorecmp) (gchar *, int, gchar*, int);
 
82
#endif