Go to the documentation of this file.
15 #define TOOLS_SG_EVENT_ID_CAST
22 #ifdef TOOLS_SG_EVENT_ID_CAST
26 virtual void*
cast(
const std::string&)
const = 0;
28 virtual event*
copy()
const = 0;
36 mem::increment(s_class().c_str());
41 mem::decrement(s_class().c_str());
47 mem::increment(s_class().c_str());
56 #ifdef TOOLS_SG_EVENT_ID_CAST
59 if(
void* p = cmp_cast<size_event>(
this,a_class))
return p;
64 virtual void*
cast(
const std::string& a_class)
const {
65 if(
void* p = cmp_cast<size_event>(
this,a_class)) {
return p;}
72 unsigned int a_w,
unsigned int a_h)
110 #ifdef TOOLS_SG_EVENT_ID_CAST
113 if(
void* p = cmp_cast<mouse_down_event>(
this,a_class))
return p;
118 virtual void*
cast(
const std::string& a_class)
const {
119 if(
void* p = cmp_cast<mouse_down_event>(
this,a_class)) {
return p;}
153 #ifdef TOOLS_SG_EVENT_ID_CAST
156 if(
void* p = cmp_cast<mouse_up_event>(
this,a_class))
return p;
161 virtual void*
cast(
const std::string& a_class)
const {
162 if(
void* p = cmp_cast<mouse_up_event>(
this,a_class)) {
return p;}
196 #ifdef TOOLS_SG_EVENT_ID_CAST
199 if(
void* p = cmp_cast<mouse_move_event>(
this,a_class))
return p;
204 virtual void*
cast(
const std::string& a_class)
const {
205 if(
void* p = cmp_cast<mouse_move_event>(
this,a_class)) {
return p;}
259 #ifdef TOOLS_SG_EVENT_ID_CAST
262 if(
void* p = cmp_cast<anim_event>(
this,a_class))
return p;
267 virtual void*
cast(
const std::string& a_class)
const {
268 if(
void* p = cmp_cast<anim_event>(
this,a_class)) {
return p;}
315 #ifdef TOOLS_SG_EVENT_ID_CAST
318 if(
void* p = cmp_cast<key_down_event>(
this,a_class))
return p;
323 virtual void*
cast(
const std::string& a_class)
const {
324 if(
void* p = cmp_cast<key_down_event>(
this,a_class)) {
return p;}
353 #ifdef TOOLS_SG_EVENT_ID_CAST
356 if(
void* p = cmp_cast<key_up_event>(
this,a_class))
return p;
361 virtual void*
cast(
const std::string& a_class)
const {
362 if(
void* p = cmp_cast<key_up_event>(
this,a_class)) {
return p;}
391 #ifdef TOOLS_SG_EVENT_ID_CAST
394 if(
void* p = cmp_cast<wheel_rotate_event>(
this,a_class))
return p;
399 virtual void*
cast(
const std::string& a_class)
const {
400 if(
void* p = cmp_cast<wheel_rotate_event>(
this,a_class)) {
return p;}
426 #ifdef TOOLS_SG_EVENT_ID_CAST
427 template <
class FROM,
class TO>
inline TO*
event_cast(FROM& a_o) {
return id_cast<FROM,TO>(a_o);}
428 template <
class FROM,
class TO>
inline const TO*
event_cast(
const FROM& a_o) {
return id_cast<FROM,TO>(a_o);}
430 template <
class FROM,
class TO>
inline TO*
event_cast(FROM& a_o) {
return safe_cast<FROM,TO>(a_o);}
431 template <
class FROM,
class TO>
inline const TO*
event_cast(
const FROM& a_o) {
return safe_cast<FROM,TO>(a_o);}
438 if(
const dn_evt_t* devt = event_cast<evt_t,dn_evt_t>(a_event)) {
443 }
else if(
const up_evt_t* uevt = event_cast<evt_t,up_evt_t>(a_event)) {
#define TOOLS_SCLASS(a_name)