~ubuntu-branches/ubuntu/precise/gnome-games/precise-proposed

« back to all changes in this revision

Viewing changes to iagno/src/iagno.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-02-06 22:22:58 UTC
  • mfrom: (1.1.103)
  • Revision ID: package-import@ubuntu.com-20120206222258-28gah1dnl2ij0kw0
Tags: 1:3.3.5-0ubuntu1
* New upstream release.
  - Performance was improved in Iagno, Mahjongg & Mines
  - Statusbar was removed from Iagno and Mines
  - Mines has a new game screen
  - Quadrapassel was ported to Vala
  - Quadrapassel has a new option to show where block
    will land
* debian/control.in:
  - Bump vala to valac-0.16 and GTK to 3.3.11
  - Build-Depend on yelp-tools instead of gnome-doc-utils
* Update install files for new help install location
* debian/patches/01_lpi.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* iagno.c generated by valac 0.15.0, the Vala compiler
 
1
/* iagno.c generated by valac 0.15.1, the Vala compiler
2
2
 * generated from iagno.vala, do not modify */
3
3
 
4
4
 
5
5
#include <glib.h>
6
6
#include <glib-object.h>
7
 
#include <gtk/gtk.h>
 
7
#include "gtk/gtk.h"
8
8
#include <gio/gio.h>
9
9
#include <games-file-list.h>
10
10
#include <stdlib.h>
11
11
#include <string.h>
12
12
#include <games-stock.h>
 
13
#include <stdio.h>
13
14
#include <glib/gi18n-lib.h>
14
15
#include <games-settings.h>
15
16
#include <games-preimage.h>
17
18
#include <canberra.h>
18
19
#include <gdk/gdk.h>
19
20
#include <games-frame.h>
20
 
#include <stdio.h>
 
21
#include <locale.h>
21
22
 
22
23
 
23
24
#define TYPE_IAGNO (iagno_get_type ())
154
155
static void _iagno_help_cb_gtk_action_callback (GtkAction* action, gpointer self);
155
156
static void iagno_about_cb (Iagno* self, GtkAction* action);
156
157
static void _iagno_about_cb_gtk_action_callback (GtkAction* action, gpointer self);
 
158
static void _iagno_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
 
159
static void _iagno_undo_move_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
 
160
static void iagno_real_startup (GApplication* base);
157
161
Iagno* iagno_new (void);
158
162
Iagno* iagno_construct (GType object_type);
 
163
static void iagno_real_activate (GApplication* base);
159
164
GameView* game_view_new (void);
160
165
GameView* game_view_construct (GType object_type);
161
166
void game_view_set_game (GameView* self, Game* value);
162
167
static void iagno_player_move_cb (Iagno* self, gint x, gint y);
163
168
static void _iagno_player_move_cb_game_view_move (GameView* _sender, gint x, gint y, gpointer self);
164
169
void game_view_set_show_grid (GameView* self, gboolean value);
 
170
void game_view_set_flip_final_result (GameView* self, gboolean value);
165
171
static GamesPreimage* iagno_load_theme_texture (Iagno* self, const gchar* filename, gboolean fail_on_error);
166
172
void game_view_set_theme (GameView* self, GamesPreimage* value);
167
173
static void iagno_start_game (Iagno* self);
168
 
static void iagno_real_activate (GApplication* base);
169
 
static void iagno_show (Iagno* self);
170
 
Game* game_new (void);
171
 
Game* game_construct (GType object_type);
 
174
Game* game_new (gint width, gint height);
 
175
Game* game_construct (GType object_type, gint width, gint height);
172
176
static void iagno_game_move_cb (Iagno* self);
173
177
static void _iagno_game_move_cb_game_move (Game* _sender, gpointer self);
174
178
static void iagno_game_complete_cb (Iagno* self);
184
188
static void iagno_show_message (Iagno* self, const gchar* message);
185
189
void game_undo (Game* self, gint count);
186
190
static void iagno_show_properties_dialog (Iagno* self);
 
191
static void iagno_play_sound (Iagno* self, const gchar* name);
187
192
gboolean game_get_can_move (Game* self);
188
193
void game_pass (Game* self);
189
194
static gboolean iagno_computer_move_cb (Iagno* self);
199
204
static void iagno_light_level_two_cb (Iagno* self, GtkToggleButton* widget);
200
205
static void iagno_light_level_three_cb (Iagno* self, GtkToggleButton* widget);
201
206
static void iagno_sound_select (Iagno* self, GtkToggleButton* widget);
202
 
static void iagno_grid_select (Iagno* self, GtkToggleButton* widget);
 
207
static void iagno_grid_toggled_cb (Iagno* self, GtkToggleButton* widget);
203
208
gboolean game_view_get_show_grid (GameView* self);
 
209
static void iagno_flip_final_toggled_cb (Iagno* self, GtkToggleButton* widget);
 
210
gboolean game_view_get_flip_final_result (GameView* self);
204
211
static void iagno_propbox_response_cb (Iagno* self, GtkWidget* widget, gint response_id);
205
212
static gboolean iagno_propbox_close_cb (Iagno* self, GtkWidget* widget, GdkEventAny* event);
206
213
static void iagno_theme_changed_cb (Iagno* self, GtkComboBox* widget);
216
223
static void _iagno_light_level_one_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
217
224
static void _iagno_light_level_two_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
218
225
static void _iagno_light_level_three_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
219
 
static void _iagno_grid_select_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
 
226
static void _iagno_grid_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
 
227
static void _iagno_flip_final_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
220
228
static void _iagno_theme_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
221
229
gint iagno_main (gchar** args, int args_length1);
222
230
static void iagno_finalize (GObject* obj);
224
232
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
225
233
 
226
234
static const GtkActionEntry IAGNO_actions[9] = {{"GameMenu", NULL, "_Game"}, {"SettingsMenu", NULL, "_Settings"}, {"HelpMenu", NULL, "_Help"}, {"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, NULL, (GCallback) _iagno_new_game_cb_gtk_action_callback}, {"UndoMove", GAMES_STOCK_UNDO_MOVE, NULL, NULL, NULL, (GCallback) _iagno_undo_move_cb_gtk_action_callback}, {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, (GCallback) _iagno_quit_game_cb_gtk_action_callback}, {"Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, (GCallback) _iagno_properties_cb_gtk_action_callback}, {"Contents", GAMES_STOCK_CONTENTS, NULL, NULL, NULL, (GCallback) _iagno_help_cb_gtk_action_callback}, {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, (GCallback) _iagno_about_cb_gtk_action_callback}};
 
235
static const GActionEntry IAGNO_app_actions[2] = {{"new-game", _iagno_new_game_cb_gsimple_action_activate_callback}, {"undo-move", _iagno_undo_move_cb_gsimple_action_activate_callback}};
227
236
 
228
237
static void _iagno_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self) {
229
238
        iagno_new_game_cb (self);
255
264
}
256
265
 
257
266
 
 
267
static void _iagno_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
 
268
        iagno_new_game_cb (self);
 
269
}
 
270
 
 
271
 
 
272
static void _iagno_undo_move_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
 
273
        iagno_undo_move_cb (self);
 
274
}
 
275
 
 
276
 
 
277
static void iagno_real_startup (GApplication* base) {
 
278
        Iagno * self;
 
279
        self = (Iagno*) base;
 
280
        G_APPLICATION_CLASS (iagno_parent_class)->startup ((GApplication*) GTK_APPLICATION (self));
 
281
        g_action_map_add_action_entries ((GActionMap*) self, IAGNO_app_actions, G_N_ELEMENTS (IAGNO_app_actions), self);
 
282
}
 
283
 
 
284
 
 
285
Iagno* iagno_construct (GType object_type) {
 
286
        Iagno * self = NULL;
 
287
        self = (Iagno*) g_object_new (object_type, "application-id", "org.gnome.iagno", "flags", G_APPLICATION_FLAGS_NONE, NULL);
 
288
        return self;
 
289
}
 
290
 
 
291
 
 
292
Iagno* iagno_new (void) {
 
293
        return iagno_construct (TYPE_IAGNO);
 
294
}
 
295
 
 
296
 
258
297
static gpointer _g_object_ref0 (gpointer self) {
259
298
        return self ? g_object_ref (self) : NULL;
260
299
}
265
304
}
266
305
 
267
306
 
268
 
Iagno* iagno_construct (GType object_type) {
269
 
        Iagno * self = NULL;
270
 
        GSettings* _tmp0_;
271
 
        GtkWindow* _tmp1_;
272
 
        GtkWindow* _tmp2_;
273
 
        GtkWindow* _tmp3_;
274
 
        const gchar* _tmp4_ = NULL;
275
 
        GtkWindow* _tmp5_;
276
 
        GtkWindow* _tmp6_;
277
 
        GtkBox* _tmp7_;
278
 
        GtkBox* _tmp8_;
279
 
        GtkBox* vbox;
280
 
        GtkWindow* _tmp9_;
281
 
        GtkUIManager* _tmp10_;
 
307
static void iagno_real_activate (GApplication* base) {
 
308
        Iagno * self;
 
309
        GtkWindow* _tmp0_;
 
310
        GSettings* _tmp2_;
 
311
        GtkBuilder* _tmp3_;
 
312
        GtkBuilder* builder;
 
313
        GtkBuilder* _tmp8_;
 
314
        GObject* _tmp9_ = NULL;
 
315
        GtkWindow* _tmp10_;
 
316
        GtkBuilder* _tmp11_;
 
317
        GObject* _tmp12_ = NULL;
 
318
        GtkGrid* _tmp13_;
 
319
        GtkGrid* top_grid;
 
320
        GtkWindow* _tmp14_;
 
321
        const gchar* _tmp15_ = NULL;
 
322
        GtkWindow* _tmp16_;
 
323
        GtkWindow* _tmp17_;
 
324
        GtkUIManager* _tmp18_;
282
325
        GtkUIManager* ui_manager;
283
 
        GtkActionGroup* _tmp11_;
 
326
        GtkActionGroup* _tmp19_;
284
327
        GtkActionGroup* action_group;
285
 
        GtkWindow* _tmp15_;
286
 
        GtkAccelGroup* _tmp16_ = NULL;
287
 
        GtkAction* _tmp17_ = NULL;
288
 
        GtkAction* _tmp18_;
289
 
        GtkAction* _tmp19_ = NULL;
290
 
        GtkAction* _tmp20_;
291
 
        GtkAction* _tmp21_;
292
 
        GtkWidget* _tmp22_ = NULL;
293
 
        GtkMenuBar* _tmp23_;
 
328
        GtkActionGroup* _tmp20_;
 
329
        GtkActionGroup* _tmp21_;
 
330
        GtkUIManager* _tmp22_;
 
331
        GtkActionGroup* _tmp23_;
 
332
        GtkWindow* _tmp28_;
 
333
        GtkUIManager* _tmp29_;
 
334
        GtkAccelGroup* _tmp30_ = NULL;
 
335
        GtkActionGroup* _tmp31_;
 
336
        GtkAction* _tmp32_ = NULL;
 
337
        GtkAction* _tmp33_;
 
338
        GtkActionGroup* _tmp34_;
 
339
        GtkAction* _tmp35_ = NULL;
 
340
        GtkAction* _tmp36_;
 
341
        GtkAction* _tmp37_;
 
342
        GtkUIManager* _tmp38_;
 
343
        GtkWidget* _tmp39_ = NULL;
 
344
        GtkMenuBar* _tmp40_;
294
345
        GtkMenuBar* menubar;
295
 
        GtkMenuBar* _tmp24_;
296
 
        GameView* _tmp25_;
297
 
        GameView* _tmp26_;
298
 
        GameView* _tmp27_;
299
 
        Game* _tmp28_;
300
 
        GameView* _tmp29_;
301
 
        GameView* _tmp30_;
302
 
        GSettings* _tmp31_;
303
 
        gboolean _tmp32_ = FALSE;
304
 
        GSettings* _tmp33_;
305
 
        gchar* _tmp34_ = NULL;
306
 
        gchar* tile_set;
307
 
        const gchar* _tmp35_;
308
 
        GamesPreimage* _tmp36_ = NULL;
309
 
        GamesPreimage* theme;
310
 
        GamesPreimage* _tmp37_;
311
 
        GameView* _tmp40_;
312
 
        GamesPreimage* _tmp41_;
313
 
        GameView* _tmp42_;
 
346
        GtkGrid* _tmp41_;
 
347
        GtkMenuBar* _tmp42_;
314
348
        GameView* _tmp43_;
315
 
        GtkStatusbar* _tmp44_;
316
 
        GtkStatusbar* _tmp45_;
317
 
        GtkStatusbar* _tmp46_;
318
 
        GtkStatusbar* _tmp47_;
319
 
        GtkGrid* _tmp48_;
320
 
        GtkGrid* _tmp49_;
321
 
        GtkGrid* grid;
322
 
        GtkStatusbar* _tmp50_;
323
 
        const gchar* _tmp51_ = NULL;
324
 
        GtkLabel* _tmp52_;
325
 
        GtkLabel* _tmp53_;
326
 
        GtkLabel* label;
327
 
        GtkLabel* _tmp54_;
328
 
        GtkLabel* _tmp55_;
329
 
        GtkLabel* _tmp56_;
330
 
        GtkLabel* _tmp57_;
331
 
        GtkLabel* _tmp58_;
332
 
        GtkLabel* _tmp59_;
333
 
        const gchar* _tmp60_ = NULL;
334
 
        GtkLabel* _tmp61_;
335
 
        GtkLabel* _tmp62_;
336
 
        GtkLabel* _tmp63_;
337
 
        GtkLabel* _tmp64_;
338
 
        GtkLabel* _tmp65_;
339
 
        GtkLabel* _tmp66_;
340
 
        GtkLabel* _tmp67_;
341
 
        GtkLabel* _tmp68_;
 
349
        GameView* _tmp44_;
 
350
        GameView* _tmp45_;
 
351
        GameView* _tmp46_;
 
352
        GameView* _tmp47_;
 
353
        Game* _tmp48_;
 
354
        GameView* _tmp49_;
 
355
        GameView* _tmp50_;
 
356
        GSettings* _tmp51_;
 
357
        gboolean _tmp52_ = FALSE;
 
358
        GameView* _tmp53_;
 
359
        GSettings* _tmp54_;
 
360
        gboolean _tmp55_ = FALSE;
 
361
        GSettings* _tmp56_;
 
362
        gchar* _tmp57_ = NULL;
 
363
        gchar* tile_set;
 
364
        const gchar* _tmp58_;
 
365
        GamesPreimage* _tmp59_ = NULL;
 
366
        GamesPreimage* theme;
 
367
        GamesPreimage* _tmp60_;
 
368
        GameView* _tmp63_;
 
369
        GamesPreimage* _tmp64_;
 
370
        GameView* _tmp65_;
 
371
        GtkGrid* _tmp66_;
 
372
        GameView* _tmp67_;
 
373
        GtkStatusbar* _tmp68_;
342
374
        GtkStatusbar* _tmp69_;
343
 
        guint _tmp70_ = 0U;
 
375
        GtkStatusbar* _tmp70_;
 
376
        GtkBuilder* _tmp71_;
 
377
        GObject* _tmp72_ = NULL;
 
378
        GtkToolbar* _tmp73_;
 
379
        GtkToolbar* toolbar;
 
380
        GtkToolbar* _tmp74_;
 
381
        GtkToolbar* _tmp75_;
 
382
        GtkStyleContext* _tmp76_ = NULL;
 
383
        GtkToolbar* _tmp77_;
 
384
        GtkSeparatorToolItem* _tmp78_;
 
385
        GtkSeparatorToolItem* _tmp79_;
 
386
        GtkToolItem* _tmp80_;
 
387
        GtkToolItem* _tmp81_;
 
388
        GtkToolItem* status_item;
 
389
        GtkToolItem* _tmp82_;
 
390
        GtkToolItem* _tmp83_;
 
391
        GtkAlignment* _tmp84_;
 
392
        GtkAlignment* _tmp85_;
 
393
        GtkAlignment* status_alignment;
 
394
        GtkAlignment* _tmp86_;
 
395
        GtkStatusbar* _tmp87_;
 
396
        GtkToolItem* _tmp88_;
 
397
        GtkAlignment* _tmp89_;
 
398
        GtkToolbar* _tmp90_;
 
399
        GtkToolItem* _tmp91_;
 
400
        GtkToolbar* _tmp92_;
 
401
        GtkGrid* _tmp93_;
 
402
        GtkGrid* _tmp94_;
 
403
        GtkGrid* grid;
 
404
        GtkGrid* _tmp95_;
 
405
        GtkGrid* _tmp96_;
 
406
        GtkStatusbar* _tmp97_;
 
407
        GtkGrid* _tmp98_;
 
408
        GtkUIManager* _tmp99_;
 
409
        GtkGrid* _tmp100_;
 
410
        const gchar* _tmp101_ = NULL;
 
411
        GtkLabel* _tmp102_;
 
412
        GtkLabel* _tmp103_;
 
413
        GtkLabel* label;
 
414
        GtkLabel* _tmp104_;
 
415
        GtkGrid* _tmp105_;
 
416
        GtkLabel* _tmp106_;
 
417
        GtkLabel* _tmp107_;
 
418
        GtkLabel* _tmp108_;
 
419
        GtkLabel* _tmp109_;
 
420
        GtkGrid* _tmp110_;
 
421
        GtkLabel* _tmp111_;
 
422
        const gchar* _tmp112_ = NULL;
 
423
        GtkLabel* _tmp113_;
 
424
        GtkLabel* _tmp114_;
 
425
        GtkLabel* _tmp115_;
 
426
        GtkGrid* _tmp116_;
 
427
        GtkLabel* _tmp117_;
 
428
        GtkLabel* _tmp118_;
 
429
        GtkLabel* _tmp119_;
 
430
        GtkLabel* _tmp120_;
 
431
        GtkGrid* _tmp121_;
 
432
        GtkLabel* _tmp122_;
 
433
        GtkStatusbar* _tmp123_;
 
434
        guint _tmp124_ = 0U;
 
435
        GtkWindow* _tmp125_;
344
436
        GError * _inner_error_ = NULL;
345
 
        self = (Iagno*) g_object_new (object_type, "application-id", "org.gnome.iagno", "flags", G_APPLICATION_FLAGS_NONE, NULL);
346
 
        _tmp0_ = g_settings_new ("org.gnome.iagno");
 
437
        self = (Iagno*) base;
 
438
        _tmp0_ = self->priv->window;
 
439
        if (_tmp0_ != NULL) {
 
440
                GtkWindow* _tmp1_;
 
441
                _tmp1_ = self->priv->window;
 
442
                gtk_widget_show ((GtkWidget*) _tmp1_);
 
443
                return;
 
444
        }
 
445
        _tmp2_ = g_settings_new ("org.gnome.iagno");
347
446
        _g_object_unref0 (self->priv->settings);
348
 
        self->priv->settings = _tmp0_;
349
 
        _tmp1_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
350
 
        _tmp2_ = g_object_ref_sink (_tmp1_);
351
 
        _g_object_unref0 (self->priv->window);
352
 
        self->priv->window = _tmp2_;
353
 
        _tmp3_ = self->priv->window;
354
 
        _tmp4_ = _ ("Iagno");
355
 
        gtk_window_set_title (_tmp3_, _tmp4_);
356
 
        _tmp5_ = self->priv->window;
357
 
        games_settings_bind_window_state ("/org/gnome/iagno/", _tmp5_);
358
 
        _tmp6_ = self->priv->window;
359
 
        gtk_application_add_window ((GtkApplication*) self, _tmp6_);
360
 
        _tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
361
 
        _tmp8_ = g_object_ref_sink (_tmp7_);
362
 
        vbox = _tmp8_;
363
 
        gtk_widget_show ((GtkWidget*) vbox);
364
 
        _tmp9_ = self->priv->window;
365
 
        gtk_container_add ((GtkContainer*) _tmp9_, (GtkWidget*) vbox);
366
 
        _tmp10_ = gtk_ui_manager_new ();
367
 
        ui_manager = _tmp10_;
368
 
        _tmp11_ = gtk_action_group_new ("group");
369
 
        action_group = _tmp11_;
370
 
        gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
371
 
        gtk_action_group_add_actions (action_group, IAGNO_actions, G_N_ELEMENTS (IAGNO_actions), self);
372
 
        gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
447
        self->priv->settings = _tmp2_;
 
448
        _tmp3_ = gtk_builder_new ();
 
449
        builder = _tmp3_;
373
450
        {
374
 
                const gchar* _tmp12_;
375
 
                _tmp12_ = self->priv->ui_description;
376
 
                gtk_ui_manager_add_ui_from_string (ui_manager, _tmp12_, (gssize) (-1), &_inner_error_);
 
451
                GtkBuilder* _tmp4_;
 
452
                _tmp4_ = builder;
 
453
                gtk_builder_add_from_file (_tmp4_, DATA_DIRECTORY "/iagno.ui", &_inner_error_);
377
454
                if (_inner_error_ != NULL) {
378
455
                        goto __catch0_g_error;
379
456
                }
382
459
        __catch0_g_error:
383
460
        {
384
461
                GError* e = NULL;
385
 
                GError* _tmp13_;
386
 
                const gchar* _tmp14_;
 
462
                FILE* _tmp5_;
 
463
                GError* _tmp6_;
 
464
                const gchar* _tmp7_;
387
465
                e = _inner_error_;
388
466
                _inner_error_ = NULL;
389
 
                _tmp13_ = e;
390
 
                _tmp14_ = _tmp13_->message;
391
 
                g_warning ("iagno.vala:96: Failed to load UI: %s", _tmp14_);
 
467
                _tmp5_ = stderr;
 
468
                _tmp6_ = e;
 
469
                _tmp7_ = _tmp6_->message;
 
470
                fprintf (_tmp5_, "Could not load UI: %s\n", _tmp7_);
392
471
                _g_error_free0 (e);
 
472
                _g_object_unref0 (builder);
 
473
                return;
393
474
        }
394
475
        __finally0:
395
476
        if (_inner_error_ != NULL) {
 
477
                _g_object_unref0 (builder);
 
478
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
479
                g_clear_error (&_inner_error_);
 
480
                return;
 
481
        }
 
482
        _tmp8_ = builder;
 
483
        _tmp9_ = gtk_builder_get_object (_tmp8_, "window");
 
484
        _tmp10_ = _g_object_ref0 (GTK_IS_WINDOW (_tmp9_) ? ((GtkWindow*) _tmp9_) : NULL);
 
485
        _g_object_unref0 (self->priv->window);
 
486
        self->priv->window = _tmp10_;
 
487
        _tmp11_ = builder;
 
488
        _tmp12_ = gtk_builder_get_object (_tmp11_, "grid");
 
489
        _tmp13_ = _g_object_ref0 (GTK_IS_GRID (_tmp12_) ? ((GtkGrid*) _tmp12_) : NULL);
 
490
        top_grid = _tmp13_;
 
491
        _tmp14_ = self->priv->window;
 
492
        _tmp15_ = _ ("Iagno");
 
493
        gtk_window_set_title (_tmp14_, _tmp15_);
 
494
        _tmp16_ = self->priv->window;
 
495
        games_settings_bind_window_state ("/org/gnome/iagno/", _tmp16_);
 
496
        _tmp17_ = self->priv->window;
 
497
        gtk_application_add_window ((GtkApplication*) self, _tmp17_);
 
498
        _tmp18_ = gtk_ui_manager_new ();
 
499
        ui_manager = _tmp18_;
 
500
        _tmp19_ = gtk_action_group_new ("group");
 
501
        action_group = _tmp19_;
 
502
        _tmp20_ = action_group;
 
503
        gtk_action_group_set_translation_domain (_tmp20_, GETTEXT_PACKAGE);
 
504
        _tmp21_ = action_group;
 
505
        gtk_action_group_add_actions (_tmp21_, IAGNO_actions, G_N_ELEMENTS (IAGNO_actions), self);
 
506
        _tmp22_ = ui_manager;
 
507
        _tmp23_ = action_group;
 
508
        gtk_ui_manager_insert_action_group (_tmp22_, _tmp23_, 0);
 
509
        {
 
510
                GtkUIManager* _tmp24_;
 
511
                const gchar* _tmp25_;
 
512
                _tmp24_ = ui_manager;
 
513
                _tmp25_ = self->priv->ui_description;
 
514
                gtk_ui_manager_add_ui_from_string (_tmp24_, _tmp25_, (gssize) (-1), &_inner_error_);
 
515
                if (_inner_error_ != NULL) {
 
516
                        goto __catch1_g_error;
 
517
                }
 
518
        }
 
519
        goto __finally1;
 
520
        __catch1_g_error:
 
521
        {
 
522
                GError* e = NULL;
 
523
                GError* _tmp26_;
 
524
                const gchar* _tmp27_;
 
525
                e = _inner_error_;
 
526
                _inner_error_ = NULL;
 
527
                _tmp26_ = e;
 
528
                _tmp27_ = _tmp26_->message;
 
529
                g_warning ("iagno.vala:125: Failed to load UI: %s", _tmp27_);
 
530
                _g_error_free0 (e);
 
531
        }
 
532
        __finally1:
 
533
        if (_inner_error_ != NULL) {
396
534
                _g_object_unref0 (action_group);
397
535
                _g_object_unref0 (ui_manager);
398
 
                _g_object_unref0 (vbox);
 
536
                _g_object_unref0 (top_grid);
 
537
                _g_object_unref0 (builder);
399
538
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
400
539
                g_clear_error (&_inner_error_);
401
 
                return NULL;
 
540
                return;
402
541
        }
403
 
        _tmp15_ = self->priv->window;
404
 
        _tmp16_ = gtk_ui_manager_get_accel_group (ui_manager);
405
 
        gtk_window_add_accel_group (_tmp15_, _tmp16_);
406
 
        _tmp17_ = gtk_action_group_get_action (action_group, "NewGame");
407
 
        _tmp18_ = _g_object_ref0 (_tmp17_);
 
542
        _tmp28_ = self->priv->window;
 
543
        _tmp29_ = ui_manager;
 
544
        _tmp30_ = gtk_ui_manager_get_accel_group (_tmp29_);
 
545
        gtk_window_add_accel_group (_tmp28_, _tmp30_);
 
546
        _tmp31_ = action_group;
 
547
        _tmp32_ = gtk_action_group_get_action (_tmp31_, "NewGame");
 
548
        _tmp33_ = _g_object_ref0 (_tmp32_);
408
549
        _g_object_unref0 (self->priv->new_game_action);
409
 
        self->priv->new_game_action = _tmp18_;
410
 
        _tmp19_ = gtk_action_group_get_action (action_group, "UndoMove");
411
 
        _tmp20_ = _g_object_ref0 (_tmp19_);
 
550
        self->priv->new_game_action = _tmp33_;
 
551
        _tmp34_ = action_group;
 
552
        _tmp35_ = gtk_action_group_get_action (_tmp34_, "UndoMove");
 
553
        _tmp36_ = _g_object_ref0 (_tmp35_);
412
554
        _g_object_unref0 (self->priv->undo_action);
413
 
        self->priv->undo_action = _tmp20_;
414
 
        _tmp21_ = self->priv->undo_action;
415
 
        gtk_action_set_sensitive (_tmp21_, FALSE);
416
 
        _tmp22_ = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
417
 
        _tmp23_ = _g_object_ref0 (GTK_MENU_BAR (_tmp22_));
418
 
        menubar = _tmp23_;
419
 
        _tmp24_ = menubar;
420
 
        gtk_box_pack_start (vbox, (GtkWidget*) _tmp24_, FALSE, FALSE, (guint) 0);
421
 
        _tmp25_ = game_view_new ();
422
 
        _tmp26_ = g_object_ref_sink (_tmp25_);
 
555
        self->priv->undo_action = _tmp36_;
 
556
        _tmp37_ = self->priv->undo_action;
 
557
        gtk_action_set_sensitive (_tmp37_, FALSE);
 
558
        _tmp38_ = ui_manager;
 
559
        _tmp39_ = gtk_ui_manager_get_widget (_tmp38_, "/MainMenu");
 
560
        _tmp40_ = _g_object_ref0 (GTK_MENU_BAR (_tmp39_));
 
561
        menubar = _tmp40_;
 
562
        _tmp41_ = top_grid;
 
563
        _tmp42_ = menubar;
 
564
        gtk_grid_attach (_tmp41_, (GtkWidget*) _tmp42_, 0, 0, 1, 1);
 
565
        _tmp43_ = game_view_new ();
 
566
        _tmp44_ = g_object_ref_sink (_tmp43_);
423
567
        _g_object_unref0 (self->priv->view);
424
 
        self->priv->view = _tmp26_;
425
 
        _tmp27_ = self->priv->view;
426
 
        _tmp28_ = self->priv->game;
427
 
        game_view_set_game (_tmp27_, _tmp28_);
428
 
        _tmp29_ = self->priv->view;
429
 
        g_signal_connect_object (_tmp29_, "move", (GCallback) _iagno_player_move_cb_game_view_move, self, 0);
430
 
        _tmp30_ = self->priv->view;
431
 
        _tmp31_ = self->priv->settings;
432
 
        _tmp32_ = g_settings_get_boolean (_tmp31_, "show-grid");
433
 
        game_view_set_show_grid (_tmp30_, _tmp32_);
434
 
        _tmp33_ = self->priv->settings;
435
 
        _tmp34_ = g_settings_get_string (_tmp33_, "tileset");
436
 
        tile_set = _tmp34_;
437
 
        _tmp35_ = tile_set;
438
 
        _tmp36_ = iagno_load_theme_texture (self, _tmp35_, FALSE);
439
 
        theme = _tmp36_;
440
 
        _tmp37_ = theme;
441
 
        if (_tmp37_ == NULL) {
442
 
                const gchar* _tmp38_;
443
 
                GamesPreimage* _tmp39_ = NULL;
444
 
                _tmp38_ = tile_set;
445
 
                g_warning ("iagno.vala:115: Unable to load theme %s, falling back to default", _tmp38_);
446
 
                _tmp39_ = iagno_load_theme_texture (self, "black_and_white.svg", TRUE);
 
568
        self->priv->view = _tmp44_;
 
569
        _tmp45_ = self->priv->view;
 
570
        gtk_widget_set_hexpand ((GtkWidget*) _tmp45_, TRUE);
 
571
        _tmp46_ = self->priv->view;
 
572
        gtk_widget_set_vexpand ((GtkWidget*) _tmp46_, TRUE);
 
573
        _tmp47_ = self->priv->view;
 
574
        _tmp48_ = self->priv->game;
 
575
        game_view_set_game (_tmp47_, _tmp48_);
 
576
        _tmp49_ = self->priv->view;
 
577
        g_signal_connect_object (_tmp49_, "move", (GCallback) _iagno_player_move_cb_game_view_move, self, 0);
 
578
        _tmp50_ = self->priv->view;
 
579
        _tmp51_ = self->priv->settings;
 
580
        _tmp52_ = g_settings_get_boolean (_tmp51_, "show-grid");
 
581
        game_view_set_show_grid (_tmp50_, _tmp52_);
 
582
        _tmp53_ = self->priv->view;
 
583
        _tmp54_ = self->priv->settings;
 
584
        _tmp55_ = g_settings_get_boolean (_tmp54_, "flip-final-results");
 
585
        game_view_set_flip_final_result (_tmp53_, _tmp55_);
 
586
        _tmp56_ = self->priv->settings;
 
587
        _tmp57_ = g_settings_get_string (_tmp56_, "tileset");
 
588
        tile_set = _tmp57_;
 
589
        _tmp58_ = tile_set;
 
590
        _tmp59_ = iagno_load_theme_texture (self, _tmp58_, FALSE);
 
591
        theme = _tmp59_;
 
592
        _tmp60_ = theme;
 
593
        if (_tmp60_ == NULL) {
 
594
                const gchar* _tmp61_;
 
595
                GamesPreimage* _tmp62_ = NULL;
 
596
                _tmp61_ = tile_set;
 
597
                g_warning ("iagno.vala:147: Unable to load theme %s, falling back to default", _tmp61_);
 
598
                _tmp62_ = iagno_load_theme_texture (self, "black_and_white.svg", TRUE);
447
599
                _g_object_unref0 (theme);
448
 
                theme = _tmp39_;
 
600
                theme = _tmp62_;
449
601
        }
450
 
        _tmp40_ = self->priv->view;
451
 
        _tmp41_ = theme;
452
 
        game_view_set_theme (_tmp40_, _tmp41_);
453
 
        _tmp42_ = self->priv->view;
454
 
        gtk_widget_show ((GtkWidget*) _tmp42_);
455
 
        _tmp43_ = self->priv->view;
456
 
        gtk_box_pack_start (vbox, (GtkWidget*) _tmp43_, TRUE, TRUE, (guint) 0);
457
 
        _tmp44_ = (GtkStatusbar*) gtk_statusbar_new ();
458
 
        _tmp45_ = g_object_ref_sink (_tmp44_);
 
602
        _tmp63_ = self->priv->view;
 
603
        _tmp64_ = theme;
 
604
        game_view_set_theme (_tmp63_, _tmp64_);
 
605
        _tmp65_ = self->priv->view;
 
606
        gtk_widget_show ((GtkWidget*) _tmp65_);
 
607
        _tmp66_ = top_grid;
 
608
        _tmp67_ = self->priv->view;
 
609
        gtk_grid_attach (_tmp66_, (GtkWidget*) _tmp67_, 0, 2, 1, 1);
 
610
        _tmp68_ = (GtkStatusbar*) gtk_statusbar_new ();
 
611
        _tmp69_ = g_object_ref_sink (_tmp68_);
459
612
        _g_object_unref0 (self->priv->statusbar);
460
 
        self->priv->statusbar = _tmp45_;
461
 
        _tmp46_ = self->priv->statusbar;
462
 
        gtk_widget_show ((GtkWidget*) _tmp46_);
463
 
        _tmp47_ = self->priv->statusbar;
464
 
        gtk_box_pack_start (vbox, (GtkWidget*) _tmp47_, FALSE, FALSE, (guint) 0);
465
 
        _tmp48_ = (GtkGrid*) gtk_grid_new ();
466
 
        _tmp49_ = g_object_ref_sink (_tmp48_);
467
 
        grid = _tmp49_;
468
 
        gtk_grid_set_column_spacing (grid, (guint) 6);
469
 
        gtk_widget_show ((GtkWidget*) grid);
470
 
        _tmp50_ = self->priv->statusbar;
471
 
        gtk_box_pack_start ((GtkBox*) _tmp50_, (GtkWidget*) grid, FALSE, TRUE, (guint) 0);
472
 
        _tmp51_ = _ ("Dark:");
473
 
        _tmp52_ = (GtkLabel*) gtk_label_new (_tmp51_);
474
 
        _tmp53_ = g_object_ref_sink (_tmp52_);
475
 
        label = _tmp53_;
476
 
        _tmp54_ = label;
477
 
        gtk_widget_show ((GtkWidget*) _tmp54_);
478
 
        _tmp55_ = label;
479
 
        gtk_grid_attach (grid, (GtkWidget*) _tmp55_, 1, 0, 1, 1);
480
 
        _tmp56_ = (GtkLabel*) gtk_label_new ("00");
481
 
        _tmp57_ = g_object_ref_sink (_tmp56_);
 
613
        self->priv->statusbar = _tmp69_;
 
614
        _tmp70_ = self->priv->statusbar;
 
615
        gtk_widget_show ((GtkWidget*) _tmp70_);
 
616
        _tmp71_ = builder;
 
617
        _tmp72_ = gtk_builder_get_object (_tmp71_, "toolbar");
 
618
        _tmp73_ = _g_object_ref0 (GTK_IS_TOOLBAR (_tmp72_) ? ((GtkToolbar*) _tmp72_) : NULL);
 
619
        toolbar = _tmp73_;
 
620
        _tmp74_ = toolbar;
 
621
        gtk_toolbar_set_show_arrow (_tmp74_, FALSE);
 
622
        _tmp75_ = toolbar;
 
623
        _tmp76_ = gtk_widget_get_style_context ((GtkWidget*) _tmp75_);
 
624
        gtk_style_context_add_class (_tmp76_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
 
625
        _tmp77_ = toolbar;
 
626
        _tmp78_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
 
627
        _tmp79_ = g_object_ref_sink (_tmp78_);
 
628
        gtk_toolbar_insert (_tmp77_, (GtkToolItem*) _tmp79_, -1);
 
629
        _g_object_unref0 (_tmp79_);
 
630
        _tmp80_ = gtk_tool_item_new ();
 
631
        _tmp81_ = g_object_ref_sink (_tmp80_);
 
632
        status_item = _tmp81_;
 
633
        _tmp82_ = status_item;
 
634
        gtk_tool_item_set_visible_horizontal (_tmp82_, TRUE);
 
635
        _tmp83_ = status_item;
 
636
        gtk_tool_item_set_expand (_tmp83_, TRUE);
 
637
        _tmp84_ = (GtkAlignment*) gtk_alignment_new (1.0f, 0.5f, 0.0f, 0.0f);
 
638
        _tmp85_ = g_object_ref_sink (_tmp84_);
 
639
        status_alignment = _tmp85_;
 
640
        _tmp86_ = status_alignment;
 
641
        _tmp87_ = self->priv->statusbar;
 
642
        gtk_container_add ((GtkContainer*) _tmp86_, (GtkWidget*) _tmp87_);
 
643
        _tmp88_ = status_item;
 
644
        _tmp89_ = status_alignment;
 
645
        gtk_container_add ((GtkContainer*) _tmp88_, (GtkWidget*) _tmp89_);
 
646
        _tmp90_ = toolbar;
 
647
        _tmp91_ = status_item;
 
648
        gtk_toolbar_insert (_tmp90_, _tmp91_, -1);
 
649
        _tmp92_ = toolbar;
 
650
        gtk_widget_show_all ((GtkWidget*) _tmp92_);
 
651
        _tmp93_ = (GtkGrid*) gtk_grid_new ();
 
652
        _tmp94_ = g_object_ref_sink (_tmp93_);
 
653
        grid = _tmp94_;
 
654
        _tmp95_ = grid;
 
655
        gtk_grid_set_column_spacing (_tmp95_, (guint) 6);
 
656
        _tmp96_ = grid;
 
657
        gtk_widget_show ((GtkWidget*) _tmp96_);
 
658
        _tmp97_ = self->priv->statusbar;
 
659
        _tmp98_ = grid;
 
660
        gtk_box_pack_start ((GtkBox*) _tmp97_, (GtkWidget*) _tmp98_, FALSE, TRUE, (guint) 0);
 
661
        _tmp99_ = ui_manager;
 
662
        _tmp100_ = grid;
 
663
        games_stock_prepare_for_statusbar_tooltips (_tmp99_, (GtkWidget*) _tmp100_);
 
664
        _tmp101_ = _ ("Dark:");
 
665
        _tmp102_ = (GtkLabel*) gtk_label_new (_tmp101_);
 
666
        _tmp103_ = g_object_ref_sink (_tmp102_);
 
667
        label = _tmp103_;
 
668
        _tmp104_ = label;
 
669
        gtk_widget_show ((GtkWidget*) _tmp104_);
 
670
        _tmp105_ = grid;
 
671
        _tmp106_ = label;
 
672
        gtk_grid_attach (_tmp105_, (GtkWidget*) _tmp106_, 1, 0, 1, 1);
 
673
        _tmp107_ = (GtkLabel*) gtk_label_new ("00");
 
674
        _tmp108_ = g_object_ref_sink (_tmp107_);
482
675
        _g_object_unref0 (self->priv->dark_score_label);
483
 
        self->priv->dark_score_label = _tmp57_;
484
 
        _tmp58_ = self->priv->dark_score_label;
485
 
        gtk_widget_show ((GtkWidget*) _tmp58_);
486
 
        _tmp59_ = self->priv->dark_score_label;
487
 
        gtk_grid_attach (grid, (GtkWidget*) _tmp59_, 2, 0, 1, 1);
488
 
        _tmp60_ = _ ("Light:");
489
 
        _tmp61_ = (GtkLabel*) gtk_label_new (_tmp60_);
490
 
        _tmp62_ = g_object_ref_sink (_tmp61_);
 
676
        self->priv->dark_score_label = _tmp108_;
 
677
        _tmp109_ = self->priv->dark_score_label;
 
678
        gtk_widget_show ((GtkWidget*) _tmp109_);
 
679
        _tmp110_ = grid;
 
680
        _tmp111_ = self->priv->dark_score_label;
 
681
        gtk_grid_attach (_tmp110_, (GtkWidget*) _tmp111_, 2, 0, 1, 1);
 
682
        _tmp112_ = _ ("Light:");
 
683
        _tmp113_ = (GtkLabel*) gtk_label_new (_tmp112_);
 
684
        _tmp114_ = g_object_ref_sink (_tmp113_);
491
685
        _g_object_unref0 (label);
492
 
        label = _tmp62_;
493
 
        _tmp63_ = label;
494
 
        gtk_widget_show ((GtkWidget*) _tmp63_);
495
 
        _tmp64_ = label;
496
 
        gtk_grid_attach (grid, (GtkWidget*) _tmp64_, 4, 0, 1, 1);
497
 
        _tmp65_ = (GtkLabel*) gtk_label_new ("00");
498
 
        _tmp66_ = g_object_ref_sink (_tmp65_);
 
686
        label = _tmp114_;
 
687
        _tmp115_ = label;
 
688
        gtk_widget_show ((GtkWidget*) _tmp115_);
 
689
        _tmp116_ = grid;
 
690
        _tmp117_ = label;
 
691
        gtk_grid_attach (_tmp116_, (GtkWidget*) _tmp117_, 4, 0, 1, 1);
 
692
        _tmp118_ = (GtkLabel*) gtk_label_new ("00");
 
693
        _tmp119_ = g_object_ref_sink (_tmp118_);
499
694
        _g_object_unref0 (self->priv->light_score_label);
500
 
        self->priv->light_score_label = _tmp66_;
501
 
        _tmp67_ = self->priv->light_score_label;
502
 
        gtk_widget_show ((GtkWidget*) _tmp67_);
503
 
        _tmp68_ = self->priv->light_score_label;
504
 
        gtk_grid_attach (grid, (GtkWidget*) _tmp68_, 5, 0, 1, 1);
505
 
        _tmp69_ = self->priv->statusbar;
506
 
        _tmp70_ = gtk_statusbar_get_context_id (_tmp69_, "iagno");
507
 
        self->priv->statusbar_id = _tmp70_;
 
695
        self->priv->light_score_label = _tmp119_;
 
696
        _tmp120_ = self->priv->light_score_label;
 
697
        gtk_widget_show ((GtkWidget*) _tmp120_);
 
698
        _tmp121_ = grid;
 
699
        _tmp122_ = self->priv->light_score_label;
 
700
        gtk_grid_attach (_tmp121_, (GtkWidget*) _tmp122_, 5, 0, 1, 1);
 
701
        _tmp123_ = self->priv->statusbar;
 
702
        _tmp124_ = gtk_statusbar_get_context_id (_tmp123_, "iagno");
 
703
        self->priv->statusbar_id = _tmp124_;
508
704
        iagno_start_game (self);
 
705
        _tmp125_ = self->priv->window;
 
706
        gtk_widget_show ((GtkWidget*) _tmp125_);
509
707
        _g_object_unref0 (label);
510
708
        _g_object_unref0 (grid);
 
709
        _g_object_unref0 (status_alignment);
 
710
        _g_object_unref0 (status_item);
 
711
        _g_object_unref0 (toolbar);
511
712
        _g_object_unref0 (theme);
512
713
        _g_free0 (tile_set);
513
714
        _g_object_unref0 (menubar);
514
715
        _g_object_unref0 (action_group);
515
716
        _g_object_unref0 (ui_manager);
516
 
        _g_object_unref0 (vbox);
517
 
        return self;
518
 
}
519
 
 
520
 
 
521
 
Iagno* iagno_new (void) {
522
 
        return iagno_construct (TYPE_IAGNO);
523
 
}
524
 
 
525
 
 
526
 
static void iagno_real_activate (GApplication* base) {
527
 
        Iagno * self;
528
 
        GtkWindow* _tmp0_;
529
 
        self = (Iagno*) base;
530
 
        _tmp0_ = self->priv->window;
531
 
        gtk_widget_show ((GtkWidget*) _tmp0_);
532
 
}
533
 
 
534
 
 
535
 
static void iagno_show (Iagno* self) {
536
 
        GtkWindow* _tmp0_;
537
 
        g_return_if_fail (self != NULL);
538
 
        _tmp0_ = self->priv->window;
539
 
        gtk_widget_show ((GtkWidget*) _tmp0_);
 
717
        _g_object_unref0 (top_grid);
 
718
        _g_object_unref0 (builder);
540
719
}
541
720
 
542
721
 
557
736
                _tmp2_ = games_preimage_new_from_file (path, &_inner_error_);
558
737
                _tmp3_ = _tmp2_;
559
738
                if (_inner_error_ != NULL) {
560
 
                        goto __catch1_g_error;
 
739
                        goto __catch2_g_error;
561
740
                }
562
741
                result = _tmp3_;
563
742
                _g_free0 (path);
564
743
                return result;
565
744
        }
566
 
        goto __finally1;
567
 
        __catch1_g_error:
 
745
        goto __finally2;
 
746
        __catch2_g_error:
568
747
        {
569
748
                GError* e = NULL;
570
749
                const gchar* _tmp4_;
571
750
                e = _inner_error_;
572
751
                _inner_error_ = NULL;
573
752
                _tmp4_ = filename;
574
 
                g_warning ("iagno.vala:171: Failed to load theme %s: %s", _tmp4_, path);
 
753
                g_warning ("iagno.vala:211: Failed to load theme %s: %s", _tmp4_, path);
575
754
                result = NULL;
576
755
                _g_error_free0 (e);
577
756
                _g_free0 (path);
578
757
                return result;
579
758
        }
580
 
        __finally1:
 
759
        __finally2:
581
760
        _g_free0 (path);
582
761
        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
583
762
        g_clear_error (&_inner_error_);
640
819
                _tmp3_ = self->priv->game;
641
820
                g_signal_handlers_disconnect_by_func (_tmp3_, NULL, self);
642
821
        }
643
 
        _tmp4_ = game_new ();
 
822
        _tmp4_ = game_new (8, 8);
644
823
        _game_unref0 (self->priv->game);
645
824
        self->priv->game = _tmp4_;
646
825
        _tmp5_ = self->priv->game;
939
1118
                _tmp0_ = self->priv->window;
940
1119
                _tmp1_ = gtk_window_get_screen (_tmp0_);
941
1120
                _tmp2_ = gtk_get_current_event_time ();
942
 
                gtk_show_uri (_tmp1_, "ghelp:iagno", _tmp2_, &_inner_error_);
 
1121
                gtk_show_uri (_tmp1_, "help:iagno", _tmp2_, &_inner_error_);
943
1122
                if (_inner_error_ != NULL) {
944
 
                        goto __catch2_g_error;
 
1123
                        goto __catch3_g_error;
945
1124
                }
946
1125
        }
947
 
        goto __finally2;
948
 
        __catch2_g_error:
 
1126
        goto __finally3;
 
1127
        __catch3_g_error:
949
1128
        {
950
1129
                GError* e = NULL;
951
1130
                GError* _tmp3_;
954
1133
                _inner_error_ = NULL;
955
1134
                _tmp3_ = e;
956
1135
                _tmp4_ = _tmp3_->message;
957
 
                g_warning ("iagno.vala:304: Failed to show help: %s", _tmp4_);
 
1136
                g_warning ("iagno.vala:344: Failed to show help: %s", _tmp4_);
958
1137
                _g_error_free0 (e);
959
1138
        }
960
 
        __finally2:
 
1139
        __finally3:
961
1140
        if (_inner_error_ != NULL) {
962
1141
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
963
1142
                g_clear_error (&_inner_error_);
984
1163
        gboolean _tmp9_;
985
1164
        gboolean _tmp15_;
986
1165
        g_return_if_fail (self != NULL);
 
1166
        iagno_play_sound (self, "flip-piece");
987
1167
        _tmp0_ = self->priv->game;
988
1168
        _tmp1_ = game_get_can_move (_tmp0_);
989
1169
        _tmp2_ = _tmp1_;
1075
1255
        Game* _tmp17_;
1076
1256
        gint _tmp18_;
1077
1257
        gint _tmp19_;
1078
 
        GSettings* _tmp21_;
1079
 
        gboolean _tmp22_ = FALSE;
1080
1258
        g_return_if_fail (self != NULL);
1081
1259
        _tmp0_ = self->priv->game;
1082
1260
        _tmp1_ = game_get_n_light_tiles (_tmp0_);
1111
1289
                _tmp20_ = _ ("The game was a draw.");
1112
1290
                iagno_show_message (self, _tmp20_);
1113
1291
        }
1114
 
        _tmp21_ = self->priv->settings;
1115
 
        _tmp22_ = g_settings_get_boolean (_tmp21_, "sound");
1116
 
        if (_tmp22_) {
1117
 
                GameView* _tmp23_;
1118
 
                gchar* _tmp24_ = NULL;
1119
 
                gchar* _tmp25_;
1120
 
                _tmp23_ = self->priv->view;
1121
 
                _tmp24_ = g_build_filename (SOUND_DIRECTORY, "gameover.ogg", NULL);
1122
 
                _tmp25_ = _tmp24_;
1123
 
                ca_gtk_play_for_widget ((GtkWidget*) _tmp23_, (guint32) 0, CA_PROP_MEDIA_NAME, "gameover", CA_PROP_MEDIA_FILENAME, _tmp25_, NULL);
1124
 
                _g_free0 (_tmp25_);
 
1292
        iagno_play_sound (self, "gameover");
 
1293
}
 
1294
 
 
1295
 
 
1296
static void iagno_play_sound (Iagno* self, const gchar* name) {
 
1297
        GSettings* _tmp0_;
 
1298
        gboolean _tmp1_ = FALSE;
 
1299
        GameView* _tmp2_;
 
1300
        const gchar* _tmp3_;
 
1301
        const gchar* _tmp4_;
 
1302
        gchar* _tmp5_ = NULL;
 
1303
        gchar* _tmp6_;
 
1304
        gchar* _tmp7_ = NULL;
 
1305
        gchar* _tmp8_;
 
1306
        g_return_if_fail (self != NULL);
 
1307
        g_return_if_fail (name != NULL);
 
1308
        _tmp0_ = self->priv->settings;
 
1309
        _tmp1_ = g_settings_get_boolean (_tmp0_, "sound");
 
1310
        if (!_tmp1_) {
 
1311
                return;
1125
1312
        }
 
1313
        _tmp2_ = self->priv->view;
 
1314
        _tmp3_ = name;
 
1315
        _tmp4_ = name;
 
1316
        _tmp5_ = g_strdup_printf ("%s.ogg", _tmp4_);
 
1317
        _tmp6_ = _tmp5_;
 
1318
        _tmp7_ = g_build_filename (SOUND_DIRECTORY, _tmp6_, NULL);
 
1319
        _tmp8_ = _tmp7_;
 
1320
        ca_gtk_play_for_widget ((GtkWidget*) _tmp2_, (guint32) 0, CA_PROP_MEDIA_NAME, _tmp3_, CA_PROP_MEDIA_FILENAME, _tmp8_, NULL);
 
1321
        _g_free0 (_tmp8_);
 
1322
        _g_free0 (_tmp6_);
1126
1323
}
1127
1324
 
1128
1325
 
1317
1514
}
1318
1515
 
