bool SetpointManagerMultiZoneHumidityMaximum_Impl::setSetpointNode(const Node& node) { bool result = setPointer(OS_SetpointManager_MultiZone_Humidity_MaximumFields::SetpointNodeorNodeListName, node.handle()); return result; }
void CoilHeatingElectric_Impl::setTemperatureSetpointNode(Node & temperatureSetpointNode) { setPointer(OS_Coil_Heating_ElectricFields::TemperatureSetpointNodeName, temperatureSetpointNode.handle()); }
bool RefrigerationCompressor_Impl::setRefrigerationCompressorCapacityCurve(const CurveBicubic& curveBicubic) { bool result = setPointer(OS_Refrigeration_CompressorFields::RefrigerationCompressorCapacityCurveName, curveBicubic.handle()); return result; }
void ePositionGauge::setPointer(int which, ePtr<gPixmap> &pixmap, const ePoint ¢er) { setPointer(which, pixmap.operator->(), center); }
bool SetpointManagerOutdoorAirPretreat_Impl::setSetpointNode(const Node& node) { bool result = setPointer(OS_SetpointManager_OutdoorAirPretreatFields::SetpointNodeorNodeListName, node.handle()); return result; }
bool ZoneHVACLowTempRadiantVarFlow_Impl::setCoolingCoil(HVACComponent& coolingCoil) { bool result = setPointer(OS_ZoneHVAC_LowTemperatureRadiant_VariableFlowFields::LowTempRadiantVariableFlowCoolingCoilName, coolingCoil.handle()); return result; }
bool CoilHeatingFourPipeBeam_Impl::setBeamHeatingCapacityHotWaterFlowModificationFactorCurve(const Curve& curve) { bool result = setPointer(OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityHotWaterFlowModificationFactorCurveName, curve.handle()); return result; }
bool APILoader::loadExtPointer(Entrypoint entryp) { if (!g_DirectPointers[entryp].ptr) { setPointer(entryp, getExtPointer(GetEntryPointName(entryp))); } return g_DirectPointers[entryp].ptr != nullptr; }
void APILoader::loadLibrary(ApiLibrary apiLibrary, LoadMode mode) { if (apiLibrary == LIBRARY_NONE) { return; } std::string libraryName = getLibraryName(apiLibrary); if (m_LoadedLibraries.find(libraryName) == m_LoadedLibraries.end()) { #ifdef _WIN32 if (mode == LoadMode::LAZY && !GetModuleHandle(libraryName.c_str())) { //Will load this later. This is used to avoid calling LoadLibrary() too early in Win. return; } #else DGL_UNUSED(mode); #endif std::vector<std::string> libSearchPath; libSearchPath.push_back(""); #ifdef _WIN32 char buffer[1000]; #ifndef _WIN64 if (GetSystemWow64Directory(buffer, sizeof(buffer)) > 0) { // we are running 32bit app on 64 bit windows libSearchPath.push_back(buffer + std::string("\\")); } #endif if (GetSystemDirectory(buffer, sizeof(buffer)) > 0) { // we are running on native system (32 on 32 or 64 on 64) libSearchPath.push_back(buffer + std::string("\\")); } #ifndef _WIN64 libSearchPath.push_back("C:\\Windows\\SysWOW64\\"); #endif libSearchPath.push_back("C:\\Windows\\System32\\"); libSearchPath.push_back("."); #endif std::shared_ptr<DynamicLibrary> openGLLibraryHandle = nullptr; for (size_t i = 0; i < libSearchPath.size() && !openGLLibraryHandle; i++) { openGLLibraryHandle = EarlyGlobalState::getDynLoader().getLibrary( (libSearchPath[i] + libraryName).c_str()); } #if DGL_HAVE_WA(ANDROID_MISSING_LIBGL) if (!openGLLibraryHandle && apiLibrary == LIBRARY_GL) { //Some Android devices support 'big' OpenGL, but libGL.so is not provided. //Instead fake the load process with *eglGetProcAddress openGLLibraryHandle = std::make_shared<FakeDynamicLibrary>(this); } #endif if (!openGLLibraryHandle) { std::string msg = std::string("Cannot load ") + libraryName + " system library"; Os::fatal(msg.c_str()); } else { m_LoadedLibraries[libraryName] = openGLLibraryHandle; } } DynamicLibrary* library = m_LoadedLibraries[libraryName].get(); #ifdef _WIN32 HookSession hookSession; #endif // g_DirectPointers is now filled with opengl32.dll pointers // we will now detour (hook) them all, so g_DirectPointers will still lead // to original opengl32.dll, but // application will always call us. for (int i = 0; i < Entrypoints_NUM; i++) { if (!(g_DirectPointers[i].libraryMask & apiLibrary)) { // Do not load - entrypoint does not belong to currently loaded API continue; } if (m_LoadedApiLibraries & g_DirectPointers[i].libraryMask) { // Do not load - entrypoint belongs to already loaded API continue; } // this sets g_DirectPointers[i].ptr setPointer(i, getGLPointer(*library, i)); if (g_DirectPointers[i].ptr) { // this entrypoint was loaded from OpenGL32.dll, detour it! #ifdef _WIN32 dgl_func_ptr hookPtr = getWrapperPointer(i); if (!hookSession.hook(&g_DirectPointers[i].ptr, hookPtr)) { Os::fatal("Cannot hook %s() function.", GetEntryPointName(i)); } #endif } } if (apiLibrary == LIBRARY_EGL || apiLibrary == LIBRARY_WGL || apiLibrary == LIBRARY_GLX) m_GlueLibrary = apiLibrary; m_LoadedApiLibraries |= apiLibrary; }
bool EvaporativeCoolerIndirectResearchSpecial_Impl::setReliefAirInletNode(const Node & node) { return setPointer(OS_EvaporativeCooler_Indirect_ResearchSpecialFields::ReliefAirInletNode, node.handle()); }
bool ElectricLoadCenterInverterSimple_Impl::setThermalZone(const ThermalZone& thermalZone) { return setPointer(OS_ElectricLoadCenter_Inverter_SimpleFields::ZoneName, thermalZone.handle()); }
void CoilHeatingGasMultiStage_Impl::addStage(CoilHeatingGasMultiStageStageData& stage) { auto group = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); group.setPointer(OS_Coil_Heating_Gas_MultiStageExtensibleFields::Stage,stage.handle()); }
bool CoilSystemCoolingWaterHeatExchangerAssisted_Impl::setCoolingCoil(const WaterToAirComponent& coolingCoil) { bool result = setPointer(OS_CoilSystem_Cooling_Water_HeatExchangerAssistedFields::CoolingCoil, coolingCoil.handle()); return result; }
bool CoilSystemCoolingWaterHeatExchangerAssisted_Impl::setHeatExchanger(const AirToAirComponent& heatExchanger) { bool result = setPointer(OS_CoilSystem_Cooling_Water_HeatExchangerAssistedFields::HeatExchanger, heatExchanger.handle()); return result; }
bool ExteriorLights_Impl::setExteriorLightsDefinition(const ExteriorLightsDefinition& exteriorLightsDefinition) { bool result = false; result = setPointer(OS_Exterior_LightsFields::ExteriorLightsDefinitionName, exteriorLightsDefinition.handle()); return result; }
void Mouse::fnBlankMouse() { setPointer(0, 0); }
bool InteriorPartitionSurfaceGroup_Impl::setSpace(const Space& space) { return setPointer(OS_InteriorPartitionSurfaceGroupFields::SpaceName, space.handle()); }
void Mouse::fnNormalMouse() { setPointer(MSE_POINTER, 0); }
bool SpaceLoad_Impl::setSpaceType(const SpaceType& spaceType) { return setPointer(this->spaceIndex(), spaceType.handle()); }
void Mouse::engine(uint16 x, uint16 y, uint16 eventFlags) { _state = 0; // all mouse events are flushed after one cycle. if (_lastState) { // delay all events by one cycle to notice L_button + R_button clicks correctly. _state = _lastState | eventFlags; _lastState = 0; } else if (eventFlags) _lastState = eventFlags; // if we received both, mouse down and mouse up event in this cycle, resort them so that // we'll receive the up event in the next one. if ((_state & MOUSE_DOWN_MASK) && (_state & MOUSE_UP_MASK)) { _lastState = _state & MOUSE_UP_MASK; _state &= MOUSE_DOWN_MASK; } _mouse.x = x; _mouse.y = y; if (!(Logic::_scriptVars[MOUSE_STATUS] & 1)) { // no human? _numObjs = 0; return; // no human, so we don't want the mouse engine } if (!Logic::_scriptVars[TOP_MENU_DISABLED]) { if (y < 40) { // okay, we are in the top menu. if (!_inTopMenu) { // are we just entering it? if (!Logic::_scriptVars[OBJECT_HELD]) _menu->fnStartMenu(); setPointer(MSE_POINTER, 0); } _menu->checkTopMenu(); _inTopMenu = true; } else if (_inTopMenu) { // we're not in the menu. did we just leave it? if (!Logic::_scriptVars[OBJECT_HELD]) _menu->fnEndMenu(); _inTopMenu = false; } } else if (_inTopMenu) { _menu->fnEndMenu(); _inTopMenu = false; } Logic::_scriptVars[MOUSE_X] = Logic::_scriptVars[SCROLL_OFFSET_X] + x + 128; Logic::_scriptVars[MOUSE_Y] = Logic::_scriptVars[SCROLL_OFFSET_Y] + y + 128 - 40; //- int32 touchedId = 0; uint16 clicked = 0; if (y > 40) { for (uint16 priority = 0; (priority < 10) && (!touchedId); priority++) { for (uint16 cnt = 0; (cnt < _numObjs) && (!touchedId); cnt++) { if ((_objList[cnt].compact->o_priority == priority) && (Logic::_scriptVars[MOUSE_X] >= (uint32)_objList[cnt].compact->o_mouse_x1) && (Logic::_scriptVars[MOUSE_X] <= (uint32)_objList[cnt].compact->o_mouse_x2) && (Logic::_scriptVars[MOUSE_Y] >= (uint32)_objList[cnt].compact->o_mouse_y1) && (Logic::_scriptVars[MOUSE_Y] <= (uint32)_objList[cnt].compact->o_mouse_y2)) { touchedId = _objList[cnt].id; clicked = cnt; } } } if (touchedId != (int)Logic::_scriptVars[SPECIAL_ITEM]) { //the mouse collision situation has changed in one way or another Logic::_scriptVars[SPECIAL_ITEM] = touchedId; if (_getOff) { // there was something else selected before, run its get-off script _logic->runMouseScript(NULL, _getOff); _getOff = 0; } if (touchedId) { // there's something new selected, now. if (_objList[clicked].compact->o_mouse_on) //run its get on _logic->runMouseScript(_objList[clicked].compact, _objList[clicked].compact->o_mouse_on); _getOff = _objList[clicked].compact->o_mouse_off; //setup get-off for later } } } else Logic::_scriptVars[SPECIAL_ITEM] = 0; if (_state & MOUSE_DOWN_MASK) { if (_inTopMenu) { if (Logic::_scriptVars[SECOND_ITEM]) _logic->runMouseScript(NULL, _menu->_objectDefs[Logic::_scriptVars[SECOND_ITEM]].useScript); if (Logic::_scriptVars[MENU_LOOKING]) _logic->cfnPresetScript(NULL, -1, PLAYER, SCR_menu_look, 0, 0, 0, 0); } Logic::_scriptVars[MOUSE_BUTTON] = _state & MOUSE_DOWN_MASK; if (Logic::_scriptVars[SPECIAL_ITEM]) { Object *compact = _objMan->fetchObject(Logic::_scriptVars[SPECIAL_ITEM]); _logic->runMouseScript(compact, compact->o_mouse_click); } } _numObjs = 0; }
void Connection_Impl::setSourceObject(ModelObject object) { setPointer(openstudio::OS_ConnectionFields::SourceObject,object.handle()); }
bool OtherEquipment_Impl::setOtherEquipmentDefinition(const OtherEquipmentDefinition& definition) { return setPointer(definitionIndex(),definition.handle()); }
bool SetpointManagerOutdoorAirPretreat_Impl::setMixedAirStreamNode(const Node& node) { bool result = setPointer(OS_SetpointManager_OutdoorAirPretreatFields::MixedAirStreamNodeName, node.handle()); return result; }
void PointerManager::_unlinkWidget(Widget* _widget) { if (_widget == mWidgetOwner) setPointer(mDefaultName, nullptr); else if (_widget == mMousePointer) mMousePointer = nullptr; }
bool ScheduleVariableInterval_Impl::setScheduleTypeLimits(const ScheduleTypeLimits& scheduleTypeLimits) { if (scheduleTypeLimits.model() != model()) { return false; } return setPointer(OS_Schedule_VariableIntervalFields::ScheduleTypeLimitsName,scheduleTypeLimits.handle()); }
void PointerManager::resetToDefaultPointer() { setPointer(mDefaultName, nullptr); }
int setNode(symbolTable* table, char* ident, node* astNode) { return setPointer(table->mainTable, ident, (void*) astNode); }
void PointerManager::setPointer(const std::string& _name) { setPointer(_name, nullptr); }
bool SetpointManagerSingleZoneReheat_Impl::setSetpointNode( const Node & node ) { return setPointer(OS_SetpointManager_SingleZone_ReheatFields::SetpointNodeorNodeListName, node.handle()); }
bool DefaultSurfaceConstructions_Impl::setFloorConstruction(const ConstructionBase& construction) { return setPointer(OS_DefaultSurfaceConstructionsFields::FloorConstructionName, construction.handle()); }