Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
gva_application.h
Go to the documentation of this file.
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
12
13#ifndef HMIDISPLAY_GVA_APPLICATION_H_
14#define HMIDISPLAY_GVA_APPLICATION_H_
15#include <gtk/gtk.h>
16#include <uncompressed/rtp_uncompressed_depayloader.h>
17#include <unistd.h>
18
19#include <iostream>
20#include <memory>
21#include <string>
22
23#include "hmicore/events_gva.h"
24#include "hmicore/gva.h"
25#include "hmicore/hmi_gva.h"
31
34 public:
36 struct Options {
38 bool videoEnabled_ = false;
40 bool windowEnabled_ = false;
42 std::string config;
43 };
44
52 GvaApplication(const Options &options, const std::string &ipaddr, const uint32_t port);
53
58 ~GvaApplication() = default;
59
64 void Exec() const;
65
71 static bool SetKeyPressed(gva::GvaKeyEnum key);
72
79 static bool SetKeyReleased(gva::HandleType *renderer, gva::GvaKeyEnum key);
80
86 static void Update(gpointer user_data);
87
89 static Options options_;
91 static gtkType gtk_;
92
93 private:
98 static void BrightnessUp();
99
104 static void BrightnessDown();
105
111 static void BrightnessAdjust(double value);
112
120 static bool ProcessTopKeys(gva::HandleType *render, gva::GvaKeyEnum key);
121
130 static bool ProcessFunctionKeys(gva::WidgetKeyboard *keyboard, gva::GvaKeyEnum key);
131
137 static void Fullscreen(gva::HandleType *render);
138
143 static void Dispatch(gva::GvaKeyEnum key);
144
146 static std::shared_ptr<gva::EventsGva> io_;
148 static bool first_execution_;
149
158 static gboolean DrawCb(GtkWidget *Widget, cairo_t *cr, gpointer data);
159
168 static gboolean ConfigureEventCb(GtkWidget *Widget, GdkEventConfigure *event, gpointer data);
169
176 static void Activate(GtkApplication *app, gpointer user_data);
177
184 static gboolean Callback(gpointer user_data);
185
190 static void CloseWindow(void);
191};
192
193#endif // HMIDISPLAY_GVA_APPLICATION_H_
Class definition of the GvaApplication.
Definition gva_application.h:33
static bool SetKeyPressed(gva::GvaKeyEnum key)
Create the Key Pressed event.
Definition gva_application.cc:196
std::string config
The config file location.
Definition gva_application.h:42
static bool SetKeyReleased(gva::HandleType *renderer, gva::GvaKeyEnum key)
Create the Key Released event.
Definition gva_application.cc:427
static void Update(gpointer user_data)
Update the GTK application.
Definition gva_application.cc:494
static Options options_
GTK application options.
Definition gva_application.h:26
static gtkType gtk_
The GTK application.
Definition gva_application.h:91
void Exec() const
Execute the main processing loop, blocking call.
Definition gva_application.cc:126
bool windowEnabled_
Window enabled flag (default false)
Definition gva_application.h:40
~GvaApplication()=default
Destroy the Gva Application object.
bool videoEnabled_
Video enabled flag (default false)
Definition gva_application.h:38
Application options.
Definition gva_application.h:36
Class definition of the HandleType.
Definition renderer_cairo_types.h:23
Class defining the mode widget.
Definition keyboard.h:26
GvaKeyEnum
These are physical GVA keys around the display.
Definition gva.h:67
The GVA application type and associated data.
Definition gva_application_types.h:19