bool C4GroupSet::RegisterGroups(const C4GroupSet &rCopy, int32_t Contents, const char *szFilename, int32_t iMaxSkipID) { // get all groups of rCopy int32_t Contents2; for (C4GroupSetNode *pNode=rCopy.pFirst; pNode; pNode=pNode->pNext) if ((Contents2 = pNode->Contents & Contents)) if (pNode->id > iMaxSkipID) { if (!szFilename) // add group but don't check the content again! RegisterGroup(*pNode->pGroup, false, pNode->Priority, Contents2, false); else { // if a filename is given, open the child group C4Group *pGroup = new C4Group(); if (!pGroup->OpenAsChild(pNode->pGroup, szFilename)) { delete pGroup; continue; } // add the child group to the local list; contents equal Contents2 // but this flag is not likely to be used if (!RegisterGroup(*pGroup, true, pNode->Priority, Contents2, false)) delete pGroup; } } // done, success return true; }
C4Group *C4GroupSet::RegisterParentFolders(const char *szScenFilename) { // the scenario filename may be a scenario or directly a group folder C4Group *pParentGroup=nullptr; bool fParentC4F; char szParentfolder[_MAX_PATH+1]; if (SEqualNoCase(GetExtension(szScenFilename), "ocf")) { fParentC4F = true; SCopy(szScenFilename, szParentfolder, _MAX_PATH); } else { GetParentPath(szScenFilename,szParentfolder); fParentC4F = SEqualNoCase(GetExtension(szParentfolder), "ocf"); } if (fParentC4F) { // replace all (back)slashes with zero-fields int32_t iOriginalLen=SLen(szParentfolder); for (int32_t i=0; i<iOriginalLen; ++i) if (szParentfolder[i]==DirectorySeparator || szParentfolder[i]=='/') szParentfolder[i]=0; // trace back until the file extension is no more .ocf int32_t iPos=iOriginalLen-1; while (iPos) { // ignore additional zero fields (double-backslashes) while (iPos && !szParentfolder[iPos]) --iPos; // break if end has been reached if (!iPos) break; // trace back until next zero field while (iPos && szParentfolder[iPos]) --iPos; // check extension of this folder if (!SEqualNoCase(GetExtension(szParentfolder+iPos+1), "ocf", 3)) break; // continue } // trace backwards, putting the (back)slashes in place again if (iPos) { szParentfolder[iPos+1+SLen(szParentfolder+iPos+1)]=szParentfolder[iPos]=DirectorySeparator; while (iPos--) if (!szParentfolder[iPos]) szParentfolder[iPos]=DirectorySeparator; ++iPos; } // trace forward again, opening all folders (iPos is 0 again) int32_t iGroupIndex=0; while (iPos<iOriginalLen) { // ignore additional zero-fields while (iPos<iOriginalLen && !szParentfolder[iPos]) ++iPos; // break if end has been reached if (iPos>=iOriginalLen) break; // open this folder C4Group *pGroup = new C4Group(); if (pParentGroup) { if (!pGroup->OpenAsChild(pParentGroup, szParentfolder+iPos)) { LogFatal(FormatString("%s: %s", LoadResStr("IDS_PRC_FILENOTFOUND"), szParentfolder+iPos).getData()); delete pGroup; return nullptr; } } else if (!Reloc.Open(*pGroup, szParentfolder+iPos)) { LogFatal(FormatString("%s: %s", LoadResStr("IDS_PRC_FILENOTFOUND"), szParentfolder+iPos).getData()); delete pGroup; return nullptr; } // set this group as new parent pParentGroup=pGroup; // add to group set, if this is a true scenario folder int32_t iContentsMask; if (WildcardMatch(C4CFN_FolderFiles, pParentGroup->GetName())) iContentsMask = C4GSCnt_Folder; else iContentsMask = C4GSCnt_Directory; if (!RegisterGroup(*pParentGroup, true, C4GSPrio_Folder+iGroupIndex++, iContentsMask)) { delete pParentGroup; LogFatal ("RegGrp: internal error"); return nullptr; } // advance by file name length iPos+=SLen(szParentfolder+iPos); } } return pParentGroup; }
Internal(GLSparseShadowMapRenderer *r):renderer(r){ GLProfiler profiler(r->device, "Sparse Page Table Generation"); cameraShadowCoord = r->GetRenderer()->GetSceneDef().viewOrigin; cameraShadowCoord = (r->matrix * cameraShadowCoord).GetXYZ(); // clear group maps for(size_t x = 0; x < Tiles; x++) for(size_t y = 0; y < Tiles; y++) groupMap[x][y] = NoGroup; const std::vector<GLModelRenderer::RenderModel>& rmodels = renderer->GetRenderer()->GetModelRenderer()->models; allInstances.reserve(256); groups.reserve(64); nodes.reserve(256); for(std::vector<GLModelRenderer::RenderModel>::const_iterator it = rmodels.begin(); it != rmodels.end(); it++) { const GLModelRenderer::RenderModel& rmodel = *it; Instance inst; inst.model = rmodel.model; OBB3 modelBounds = inst.model->GetBoundingBox(); for(size_t i = 0; i < rmodel.params.size(); i++) { inst.param = &(rmodel.params[i]); if(inst.param->depthHack) continue; OBB3 instWorldBoundsOBB = inst.param->matrix * modelBounds; // w should be 1, so this should wor OBB3 instBoundsOBB = r->matrix * instWorldBoundsOBB; AABB3 instBounds = instBoundsOBB.GetBoundingAABB(); // frustrum(?) cull if(instBounds.max.x < -1.f || instBounds.max.y < -1.f || instBounds.min.x > 1.f || instBounds.min.y > 1.f) continue; inst.tile1 = ShadowMapToTileCoord(instBounds.min); inst.tile2 = ShadowMapToTileCoord(instBounds.max); inst.tile2.x++; inst.tile2.y++; if(inst.tile1.x < 0) inst.tile1.x = 0; if(inst.tile1.y < 0) inst.tile1.y = 0; if(inst.tile2.x > Tiles) inst.tile2.x = Tiles; if(inst.tile2.y > Tiles) inst.tile2.y = Tiles; if(inst.tile1.x >= inst.tile2.x) continue; if(inst.tile1.y >= inst.tile2.y) continue; size_t instId = allInstances.size(); size_t grp = RegisterGroup(inst.tile1, inst.tile2); Group& g = groups[grp]; SPAssert(g.valid); if(g.lastInstance == NoInstance) { // this is new group. g.firstInstance = instId; g.lastInstance = instId; inst.prev = NoInstance; inst.next = NoInstance; }else{ // adding this instance to the group Instance& oldLast = allInstances[g.lastInstance]; SPAssert(oldLast.next == NoInstance); oldLast.next = instId; inst.prev = g.lastInstance; inst.next = NoInstance; g.lastInstance = instId; } g.lod = std::max(g.lod, ComputeLod(instBoundsOBB.m.GetOrigin())); allInstances.push_back(inst); } } if(false){ GLProfiler profiler(r->device, "Debug Output"); SPLog("Sparse Page Table -------"); for(int y = 0; y < Tiles; y++) { char buf[Tiles + 1]; for(int x = 0; x < Tiles; x++) { size_t g = groupMap[x][y]; const char *c = "0123456789ABCDEF"; if(g == NoGroup) buf[x] = ' '; else buf[x] = c[g & 15]; } buf[Tiles] = 0; SPLog("%s", buf); } SPLog("-----------------------"); } mapSize = r_shadowMapSize; }
BOOL BuildGUI(char *screenname) { Object *MUISave, *MUIUse, *MUICancel; Object *page1,*page2; Object *MUITFreq,*MUITChannels,*MUITOutvol,*MUITMonvol,*MUITGain,*MUITInput,*MUITOutput,*MUITDebug,*MUITEcho,*MUITSurround,*MUITClipvol,*MUITCpu,*MUITACTime,*MUITScalemode; UpdateStrings(); MUIMasterBase = (void *)OpenLibrary("muimaster.library", MUIMASTER_VLATEST); if(MUIMasterBase == NULL) { Printf((char *) msgTextNoOpen, (ULONG) "muimaster.library", MUIMASTER_VLATEST); Printf("\n"); return FALSE; } page1 = HGroup, Child, VGroup, Child, MUIUnit = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, Units, MUIA_Cycle_Active, state.UnitSelected, End, Child, ListviewObject, MUIA_CycleChain, 1, MUIA_Listview_List, MUIList = ListObject, InputListFrame, MUIA_List_AutoVisible, TRUE, End, End, Child, HGroup, ReadListFrame, MUIA_Background, MUII_TextBack, Child, TextObject, MUIA_Text_Contents, msgProperties, MUIA_Text_SetMax, TRUE, End, Child, MUIInfos = TextObject, MUIA_Text_Contents, "\n\n\n\n\n\n", MUIA_Text_SetMin, FALSE, End, End, End, Child, BalanceObject, End, Child, VGroup, Child, HVSpace, Child, ColGroup(3), GroupFrameT(msgOptions), Child, MUITFreq = SpecialButton((STRPTR)msgOptFrequency), Child, MUIFreq = SpecialSlider(0,max(state.Frequencies-1,0),state.FreqSelected), Child, MUILFreq = SpecialLabel(getFreq()), Child, MUITChannels = SpecialButton((STRPTR)msgOptChannels), Child, MUIChannels = SpecialSlider(1,state.Channels,state.ChannelsSelected), Child, MUILChannels = SpecialLabel(getChannels()), Child, MUITOutvol = SpecialButton((STRPTR)msgOptVolume), Child, MUIOutvol = SpecialSlider(0,max(state.OutVols-1,0),state.OutVolSelected), Child, MUILOutvol = SpecialLabel(getOutVol()), Child, MUITMonvol = SpecialButton((STRPTR)msgOptMonitor), Child, MUIMonvol = SpecialSlider(0,max(state.MonVols-1,1),state.MonVolSelected), Child, MUILMonvol = SpecialLabel(getMonVol()), Child, MUITGain = SpecialButton((STRPTR)msgOptGain), Child, MUIGain = SpecialSlider(0,max(state.Gains-1,0),state.GainSelected), Child, MUILGain = SpecialLabel(getGain()), Child, MUITInput = SpecialButton((STRPTR)msgOptInput), Child, MUIInput = SpecialSlider(0,max(state.Inputs-1,0),state.InputSelected), Child, MUILInput = SpecialLabel(getInput()), Child, MUITOutput = SpecialButton((STRPTR)msgOptOutput), Child, MUIOutput = SpecialSlider(0,max(state.Outputs-1,0),state.OutputSelected), Child, MUILOutput = SpecialLabel(getOutput()), End, Child, MUIPlay = SimpleButton(msgButtonPlay), Child, HVSpace, End, End; page2 = VGroup, Child, HVSpace, Child, HGroup, Child, HVSpace, Child, ColGroup(2), GroupFrameT(msgGlobalOptions), Child, MUITDebug = SpecialButton((STRPTR)msgGlobOptDebugLevel), Child, MUIDebug = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, DebugLabels, MUIA_Cycle_Active, globalprefs.ahigp_DebugLevel, End, Child, MUITEcho = SpecialButton((STRPTR)msgGlobOptEcho), Child, MUIEcho = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, EchoLabels, MUIA_Cycle_Active, (globalprefs.ahigp_DisableEcho ? 2 : 0) | (globalprefs.ahigp_FastEcho ? 1 : 0), MUIA_Disabled, AHIBase->lib_Version >= 5, End, Child, MUITSurround = SpecialButton((STRPTR)msgGlobOptSurround), Child, MUISurround = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, SurroundLabels, MUIA_Cycle_Active, globalprefs.ahigp_DisableSurround, MUIA_Disabled, AHIBase->lib_Version >= 5, End, Child, MUITClipvol = SpecialButton((STRPTR)msgGlobOptMasterVol), Child, MUIClipvol = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, ClipMVLabels, MUIA_Cycle_Active, globalprefs.ahigp_ClipMasterVolume, MUIA_Disabled, AHIBase->lib_Version >= 5, End, Child, MUITCpu = SpecialButton((STRPTR)msgGlobOptCPULimit), Child, MUICpu = SliderObject, MUIA_CycleChain, 1, MUIA_Slider_Horiz, TRUE, MUIA_Numeric_Min, 0, MUIA_Numeric_Max, 100, MUIA_Numeric_Value,(globalprefs.ahigp_MaxCPU * 100 + 32768) / 65536, MUIA_Numeric_Format,"%ld%%", End, Child, MUITACTime = SpecialButton((STRPTR)msgGlobOptACTime), Child, MUIACTime = SliderObject, MUIA_CycleChain, 1, MUIA_Slider_Horiz, TRUE, MUIA_Numeric_Min, 0, MUIA_Numeric_Max, 100, MUIA_Numeric_Value,(globalprefs.ahigp_AntiClickTime * 1000 + 32768) >> 16, MUIA_Numeric_Format,"%ld ms", MUIA_Disabled, AHIBase->lib_Version <= 4, End, Child, MUITScalemode = SpecialButton((STRPTR)msgOptScalemode), Child, MUIScalemode = CycleObject, MUIA_CycleChain, 1, MUIA_Cycle_Entries, ScaleLabels, MUIA_Cycle_Active, globalprefs.ahigp_ScaleMode, MUIA_Disabled, AHIBase->lib_Version <= 4, End, End, Child, HVSpace, End, Child, HVSpace, End; MUIApp = ApplicationObject, MUIA_Application_Title, (char *) msgTextProgramName, MUIA_Application_Version, Version, MUIA_Application_Copyright, "©1996-2004 Martin Blom", MUIA_Application_Author, "Stéphane Barbaray/Martin Blom", MUIA_Application_Base, "AHI", MUIA_Application_HelpFile, HELPFILE, MUIA_Application_Menustrip, MUIMenu = MUI_MakeObject(MUIO_MenustripNM,Menus,0), MUIA_Application_SingleTask, TRUE, SubWindow, MUIWindow = WindowObject, MUIA_Window_Title, (char *) msgTextProgramName, MUIA_Window_ID , MAKE_ID('M','A','I','N'), MUIA_HelpNode, "AHI", WindowContents, VGroup, Child, RegisterGroup(PageNames), MUIA_CycleChain, 1, Child, page1, Child, page2, End, Child, HGroup, Child, MUISave = SimpleButton(msgButtonSave), Child, MUIUse = SimpleButton(msgButtonUse), Child, MUICancel = SimpleButton(msgButtonCancel), End, End, End, End; if( MUIApp != NULL ) { APTR item = (APTR)DoMethod(MUIMenu,MUIM_FindUData,ACTID_ICONS); if(item) { set(item, MUIA_Menuitem_Checked, SaveIcons); } DoMethod(MUIWindow, MUIM_MultiSet, MUIA_Text_PreParse,"\033l",MUILFreq,MUILChannels,MUILOutvol,MUILMonvol,MUILGain,MUILInput,MUILOutput,NULL); DoMethod(MUIWindow, MUIM_MultiSet, MUIA_CycleChain, 1, MUISave,MUIUse,MUICancel,NULL); DoMethod(MUITFreq, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIFreq); DoMethod(MUITChannels, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIChannels); DoMethod(MUITOutvol, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIOutvol); DoMethod(MUITMonvol, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIMonvol); DoMethod(MUITGain, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIGain); DoMethod(MUITInput, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIInput); DoMethod(MUITOutput, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIOutput); DoMethod(MUIPlay, MUIM_Notify, MUIA_Pressed, FALSE, MUIApp, 2, MUIM_Application_ReturnID, ACTID_PLAY); DoMethod(MUITDebug, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIDebug); DoMethod(MUITEcho, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIEcho); DoMethod(MUITSurround, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUISurround); DoMethod(MUITClipvol, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIClipvol); DoMethod(MUITCpu, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUICpu); DoMethod(MUITACTime, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIACTime); DoMethod(MUITScalemode, MUIM_Notify, MUIA_Pressed, TRUE, MUIWindow, 3, MUIM_Set, MUIA_Window_ActiveObject, MUIScalemode); DoMethod(MUIWindow, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, MUIApp, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); DoMethod(MUISave, MUIM_Notify, MUIA_Pressed, FALSE, MUIApp, 2, MUIM_Application_ReturnID, ACTID_SAVE); DoMethod(MUIUse, MUIM_Notify, MUIA_Pressed, FALSE, MUIApp, 2, MUIM_Application_ReturnID, ACTID_USE); DoMethod(MUICancel, MUIM_Notify, MUIA_Pressed, FALSE, MUIApp, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); DoMethod(MUIUnit, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_UNIT); DoMethod(MUIList, MUIM_Notify, MUIA_List_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_MODE); DoMethod(MUIDebug, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_DEBUG); DoMethod(MUISurround, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_SURROUND); DoMethod(MUIEcho, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_ECHO); DoMethod(MUICpu, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_CPULIMIT); DoMethod(MUIClipvol, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_CLIPMV); DoMethod(MUIACTime, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_ACTIME); DoMethod(MUIScalemode, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, MUIApp, 2, MUIM_Application_ReturnID, ACTID_SCALEMODE); DoMethod(MUIFreq, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIChannels, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIOutvol, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIMonvol, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIGain, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIInput, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); DoMethod(MUIOutput, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, MUIV_Notify_Self, 3, MUIM_CallHook, &hookSlider, MUIV_TriggerValue); set(MUIWindow, MUIA_Window_Open, TRUE); GUINewUnit(); return TRUE; } return FALSE; }
/*** Methods ****************************************************************/ Object * NetPEditor__OM_NEW(Class *CLASS, Object *self, struct opSet *message) { Object *deviceString, *IPString, *maskString, *gateString, *DNSString[2], *hostString, *domainString, *DHCPState, *autostart; DHCPCycle[0] = _(MSG_IP_MODE_MANUAL); DHCPCycle[1] = _(MSG_IP_MODE_DHCP); NetworkTabs[0] = _(MSG_TAB_IP_CONFIGURATION); NetworkTabs[1] = _(MSG_TAB_COMPUTER_NAME); self = (Object *)DoSuperNewTags ( CLASS, self, NULL, MUIA_PrefsEditor_Name, __(MSG_NAME), MUIA_PrefsEditor_Path, (IPTR)"AROSTCP/arostcp.prefs", Child, RegisterGroup((IPTR)NetworkTabs), Child, (IPTR)ColGroup(2), Child, (IPTR)Label2(__(MSG_DEVICE)),Child, (IPTR)PopaslObject, MUIA_Popasl_Type, ASL_FileRequest, ASLFO_MaxHeight, 100, MUIA_Popstring_String, (IPTR)(deviceString = (Object *)StringObject, TextFrame, MUIA_Background, MUII_TextBack, End), MUIA_Popstring_Button, (IPTR)PopButton(MUII_PopUp), End, Child, (IPTR)Label2(__(MSG_IP_MODE)), Child, (IPTR)(DHCPState = (Object *)CycleObject, MUIA_Cycle_Entries, (IPTR)DHCPCycle, End), Child, (IPTR)Label2(__(MSG_IP)), Child, (IPTR)(IPString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End), Child, (IPTR)Label2(__(MSG_MASK)),Child, (IPTR)(maskString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End), Child, (IPTR)Label2(__(MSG_GATE)),Child, (IPTR)(gateString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End), Child, (IPTR)Label2(__(MSG_DNS1)),Child, (IPTR)(DNSString[0] = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End), Child, (IPTR)Label2(__(MSG_DNS2)),Child, (IPTR)(DNSString[1] = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End), Child, (IPTR)Label2(__(MSG_AUTOSTART_STACK)), Child, (IPTR)HGroup, Child, (IPTR)(autostart = MUI_MakeObject(MUIO_Checkmark, NULL)), Child, (IPTR)HVSpace, End, End, Child, (IPTR)ColGroup(2), Child, (IPTR)Label2(__(MSG_HOST_NAME)), Child, (IPTR)(hostString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789abcdefghijklmnopqrstuvwxyz-", End), Child, (IPTR)Label2(__(MSG_DOMAIN_NAME)), Child, (IPTR)(domainString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789abcdefghijklmnopqrstuvwxyz-.", End), End, End, // register TAG_DONE ); if (self != NULL) { struct NetPEditor_DATA *data = INST_DATA(CLASS, self); data->netped_deviceString = deviceString; data->netped_IPString = IPString; data->netped_maskString = maskString; data->netped_gateString = gateString; data->netped_DNSString[0] = DNSString[0]; data->netped_DNSString[1] = DNSString[1]; data->netped_hostString = hostString; data->netped_domainString = domainString; data->netped_DHCPState = DHCPState; data->netped_Autostart = autostart; /*-- Setup notifications -------------------------------------------*/ DoMethod ( deviceString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( IPString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( maskString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( gateString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( DNSString[0], MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( DNSString[1], MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( hostString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( domainString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( autostart, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE ); DoMethod ( DHCPState, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, (IPTR)self, 1, MUIM_NetPEditor_IPModeChanged ); } return self; }
/*** Methods ****************************************************************/ Object *AboutWindow__OM_NEW ( Class *CLASS, Object *self, struct opSet *message ) { struct AboutWindow_DATA *data = NULL; const struct TagItem *tstate = message->ops_AttrList; struct TagItem *tag = NULL, *authorsTags = NULL, *sponsorsTags = NULL; struct Catalog *catalog = NULL; APTR pool; Object *rootGroup = NULL, *imageGroup = NULL, *imageObject = NULL, *versionObject = NULL, *copyrightObject = NULL, *descriptionGroup = NULL, *descriptionObject = NULL, *authorsList = NULL, *sponsorsList = NULL; STRPTR title = NULL, versionNumber = NULL, versionDate = NULL, versionExtra = NULL, description = NULL, copyright = NULL; CONST_STRPTR pages[] = { NULL, NULL, NULL }; UBYTE nextPage = 0; /* Allocate memory pool ------------------------------------------------*/ pool = CreatePool(MEMF_ANY, 4096, 4096); if (pool == NULL) return NULL; /* Initialize locale ---------------------------------------------------*/ catalog = OpenCatalogA ( NULL, "System/Classes/Zune/AboutWindow.catalog", NULL ); /* Parse initial attributes --------------------------------------------*/ while ((tag = NextTagItem(&tstate)) != NULL) { switch (tag->ti_Tag) { case MUIA_AboutWindow_Image: imageObject = (Object *) tag->ti_Data; break; case MUIA_AboutWindow_Title: title = StrDup((STRPTR) tag->ti_Data); if (title == NULL) title = IGNORE; break; case MUIA_AboutWindow_Version_Number: versionNumber = StrDup((STRPTR) tag->ti_Data); if (versionNumber == NULL) versionNumber = IGNORE; break; case MUIA_AboutWindow_Version_Date: versionDate = StrDup((STRPTR) tag->ti_Data); if (versionDate == NULL) versionDate = IGNORE; break; case MUIA_AboutWindow_Version_Extra: versionExtra = StrDup((STRPTR) tag->ti_Data); if (versionExtra == NULL) versionExtra = IGNORE; break; case MUIA_AboutWindow_Copyright: copyright = StrDup((STRPTR) tag->ti_Data); if (copyright == NULL) copyright = IGNORE; break; case MUIA_AboutWindow_Description: description = StrDup((STRPTR) tag->ti_Data); if (description == NULL) description = IGNORE; break; case MUIA_AboutWindow_Authors: authorsTags = (struct TagItem *) tag->ti_Data; break; case MUIA_AboutWindow_Sponsors: sponsorsTags = (struct TagItem *) tag->ti_Data; break; default: continue; /* Don't supress non-processed tags */ } tag->ti_Tag = TAG_IGNORE; } /* Setup image ---------------------------------------------------------*/ if (imageObject == NULL) { TEXT path[512], program[1024]; path[0] = '\0'; program[0] = '\0'; if (GetProgramName(program, 1024)) { strlcat(path, "PROGDIR:", 512); strlcat(path, FilePart(program), 512); imageObject = (Object *)IconImageObject, MUIA_IconImage_File, (IPTR) path, End; } if (imageObject == NULL) { imageObject = HVSpace; } } /* Setup pages ---------------------------------------------------------*/ if (authorsTags != NULL) { pages[nextPage] = _(MSG_AUTHORS); nextPage++; } if (sponsorsTags != NULL) { pages[nextPage] = _(MSG_SPONSORS); nextPage++; } self = (Object *) DoSuperNewTags ( CLASS, self, NULL, MUIA_Window_Activate, TRUE, MUIA_Window_NoMenus, TRUE, MUIA_Window_Height, MUIV_Window_Height_Visible(25), MUIA_Window_Width, MUIV_Window_Width_Visible(25), WindowContents, (IPTR) VGroup, GroupSpacing(6), Child, (IPTR) (imageGroup = (Object *)HGroup, MUIA_Weight, 0, Child, (IPTR) HVSpace, Child, (IPTR) imageObject, Child, (IPTR) HVSpace, End), Child, (IPTR) (versionObject = (Object *)TextObject, MUIA_Text_PreParse, (IPTR) MUIX_C, MUIA_Text_Contents, (IPTR) NULL, End), Child, (IPTR) (copyrightObject = (Object *)TextObject, MUIA_Text_PreParse, (IPTR) MUIX_C, MUIA_Text_Contents, (IPTR) NULL, End), Child, (IPTR) (descriptionGroup = (Object *)VGroup, Child, (IPTR) VSpace(6), Child, (IPTR) (descriptionObject = (Object *)TextObject, MUIA_Text_PreParse, (IPTR) MUIX_I MUIX_C, MUIA_Text_Contents, (IPTR) NULL, End), End), Child, (IPTR) VSpace(6), Child, (IPTR) RegisterGroup(pages), Child, (IPTR) ListviewObject, MUIA_Listview_List, (IPTR) (authorsList = (Object *)ListObject, ReadListFrame, End), End, Child, (IPTR) ListviewObject, MUIA_Listview_List, (IPTR) (sponsorsList = (Object *)ListObject, ReadListFrame, End), End, End, End, TAG_MORE, (IPTR) message->ops_AttrList ); if (self == NULL) goto error; data = INST_DATA(CLASS, self); data->awd_Catalog = catalog; data->awd_Pool = pool; data->awd_RootGroup = rootGroup; data->awd_ImageGroup = imageGroup; data->awd_ImageObject = imageObject; data->awd_VersionObject = versionObject; data->awd_CopyrightObject = copyrightObject; data->awd_DescriptionGroup = descriptionGroup; data->awd_DescriptionObject = descriptionObject; data->awd_Title = title; data->awd_VersionNumber = versionNumber; data->awd_VersionDate = versionDate; data->awd_VersionExtra = versionExtra; data->awd_Copyright = copyright; data->awd_Description = description; if (authorsTags != NULL) NamesToList(authorsList, authorsTags, data); if (sponsorsTags != NULL) NamesToList(sponsorsList, sponsorsTags, data); /* Setup notifications */ DoMethod ( self, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR) self, 2, MUIA_Window_Open, FALSE ); return self; error: if (catalog != NULL) CloseCatalog(catalog); return NULL; }