[gnome-games/wip/exalm/views: 6/19] ui: Add DisplayView
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/views: 6/19] ui: Add DisplayView
- Date: Mon, 25 Feb 2019 09:23:29 +0000 (UTC)
commit 8ba05d0acd373ccec576adf58e159b7b48468003
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Oct 4 17:59:26 2018 +0500
ui: Add DisplayView
This will be used in the subsequent commits to move game display logic out
of ApplicationWindow.
Make 'box' and 'header_bar' public temporarily, until their references in
ApplicationWindow are removed.
src/meson.build | 1 +
src/ui/display-view.vala | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
---
diff --git a/src/meson.build b/src/meson.build
index f71f9c8d..87aae655 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -136,6 +136,7 @@ vala_sources = [
'ui/developers-view.vala',
'ui/display-box.vala',
'ui/display-header-bar.vala',
+ 'ui/display-view.vala',
'ui/dummy-display.vala',
'ui/empty-collection.vala',
'ui/error-display.vala',
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
new file mode 100644
index 00000000..58db88ef
--- /dev/null
+++ b/src/ui/display-view.vala
@@ -0,0 +1,65 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+private class Games.DisplayView: Object, UiView {
+ public signal void back ();
+
+ public DisplayBox box;
+ public DisplayHeaderBar header_bar;
+
+ public Gtk.Widget content_box {
+ get { return box; }
+ }
+
+ public Gtk.Widget title_bar {
+ get { return header_bar; }
+ }
+
+ private bool _is_view_active;
+ public bool is_view_active {
+ get { return _is_view_active; }
+ set {
+ if (is_view_active == value)
+ return;
+
+ _is_view_active = value;
+ }
+ }
+
+ public ApplicationWindow window { get; construct set; }
+
+ public DisplayView (ApplicationWindow window) {
+ Object (window: window);
+ }
+
+ construct {
+ box = new DisplayBox ();
+ header_bar = new DisplayHeaderBar ();
+
+ box.back.connect (on_display_back);
+ header_bar.back.connect (on_display_back);
+ }
+
+ public bool on_button_pressed (Gdk.EventButton event) {
+ return false;
+ }
+
+ public bool on_key_pressed (Gdk.EventKey event) {
+ return false;
+ }
+
+ public bool gamepad_button_press_event (Manette.Event event) {
+ return false;
+ }
+
+ public bool gamepad_button_release_event (Manette.Event event) {
+ return false;
+ }
+
+ public bool gamepad_absolute_axis_event (Manette.Event event) {
+ return false;
+ }
+
+ private void on_display_back () {
+ back ();
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]