42 void set_return_code (
int rc)
43 { return_code_ = rc; }
46 void set_signal_connect (
const Functor0 &func,
u_int8 signal)
47 { callback_[signal] = func; }
48 void set_callback_destroy (
const Functor0wRet<bool> &func)
49 { callback_destroy_ = func; }
50 void set_callback_quit (
const Functor1<int> &func)
51 { callback_quit_ = func;}
56 void py_signal_connect (PyObject *pyfunc,
int signal, PyObject *args = NULL);
58 const static u_int8 ACTIVATE =1 ;
59 const static u_int8 UNACTIVATE = 2;
60 const static u_int8 UPDATE = 3;
61 const static u_int8 DRAW = 4;
62 const static u_int8 DRAW_ON_VISIBLE = 5;
63 const static u_int8 ACTIVATE_KEY = 6;
64 const static u_int8 SELECT = 7;
65 const static u_int8 UNSELECT = 8;
66 const static u_int8 KEYBOARD = 9;
67 const static u_int8 SCROLL_UP = 10;
68 const static u_int8 SCROLL_DOWN = 11;
69 const static u_int8 NEXT = 12;
70 const static u_int8 PREVIOUS = 13;
71 const static u_int8 CLOSE = 14;
72 const static u_int8 DESTROY = 15;
81 vector<py_callback *> py_callbacks;
84 Functor0 callback_[20];
85 Functor0wRet<bool> callback_destroy_;
86 Functor1<int> callback_quit_;
92 virtual void on_activate(){
if(callback_[ACTIVATE]) (callback_[ACTIVATE])();}
93 virtual void on_unactivate(){
if(callback_[UNACTIVATE]) (callback_[UNACTIVATE])();}
95 virtual void on_update() {
if(callback_[UPDATE]) (callback_[UPDATE])();}
97 virtual void on_draw_visible(){
if(callback_[DRAW_ON_VISIBLE]) (callback_[DRAW_ON_VISIBLE])();}
98 virtual void on_draw(){
if(callback_[DRAW]) (callback_[DRAW])();}
100 virtual void on_activate_key(){
if(callback_[ACTIVATE_KEY]) (callback_[ACTIVATE_KEY])();}
101 virtual void on_select(){
if(callback_[SELECT]) (callback_[SELECT])();}
102 virtual void on_unselect(){
if(callback_[UNSELECT]) (callback_[UNSELECT])();}
104 virtual void on_up(){
if(callback_[SCROLL_UP]) (callback_[SCROLL_UP])();}
105 virtual void on_down(){
if(callback_[SCROLL_DOWN]) (callback_[SCROLL_DOWN])();}
107 virtual void on_next(){
if(callback_[NEXT]) (callback_[NEXT])();}
108 virtual void on_previous(){
if(callback_[PREVIOUS]) (callback_[PREVIOUS])();}