ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/RenegadeMapSelector/MapSelector.h
Revision: 368
Committed: 2008-08-23T02:44:00-07:00 (16 years, 9 months ago) by douglas
Content type: text/x-c
File size: 1779 byte(s)
Log Message:
Rearranged everything else.

File Contents

# User Rev Content
1 douglas 86 // Renegade Map Selector
2     //
3     // Douglas Thrift
4     //
5     // MapSelector.h
6    
7     #ifndef _WIN32
8     #ifndef _MapSelector_h_
9     #define _MapSelector_h_
10    
11     #include "RenegadeConfig.h"
12 douglas 88 #include <sys/types.h>
13     #include <sys/param.h>
14     #include <unistd.h>
15     #include <dirent.h>
16 douglas 86 #include <gtk/gtk.h>
17    
18 douglas 87 extern RenegadeConfig* config;
19    
20 douglas 86 inline void message(GtkWindow* parent, const string& text, const string& title,
21     GtkMessageType type)
22     {
23     GtkWidget* box = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, type,
24     GTK_BUTTONS_OK, text.c_str());
25    
26     gtk_window_set_title(GTK_WINDOW(box), title.c_str());
27    
28     gtk_dialog_run(GTK_DIALOG(box));
29     gtk_widget_destroy(box);
30     }
31    
32     class MapSelector
33     {
34     private:
35     GtkWidget* window;
36 douglas 88 GtkWidget* available;
37     GtkWidget* selected;
38 douglas 86 GtkWidget* add;
39     GtkWidget* remove;
40     GtkWidget* up;
41     GtkWidget* down;
42 douglas 88 void setupAvailable();
43     void setupSelected();
44 douglas 95 unsigned counter;
45     unsigned insert;
46 douglas 86 public:
47     MapSelector();
48 douglas 87 ~MapSelector() {}
49     // friends:
50     friend void destruct(GtkWidget* widget, MapSelector* data);
51     friend void done(GtkWidget* widget, MapSelector* data);
52 douglas 94 friend void changeAvailable(GtkTreeSelection* selection, MapSelector* data);
53     friend void changeSelected(GtkTreeSelection* selection, MapSelector* data);
54 douglas 87 friend void mapAdd(GtkWidget* widget, MapSelector* data);
55 douglas 95 friend void mapAddEach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter*
56     iter, MapSelector* data);
57 douglas 87 friend void mapRemove(GtkWidget* widget, MapSelector* data);
58 douglas 95 friend void mapRemoveEach(GtkTreePath* path, MapSelector* data);
59 douglas 87 friend void mapUp(GtkWidget* widget, MapSelector* data);
60 douglas 95 friend void mapUpEach(GtkTreePath* path, MapSelector* data);
61 douglas 87 friend void mapDown(GtkWidget* widget, MapSelector* data);
62 douglas 95 friend void mapDownEach(GtkTreePath* path, MapSelector* data);
63 douglas 86 };
64    
65 douglas 97 #endif // _MapSelector_h_
66 douglas 86 #endif