~ubuntu-branches/ubuntu/jaunty/bygfoot/jaunty

« back to all changes in this revision

Viewing changes to src/bygfoot.h

  • Committer: Bazaar Package Importer
  • Author(s): Isaac Clerencia
  • Date: 2005-07-05 23:53:40 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050705235340-akpef5bdm7gsm9m4
Tags: 1.9.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef BYGFOOT_H
 
2
#define BYGFOOT_H
 
3
 
 
4
#include <stdio.h>
 
5
#include <stdlib.h>
 
6
#include <string.h>
 
7
 
 
8
#ifdef HAVE_CONFIG_H
 
9
#  include <config.h>
 
10
#endif
 
11
 
 
12
#include <gtk/gtk.h>
 
13
 
 
14
#include "gettext_macros.h"
 
15
 
 
16
/**
 
17
 * Program version number.
 
18
 */
 
19
#define VERS "1.9.0"
 
20
 
 
21
/** Home dir name */
 
22
#define HOMEDIRNAME ".bygfoot-1.9"
 
23
 
 
24
/**
 
25
 * Convenience macros, used for string sizes (typically buf[SMALL]).
 
26
 */
 
27
#define SMALL 10000
 
28
#define BIG 1000000
 
29
 
 
30
/** Starting numbers of league, cup and supercup numerical ids. */
 
31
#define ID_LEAGUE_START 1000
 
32
#define ID_CUP_START 2000
 
33
#define ID_PROM_CUP_START 3000
 
34
#define ID_SUPERCUP_START 4000
 
35
 
 
36
#define player_id_new (counters[COUNT_PLAYER_ID]++)
 
37
#define team_id_new (counters[COUNT_TEAM_ID]++)
 
38
#define cup_id_new (counters[COUNT_CUP_ID]++)
 
39
#define league_id_new (counters[COUNT_LEAGUE_ID]++)
 
40
#define fixture_id_new (counters[COUNT_FIX_ID]++)
 
41
 
 
42
/** Convenience abbreviation. */
 
43
#define ligs country.leagues
 
44
/** Convenience abbreviation. */
 
45
#define lig(i) g_array_index(country.leagues, League, i)
 
46
 
 
47
/** Convenience abbreviation. */
 
48
#define cps country.cups
 
49
/** Convenience abbreviation. */
 
50
#define cp(i) g_array_index(country.cups, Cup, i)
 
51
 
 
52
/** Convenience abbreviation. */
 
53
#define acps country.allcups
 
54
/** Convenience abbreviation. */
 
55
#define acp(i) ((Cup*)g_ptr_array_index(country.allcups, i))
 
56
 
 
57
/** Convenience abbrevs. */
 
58
#define stat0 status[0]
 
59
#define stat1 status[1]
 
60
#define stat2 status[2]
 
61
#define stat3 status[3]
 
62
#define stat4 status[4]
 
63
#define stat5 status[5]
 
64
 
 
65
#define debug opt_int("int_opt_debug")
 
66
 
 
67
/**
 
68
 * Exit codes.
 
69
 */
 
70
enum ExitCodes
 
71
{
 
72
    EXIT_OK = 0, /**< Normal exit. */
 
73
    EXIT_NO_COUNTRY_FILES, /**< Exit when no country files have been found. */
 
74
    EXIT_FILE_OPEN_FAILED, /**< A file could not be opened. */
 
75
    EXIT_PRINT_ERROR, /**< Exit when the print_error function is called on a set error.*/
 
76
    EXIT_NO_LEAGUES, /**< The game must contain at least one league. */
 
77
    EXIT_CHOOSE_TEAM_ERROR, /**< There was a problem loading the choose_teams. @see cup_load_choose_teams() */
 
78
    EXIT_FIXTURE_WRITE_ERROR, /**< There was an error writing the fixtures. */
 
79
    EXIT_USER_FIRED, /**< Single user was fired and didn't accept the new offer. */
 
80
    EXIT_FIRST_WEEK_ERROR, /**< First week of cup was negative. */
 
81
    EXIT_OPTION_NOT_FOUND, /**< An option couldn't be found. */
 
82
    EXIT_POINTER_NOT_FOUND, /**< We didn't find a pointer needed. */
 
83
    EXIT_INT_NOT_FOUND, /**< We didn't find an integer value (mostly indices). */
 
84
    EXIT_NO_SUPPORT_DIR, /**< No support directory found. */
 
85
    EXIT_CUP_ROUND_ERROR, /**< Too few cup rounds. */
 
86
    EXIT_END
 
87
};
 
88
 
 
89
/**
 
90
 * A struct representing a country.
 
91
 */
 
92
typedef struct
 
93
{
 
94
    GString *name, /**< Name of the country. */
 
95
        *symbol, /**< Symbol of the country, eg a flag pixmap. */
 
96
        *sid; /**< Id of the country, eg 'england'. */
 
97
 
 
98
    /** Leagues and cups arrays. */
 
99
    GArray *leagues, *cups;
 
100
    
 
101
    /** Pointer array holding all cups. */
 
102
    GPtrArray *allcups;
 
103
} Country;
 
104
 
 
105
/** Struct used for having all the windows
 
106
    in one place. */
 
107
typedef struct
 
108
{
 
109
    GtkWidget *main,
 
110
        *startup,
 
111
        *live,
 
112
        *warning,
 
113
        *progress,
 
114
        *digits,
 
115
        *stadium,
 
116
        *job_offer,
 
117
        *yesno,
 
118
        *options,
 
119
        *font_sel,
 
120
        *file_chooser,
 
121
        *contract,
 
122
        *menu_player,
 
123
        *user_management,
 
124
        *wdebug,
 
125
        *help,
 
126
        *transfer_dialog;
 
127
} Windows;
 
128
#endif