You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							72 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
	
	
							72 lines
						
					
					
						
							1.3 KiB
						
					
					
				| #pragma once
 | |
| 
 | |
| #include <string>
 | |
| 
 | |
| #include <QWidget>
 | |
| #include <QTimer>
 | |
| #include <QOpenGLWidget>
 | |
| #include <QOpenGLFunctions>
 | |
| #include <QStackedLayout>
 | |
| 
 | |
| #include "qt/qt_sound.hpp"
 | |
| #include "offroad/settings.hpp"
 | |
| #include "offroad/onboarding.hpp"
 | |
| #include "ui/ui.hpp"
 | |
| 
 | |
| 
 | |
| class GLWindow : public QOpenGLWidget, protected QOpenGLFunctions {
 | |
|   Q_OBJECT
 | |
| 
 | |
| public:
 | |
|   using QOpenGLWidget::QOpenGLWidget;
 | |
|   explicit GLWindow(QWidget *parent = 0);
 | |
|   void wake();
 | |
|   ~GLWindow();
 | |
| 
 | |
| protected:
 | |
|   void mousePressEvent(QMouseEvent *e) override;
 | |
|   void initializeGL() override;
 | |
|   void resizeGL(int w, int h) override;
 | |
|   void paintGL() override;
 | |
| 
 | |
| private:
 | |
|   QTimer * timer;
 | |
|   QTimer * backlight_timer;
 | |
| 
 | |
|   UIState * ui_state = nullptr;
 | |
|   QtSound sound;
 | |
| 
 | |
|   bool onroad = true;
 | |
| 
 | |
|   // TODO: this shouldn't be here
 | |
|   float brightness_b = 0;
 | |
|   float brightness_m = 0;
 | |
|   float smooth_brightness = 0;
 | |
| 
 | |
| public slots:
 | |
|   void timerUpdate();
 | |
|   void backlightUpdate();
 | |
| 
 | |
| signals:
 | |
|   void openSettings();
 | |
| };
 | |
| 
 | |
| class MainWindow : public QWidget {
 | |
|   Q_OBJECT
 | |
| 
 | |
| protected:
 | |
|   bool eventFilter(QObject *obj, QEvent *event) override;
 | |
| 
 | |
| public:
 | |
|   explicit MainWindow(QWidget *parent = 0);
 | |
| 
 | |
| private:
 | |
|   QStackedLayout *main_layout;
 | |
|   GLWindow *glWindow;
 | |
|   SettingsWindow *settingsWindow;
 | |
|   OnboardingWindow *onboardingWindow;
 | |
| 
 | |
| public slots:
 | |
|   void openSettings();
 | |
|   void closeSettings();
 | |
| };
 | |
| 
 |