1319
1516
 
1320
 
static void iagno_grid_select (Iagno* self, GtkToggleButton* widget) {
 
1517
static void iagno_grid_toggled_cb (Iagno* self, GtkToggleButton* widget) {
1321
1518
        GameView* _tmp0_;
1322
1519
        GtkToggleButton* _tmp1_;
1323
1520
        gboolean _tmp2_ = FALSE;
1339
1536
}
1340
1537
 
1341
1538
 
 
1539
static void iagno_flip_final_toggled_cb (Iagno* self, GtkToggleButton* widget) {
 
1540
        GameView* _tmp0_;
 
1541
        GtkToggleButton* _tmp1_;
 
1542
        gboolean _tmp2_ = FALSE;
 
1543
        GSettings* _tmp3_;
 
1544
        GameView* _tmp4_;
 
1545
        gboolean _tmp5_;
 
1546
        gboolean _tmp6_;
 
1547
        g_return_if_fail (self != NULL);
 
1548
        g_return_if_fail (widget != NULL);
 
1549
        _tmp0_ = self->priv->view;
 
1550
        _tmp1_ = widget;
 
1551
        _tmp2_ = gtk_toggle_button_get_active (_tmp1_);
 
1552
        game_view_set_flip_final_result (_tmp0_, _tmp2_);
 
1553
        _tmp3_ = self->priv->settings;
 
1554
        _tmp4_ = self->priv->view;
 
1555
        _tmp5_ = game_view_get_flip_final_result (_tmp4_);
 
1556
        _tmp6_ = _tmp5_;
 
1557
        g_settings_set_boolean (_tmp3_, "flip-final-results", _tmp6_);
 
1558
}
 
1559
 
 
1560
 
1342
1561
static void iagno_propbox_response_cb (Iagno* self, GtkWidget* widget, gint response_id) {
1343
1562
        GtkWidget* _tmp0_;
1344
1563
        g_return_if_fail (self != NULL);
1393
1612
        if (_tmp9_ == NULL) {
1394
1613
                const gchar* _tmp10_;
1395
1614
                _tmp10_ = tile_set;
1396
 
                g_warning ("iagno.vala:443: Unable to load theme %s", _tmp10_);
 
1615
                g_warning ("iagno.vala:496: Unable to load theme %s", _tmp10_);
1397
1616
        } else {
1398
1617
                GameView* _tmp11_;
1399
1618
                GamesPreimage* _tmp12_;
1465
1684
}
1466
1685
 
1467
1686
 
1468
 
static void _iagno_grid_select_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
1469
 
        iagno_grid_select (self, _sender);
 
1687
static void _iagno_grid_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
 
1688
        iagno_grid_toggled_cb (self, _sender);
 
1689
}
 
1690
 
 
1691
 
 
1692
static void _iagno_flip_final_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
 
1693
        iagno_flip_final_toggled_cb (self, _sender);
1470
1694
}
1471
1695
 
