292
static void swell_foop_load_css (SwellFoop* self) {
293
GtkCssProvider* css_provider = NULL;
294
GtkCssProvider* _tmp0_ = NULL;
295
gchar* css_path = NULL;
296
gchar* _tmp1_ = NULL;
297
GdkScreen* _tmp4_ = NULL;
298
GError * _inner_error_ = NULL;
299
g_return_if_fail (self != NULL);
300
_tmp0_ = gtk_css_provider_new ();
301
css_provider = _tmp0_;
302
_tmp1_ = g_build_filename (DATADIR, "swell-foop.css", NULL);
305
gtk_css_provider_load_from_path (css_provider, css_path, &_inner_error_);
306
if (G_UNLIKELY (_inner_error_ != NULL)) {
307
goto __catch3_g_error;
314
GError* _tmp2_ = NULL;
315
const gchar* _tmp3_ = NULL;
317
_inner_error_ = NULL;
319
_tmp3_ = _tmp2_->message;
320
g_warning ("swell-foop.vala:66: Error loading css styles from %s: %s", css_path, _tmp3_);
324
if (G_UNLIKELY (_inner_error_ != NULL)) {
326
_g_object_unref0 (css_provider);
327
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);
328
g_clear_error (&_inner_error_);
331
_tmp4_ = gdk_screen_get_default ();
332
gtk_style_context_add_provider_for_screen (_tmp4_, (GtkStyleProvider*) css_provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
334
_g_object_unref0 (css_provider);
338
static Block1Data* block1_data_ref (Block1Data* _data1_) {
339
g_atomic_int_inc (&_data1_->_ref_count_);
344
static void block1_data_unref (void * _userdata_) {
346
_data1_ = (Block1Data*) _userdata_;
347
if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
349
self = _data1_->self;
350
_g_object_unref0 (_data1_->stack);
351
_g_object_unref0 (self);
352
g_slice_free (Block1Data, _data1_);
357
static void __lambda5_ (Block1Data* _data1_) {
359
GSettings* _tmp0_ = NULL;
360
self = _data1_->self;
361
gtk_stack_set_transition_type (_data1_->stack, GTK_STACK_TRANSITION_TYPE_SLIDE_UP);
362
gtk_stack_set_transition_duration (_data1_->stack, (guint) 500);
363
gtk_stack_set_visible_child_name (_data1_->stack, "game");
364
_tmp0_ = self->priv->settings;
365
g_settings_set_boolean (_tmp0_, "first-run", FALSE);
369
static void ___lambda5__gtk_button_clicked (GtkButton* _sender, gpointer self) {
277
374
static gpointer _g_object_ref0 (gpointer self) {
278
375
return self ? g_object_ref (self) : NULL;
379
static GtkStack* swell_foop_build_first_run_stack (SwellFoop* self) {
380
GtkStack* result = NULL;
382
GtkStack* _tmp0_ = NULL;
383
GtkBox* first_vbox = NULL;
384
GtkBox* _tmp1_ = NULL;
385
GtkImage* logo = NULL;
386
GtkImage* _tmp2_ = NULL;
387
GtkLabel* label = NULL;
388
const gchar* _tmp3_ = NULL;
389
GtkLabel* _tmp4_ = NULL;
390
GtkLabel* _tmp5_ = NULL;
391
GtkStyleContext* _tmp6_ = NULL;
392
GtkLabel* _tmp7_ = NULL;
393
const gchar* _tmp8_ = NULL;
394
GtkLabel* _tmp9_ = NULL;
395
GtkLabel* _tmp10_ = NULL;
396
GtkStyleContext* _tmp11_ = NULL;
397
GtkLabel* _tmp12_ = NULL;
398
GtkButton* play_button = NULL;
399
const gchar* _tmp13_ = NULL;
400
GtkButton* _tmp14_ = NULL;
401
GtkStyleContext* _tmp15_ = NULL;
402
GtkStyleContext* _tmp16_ = NULL;
403
GtkStack* _tmp17_ = NULL;
404
g_return_val_if_fail (self != NULL, NULL);
405
_data1_ = g_slice_new0 (Block1Data);
406
_data1_->_ref_count_ = 1;
407
_data1_->self = g_object_ref (self);
408
_tmp0_ = (GtkStack*) gtk_stack_new ();
409
g_object_ref_sink (_tmp0_);
410
_data1_->stack = _tmp0_;
411
_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
412
g_object_ref_sink (_tmp1_);
414
swell_foop_load_css (self);
415
_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("swell-foop", GTK_ICON_SIZE_DIALOG);
416
g_object_ref_sink (_tmp2_);
418
gtk_image_set_pixel_size (logo, 96);
419
gtk_box_pack_start (first_vbox, (GtkWidget*) logo, FALSE, TRUE, (guint) 0);
420
_tmp3_ = _ ("Welcome to Swell Foop");
421
_tmp4_ = (GtkLabel*) gtk_label_new (_tmp3_);
422
g_object_ref_sink (_tmp4_);
425
_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
426
gtk_style_context_add_class (_tmp6_, "welcome");
428
gtk_box_pack_start (first_vbox, (GtkWidget*) _tmp7_, FALSE, TRUE, (guint) 0);
429
_tmp8_ = _ ("Clear as many blocks as you can.\nFewer clicks means more points.");
430
_tmp9_ = (GtkLabel*) gtk_label_new (_tmp8_);
431
g_object_ref_sink (_tmp9_);
432
_g_object_unref0 (label);
435
_tmp11_ = gtk_widget_get_style_context ((GtkWidget*) _tmp10_);
436
gtk_style_context_add_class (_tmp11_, "tip");
438
gtk_box_pack_start (first_vbox, (GtkWidget*) _tmp12_, FALSE, TRUE, (guint) 0);
439
_tmp13_ = _ ("Let's _Play");
440
_tmp14_ = (GtkButton*) gtk_button_new_with_mnemonic (_tmp13_);
441
g_object_ref_sink (_tmp14_);
442
play_button = _tmp14_;
443
_tmp15_ = gtk_widget_get_style_context ((GtkWidget*) play_button);
444
gtk_style_context_add_class (_tmp15_, "play");
445
_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) play_button);
446
gtk_style_context_add_class (_tmp16_, "suggested-action");
447
gtk_widget_set_valign ((GtkWidget*) play_button, GTK_ALIGN_CENTER);
448
gtk_widget_set_halign ((GtkWidget*) play_button, GTK_ALIGN_CENTER);
449
g_signal_connect_data (play_button, "clicked", (GCallback) ___lambda5__gtk_button_clicked, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
450
gtk_box_pack_start (first_vbox, (GtkWidget*) play_button, FALSE, TRUE, (guint) 0);
451
gtk_widget_set_halign ((GtkWidget*) first_vbox, GTK_ALIGN_CENTER);
452
gtk_widget_set_valign ((GtkWidget*) first_vbox, GTK_ALIGN_CENTER);
453
gtk_stack_add_named (_data1_->stack, (GtkWidget*) first_vbox, "first-run");
454
gtk_stack_set_visible_child_name (_data1_->stack, "first-run");
455
gtk_widget_show_all ((GtkWidget*) _data1_->stack);
456
_tmp17_ = _g_object_ref0 (_data1_->stack);
458
_g_object_unref0 (play_button);
459
_g_object_unref0 (label);
460
_g_object_unref0 (logo);
461
_g_object_unref0 (first_vbox);
462
block1_data_unref (_data1_);
282
468
static void _swell_foop_update_score_cb_game_update_score (Game* _sender, gint points_awarded, gpointer self) {
283
469
swell_foop_update_score_cb ((SwellFoop*) self, points_awarded);
340
529
GMenu* _tmp29_ = NULL;
341
530
const gchar* _tmp30_ = NULL;
342
531
GMenu* _tmp31_ = NULL;
343
const gchar* _tmp32_ = NULL;
532
GMenu* _tmp32_ = NULL;
344
533
GMenu* _tmp33_ = NULL;
345
GtkHeaderBar* _tmp34_ = NULL;
346
GtkHeaderBar* _tmp35_ = NULL;
347
GtkHeaderBar* _tmp36_ = NULL;
534
GMenu* _tmp34_ = NULL;
535
const gchar* _tmp35_ = NULL;
536
GMenu* _tmp36_ = NULL;
348
537
const gchar* _tmp37_ = NULL;
349
GtkHeaderBar* _tmp38_ = NULL;
350
GtkWindow* _tmp39_ = NULL;
351
GtkHeaderBar* _tmp40_ = NULL;
352
GtkSettings* _tmp41_ = NULL;
353
gboolean _tmp42_ = FALSE;
354
gboolean _tmp43_ = FALSE;
355
GtkClutterEmbed* _tmp52_ = NULL;
356
GtkClutterEmbed* _tmp53_ = NULL;
357
GtkBox* _tmp54_ = NULL;
358
GtkClutterEmbed* _tmp55_ = NULL;
359
GtkClutterEmbed* _tmp56_ = NULL;
360
ClutterActor* _tmp57_ = NULL;
361
ClutterStage* _tmp58_ = NULL;
362
ClutterStage* _tmp59_ = NULL;
363
ClutterColor _tmp60_ = {0};
364
Size* _tmp61_ = NULL;
365
Size* _tmp62_ = NULL;
366
gint _tmp62__length1 = 0;
367
gchar* _tmp63_ = NULL;
368
const gchar* _tmp64_ = NULL;
369
gchar* _tmp65_ = NULL;
372
Size* _tmp68_ = NULL;
373
gint _tmp68__length1 = 0;
374
gchar* _tmp69_ = NULL;
375
const gchar* _tmp70_ = NULL;
376
gchar* _tmp71_ = NULL;
379
Size* _tmp74_ = NULL;
380
gint _tmp74__length1 = 0;
381
gchar* _tmp75_ = NULL;
382
const gchar* _tmp76_ = NULL;
383
gchar* _tmp77_ = NULL;
538
GMenu* _tmp38_ = NULL;
539
const gchar* _tmp39_ = NULL;
540
GMenu* _tmp40_ = NULL;
541
GtkHeaderBar* _tmp41_ = NULL;
542
GtkHeaderBar* _tmp42_ = NULL;
543
GtkHeaderBar* _tmp43_ = NULL;
544
const gchar* _tmp44_ = NULL;
545
GtkHeaderBar* _tmp45_ = NULL;
546
GtkWindow* _tmp46_ = NULL;
547
GtkHeaderBar* _tmp47_ = NULL;
548
GtkSettings* _tmp48_ = NULL;
549
gboolean _tmp49_ = FALSE;
550
gboolean _tmp50_ = FALSE;
551
GtkClutterEmbed* _tmp59_ = NULL;
552
GtkClutterEmbed* _tmp60_ = NULL;
553
gboolean first_run = FALSE;
554
GSettings* _tmp61_ = NULL;
555
gboolean _tmp62_ = FALSE;
556
gboolean _tmp63_ = FALSE;
557
GtkClutterEmbed* _tmp71_ = NULL;
558
ClutterActor* _tmp72_ = NULL;
559
ClutterStage* _tmp73_ = NULL;
560
ClutterStage* _tmp74_ = NULL;
561
ClutterColor _tmp75_ = {0};
562
Size* _tmp76_ = NULL;
563
Size* _tmp77_ = NULL;
564
gint _tmp77__length1 = 0;
565
gchar* _tmp78_ = NULL;
566
const gchar* _tmp79_ = NULL;
567
gchar* _tmp80_ = NULL;
387
568
Size _tmp81_ = {0};
392
GSettings* _tmp86_ = NULL;
394
Game* _tmp88_ = NULL;
395
Game* _tmp89_ = NULL;
396
Game* _tmp90_ = NULL;
397
GameView* _tmp91_ = NULL;
398
GameView* _tmp92_ = NULL;
399
GSettings* _tmp93_ = NULL;
400
gchar* _tmp94_ = NULL;
401
gchar* _tmp95_ = NULL;
402
GameView* _tmp96_ = NULL;
403
GSettings* _tmp97_ = NULL;
404
gboolean _tmp98_ = FALSE;
405
GameView* _tmp99_ = NULL;
406
Game* _tmp100_ = NULL;
407
ClutterStage* _tmp101_ = NULL;
408
GameView* _tmp102_ = NULL;
409
ClutterStage* _tmp103_ = NULL;
410
GameView* _tmp104_ = NULL;
411
gfloat _tmp105_ = 0.0F;
412
gfloat _tmp106_ = 0.0F;
570
Size* _tmp83_ = NULL;
571
gint _tmp83__length1 = 0;
572
gchar* _tmp84_ = NULL;
573
const gchar* _tmp85_ = NULL;
574
gchar* _tmp86_ = NULL;
577
Size* _tmp89_ = NULL;
578
gint _tmp89__length1 = 0;
579
gchar* _tmp90_ = NULL;
580
const gchar* _tmp91_ = NULL;
581
gchar* _tmp92_ = NULL;
590
GSettings* _tmp101_ = NULL;
592
Game* _tmp103_ = NULL;
593
Game* _tmp104_ = NULL;
594
Game* _tmp105_ = NULL;
595
GameView* _tmp106_ = NULL;
413
596
GameView* _tmp107_ = NULL;
414
gfloat _tmp108_ = 0.0F;
415
gfloat _tmp109_ = 0.0F;
416
GtkClutterEmbed* _tmp110_ = NULL;
417
ClutterStage* _tmp111_ = NULL;
418
gfloat _tmp112_ = 0.0F;
419
gfloat _tmp113_ = 0.0F;
420
ClutterStage* _tmp114_ = NULL;
421
gfloat _tmp115_ = 0.0F;
422
gfloat _tmp116_ = 0.0F;
423
GtkClutterEmbed* _tmp117_ = NULL;
424
GameView* _tmp118_ = NULL;
425
const gchar* _tmp119_ = NULL;
426
gchar* _tmp120_ = NULL;
427
gchar* _tmp121_ = NULL;
428
History* _tmp122_ = NULL;
429
History* _tmp123_ = NULL;
430
GtkWindow* _tmp124_ = NULL;
597
GSettings* _tmp108_ = NULL;
598
gchar* _tmp109_ = NULL;
599
gchar* _tmp110_ = NULL;
600
GameView* _tmp111_ = NULL;
601
GSettings* _tmp112_ = NULL;
602
gboolean _tmp113_ = FALSE;
603
GameView* _tmp114_ = NULL;
604
Game* _tmp115_ = NULL;
605
ClutterStage* _tmp116_ = NULL;
606
GameView* _tmp117_ = NULL;
607
ClutterStage* _tmp118_ = NULL;
608
GameView* _tmp119_ = NULL;
609
gfloat _tmp120_ = 0.0F;
610
gfloat _tmp121_ = 0.0F;
611
GameView* _tmp122_ = NULL;
612
gfloat _tmp123_ = 0.0F;
613
gfloat _tmp124_ = 0.0F;
614
GtkClutterEmbed* _tmp125_ = NULL;
615
ClutterStage* _tmp126_ = NULL;
616
gfloat _tmp127_ = 0.0F;
617
gfloat _tmp128_ = 0.0F;
618
ClutterStage* _tmp129_ = NULL;
619
gfloat _tmp130_ = 0.0F;
620
gfloat _tmp131_ = 0.0F;
621
GtkClutterEmbed* _tmp132_ = NULL;
622
GameView* _tmp133_ = NULL;
623
const gchar* _tmp134_ = NULL;
624
gchar* _tmp135_ = NULL;
625
gchar* _tmp136_ = NULL;
626
History* _tmp137_ = NULL;
627
History* _tmp138_ = NULL;
628
GtkWindow* _tmp139_ = NULL;
431
629
self = (SwellFoop*) base;
432
630
G_APPLICATION_CLASS (swell_foop_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_get_type (), GtkApplication));
433
631
_tmp0_ = gtk_settings_get_default ();
436
634
_g_object_unref0 (self->priv->settings);
437
635
self->priv->settings = _tmp1_;
438
636
g_action_map_add_action_entries ((GActionMap*) self, SWELL_FOOP_action_entries, G_N_ELEMENTS (SWELL_FOOP_action_entries), self);
439
gtk_application_add_accelerator ((GtkApplication*) self, "<Primary>n", "app.new-game", NULL);
440
gtk_application_add_accelerator ((GtkApplication*) self, "F1", "app.help", NULL);
441
gtk_application_add_accelerator ((GtkApplication*) self, "<Primary>q", "app.quit", NULL);
442
_tmp2_ = (GtkApplicationWindow*) gtk_application_window_new ((GtkApplication*) self);
443
g_object_ref_sink (_tmp2_);
637
_tmp2_ = g_strdup ("<Primary>n");
638
_tmp3_ = g_new0 (gchar*, 1 + 1);
642
gtk_application_set_accels_for_action ((GtkApplication*) self, "app.new-game", _tmp4_);
643
_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
644
_tmp5_ = g_strdup ("F1");
645
_tmp6_ = g_new0 (gchar*, 1 + 1);
649
gtk_application_set_accels_for_action ((GtkApplication*) self, "app.help", _tmp7_);
650
_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
651
_tmp8_ = g_strdup ("<Primary>q");
652
_tmp9_ = g_new0 (gchar*, 1 + 1);
656
gtk_application_set_accels_for_action ((GtkApplication*) self, "app.quit", _tmp10_);
657
_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
658
_tmp11_ = (GtkApplicationWindow*) gtk_application_window_new ((GtkApplication*) self);
659
g_object_ref_sink (_tmp11_);
444
660
_g_object_unref0 (self->priv->window);
445
self->priv->window = (GtkWindow*) _tmp2_;
446
_tmp3_ = self->priv->window;
447
_tmp4_ = _ ("Swell Foop");
448
gtk_window_set_title (_tmp3_, _tmp4_);
449
_tmp5_ = self->priv->window;
450
gtk_window_set_icon_name (_tmp5_, "swell-foop");
451
_tmp6_ = self->priv->window;
452
gtk_window_set_resizable (_tmp6_, FALSE);
453
_tmp7_ = self->priv->window;
454
_tmp8_ = self->priv->window;
455
_tmp9_ = gtk_widget_get_events ((GtkWidget*) _tmp8_);
456
gtk_widget_set_events ((GtkWidget*) _tmp7_, (_tmp9_ | GDK_KEY_PRESS_MASK) | GDK_KEY_RELEASE_MASK);
457
_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
458
g_object_ref_sink (_tmp10_);
461
gtk_widget_show ((GtkWidget*) _tmp11_);
661
self->priv->window = (GtkWindow*) _tmp11_;
462
662
_tmp12_ = self->priv->window;
464
gtk_container_add ((GtkContainer*) _tmp12_, (GtkWidget*) _tmp13_);
465
_tmp14_ = g_menu_new ();
467
_tmp15_ = g_menu_new ();
471
g_menu_append_section (_tmp16_, NULL, (GMenuModel*) _tmp17_);
473
_tmp19_ = _ ("_New Game");
474
g_menu_append (_tmp18_, _tmp19_, "app.new-game");
476
_tmp21_ = _ ("_Scores");
477
g_menu_append (_tmp20_, _tmp21_, "app.scores");
479
_tmp23_ = _ ("_Preferences");
480
g_menu_append (_tmp22_, _tmp23_, "app.preferences");
663
_tmp13_ = _ ("Swell Foop");
664
gtk_window_set_title (_tmp12_, _tmp13_);
665
_tmp14_ = self->priv->window;
666
gtk_window_set_icon_name (_tmp14_, "swell-foop");
667
_tmp15_ = self->priv->window;
668
gtk_window_set_resizable (_tmp15_, FALSE);
669
_tmp16_ = self->priv->window;
670
_tmp17_ = self->priv->window;
671
_tmp18_ = gtk_widget_get_events ((GtkWidget*) _tmp17_);
672
gtk_widget_set_events ((GtkWidget*) _tmp16_, (_tmp18_ | GDK_KEY_PRESS_MASK) | GDK_KEY_RELEASE_MASK);
673
_tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
674
g_object_ref_sink (_tmp19_);
677
gtk_widget_show ((GtkWidget*) _tmp20_);
678
_tmp21_ = self->priv->window;
680
gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) _tmp22_);
681
_tmp23_ = g_menu_new ();
481
683
_tmp24_ = g_menu_new ();
482
_g_object_unref0 (section);
483
684
section = _tmp24_;
485
686
_tmp26_ = section;
486
687
g_menu_append_section (_tmp25_, NULL, (GMenuModel*) _tmp26_);
487
688
_tmp27_ = section;
488
_tmp28_ = _ ("_Help");
489
g_menu_append (_tmp27_, _tmp28_, "app.help");
689
_tmp28_ = _ ("_Scores");
690
g_menu_append (_tmp27_, _tmp28_, "app.scores");
490
691
_tmp29_ = section;
491
_tmp30_ = _ ("_About");
492
g_menu_append (_tmp29_, _tmp30_, "app.about");
494
_tmp32_ = _ ("_Quit");
495
g_menu_append (_tmp31_, _tmp32_, "app.quit");
497
gtk_application_set_app_menu ((GtkApplication*) self, (GMenuModel*) _tmp33_);
498
_tmp34_ = (GtkHeaderBar*) gtk_header_bar_new ();
499
g_object_ref_sink (_tmp34_);
692
_tmp30_ = _ ("_Preferences");
693
g_menu_append (_tmp29_, _tmp30_, "app.preferences");
694
_tmp31_ = g_menu_new ();
695
_g_object_unref0 (section);
699
g_menu_append_section (_tmp32_, NULL, (GMenuModel*) _tmp33_);
701
_tmp35_ = _ ("_Help");
702
g_menu_append (_tmp34_, _tmp35_, "app.help");
704
_tmp37_ = _ ("_About");
705
g_menu_append (_tmp36_, _tmp37_, "app.about");
707
_tmp39_ = _ ("_Quit");
708
g_menu_append (_tmp38_, _tmp39_, "app.quit");
710
gtk_application_set_app_menu ((GtkApplication*) self, (GMenuModel*) _tmp40_);
711
_tmp41_ = (GtkHeaderBar*) gtk_header_bar_new ();
712
g_object_ref_sink (_tmp41_);
500
713
_g_object_unref0 (self->priv->headerbar);
501
self->priv->headerbar = _tmp34_;
502
_tmp35_ = self->priv->headerbar;
503
gtk_widget_show ((GtkWidget*) _tmp35_);
504
_tmp36_ = self->priv->headerbar;
505
_tmp37_ = _ ("Swell Foop");
506
gtk_header_bar_set_title (_tmp36_, _tmp37_);
507
_tmp38_ = self->priv->headerbar;
508
gtk_header_bar_set_show_close_button (_tmp38_, TRUE);
509
_tmp39_ = self->priv->window;
510
_tmp40_ = self->priv->headerbar;
511
gtk_window_set_titlebar (_tmp39_, (GtkWidget*) _tmp40_);
512
_tmp41_ = gtk_settings_get_default ();
513
g_object_get (_tmp41_, "gtk-shell-shows-app-menu", &_tmp42_, NULL);
714
self->priv->headerbar = _tmp41_;
715
_tmp42_ = self->priv->headerbar;
716
gtk_widget_show ((GtkWidget*) _tmp42_);
717
_tmp43_ = self->priv->headerbar;
718
_tmp44_ = _ ("Swell Foop");
719
gtk_header_bar_set_title (_tmp43_, _tmp44_);
720
_tmp45_ = self->priv->headerbar;
721
gtk_header_bar_set_show_close_button (_tmp45_, TRUE);
722
_tmp46_ = self->priv->window;
723
_tmp47_ = self->priv->headerbar;
724
gtk_window_set_titlebar (_tmp46_, (GtkWidget*) _tmp47_);
725
_tmp48_ = gtk_settings_get_default ();
726
g_object_get (_tmp48_, "gtk-shell-shows-app-menu", &_tmp49_, NULL);
516
729
GtkButton* new_game_button = NULL;
517
GtkButton* _tmp44_ = NULL;
518
GtkButton* _tmp45_ = NULL;
519
GtkButton* _tmp46_ = NULL;
520
GtkButton* _tmp47_ = NULL;
521
const gchar* _tmp48_ = NULL;
522
GtkButton* _tmp49_ = NULL;
523
GtkHeaderBar* _tmp50_ = NULL;
524
730
GtkButton* _tmp51_ = NULL;
525
_tmp44_ = (GtkButton*) gtk_button_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
526
g_object_ref_sink (_tmp44_);
527
new_game_button = _tmp44_;
528
_tmp45_ = new_game_button;
529
gtk_widget_set_valign ((GtkWidget*) _tmp45_, GTK_ALIGN_CENTER);
530
_tmp46_ = new_game_button;
531
gtk_actionable_set_action_name ((GtkActionable*) _tmp46_, "app.new-game");
532
_tmp47_ = new_game_button;
533
_tmp48_ = _ ("Start a new game");
534
gtk_widget_set_tooltip_text ((GtkWidget*) _tmp47_, _tmp48_);
535
_tmp49_ = new_game_button;
536
gtk_widget_show ((GtkWidget*) _tmp49_);
537
_tmp50_ = self->priv->headerbar;
538
_tmp51_ = new_game_button;
539
gtk_header_bar_pack_start (_tmp50_, (GtkWidget*) _tmp51_);
731
GtkButton* _tmp52_ = NULL;
732
GtkButton* _tmp53_ = NULL;
733
GtkButton* _tmp54_ = NULL;
734
const gchar* _tmp55_ = NULL;
735
GtkButton* _tmp56_ = NULL;
736
GtkHeaderBar* _tmp57_ = NULL;
737
GtkButton* _tmp58_ = NULL;
738
_tmp51_ = (GtkButton*) gtk_button_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
739
g_object_ref_sink (_tmp51_);
740
new_game_button = _tmp51_;
741
_tmp52_ = new_game_button;
742
gtk_widget_set_valign ((GtkWidget*) _tmp52_, GTK_ALIGN_CENTER);
743
_tmp53_ = new_game_button;
744
gtk_actionable_set_action_name ((GtkActionable*) _tmp53_, "app.new-game");
745
_tmp54_ = new_game_button;
746
_tmp55_ = _ ("Start a new game");
747
gtk_widget_set_tooltip_text ((GtkWidget*) _tmp54_, _tmp55_);
748
_tmp56_ = new_game_button;
749
gtk_widget_show ((GtkWidget*) _tmp56_);
750
_tmp57_ = self->priv->headerbar;
751
_tmp58_ = new_game_button;
752
gtk_header_bar_pack_start (_tmp57_, (GtkWidget*) _tmp58_);
540
753
_g_object_unref0 (new_game_button);
542
755
swell_foop_update_score_cb (self, 0);
543
_tmp52_ = (GtkClutterEmbed*) gtk_clutter_embed_new ();
544
g_object_ref_sink (_tmp52_);
756
_tmp59_ = (GtkClutterEmbed*) gtk_clutter_embed_new ();
757
g_object_ref_sink (_tmp59_);
545
758
_g_object_unref0 (self->priv->clutter_embed);
546
self->priv->clutter_embed = _tmp52_;
547
_tmp53_ = self->priv->clutter_embed;
548
gtk_widget_show ((GtkWidget*) _tmp53_);
550
_tmp55_ = self->priv->clutter_embed;
551
gtk_box_pack_start (_tmp54_, (GtkWidget*) _tmp55_, TRUE, TRUE, (guint) 0);
552
_tmp56_ = self->priv->clutter_embed;
553
_tmp57_ = gtk_clutter_embed_get_stage (_tmp56_);
554
_tmp58_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, clutter_stage_get_type (), ClutterStage));
759
self->priv->clutter_embed = _tmp59_;
760
_tmp60_ = self->priv->clutter_embed;
761
gtk_widget_show ((GtkWidget*) _tmp60_);
762
_tmp61_ = self->priv->settings;
763
_tmp62_ = g_settings_get_boolean (_tmp61_, "first-run");
767
GtkStack* stack = NULL;
768
GtkStack* _tmp64_ = NULL;
769
GtkStack* _tmp65_ = NULL;
770
GtkClutterEmbed* _tmp66_ = NULL;
771
GtkBox* _tmp67_ = NULL;
772
GtkStack* _tmp68_ = NULL;
773
_tmp64_ = swell_foop_build_first_run_stack (self);
776
_tmp66_ = self->priv->clutter_embed;
777
gtk_stack_add_named (_tmp65_, (GtkWidget*) _tmp66_, "game");
780
gtk_box_pack_start (_tmp67_, (GtkWidget*) _tmp68_, TRUE, TRUE, (guint) 0);
781
_g_object_unref0 (stack);
783
GtkBox* _tmp69_ = NULL;
784
GtkClutterEmbed* _tmp70_ = NULL;
786
_tmp70_ = self->priv->clutter_embed;
787
gtk_box_pack_start (_tmp69_, (GtkWidget*) _tmp70_, TRUE, TRUE, (guint) 0);
789
_tmp71_ = self->priv->clutter_embed;
790
_tmp72_ = gtk_clutter_embed_get_stage (_tmp71_);
791
_tmp73_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, clutter_stage_get_type (), ClutterStage));
555
792
_g_object_unref0 (self->priv->stage);
556
self->priv->stage = _tmp58_;
557
_tmp59_ = self->priv->stage;
558
clutter_color_from_string (&_tmp60_, "#000000");
559
clutter_actor_set_background_color ((ClutterActor*) _tmp59_, &_tmp60_);
560
_tmp61_ = g_new0 (Size, 3);
793
self->priv->stage = _tmp73_;
794
_tmp74_ = self->priv->stage;
795
clutter_color_from_string (&_tmp75_, "#000000");
796
clutter_actor_set_background_color ((ClutterActor*) _tmp74_, &_tmp75_);
797
_tmp76_ = g_new0 (Size, 3);
561
798
self->sizes = (_vala_Size_array_free (self->sizes, self->sizes_length1), NULL);
562
self->sizes = _tmp61_;
799
self->sizes = _tmp76_;
563
800
self->sizes_length1 = 3;
564
_tmp62_ = self->sizes;
565
_tmp62__length1 = self->sizes_length1;
566
_tmp63_ = g_strdup ("small");
567
_tmp64_ = _ ("Small");
568
_tmp65_ = g_strdup (_tmp64_);
569
_g_free0 (_tmp66_.id);
570
_tmp66_.id = _tmp63_;
571
_g_free0 (_tmp66_.name);
572
_tmp66_.name = _tmp65_;
575
size_destroy (&_tmp62_[0]);
576
_tmp62_[0] = _tmp66_;
577
_tmp67_ = _tmp62_[0];
578
_tmp68_ = self->sizes;
579
_tmp68__length1 = self->sizes_length1;
580
_tmp69_ = g_strdup ("normal");
581
_tmp70_ = _ ("Normal");
582
_tmp71_ = g_strdup (_tmp70_);
583
_g_free0 (_tmp72_.id);
584
_tmp72_.id = _tmp69_;
585
_g_free0 (_tmp72_.name);
586
_tmp72_.name = _tmp71_;
587
_tmp72_.columns = 15;
589
size_destroy (&_tmp68_[1]);
590
_tmp68_[1] = _tmp72_;
591
_tmp73_ = _tmp68_[1];
592
_tmp74_ = self->sizes;
593
_tmp74__length1 = self->sizes_length1;
594
_tmp75_ = g_strdup ("large");
595
_tmp76_ = _ ("Large");
596
_tmp77_ = g_strdup (_tmp76_);
597
_g_free0 (_tmp78_.id);
598
_tmp78_.id = _tmp75_;
599
_g_free0 (_tmp78_.name);
600
_tmp78_.name = _tmp77_;
601
_tmp78_.columns = 20;
603
size_destroy (&_tmp74_[2]);
604
_tmp74_[2] = _tmp78_;
605
_tmp79_ = _tmp74_[2];
606
swell_foop_get_size (self, &_tmp80_);
608
_tmp82_ = _tmp81_.rows;
609
swell_foop_get_size (self, &_tmp83_);
611
_tmp85_ = _tmp84_.columns;
612
_tmp86_ = self->priv->settings;
613
_tmp87_ = g_settings_get_int (_tmp86_, "colors");
614
_tmp88_ = game_new (_tmp82_, _tmp85_, _tmp87_);
801
_tmp77_ = self->sizes;
802
_tmp77__length1 = self->sizes_length1;
803
_tmp78_ = g_strdup ("small");
804
_tmp79_ = _ ("Small");
805
_tmp80_ = g_strdup (_tmp79_);
806
_g_free0 (_tmp81_.id);
807
_tmp81_.id = _tmp78_;
808
_g_free0 (_tmp81_.name);
809
_tmp81_.name = _tmp80_;
812
size_destroy (&_tmp77_[0]);
813
_tmp77_[0] = _tmp81_;
814
_tmp82_ = _tmp77_[0];
815
_tmp83_ = self->sizes;
816
_tmp83__length1 = self->sizes_length1;
817
_tmp84_ = g_strdup ("normal");
818
_tmp85_ = _ ("Normal");
819
_tmp86_ = g_strdup (_tmp85_);
820
_g_free0 (_tmp87_.id);
821
_tmp87_.id = _tmp84_;
822
_g_free0 (_tmp87_.name);
823
_tmp87_.name = _tmp86_;
824
_tmp87_.columns = 15;
826
size_destroy (&_tmp83_[1]);
827
_tmp83_[1] = _tmp87_;
828
_tmp88_ = _tmp83_[1];
829
_tmp89_ = self->sizes;
830
_tmp89__length1 = self->sizes_length1;
831
_tmp90_ = g_strdup ("large");
832
_tmp91_ = _ ("Large");
833
_tmp92_ = g_strdup (_tmp91_);
834
_g_free0 (_tmp93_.id);
835
_tmp93_.id = _tmp90_;
836
_g_free0 (_tmp93_.name);
837
_tmp93_.name = _tmp92_;
838
_tmp93_.columns = 20;
840
size_destroy (&_tmp89_[2]);
841
_tmp89_[2] = _tmp93_;
842
_tmp94_ = _tmp89_[2];
843
swell_foop_get_size (self, &_tmp95_);
845
_tmp97_ = _tmp96_.rows;
846
swell_foop_get_size (self, &_tmp98_);
848
_tmp100_ = _tmp99_.columns;
849
_tmp101_ = self->priv->settings;
850
_tmp102_ = g_settings_get_int (_tmp101_, "colors");
851
_tmp103_ = game_new (_tmp97_, _tmp100_, _tmp102_);
615
852
_g_object_unref0 (self->priv->game);
616
self->priv->game = _tmp88_;
617
size_destroy (&_tmp84_);
618
size_destroy (&_tmp81_);
619
_tmp89_ = self->priv->game;
620
g_signal_connect_object (_tmp89_, "update-score", (GCallback) _swell_foop_update_score_cb_game_update_score, self, 0);
621
_tmp90_ = self->priv->game;
622
g_signal_connect_object (_tmp90_, "complete", (GCallback) _swell_foop_complete_cb_game_complete, self, 0);
623
_tmp91_ = game_view_new ();
624
g_object_ref_sink (_tmp91_);
853
self->priv->game = _tmp103_;
854
size_destroy (&_tmp99_);
855
size_destroy (&_tmp96_);
856
_tmp104_ = self->priv->game;
857
g_signal_connect_object (_tmp104_, "update-score", (GCallback) _swell_foop_update_score_cb_game_update_score, self, 0);
858
_tmp105_ = self->priv->game;
859
g_signal_connect_object (_tmp105_, "complete", (GCallback) _swell_foop_complete_cb_game_complete, self, 0);
860
_tmp106_ = game_view_new ();
861
g_object_ref_sink (_tmp106_);
625
862
_g_object_unref0 (self->priv->view);
626
self->priv->view = _tmp91_;
627
_tmp92_ = self->priv->view;
628
_tmp93_ = self->priv->settings;
629
_tmp94_ = g_settings_get_string (_tmp93_, "theme");
631
game_view_set_theme_name (_tmp92_, _tmp95_);
633
_tmp96_ = self->priv->view;
634
_tmp97_ = self->priv->settings;
635
_tmp98_ = g_settings_get_boolean (_tmp97_, "zealous");
636
_tmp96_->is_zealous = _tmp98_;
637
_tmp99_ = self->priv->view;
638
_tmp100_ = self->priv->game;
639
game_view_set_game (_tmp99_, _tmp100_);
640
_tmp101_ = self->priv->stage;
641
_tmp102_ = self->priv->view;
642
clutter_actor_add_child ((ClutterActor*) _tmp101_, (ClutterActor*) _tmp102_);
643
_tmp103_ = self->priv->stage;
644
_tmp104_ = self->priv->view;
645
_tmp105_ = clutter_actor_get_width ((ClutterActor*) _tmp104_);
863
self->priv->view = _tmp106_;
647
864
_tmp107_ = self->priv->view;
648
_tmp108_ = clutter_actor_get_height ((ClutterActor*) _tmp107_);
650
clutter_actor_set_size ((ClutterActor*) _tmp103_, _tmp106_, _tmp109_);
651
_tmp110_ = self->priv->clutter_embed;
652
_tmp111_ = self->priv->stage;
653
_tmp112_ = clutter_actor_get_width ((ClutterActor*) _tmp111_);
655
_tmp114_ = self->priv->stage;
656
_tmp115_ = clutter_actor_get_height ((ClutterActor*) _tmp114_);
658
gtk_widget_set_size_request ((GtkWidget*) _tmp110_, (gint) _tmp113_, (gint) _tmp116_);
659
_tmp117_ = self->priv->clutter_embed;
660
_tmp118_ = self->priv->view;
661
g_signal_connect_object ((GtkWidget*) _tmp117_, "leave-notify-event", (GCallback) _game_view_board_left_cb_gtk_widget_leave_notify_event, _tmp118_, 0);
662
_tmp119_ = g_get_user_data_dir ();
663
_tmp120_ = g_build_filename (_tmp119_, "swell-foop", "history", NULL);
865
_tmp108_ = self->priv->settings;
866
_tmp109_ = g_settings_get_string (_tmp108_, "theme");
868
game_view_set_theme_name (_tmp107_, _tmp110_);
870
_tmp111_ = self->priv->view;
871
_tmp112_ = self->priv->settings;
872
_tmp113_ = g_settings_get_boolean (_tmp112_, "zealous");
873
_tmp111_->is_zealous = _tmp113_;
874
_tmp114_ = self->priv->view;
875
_tmp115_ = self->priv->game;
876
game_view_set_game (_tmp114_, _tmp115_);
877
_tmp116_ = self->priv->stage;
878
_tmp117_ = self->priv->view;
879
clutter_actor_add_child ((ClutterActor*) _tmp116_, (ClutterActor*) _tmp117_);
880
_tmp118_ = self->priv->stage;
881
_tmp119_ = self->priv->view;
882
_tmp120_ = clutter_actor_get_width ((ClutterActor*) _tmp119_);
664
883
_tmp121_ = _tmp120_;
665
_tmp122_ = history_new (_tmp121_);
884
_tmp122_ = self->priv->view;
885
_tmp123_ = clutter_actor_get_height ((ClutterActor*) _tmp122_);
887
clutter_actor_set_size ((ClutterActor*) _tmp118_, _tmp121_, _tmp124_);
888
_tmp125_ = self->priv->clutter_embed;
889
_tmp126_ = self->priv->stage;
890
_tmp127_ = clutter_actor_get_width ((ClutterActor*) _tmp126_);
892
_tmp129_ = self->priv->stage;
893
_tmp130_ = clutter_actor_get_height ((ClutterActor*) _tmp129_);
895
gtk_widget_set_size_request ((GtkWidget*) _tmp125_, (gint) _tmp128_, (gint) _tmp131_);
896
_tmp132_ = self->priv->clutter_embed;
897
_tmp133_ = self->priv->view;
898
g_signal_connect_object ((GtkWidget*) _tmp132_, "leave-notify-event", (GCallback) _game_view_board_left_cb_gtk_widget_leave_notify_event, _tmp133_, 0);
899
_tmp134_ = g_get_user_data_dir ();
900
_tmp135_ = g_build_filename (_tmp134_, "swell-foop", "history", NULL);
902
_tmp137_ = history_new (_tmp136_);
666
903
_g_object_unref0 (self->priv->history);
667
self->priv->history = _tmp122_;
669
_tmp123_ = self->priv->history;
670
history_load (_tmp123_);
671
_tmp124_ = self->priv->window;
672
g_signal_connect_object ((GtkWidget*) _tmp124_, "key-press-event", (GCallback) _swell_foop_key_press_event_cb_gtk_widget_key_press_event, self, 0);
904
self->priv->history = _tmp137_;
906
_tmp138_ = self->priv->history;
907
history_load (_tmp138_);
908
_tmp139_ = self->priv->window;
909
g_signal_connect_object ((GtkWidget*) _tmp139_, "key-press-event", (GCallback) _swell_foop_key_press_event_cb_gtk_widget_key_press_event, self, 0);
673
910
_g_object_unref0 (section);
674
911
_g_object_unref0 (menu);
675
912
_g_object_unref0 (vbox);