Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-stub/gui_main.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
gui_main.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdio.h>
19
20/* utility */
21#include "fc_cmdline.h"
22#include "fciconv.h"
23#include "log.h"
24
25/* gui main header */
26#include "gui_stub.h"
27
28/* client */
29#include "gui_cbsetter.h"
30#include "client_main.h"
31#include "editgui_g.h"
32#include "options.h"
33
34#include "gui_main.h"
35
36 const char *client_string = "gui-stub";
37
38 const char * const gui_character_encoding = "UTF-8";
39 const bool gui_use_transliteration = FALSE;
40
41/**********************************************************************/
44 void gui_ui_init(void)
45{
46 /* PORTME */
47}
48
49/**********************************************************************/
52 int main(int argc, char **argv)
53{
54 setup_gui_funcs();
55 return client_main(argc, argv, FALSE);
56}
57
58/**********************************************************************/
62 static void print_usage(const char *argv0)
63{
64 /* PORTME */
65 /* add client-specific usage information here */
66 fc_fprintf(stderr,
67 _("This client has no special command line options\n\n"));
68
69 /* TRANS: No full stop after the URL, could cause confusion. */
70 fc_fprintf(stderr, _("Report bugs at %s\n"), BUG_URL);
71}
72
73/**********************************************************************/
76 static bool parse_options(int argc, char **argv)
77{
78 int i = 1;
79
80 while (i < argc) {
81 if (is_option("--help", argv[i])) {
82 print_usage(argv[0]);
83
84 return FALSE;
85 } else {
86 fc_fprintf(stderr, _("Unrecognized option: \"%s\"\n"), argv[i]);
87 exit(EXIT_FAILURE);
88 }
89
90 i++;
91 }
92
93 return TRUE;
94}
95
96/**********************************************************************/
100 int gui_ui_main(int argc, char *argv[])
101{
102 if (parse_options(argc, argv)) {
103 /* PORTME */
104 fc_fprintf(stderr, "Freeciv rules!\n");
105
106 /* Main loop here */
107
108 start_quitting();
109 }
110
111 return EXIT_SUCCESS;
112}
113
114/**********************************************************************/
117 void gui_options_extra_init(void)
118{
119 /* Nothing to do. */
120}
121
122/**********************************************************************/
125 void gui_ui_exit(void)
126{
127 /* PORTME */
128}
129
130/**********************************************************************/
133 enum gui_type gui_get_gui_type(void)
134{
135 return GUI_STUB;
136}
137
138/**********************************************************************/
141 void gui_real_conn_list_dialog_update(void *unused)
142{
143 /* PORTME */
144}
145
146/**********************************************************************/
150 void gui_sound_bell(void)
151{
152 /* PORTME */
153}
154
155/**********************************************************************/
162 void gui_add_net_input(int sock)
163{
164 /* PORTME */
165}
166
167/**********************************************************************/
172 void gui_remove_net_input(void)
173{
174 /* PORTME */
175}
176
177/**********************************************************************/
188 void gui_set_unit_icon(int idx, struct unit *punit)
189{
190 /* PORTME */
191}
192
193/**********************************************************************/
200 void gui_set_unit_icons_more_arrow(bool onoff)
201{
202 /* PORTME */
203}
204
205/**********************************************************************/
210 void gui_real_focus_units_changed(void)
211{
212 /* PORTME */
213}
214
215/**********************************************************************/
220 void gui_add_idle_callback(void (callback)(void *), void *data)
221{
222 /* PORTME */
223
224 /* This is a reasonable fallback if it's not ported. */
225 log_error("Unimplemented add_idle_callback.");
226 (callback)(data);
227}
228
229/**********************************************************************/
232 void gui_editgui_tileset_changed(void)
233{}
234
235/**********************************************************************/
238 void gui_editgui_refresh(void)
239{}
240
241/**********************************************************************/
244 void gui_editgui_popup_properties(const struct tile_list *tiles, int objtype)
245{}
246
247/**********************************************************************/
250 void gui_editgui_popdown_all(void)
251{}
252
253/**********************************************************************/
256 void gui_editgui_notify_object_changed(int objtype, int object_id,
257 bool removal)
258{}
259
260/**********************************************************************/
263 void gui_editgui_notify_object_created(int tag, int id)
264{}
265
266/**********************************************************************/
269 void gui_gui_update_font(const char *font_name, const char *font_value)
270{
271 /* PORTME */
272}
273
274/**********************************************************************/
277 void gui_insert_client_build_info(char *outbuf, size_t outlen)
278{
279 /* PORTME */
280}
client_main
int client_main(int argc, char *argv[], bool postpone_tileset)
Definition client_main.c:351
start_quitting
void start_quitting(void)
Definition client_main.c:1644
client_main.h
incite_cost
char * incite_cost
Definition comments.c:74
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
editgui_g.h
objtype
int objtype
Definition editgui_g.h:28
is_option
bool is_option(const char *option_name, char *option)
Definition fc_cmdline.c:112
fc_cmdline.h
fciconv.h
fc_fprintf
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
_
#define _(String)
Definition fcintl.h:67
client_string
const char * client_string
Definition gui_main.c:105
print_usage
static void print_usage(void)
Definition gui_main.c:265
main
int main(int argc, char **argv)
Definition gui_main.c:1787
gui_character_encoding
const char *const gui_character_encoding
Definition gui_main.c:161
parse_options
static bool parse_options(int argc, char **argv)
Definition gui_main.c:295
gui_use_transliteration
const bool gui_use_transliteration
Definition gui_main.c:162
gui_real_conn_list_dialog_update
void gui_real_conn_list_dialog_update(void *unused)
Definition gui_main.c:141
gui_insert_client_build_info
void gui_insert_client_build_info(char *outbuf, size_t outlen)
Definition gui_main.c:277
gui_editgui_tileset_changed
void gui_editgui_tileset_changed(void)
Definition gui_main.c:232
gui_editgui_popdown_all
void gui_editgui_popdown_all(void)
Definition gui_main.c:250
gui_set_unit_icon
void gui_set_unit_icon(int idx, struct unit *punit)
Definition gui_main.c:188
gui_sound_bell
void gui_sound_bell(void)
Definition gui_main.c:150
gui_editgui_notify_object_changed
void gui_editgui_notify_object_changed(int objtype, int object_id, bool removal)
Definition gui_main.c:256
gui_remove_net_input
void gui_remove_net_input(void)
Definition gui_main.c:172
gui_real_focus_units_changed
void gui_real_focus_units_changed(void)
Definition gui_main.c:210
gui_add_net_input
void gui_add_net_input(int sock)
Definition gui_main.c:162
gui_editgui_notify_object_created
void gui_editgui_notify_object_created(int tag, int id)
Definition gui_main.c:263
gui_ui_init
void gui_ui_init(void)
Definition gui_main.c:44
gui_get_gui_type
enum gui_type gui_get_gui_type(void)
Definition gui_main.c:133
gui_ui_main
int gui_ui_main(int argc, char *argv[])
Definition gui_main.c:100
gui_gui_update_font
void gui_gui_update_font(const char *font_name, const char *font_value)
Definition gui_main.c:269
gui_options_extra_init
void gui_options_extra_init(void)
Definition gui_main.c:117
gui_editgui_refresh
void gui_editgui_refresh(void)
Definition gui_main.c:238
gui_add_idle_callback
void gui_add_idle_callback(void(callback)(void *), void *data)
Definition gui_main.c:220
gui_set_unit_icons_more_arrow
void gui_set_unit_icons_more_arrow(bool onoff)
Definition gui_main.c:200
gui_editgui_popup_properties
void gui_editgui_popup_properties(const struct tile_list *tiles, int objtype)
Definition gui_main.c:244
gui_ui_exit
void gui_ui_exit(void)
Definition gui_main.c:125
gui_main.h
gui_cbsetter.h
font_name
const char * font_name
Definition gui_main_g.h:43
gui_stub.h
log.h
log_error
#define log_error(message,...)
Definition log.h:103
options.h
setup_gui_funcs
void setup_gui_funcs()
Definition qtg_cxxside.cpp:29
callback
Definition gui_main.c:2404
unit
Definition unit.h:138
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47