1472
1696
 
1483
1707
        GtkDialog* propbox;
1484
1708
        GtkDialog* _tmp4_;
1485
1709
        GtkDialog* _tmp5_;
1486
 
        GtkWidget* _tmp6_ = NULL;
 
1710
        GtkBox* _tmp6_ = NULL;
1487
1711
        GtkBox* _tmp7_;
1488
1712
        GtkBox* box;
1489
1713
        GtkBox* _tmp8_;
1650
1874
        GSettings* _tmp168_;
1651
1875
        gboolean _tmp169_ = FALSE;
1652
1876
        GtkBox* _tmp170_;
1653
 
        GtkBox* _tmp171_;
1654
 
        GtkBox* _tmp172_;
 
1877
        const gchar* _tmp171_ = NULL;
 
1878
        GtkCheckButton* _tmp172_;
 
1879
        GtkCheckButton* _tmp173_;
 
1880
        GtkCheckButton* flip_final_button;
 
1881
        GSettings* _tmp174_;
 
1882
        gboolean _tmp175_ = FALSE;
 
1883
        GtkBox* _tmp176_;
 
1884
        GtkBox* _tmp177_;
 
1885
        GtkBox* _tmp178_;
1655
1886
        GtkBox* hbox;
1656
 
        GtkBox* _tmp173_;
