]> sigrok.org Git - sigrok-qt.git/blob - mainwindow.h
Add "Copyright and license" section.
[sigrok-qt.git] / mainwindow.h
1 /*
2  * This file is part of the sigrok-qt project.
3  *
4  * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 #ifndef SIGROK_QT_MAINWINDOW_H
22 #define SIGROK_QT_MAINWINDOW_H
23
24 #include <QtGui/QMainWindow>
25 #include <QLineEdit>
26 #include <QDockWidget>
27 #include <QGridLayout>
28 #include <QScrollBar>
29 #include "channelform.h"
30
31 extern "C" {
32 #include <glib.h>
33 }
34
35 extern uint8_t *sample_buffer;
36
37 namespace Ui
38 {
39         class MainWindow;
40 }
41
42 class MainWindow : public QMainWindow
43 {
44         Q_OBJECT
45
46 public:
47         MainWindow(QWidget *parent = 0);
48         ~MainWindow();
49
50         Ui::MainWindow *ui;
51
52         GSList *getDevices(void);
53         void setCurrentLA(int la);
54         int getCurrentLA(void);
55         void setNumChannels(int ch);
56         int getNumChannels(void);
57         void setSampleRate(uint64_t s);
58         uint64_t getSampleRate(void);
59         void setNumSamples(uint64_t s);
60         uint64_t getNumSamples(void);
61
62         /* TODO: Don't hardcode maximum number of channels. */
63 #define NUMCHANNELS 64
64
65         /* FIXME */
66         QDockWidget *dockWidgets[NUMCHANNELS];
67         ChannelForm *channelForms[NUMCHANNELS];
68         QScrollBar *horizontalScrollBar;
69
70         void setupDockWidgets(void);
71
72 private:
73         GSList *devices;
74         int currentLA;
75         int numChannels;
76         uint64_t sampleRate;
77         uint64_t numSamples;
78         int configChannelTitleBarLayout;
79         void updateScrollBar(void);
80
81 public slots:
82         void configChannelTitleBarLayoutChanged(int index);
83
84 private slots:
85         void on_actionConfigure_triggered();
86         void on_action_New_triggered();
87         void on_action_Get_samples_triggered();
88         void on_action_Save_as_triggered();
89         void on_action_Open_triggered();
90         void on_actionScan_triggered();
91         void on_actionPreferences_triggered();
92         void on_actionAbout_Qt_triggered();
93         void on_actionAbout_triggered();
94         void updateScaleFactors(float value);
95         void on_actionProtocol_decoder_stacks_triggered();
96         void on_actionQUICK_HACK_PD_TEST_triggered();
97 };
98
99 extern MainWindow *w;
100
101 #endif