toplevel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00030 #ifndef TOPLEVEL_H
00031 #define TOPLEVEL_H
00032
00033 #include <sigc++/signal.h>
00034
00035 #include <cwidget/generic/util/ref_ptr.h>
00036
00038 namespace cwidget
00039 {
00041 std::string version();
00042
00043 namespace threads
00044 {
00045 class mutex;
00046 }
00047
00048 namespace widgets
00049 {
00050 class widget;
00051 }
00052
00061 namespace toplevel
00062 {
00066 class event
00067 {
00068 public:
00069 virtual void dispatch() = 0;
00070 virtual ~event();
00071 };
00072
00082 class slot_event : public event
00083 {
00084 sigc::slot0<void> the_slot;
00085 public:
00086 slot_event(const sigc::slot0<void> &_the_slot)
00087 : the_slot(_the_slot)
00088 {
00089 }
00090
00091 void dispatch();
00092 };
00093
00097 void init();
00098
00109 void install_sighandlers();
00110
00116 util::ref_ptr<widgets::widget> settoplevel(const util::ref_ptr<widgets::widget> &widget);
00117
00121 void queuelayout();
00122
00124 void layoutnow();
00125
00126
00127
00150 void mainloop(int synch=0);
00151
00159 void post_event(event *ev);
00160
00167 bool poll();
00168
00169 void exitmain();
00170
00171
00172 void redraw();
00173
00174
00176 void update();
00177
00179 void tryupdate();
00180
00184 void updatecursor();
00185
00191 void suspend();
00192
00197 void suspend_without_signals();
00198
00203 void shutdown();
00204
00208 void resume();
00209
00216 int addtimeout(event *ev, int msecs);
00217
00219 void deltimeout(int id);
00220
00221 void handleresize();
00222
00223
00224
00225
00226
00227
00228
00229
00230 threads::mutex &get_mutex();
00231
00242 int get_suspend_count();
00243
00244 extern sigc::signal0<void> main_hook;
00245
00246
00247
00248
00249 }
00250 }
00251
00252 #endif