1657
 
        const gchar* _tmp174_ = NULL;
1658
 
        GtkLabel* _tmp175_;
1659
 
        GtkLabel* _tmp176_;
1660
 
        GtkLabel* _tmp177_;
1661
 
        gchar* _tmp178_ = NULL;
1662
 
        gchar* _tmp179_;
1663
 
        GamesFileList* _tmp180_;
1664
 
        GamesFileList* _tmp181_;
1665
 
        GamesFileList* _tmp182_;
1666
 
        GSettings* _tmp183_;
 
1887
        GtkBox* _tmp179_;
 
1888
        const gchar* _tmp180_ = NULL;
 
1889
        GtkLabel* _tmp181_;
 
1890
        GtkLabel* _tmp182_;
 
1891
        GtkLabel* _tmp183_;
1667
1892
        gchar* _tmp184_ = NULL;
1668
1893
        gchar* _tmp185_;
1669
 
        GtkWidget* _tmp186_ = NULL;
1670
 
        GtkComboBox* _tmp187_;
 
1894
        GamesFileList* _tmp186_;
 
1895
        GamesFileList* _tmp187_;
 
1896
        GamesFileList* _tmp188_;
 
1897
        GSettings* _tmp189_;
 
1898
        gchar* _tmp190_ = NULL;
 
