McoStatus ToneTab::updateWindowData(int changed) { Rect r1; short iType; Handle iHandle; Str255 text; char desc[100]; int result; int newhand; if (!doc) return MCO_OBJECT_NOT_INITIALIZED; if (!doc->printData) return MCO_OBJECT_NOT_INITIALIZED; // see if export is valid GetDItem (dp, DESCRIPTION+startNum, &iType, (Handle*)&iHandle, &r1); GetIText(iHandle,text); ptocstr(text); strcpy(desc,doc->printData->setting.toneDesc); if (strcmp((char*)text,desc)) { ctopstr(desc); SetIText(iHandle,(unsigned char*)desc); } if (last_changed) changed = 0; last_changed = 0; if (changed) CopyIntoControl(-1); return MCO_SUCCESS; }
// Open a gammut surface dialog, use info passed in data if data is valid McoStatus AllWins::openGammutSurface2(Document *doc,void *data,MS_WindowTypes type) { GamutSurfaceWin *gamutsurf; int32 maxwinnum = 0; McoStatus state = MCO_SUCCESS; int i; Str255 patchFName; RawData *patch; char fn[100]; patch = (RawData*)data; if (!QD3D_Present) return MCO_NO_QD3D; if (xyztorgb == NULL) return MCO_FAILURE; if (num_documents <1) return MCO_FAILURE; for (i=0; i<((ProfileDoc*)doc)->_condata.smooth; i++) ((ProfileDoc*)doc)->patchD->smooth_patch(); maxwinnum = 0; for (i=0; i<numWins; i++) if (wins[i]->isMyWindowType(type)) { if (wins[i]->WinNum >= maxwinnum) maxwinnum = wins[i]->WinNum+1; } strcpy(fn,patch->desc); ctopstr(fn); memcpy(patchFName, fn, fn[0]+1); gamutsurf = new GamutSurfaceWin((ProfileDoc*)doc,patch,0,type,maxwinnum,patchFName); if (gamutsurf == 0L) return MCO_MEM_ALLOC_ERROR; if (gamutsurf->error == MCO_MEM_ALLOC_ERROR) { McoErrorAlert(gamutsurf->error); delete gamutsurf; return MCO_SUCCESS; } if (gamutsurf->error != MCO_SUCCESS) { state = gamutsurf->error; delete gamutsurf; return state; } state = AddWin(gamutsurf,doc); return state; }
AIErr addFileFormat( SPInterfaceMessage *message ) { AIErr error; PlatformAddFileFormatData affd; AIFileFormatHandle fileFormat; char fftitleStr[] = "Selection As Raster PICT"; affd.type = 'PICT'; affd.title = ctopstr( fftitleStr ); affd.titleOrder = 0; error = sFileFormat->AddFileFormat( message->d.self, "raster pict format", &affd, kFileFormatWrite | kFileFormatRead, &fileFormat ); if (error) goto error; error: return error; }
DisplayDialog::DisplayDialog(ProfileDoc *dc,RawData *pD,int wn):InputDialog(dc,pD,1) { short iType; Handle iHandle; Handle sHandle; Rect iRect, r,pRect,tRect; UserItemUPP box3D; QDErr error; GDHandle oldGD; GWorldPtr oldGW; RGBColor c,oldbackcolor,oldforecolor; WindowPtr oldP; OSErr err; int32 i,wi,hi; double w,h; short dtp_ids[] = DISPPATCH_IDS; Str255 theString,name; for (i=0; i<NumInputIDS; i++) ids[i] = dtp_ids[i]; WinType = DisplayWindow; WinNum = wn; setDialog(Input_Dialog); GetIndString(theString,Display_Title,1); SetWTitle( dp, theString); // Added by James, 3D the box threeD_box(ids[ThreeDBox]); //playSound(8193); // initialize the big gworld GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect); tRect = iRect; OffsetRect(&tRect,-iRect.left,-iRect.top); error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 ); if (error != 0) { delete this; return; } GetGWorld(&oldGW,&oldGD); SetGWorld(BigGW,nil); // GetBackColor(&oldbackcolor); GetForeColor(&oldforecolor); c.red = 65535; c.green = 65535; c.blue = 65535; RGBBackColor(&c); c.red = 0; c.green = 0; c.blue = 0; RGBForeColor(&c); // EraseRect( &tRect ); SetGWorld(oldGW,oldGD); // RGBBackColor(&oldbackcolor); RGBForeColor(&oldforecolor); // SetPort(oldP); GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect); num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top); top_patch = 0; //init the static members //current_patch = total_patches-1; //current_patch = 0; current_patch = 0; current_strip = 0; current_sheet = 0; _done = 0; _waiting = 0; SetSheetStripText(); current_top = current_patch - 2*num_display_patch/3; current_bottom = current_top + num_display_patch - 1; if (current_top < 0) { current_top = 0; current_bottom = current_top + num_display_patch - 1; } if (current_bottom >= total_patches-1) { current_bottom = total_patches - 1; current_top = current_bottom - num_display_patch + 1; } current_disp = 2*num_display_patch/3; init(); getpatchRGB(); Disable(dp,ids[Redo]); GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect); SetCtlMin((ControlHandle)iHandle,0); SetCtlMax((ControlHandle)iHandle,total_patches-1); // GetDItem ( dp,ids[Message], &iType, (Handle*)&iHandle, &pRect ); // SetIText(iHandle,"\p"); GetDItem ( dp,PatchLabel, &iType, (Handle*)&iHandle, &pRect ); GetIndString(theString,Message_List_ID,Patch_Message); SetIText(iHandle,theString); strcpy((char*)name,pD->desc); ctopstr((char*)name); SetWTitle( dp, name); DrawWindow(); }