CEBL  2.1
PieMenu.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 
18 /* PieMenu.hpp
19  * \author Jeshua Bratman
20  *
21  * Pie menu widget for GTK. Used by CEBL pie interfaces.
22  */
23 
24 #ifndef PIE_H
25 #define PIE_H
26 
27 #include <gtk/gtk.h>
28 #include <vector>
29 #include <string>
30 
31 G_BEGIN_DECLS
32 
33 #define PIE_MENU_TYPE (pie_menu_get_type())
34 #define PIE_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIE_MENU_TYPE, PieMenu))
35 #define PIE_MENU_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), PIE_MENU, PieMenuClass))
36 #define PIE_IS_PIE_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIE_MENU_TYPE))
37 #define PIE_IS_PIE_MENU_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), PIE_MENU_TYPE))
38 #define PIE_MENU_GET_CLASS (G_TYPE_INSTANCE_GET_CLASS ((obj), PIE_MENU_TYPE, PieMenuClass))
39 
40 typedef struct _PieMenu PieMenu;
41 typedef struct _PieMenuClass PieMenuClass;
42 
43 struct _PieMenu
44 {
45  GtkDrawingArea parent;
46 };
47 
49 {
50  GtkDrawingAreaClass parent_class;
51 };
52 
53 
54 
55 GtkWidget *pie_menu_new (void);
56 GType pie_menu_get_type (void);
57 
58 G_END_DECLS
59 
60 void pie_set_segments(GtkWidget *pie, int segments);
61 void pie_set_selected(GtkWidget *pie, int segment);
62 void pie_set_bars_visible(GtkWidget *pie, bool val);
63 void pie_set_labels(GtkWidget *pie, std::vector<std::string> labels);
64 void pie_set_secondary_labels(GtkWidget *pie, std::vector<std::string> labels);
65 void pie_set_train_mode(GtkWidget *pie);
66 void pie_set_use_mode(GtkWidget *pie);
67 void pie_set_bg(GtkWidget *pie, unsigned int red, unsigned int green, unsigned int blue);
68 
69 void pie_set_class_proportions(GtkWidget *pie,std::vector<double> proportions);
70 void pie_select_class(GtkWidget *pie,int c);
71 
72 #endif