1899
        gchar* _tmp191_;
 
1900
        GtkWidget* _tmp192_ = NULL;
 
1901
        GtkComboBox* _tmp193_;
1671
1902
        GtkComboBox* theme_combo;
1672
 
        GtkLabel* _tmp188_;
1673
 
        GtkDialog* _tmp189_;
 
1903
        GtkLabel* _tmp194_;
 
1904
        GtkDialog* _tmp195_;
1674
1905
        g_return_if_fail (self != NULL);
1675
1906
        _tmp0_ = _ ("Iagno Preferences");
1676
1907
        _tmp1_ = self->priv->window;
1954
2185
        _tmp168_ = self->priv->settings;
1955
2186
        _tmp169_ = g_settings_get_boolean (_tmp168_, "show-grid");
1956
2187
        gtk_toggle_button_set_active ((GtkToggleButton*) grid_button, _tmp169_);
1957
 
        g_signal_connect_object ((GtkToggleButton*) grid_button, "toggled", (GCallback) _iagno_grid_select_gtk_toggle_button_toggled, self, 0);
 
2188
        g_signal_connect_object ((GtkToggleButton*) grid_button, "toggled", (GCallback) _iagno_grid_toggled_cb_gtk_toggle_button_toggled, self, 0);
1958
2189
        _tmp170_ = vbox;
