📄 widget.cc
字号:
#include <iostream.h>#include <photonmm/Widget.h>/* extern "C" static int // XXX ?? */static intev_ptr_motion_nobutton (PtWidget_t*, void* data, PtCallbackInfo_t* not_used){ SigC::Slot0<void>* slot = (SigC::Slot0<void >*) data; (void) (*slot) (); // delete slot ?? return Pt_TRUE;} static intcb_destroyed (PtWidget_t*, void* data, PtCallbackInfo_t* not_used){ SigC::Slot0<void>* slot = (SigC::Slot0<void >*) data; (void) (*slot) (); return Pt_CONTINUE;}// namespace Pt { void Widget_Class::set_set (bool new_set) // Pt_SET { PtSetResource (obj, Pt_ARG_FLAGS, (new_set) ? Pt_TRUE : Pt_FALSE, Pt_SET); } bool Widget_Class::get_set () const { long* flags; PtGetResource (obj, Pt_ARG_FLAGS, &flags, 0); return ( *flags) & Pt_SET; } void Widget_Class::set_delay_realize (bool delay ) // Pt_DELAY_REALIZE { if (delay) PtRealizeWidget (obj); else if (get_realized () ) PtUnrealizeWidget (obj); else PtSetResource (obj, Pt_ARG_FLAGS, Pt_TRUE, Pt_DELAY_REALIZE ); } bool Widget_Class::get_realized () const // Pt_REALIZED { long* flags; PtGetResource (obj, Pt_ARG_FLAGS, &flags, 0); return ( *flags) & Pt_REALIZED; } bool Widget_Class::get_destroyed () const // Pt_DESTROYED{ long* flags;cerr<< "PtGetResource..\n"; PtGetResource (obj, Pt_ARG_FLAGS, &flags, 0); return (*flags) & Pt_DESTROYED;} void Widget_Class::set_pos (PhPoint_t* new_pos) { PtSetResource (obj, Pt_ARG_POS, new_pos, 0); // PtSetResource__s__?? } PhPoint_t* Widget_Class::get_pos () const { PhPoint_t* pos =0; PtGetResource (obj, Pt_ARG_POS, pos, 0); return pos; } SignalProxy<SigC::Slot0<void> > Widget_Class::signal_ptr_motion_no_button () { return SignalProxy<SigC::Slot0<void> > ( new Handler<SigC::Slot0<void> > (&ev_ptr_motion_nobutton, obj, Ph_EV_PTR_MOTION_NOBUTTON) ); } SignalProxy<SigC::Slot0<void> > Widget_Class::signal_destroyed (){ return SignalProxy<SigC::Slot0<void> > ( new Callback<SigC::Slot0<void> > (&cb_destroyed, obj, Pt_CB_DESTROYED) );} PropertyProxy<bool> Widget_Class::property_set () // Pt_SET { return PropertyProxy<bool> ( new Property<bool, Widget_Class, &Widget_Class::get_set, &Widget_Class::set_set> (this) ); } PropertyProxy<bool> Widget_Class::property_realized () // Pt_REALIZED, Pt_DELAY_REALIZE { return PropertyProxy<bool> ( new Property<bool, Widget_Class, &Widget_Class::get_realized, &Widget_Class::set_delay_realize> (this) ); } PropertyProxy<PhPoint_t*> Widget_Class::property_pos () // Pt_ARG_POS { return PropertyProxy<PhPoint_t*> ( new Property<PhPoint_t*, Widget_Class, &Widget_Class::get_pos, &Widget_Class::set_pos> (this) ); }PropertyProxy_ReadOnly<bool> Widget_Class::property_destroyed () // Pt_DESTROYED{ return PropertyProxy_ReadOnly<bool> ( new Property_ReadOnly<bool, Widget_Class, &Widget_Class::get_destroyed> (this) );}// }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -