37 void set_return_code (
int rc)
38 { return_code_ = rc; }
41 void set_signal_connect (
const Functor0 &func,
u_int8 signal)
42 { callback_[signal] = func; }
43 void set_callback_destroy (
const Functor0wRet<bool> &func)
44 { callback_destroy_ = func; }
45 void set_callback_quit (
const Functor1<int> &func)
46 { callback_quit_ = func;}
51 void py_signal_connect (PyObject *pyfunc,
int signal, PyObject *args = NULL);
53 const static u_int8 ACTIVATE =1 ;
54 const static u_int8 UNACTIVATE = 2;
55 const static u_int8 UPDATE = 3;
56 const static u_int8 DRAW = 4;
57 const static u_int8 DRAW_ON_VISIBLE = 5;
58 const static u_int8 ACTIVATE_KEY = 6;
59 const static u_int8 SELECT = 7;
60 const static u_int8 UNSELECT = 8;
61 const static u_int8 KEYBOARD = 9;
62 const static u_int8 SCROLL_UP = 10;
63 const static u_int8 SCROLL_DOWN = 11;
64 const static u_int8 NEXT = 12;
65 const static u_int8 PREVIOUS = 13;
66 const static u_int8 CLOSE = 14;
67 const static u_int8 DESTROY = 15;
76 vector<py_callback *> py_callbacks;
79 Functor0 callback_[20];
80 Functor0wRet<bool> callback_destroy_;
81 Functor1<int> callback_quit_;
87 virtual void on_activate(){
if(callback_[ACTIVATE]) (callback_[ACTIVATE])();}
88 virtual void on_unactivate(){
if(callback_[UNACTIVATE]) (callback_[UNACTIVATE])();}
90 virtual void on_update() {
if(callback_[UPDATE]) (callback_[UPDATE])();}
92 virtual void on_draw_visible(){
if(callback_[DRAW_ON_VISIBLE]) (callback_[DRAW_ON_VISIBLE])();}
93 virtual void on_draw(){
if(callback_[DRAW]) (callback_[DRAW])();}
95 virtual void on_activate_key(){
if(callback_[ACTIVATE_KEY]) (callback_[ACTIVATE_KEY])();}
96 virtual void on_select(){
if(callback_[SELECT]) (callback_[SELECT])();}
97 virtual void on_unselect(){
if(callback_[UNSELECT]) (callback_[UNSELECT])();}
99 virtual void on_up(){
if(callback_[SCROLL_UP]) (callback_[SCROLL_UP])();}
100 virtual void on_down(){
if(callback_[SCROLL_DOWN]) (callback_[SCROLL_DOWN])();}
102 virtual void on_next(){
if(callback_[NEXT]) (callback_[NEXT])();}
103 virtual void on_previous(){
if(callback_[PREVIOUS]) (callback_[PREVIOUS])();}