1959
2190
        gtk_box_pack_start (_tmp170_, (GtkWidget*) grid_button, FALSE, FALSE, (guint) 0);
1960
 
        _tmp171_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
1961
 
        _tmp172_ = g_object_ref_sink (_tmp171_);
1962
 
        hbox = _tmp172_;
1963
 
        _tmp173_ = vbox;
1964
 
        gtk_box_pack_start (_tmp173_, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
1965
 
        _tmp174_ = _ ("_Tile set:");
1966
 
        _tmp175_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp174_);
1967
 
        _tmp176_ = g_object_ref_sink (_tmp175_);
 
2191
        _tmp171_ = _ ("_Flip final results");
 
2192
        _tmp172_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp171_);
 
2193
        _tmp173_ = g_object_ref_sink (_tmp172_);
 
2194
        flip_final_button = _tmp173_;
 
2195
        _tmp174_ = self->priv->settings;
 
2196
        _tmp175_ = g_settings_get_boolean (_tmp174_, "flip-final-results");
 
2197
        gtk_toggle_button_set_active ((GtkToggleButton*) flip_final_button, _tmp175_);
 
2198
        g_signal_connect_object ((GtkToggleButton*) flip_final_button, "toggled", (GCallback) _iagno_flip_final_toggled_cb_gtk_toggle_button_toggled, self, 0);
 
2199
        _tmp176_ = vbox;
 
2200
        gtk_box_pack_start (_tmp176_, (GtkWidget*) flip_final_button, FALSE, FALSE, (guint) 0);
 
2201
        _tmp177_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 
2202
        _tmp178_ = g_object_ref_sink (_tmp177_);
 
2203
        hbox = _tmp178_;
 
2204
        _tmp179_ = vbox;
 
2205
        gtk_box_pack_start (_tmp179_, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
 
2206
        _tmp180_ = _ ("_Tile set:");
 
2207
        _tmp181_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp180_);
 
2208
        _tmp182_ = g_object_ref_sink (_tmp181_);
1968
2209
        _g_object_unref0 (label);
1969
 
        label = _tmp176_;
1970
 
        _tmp177_ = label;
1971
 
        gtk_box_pack_start (hbox, (GtkWidget*) _tmp177_, FALSE, FALSE, (guint) 0);
1972
 
        _tmp178_ = g_build_filename (DATA_DIRECTORY, "themes", NULL);
1973
 
        _tmp179_ = _tmp178_;
1974
 
        _tmp180_ = games_file_list_new_images (_tmp179_, NULL, NULL);
1975
 
        _g_object_unref0 (self->priv->theme_file_list);
1976
 
        self->priv->theme_file_list = _tmp180_;
1977
 
        _g_free0 (_tmp179_);
1978
 
        _tmp181_ = self->priv->theme_file_list;
1979
 
        games_file_list_transform_basename (_tmp181_);
1980
 
        _tmp182_ = self->priv->theme_file_list;
1981
 
        _tmp183_ = self->priv->settings;
1982
 
        _tmp184_ = g_settings_get_string (_tmp183_, "tileset");
 
2210
        label = _tmp182_;
 
2211
        _tmp183_ = label;
 
2212
        gtk_box_pack_start (hbox, (GtkWidget*) _tmp183_, FALSE, FALSE, (guint) 0);
 
2213
        _tmp184_ = g_build_filename (DATA_DIRECTORY, "themes", NULL);
1983
2214
        _tmp185_ = _tmp184_;
1984
 
        _tmp186_ = games_file_list_create_widget (_tmp182_, _tmp185_, (guint) (GAMES_FILE_LIST_REMOVE_EXTENSION | GAMES_FILE_LIST_REPLACE_UNDERSCORES));
1985
 
        _tmp187_ = GTK_COMBO_BOX (_tmp186_);
 
2215
        _tmp186_ = games_file_list_new_images (_tmp185_, NULL, NULL);
 
2216
        _g_object_unref0 (self->priv->theme_file_list);
 
2217
        self->priv->theme_file_list = _tmp186_;
1986
2218
        _g_free0 (_tmp185_);
1987
 
        theme_combo = _tmp187_;
1988
 
        _tmp188_ = label;
1989
 
        gtk_label_set_mnemonic_widget (_tmp188_, (GtkWidget*) theme_combo);
 
2219
        _tmp187_ = self->priv->theme_file_list;
 
2220
        games_file_list_transform_basename (_tmp187_);
 
2221
        _tmp188_ = self->priv->theme_file_list;
 
2222
        _tmp189_ = self->priv->settings;
 
2223
        _tmp190_ = g_settings_get_string (_tmp189_, "tileset");
 
2224
        _tmp191_ = _tmp190_;
 
2225
        _tmp192_ = games_file_list_create_widget (_tmp188_, _tmp191_, (guint) (GAMES_FILE_LIST_REMOVE_EXTENSION | GAMES_FILE_LIST_REPLACE_UNDERSCORES));
 
2226
        _tmp193_ = GTK_COMBO_BOX (_tmp192_);
 
2227
        _g_free0 (_tmp191_);
 
2228
        theme_combo = _tmp193_;
 
2229
        _tmp194_ = label;
 
2230
        gtk_label_set_mnemonic_widget (_tmp194_, (GtkWidget*) theme_combo);
1990
2231
        g_signal_connect_object (theme_combo, "changed", (GCallback) _iagno_theme_changed_cb_gtk_combo_box_changed, self, 0);
1991
2232
        gtk_box_pack_start (hbox, (GtkWidget*) theme_combo, TRUE, TRUE, (guint) 0);
1992
 
        _tmp189_ = propbox;
1993
 
        gtk_widget_show_all ((GtkWidget*) _tmp189_);
 
2233
        _tmp195_ = propbox;
 
2234
        gtk_widget_show_all ((GtkWidget*) _tmp195_);
1994
2235
        _g_object_unref0 (theme_combo);
1995
2236
        _g_object_unref0 (hbox);
 
2237
        _g_object_unref0 (flip_final_button);
1996
2238
        _g_object_unref0 (grid_button);
1997
2239
        _g_object_unref0 (computer_button);
1998
2240
        _g_object_unref0 (frame);
2018
2260
        Iagno* _tmp9_;
2019
2261
        Iagno* app;
2020
2262
        Iagno* _tmp10_;
2021
 
        Iagno* _tmp11_;
2022
 
        gint _tmp12_ = 0;
 
2263
        gint _tmp11_ = 0;
2023
2264
        gint _result_;
2024
2265
        GError * _inner_error_ = NULL;
 
2266
        setlocale (LC_ALL, "");
 
2267
        bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 
2268
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
2269
        textdomain (GETTEXT_PACKAGE);
2025
2270
        _tmp0_ = g_option_context_new ("");
2026
2271
        context = _tmp0_;
2027
2272
        _tmp1_ = context;
2034
2279
                _tmp4_ = context;
2035
2280
                g_option_context_parse (_tmp4_, &args_length1, &args, &_inner_error_);
2036
2281
                if (_inner_error_ != NULL) {
2037
 
                        goto __catch3_g_error;
 
2282
                        goto __catch4_g_error;
2038
2283
                }
2039
2284
        }
2040
 
        goto __finally3;
2041
 
        __catch3_g_error:
 
2285
        goto __finally4;
 
2286
        __catch4_g_error:
2042
2287
        {
2043
2288
                GError* e = NULL;
2044
2289
                FILE* _tmp5_;
2055
2300
                _g_option_context_free0 (context);
2056
2301
                return result;
2057
2302
        }
2058
 
        __finally3:
 
2303
        __finally4:
2059
2304
        if (_inner_error_ != NULL) {
2060
2305
                _g_option_context_free0 (context);
2061
2306
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2069
2314
        _tmp9_ = iagno_new ();
2070
2315
        app = _tmp9_;
2071
2316
        _tmp10_ = app;
2072
 
        iagno_show (_tmp10_);
2073
 
        _tmp11_ = app;
2074
 
        _tmp12_ = g_application_run ((GApplication*) _tmp11_, 0, NULL);
2075
 
        _result_ = _tmp12_;
 
2317
        _tmp11_ = g_application_run ((GApplication*) _tmp10_, 0, NULL);
 
2318
        _result_ = _tmp11_;
2076
2319
        result = _result_;
2077
2320
        _g_object_unref0 (app);
2078
2321
        _g_option_context_free0 (context);
2089
2332
static void iagno_class_init (IagnoClass * klass) {
2090
2333
        iagno_parent_class = g_type_class_peek_parent (klass);
2091
2334
        g_type_class_add_private (klass, sizeof (IagnoPrivate));
 
2335
        G_APPLICATION_CLASS (klass)->startup = iagno_real_startup;
2092
2336
        G_APPLICATION_CLASS (klass)->activate = iagno_real_activate;
2093
2337
        G_OBJECT_CLASS (klass)->finalize = iagno_finalize;
2094
2338
}