CEBL  2.1
CEBLViewGTK.hpp
Go to the documentation of this file.
1 /*
2 * CEBL : CSU EEG Brain-Computer Interface Lab
3 *
4 * Author: Jeshua Bratman - jeshuabratman@gmail.com
5 *
6 * This file is part of CEBL.
7 *
8 * CEBL is free software; you can redistribute it and/or modify it.
9 * We only ask that if you use our code that you cite the source in
10 * your project or publication.
11 *
12 * EEG Group (www.cs.colostate.edu/eeg)
13 * Department of Computer Science
14 * Colorado State University
15 *
16 */
17 
26 #ifndef CEBLVIEWGTK_H
27 #define CEBLVIEWGTK_H
28 
29 // STANDARD INCLUDES
30 
31 //for NULL
32 #include <cstdlib>
33 //include gtk headers
34 #include <gtk/gtk.h>
35 //std headers
36 #include <vector>
37 
38 
39 
40 // CEBL INCLUDES
41 #include "../CEBLView.hpp"
42 #include "../CEBLModel.hpp"
43 
44 
45 // Forward Declarations
46 class Tab;
47 class ToolbarMenu;
48 class DataSourceCombo;
49 class InterfaceCombo;
50 class StatusBar;
51 class StringTable;
52 class InfoBar;
53 
54 class CEBLViewGTK : public CEBLView
55 {
56 private:
57  //args to pass to gtk
58  int ac;
59  char ** av;
60 
61  //widgets
62  GtkWidget *main_window,
63  *main_container,
64  *main_notebook;
65  StatusBar *status_bar;
66  InfoBar *info_bar;
67 
68  ToolbarMenu * main_menu;
69 
70  //gui needs its own string table
71  StringTable * string_table;
72 
73  //tabs
74  std::vector<Tab* > tabs;
75  DataSourceCombo *data_source;
76  InterfaceCombo *interface_combo;
77 
78  //properties
79  int BG_RED;
80  int BG_GREEN;
81  int BG_BLUE;
82  int WINDOW_WIDTH;
83  int WINDOW_HEIGHT;
84 
85 
86  //various functions to set up gui
87  void CreateMainWindow();
88  void CreateLayout();
89 
90  //CALLBACKS
91  static void CB_ChangeTab(GtkNotebook *notebook, GtkNotebookPage *page,
92  guint page_num, gpointer data);
93  static gboolean CB_WindowDelete(GtkWidget *widget, GdkEvent *event,
94  gpointer data);
95  static void CB_WindowDestroy(GtkWidget *widget, gpointer data);
96 
97  int old_page;
98 
99 public:
100  CEBLViewGTK(CEBLModel* model, int ac = 0, char ** av = NULL);
101  ~CEBLViewGTK();
102 
104  void Start();
105 
106 
108  void updateView();
110  void updateModel();
112  void updateInfoBar();
113 
115  GtkWidget * getMainWindow() { return main_window; }
116  DataSourceCombo * getDataSource() { return data_source; }
117  InterfaceCombo * getInterfaceCombo() { return interface_combo; }
118  StatusBar * getStatusBar() { return status_bar; }
119  int getBGRED() { return BG_RED; }
120  int getBGGREEN() { return BG_GREEN; }
121  int getBGBLUE() { return BG_BLUE; }
122  const char * getString(string name);
123 };
124 
125 
126 
127 #endif
128