bool Rectangle::setProperty( const Falcon::String& s, const Falcon::Item& it ) { assert( m_obj ); GdkRectangle* m_rectangle = (GdkRectangle*) m_obj; if ( s == "x" ) m_rectangle->x = it.forceInteger(); else if ( s == "y" ) m_rectangle->y = it.forceInteger(); else if ( s == "width" ) m_rectangle->width = it.forceInteger(); else if ( s == "height" ) m_rectangle->height = it.forceInteger(); else return false; return true; }
bool Geometry::setProperty( const Falcon::String& s, const Falcon::Item& it ) { assert( m_obj ); GdkGeometry* m_geom = (GdkGeometry*) m_obj; if ( s == "min_width" ) m_geom->min_width = it.forceInteger(); else if ( s == "min_height" ) m_geom->min_height = it.forceInteger(); else if ( s == "max_width" ) m_geom->max_width = it.forceInteger(); else if ( s == "max_height" ) m_geom->max_height = it.forceInteger(); else if ( s == "base_width" ) m_geom->base_width = it.forceInteger(); else if ( s == "base_height" ) m_geom->base_height = it.forceInteger(); else if ( s == "width_inc" ) m_geom->width_inc = it.forceInteger(); else if ( s == "height_inc" ) m_geom->height_inc = it.forceInteger(); else if ( s == "min_aspect" ) m_geom->min_aspect = it.forceNumeric(); else if ( s == "max_aspect" ) m_geom->max_aspect = it.forceNumeric(); else if ( s == "win_gravity" ) m_geom->win_gravity = (GdkGravity) it.forceInteger(); else return false; return true; }
void dfsapi_thor_Action::init(Falcon::VMachine* vm) { dfsapi_thor_Action* self = Falcon::dyncast<dfsapi_thor_Action*>(vm->self().asObject()); Falcon::Item* keyobut = vm->param(0); Falcon::Item* act = vm->param(1); if(keyobut == NULL || !keyobut->isOrdinal()) { throw new Falcon::ParamError(Falcon::ErrorParam(Falcon::e_inv_params, __LINE__).extra("I, [I]")); } Falcon::int64 kob = keyobut->forceInteger(); if(kob - (Falcon::int64)sf::Keyboard::KeyCount > 0) { sf::Mouse::Button but = sf::Mouse::Button(kob - ((Falcon::int64)sf::Keyboard::KeyCount + 1)); if(act != NULL) self->action().reset(new thor::Action(but, (thor::Action::ActionType)act->forceInteger())); else self->action().reset(new thor::Action(but)); } else { sf::Keyboard::Key key = (sf::Keyboard::Key)kob; if(act != NULL) self->action().reset(new thor::Action(key, (thor::Action::ActionType)act->forceInteger())); else self->action().reset(new thor::Action(key)); } }
FALCON_FUNC FWrapLog(Falcon::VMachine* vm) { Falcon::Item* lglv = vm->param(0); Falcon::Item* message = vm->param(1); if((lglv == NULL || !lglv->isInteger()) || (message == NULL || !message->isString())) { throw new Falcon::ParamError(Falcon::ErrorParam(Falcon::e_inv_params, __LINE__) .extra("LOG_LEVEL, String")); } PE::Logging::Levels lvl = PE::Logging::Levels(lglv->forceInteger()); std::string mess = FString::fromStringS(*message->asString()); Log::log(lvl, mess); }