Codebase list five-or-more / e59a626
Add Vala application window Ruxandra Simion authored 5 years ago Robert Roth committed 5 years ago
8 changed file(s) with 170 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 <?xml version="1.0" encoding="UTF-8"?>
1 <interface>
2 <!-- interface-requires gtk+ 3.0 -->
3 <object class="GtkAccelGroup" id="accelgroup"/>
4 <template class="FiveOrMoreWindow" parent="GtkApplicationWindow">
5 <property name="can_focus">False</property>
6 <property name="default_width">320</property>
7 <property name="default_height">400</property>
8 <property name="icon_name">glines</property>
9 <accel-groups>
10 <group name="accelgroup"/>
11 </accel-groups>
12 <child type="titlebar">
13 <object class="GtkHeaderBar" id="headerbar">
14 <property name="visible">True</property>
15 <property name="can_focus">False</property>
16 <property name="show_close_button">True</property>
17 <property name="title" translatable="yes">Five or More</property>
18 <child>
19 <object class="GtkBox" id="preview_hbox">
20 <property name="visible">True</property>
21 <property name="can_focus">False</property>
22 <property name="orientation">horizontal</property>
23 <child>
24 <object class="GtkLabel" id="labelNext">
25 <property name="visible">True</property>
26 <property name="can_focus">False</property>
27 <property name="margin_start">2</property>
28 <property name="margin_end">2</property>
29 <property name="label" translatable="yes">Next:</property>
30 <attributes>
31 <attribute name="weight" value="bold"/>
32 </attributes>
33 </object>
34 <packing>
35 <property name="pack_type">start</property>
36 </packing>
37 </child>
38 </object>
39 </child>
40 <child>
41 <object class="GtkLabel" id="scorelabel">
42 <property name="visible">True</property>
43 <property name="can_focus">False</property>
44 <property name="margin_end">2</property>
45 <property name="label">0</property>
46 </object>
47 <packing>
48 <property name="pack_type">end</property>
49 </packing>
50 </child>
51 <child>
52 <object class="GtkLabel" id="labelScore">
53 <property name="visible">True</property>
54 <property name="can_focus">False</property>
55 <property name="label" translatable="yes">Score:</property>
56 <attributes>
57 <attribute name="weight" value="bold"/>
58 </attributes>
59 </object>
60 <packing>
61 <property name="pack_type">end</property>
62 </packing>
63 </child>
64 </object>
65 </child>
66 <child>
67 <object class="GtkBox" id="hbox">
68 <property name="visible">True</property>
69 <property name="can_focus">False</property>
70 <property name="orientation">horizontal</property>
71 <child>
72 <object class="GtkButton" id="new_game_button">
73 <property name="visible">True</property>
74 <property name="use_underline">True</property>
75 <property name="label" translatable="yes">_New Game</property>
76 <property name="halign">center</property>
77 <property name="valign">end</property>
78 <property name="action-name">app.new-game</property>
79 <property name="tooltip-text" translatable="yes">Start a new puzzle</property>
80 <property name="width-request">120</property>
81 <property name="height-request">60</property>
82 </object>
83 <packing>
84 <property name="expand">False</property>
85 <property name="fill">False</property>
86 <property name="pack_type">end</property>
87 </packing>
88 </child>
89 </object>
90 </child>
91 </template>
92 </interface>
4646 install_dir: join_paths(data_dir, 'glib-2.0', 'schemas')
4747 )
4848
49 # Gresource
50 resource_files = files('org.gnome.five-or-more.gresource.xml')
51 resources = gnome.compile_resources('five-or-more', resource_files)
52
4953 # Manpage
5054 install_man(
5155 'five-or-more.6'
0 <?xml version="1.0" encoding="UTF-8"?>
1 <gresources>
2 <gresource prefix="/org/gnome/five-or-more/ui">
3 <file>five-or-more-vala.ui</file>
4 </gresource>
5 </gresources>
0 project('five-or-more', ['c'],
1 version: '3.29.3',
2 meson_version: '>= 0.43.0',
3 license: 'GPLv2'
0 project('five-or-more', ['c', 'vala'],
1 version: '3.29.3',
2 meson_version: '>= 0.43.0',
3 license: 'GPLv2'
44 )
55
66 gnome = import('gnome')
3636 configure_file(output: 'config.h', configuration: conf)
3737 config_h_dir = include_directories('.')
3838
39 add_project_arguments([
40 '-include', 'config.h'
41 ],
42 language: 'c'
43 )
44
3945 # Extra scripts
4046 meson.add_install_script('meson_post_install.py')
4147
4450 subdir('help')
4551 subdir('po')
4652 subdir('src')
53 subdir('src-vala')
0 public const string DATADIR;
1 public const string GETTEXT_PACKAGE;
2 public const string LOCALEDIR;
3 public const string VERSION;
0 public class FiveOrMoreApp: Gtk.Application {
1 private Gtk.Window window;
2
3 public FiveOrMoreApp () {
4 Object (application_id: "org.gnome.five-or-more", flags: ApplicationFlags.FLAGS_NONE);
5 }
6
7 public override void activate () {
8 window = new FiveOrMore.Window(this);
9 window.present ();
10 }
11
12 public static int main (string[] args) {
13 Environment.set_application_name (_("Five or More"));
14 Gtk.Window.set_default_icon_name ("five-or-more");
15
16 var app = new FiveOrMoreApp ();
17 return app.run (args);
18 }
19 }
0 #five-or-more executable
1
2 five_or_more_sources = [
3 'config.vapi',
4 'main.vala',
5 'window.vala',
6 resources
7 ]
8
9 five_or_more_deps = [
10 gio_dep,
11 gtk_dep,
12 ]
13
14 five_or_more_vala_args = [
15 '--gresources', resource_files,
16 ]
17
18 executable('five-or-more-vala', five_or_more_sources,
19 dependencies: five_or_more_deps,
20 vala_args: five_or_more_vala_args,
21 install: true,
22 )
0 namespace FiveOrMore {
1 [GtkTemplate (ui = "/org/gnome/five-or-more/ui/five-or-more-vala.ui")]
2 public class Window : Gtk.ApplicationWindow {
3
4 public Window (Gtk.Application app) {
5 Object (application: app);
6 }
7 }
8 }