本文整理汇总了C++中NewHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ NewHandle函数的具体用法?C++ NewHandle怎么用?C++ NewHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewHandle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DWStruct
dw_handle DWENTRY DWStruct(
dw_client cli,
uint kind )
{
dw_handle new_hdl;
new_hdl = NewHandle( cli );
CreateExtra( cli, new_hdl )->structure.kind = kind;
return( new_hdl );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:10,代码来源:dwtype.c
示例2: InitReqList
static void InitReqList (int first, int last, ReqListRec ***reqlistptr)
{
register i;
(*reqlistptr) = (ReqListRec**)
(NewHandle (sizeof(ReqListRec) + (last-first)*sizeof(short)));
(**reqlistptr)->reqLSize = last-first;
for (i=first; i<=last; i++)
(**reqlistptr)->reqLData[i-first] = i;
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:10,代码来源:srgp_color_MAC.c
示例3: DWHandle
dw_handle DWENTRY DWHandle(
dw_client cli,
uint kind )
{
dw_handle new_hdl;
kind = kind;
new_hdl = NewHandle( cli );
return( new_hdl );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:10,代码来源:dwtype.c
示例4: CompressPixMapRLE
// CompressRLE
// Main compress routine, this function will call the appropriate RLE compression
// method depending on the pixel depth of the source image.
OSErr CompressPixMapRLE(PixMapHandle pixMapHdl, Ptr compressBuffer, Size *compressBufferSizePtr)
{
Handle hdl = NULL;
Ptr tempPtr = NULL,srcData;
Ptr pixBaseAddr = GetPixBaseAddr(pixMapHdl);
OSType pixelFormat = GETPIXMAPPIXELFORMAT(*pixMapHdl);
int depth = QTGetPixelSize(pixelFormat);
long rowBytes = QTGetPixMapHandleRowBytes(pixMapHdl);
int width = (**pixMapHdl).bounds.right - (**pixMapHdl).bounds.left;
int i, height = (**pixMapHdl).bounds.bottom - (**pixMapHdl).bounds.top;
Size widthByteSize = (depth * (long)width + 7) >> 3;
OSErr err = noErr;
// need to remove padding between rows?
if(widthByteSize != rowBytes){
// Make a temp buffer for the source
hdl = NewHandle(height * widthByteSize);
err = MemError();
if (err) goto bail;
HLock(hdl);
srcData = tempPtr = *hdl;
// Get rid of row bytes padding
for (i = 0; i < height; i++) {
BlockMoveData(pixBaseAddr, tempPtr, widthByteSize);
tempPtr += widthByteSize;
pixBaseAddr += rowBytes;
}
}else
srcData = pixBaseAddr;
// Compress
switch (depth) {
case 1:
CompressRLE8((UInt8*)srcData, height * widthByteSize, compressBuffer, compressBufferSizePtr);
break;
case 8:
CompressRLE8((UInt8*)srcData, height * widthByteSize, compressBuffer, compressBufferSizePtr);
break;
case 16:
CompressRLE16((UInt16*)srcData, height * (widthByteSize >> 1), compressBuffer, compressBufferSizePtr);
break;
case 32:
CompressRLE32((UInt32*)srcData, height * (widthByteSize >> 2), compressBuffer, compressBufferSizePtr);
break;
}
bail:
if (hdl)
DisposeHandle(hdl);
return err;
}
开发者ID:JanX2,项目名称:Quicktime-Component-for-Electric-Image-Format,代码行数:58,代码来源:EI_RLE.c
示例5: HapQTCreateCVPixelBufferOptionsDictionary
void MovieGlHap::allocateVisualContext()
{
// Load HAP Movie
if( HapQTQuickTimeMovieHasHapTrackPlayable( getObj()->mMovie ) )
{
// QT Visual Context attributes
OSStatus err = noErr;
QTVisualContextRef * visualContext = (QTVisualContextRef*)&getObj()->mVisualContext;
CFDictionaryRef pixelBufferOptions = HapQTCreateCVPixelBufferOptionsDictionary();
const CFStringRef keys[] = { kQTVisualContextPixelBufferAttributesKey };
CFDictionaryRef visualContextOptions = ::CFDictionaryCreate(kCFAllocatorDefault, (const void**)&keys, (const void**)&pixelBufferOptions, sizeof(keys)/sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
err = QTPixelBufferContextCreate( kCFAllocatorDefault, visualContextOptions, visualContext );
::CFRelease( pixelBufferOptions );
::CFRelease( visualContextOptions );
if( err != noErr ) {
CI_LOG_E( "HAP ERROR :: " << err << " couldnt create visual context." );
return;
}
// Set the movie's visual context
err = SetMovieVisualContext( getObj()->mMovie, *visualContext );
if( err != noErr ) {
CI_LOG_E( "HAP ERROR :: " << err << " SetMovieVisualContext." );
return;
}
}
// Get codec name
for (long i = 1; i <= GetMovieTrackCount(getObj()->mMovie); i++) {
Track track = GetMovieIndTrack(getObj()->mMovie, i);
Media media = GetTrackMedia(track);
OSType mediaType;
GetMediaHandlerDescription(media, &mediaType, NULL, NULL);
if (mediaType == VideoMediaType)
{
// Get the codec-type of this track
ImageDescriptionHandle imageDescription = (ImageDescriptionHandle)NewHandle(0); // GetMediaSampleDescription will resize it
GetMediaSampleDescription(media, 1, (SampleDescriptionHandle)imageDescription);
OSType codecType = (*imageDescription)->cType;
DisposeHandle((Handle)imageDescription);
switch (codecType) {
case 'Hap1': mCodec = Codec::HAP; break;
case 'Hap5': mCodec = Codec::HAP_A; break;
case 'HapY': mCodec = Codec::HAP_Q; break;
default: mCodec = Codec::UNSUPPORTED; break;
}
}
}
// Set framerate callback
this->setNewFrameCallback( updateMovieFPS, (void*)this );
}
开发者ID:brucelane,项目名称:Cinder-Hap2,代码行数:55,代码来源:MovieHap.cpp
示例6: srVerNo
static int srVerNo(void* p_void)
{
char cVersionStr[200];
srUtiVerNo(cVersionStr);
long LenVersionStr = strlen(cVersionStr);
Handle VersionStr = NewHandle(LenVersionStr);
strncpy(*VersionStr, cVersionStr, LenVersionStr);
((srTIgorVersionStruct*)p_void)->result = VersionStr;
return 0;
}
开发者ID:ebknudsen,项目名称:SRW,代码行数:11,代码来源:srigintr.cpp
示例7: ThrowIf_
/*============================================
SUMiscUtils::DuplicateHandle
==============================================*/
Handle SUMiscUtils::DuplicateHandle( Handle source )
{
ThrowIf_ ( !source || !*source );
SInt32 numBytes = GetHandleSize( source );
Handle result = NewHandle( numBytes );
ThrowIfMemFail_( result );
BlockMoveData( *source, *result, numBytes );
return( result );
}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:14,代码来源:SUMiscUtils.cpp
示例8: WritePos
//_______________________________________________________________________________
void WritePos (WindowPtr win, short resFile)
{
Handle h = NewHandle (sizeof(Point));
if (h) {
Point *p = (Point *)*h;
SetPort(win);
p->h = win->portRect.left;
p->v = win->portRect.top;
LocalToGlobal(p);
WriteRsrc (h, kWinPosRsrc, kWinposID, resFile);
}
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:13,代码来源:msRsrc.c
示例9: write_setting_filename
void write_setting_filename(void *handle, const char *key, Filename fn)
{
int fd = *(int *)handle;
AliasHandle h;
int id;
OSErr error;
Str255 pkey;
UseResFile(fd);
if (ResError() != noErr)
fatalbox("Failed to open saved session (%d)", ResError());
if (filename_is_null(fn)) {
/* Generate a special "null" alias */
h = (AliasHandle)NewHandle(sizeof(**h));
if (h == NULL)
fatalbox("Failed to create fake alias");
(*h)->userType = 'pTTY';
(*h)->aliasSize = sizeof(**h);
} else {
error = NewAlias(NULL, &fn.fss, &h);
if (error == fnfErr) {
/*
* NewAlias can't create an alias for a nonexistent file.
* Create an alias for the directory, and record the
* filename as well.
*/
FSSpec tmpfss;
FSMakeFSSpec(fn.fss.vRefNum, fn.fss.parID, NULL, &tmpfss);
error = NewAlias(NULL, &tmpfss, &h);
if (error != noErr)
fatalbox("Failed to create alias");
(*h)->userType = 'pTTY';
SetHandleSize((Handle)h, (*h)->aliasSize + fn.fss.name[0] + 1);
if (MemError() != noErr)
fatalbox("Failed to create alias");
memcpy((char *)*h + (*h)->aliasSize, fn.fss.name,
fn.fss.name[0] + 1);
}
if (error != noErr)
fatalbox("Failed to create alias");
}
/* Put the data in a resource. */
id = Unique1ID(rAliasType);
if (ResError() != noErr)
fatalbox("Failed to get ID for resource %s (%d)", key, ResError());
c2pstrcpy(pkey, key);
AddResource((Handle)h, rAliasType, id, pkey);
if (ResError() != noErr)
fatalbox("Failed to add resource %s (%d)", key, ResError());
}
开发者ID:sdottaka,项目名称:cvsnt-sjis,代码行数:52,代码来源:macstore.c
示例10: QT_Process_Audio_Track
static HRESULT QT_Process_Audio_Track(QTSplitter* filter, Track trk)
{
AM_MEDIA_TYPE amt;
WAVEFORMATEX* pvi;
PIN_INFO piOutput;
HRESULT hr = S_OK;
static const WCHAR szwAudioOut[] = {'A','u','d','i','o',0};
Media audioMedia;
SoundDescriptionHandle aDesc = (SoundDescriptionHandle) NewHandle(sizeof(SoundDescription));
audioMedia = GetTrackMedia(trk);
GetMediaSampleDescription(audioMedia, 1, (SampleDescriptionHandle)aDesc);
ZeroMemory(&amt, sizeof(amt));
amt.formattype = FORMAT_WaveFormatEx;
amt.majortype = MEDIATYPE_Audio;
amt.subtype = MEDIASUBTYPE_PCM;
amt.bTemporalCompression = 0;
amt.cbFormat = sizeof(WAVEFORMATEX);
amt.pbFormat = CoTaskMemAlloc(amt.cbFormat);
ZeroMemory(amt.pbFormat, amt.cbFormat);
pvi = (WAVEFORMATEX*)amt.pbFormat;
pvi->cbSize = sizeof(WAVEFORMATEX);
pvi->wFormatTag = WAVE_FORMAT_PCM;
pvi->nChannels = ((SoundDescription)**aDesc).numChannels;
if (pvi->nChannels < 1 || pvi->nChannels > 2)
pvi->nChannels = 2;
pvi->nSamplesPerSec = (((SoundDescription)**aDesc).sampleRate/65536);
if (pvi->nSamplesPerSec < 8000 || pvi->nChannels > 48000)
pvi->nSamplesPerSec = 44100;
pvi->wBitsPerSample = ((SoundDescription)**aDesc).sampleSize;
if (pvi->wBitsPerSample < 8 || pvi->wBitsPerSample > 32)
pvi->wBitsPerSample = 16;
pvi->nBlockAlign = (pvi->nChannels * pvi->wBitsPerSample) / 8;
pvi->nAvgBytesPerSec = pvi->nSamplesPerSec * pvi->nBlockAlign;
DisposeHandle((Handle)aDesc);
piOutput.dir = PINDIR_OUTPUT;
piOutput.pFilter = &filter->filter.IBaseFilter_iface;
lstrcpyW(piOutput.achName,szwAudioOut);
hr = QT_AddPin(filter, &piOutput, &amt, FALSE);
if (FAILED(hr))
ERR("Failed to add Audio Track\n");
else
TRACE("Audio Pin %p\n",filter->pAudio_Pin);
return hr;
}
开发者ID:Kelimion,项目名称:wine,代码行数:52,代码来源:qtsplitter.c
示例11: QT_GetCodecSettingsFromScene
static OSErr QT_GetCodecSettingsFromScene(RenderData *rd, ReportList *reports)
{
Handle myHandle = NULL;
ComponentResult myErr = noErr;
QuicktimeCodecData *qcd = rd->qtcodecdata;
/* if there is codecdata in the blendfile, convert it to a Quicktime handle */
if (qcd) {
myHandle = NewHandle(qcd->cdSize);
PtrToHand(qcd->cdParms, &myHandle, qcd->cdSize);
}
/* restore codecsettings to the quicktime component */
if (qcd->cdParms && qcd->cdSize) {
myErr = SCSetSettingsFromAtomContainer((GraphicsExportComponent)qtdata->theComponent, (QTAtomContainer)myHandle);
if (myErr != noErr) {
BKE_report(reports, RPT_ERROR, "Quicktime: SCSetSettingsFromAtomContainer failed");
goto bail;
}
/* update runtime codecsettings for use with the codec dialog */
SCGetInfo(qtdata->theComponent, scDataRateSettingsType, &qtdata->aDataRateSetting);
SCGetInfo(qtdata->theComponent, scSpatialSettingsType, &qtdata->gSpatialSettings);
SCGetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings);
/* Fill the render QuicktimeCodecSettigns struct */
rd->qtcodecsettings.codecTemporalQuality = (qtdata->gTemporalSettings.temporalQuality * 100) / codecLosslessQuality;
/* Do not override scene frame rate (qtdata->gTemporalSettings.framerate) */
rd->qtcodecsettings.keyFrameRate = qtdata->gTemporalSettings.keyFrameRate;
rd->qtcodecsettings.codecType = qtdata->gSpatialSettings.codecType;
rd->qtcodecsettings.codec = (int)qtdata->gSpatialSettings.codec;
rd->qtcodecsettings.colorDepth = qtdata->gSpatialSettings.depth;
rd->qtcodecsettings.codecSpatialQuality = (qtdata->gSpatialSettings.spatialQuality * 100) / codecLosslessQuality;
rd->qtcodecsettings.bitRate = qtdata->aDataRateSetting.dataRate;
rd->qtcodecsettings.minSpatialQuality = (qtdata->aDataRateSetting.minSpatialQuality * 100) / codecLosslessQuality;
rd->qtcodecsettings.minTemporalQuality = (qtdata->aDataRateSetting.minTemporalQuality * 100) / codecLosslessQuality;
/* Frame duration is already known (qtdata->aDataRateSetting.frameDuration) */
}
else {
BKE_report(reports, RPT_ERROR, "Quicktime: QT_GetCodecSettingsFromScene failed");
}
bail:
if (myHandle != NULL)
DisposeHandle(myHandle);
return((OSErr)myErr);
}
开发者ID:244xiao,项目名称:blender,代码行数:52,代码来源:quicktime_export.c
示例12: InitMacColorTable
static void InitMacColorTable (int first, int last, CTabHandle *ctabptr)
{
register i;
CTabHandle ctab;
*ctabptr = ctab = (CTabHandle)
NewHandle (sizeof(ColorTable) + (last-first)*sizeof(ColorSpec));
(*ctab)->ctSize = last-first;
(*ctab)->ctSeed = GetCTSeed();
(*ctab)->ctFlags = (short) (((unsigned short)(-1))<<15);
for (i=first; i<=last; i++)
(*ctab)->ctTable[i-first].value = i;
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:13,代码来源:srgp_color_MAC.c
示例13: handle_from_c_string
static Handle
handle_from_c_string (char *str)
{
int len;
Handle retval;
len = strlen (str);
retval = NewHandle (len);
BlockMove (str, *retval, len);
return retval;
}
开发者ID:LarBob,项目名称:executor,代码行数:13,代码来源:munger_test.c
示例14: NewHandle
void CAComponent::SetCompInfo () const
{
if (!mCompInfo) {
Handle h1 = NewHandle(4);
CAComponentDescription desc;
OSStatus err = GetComponentInfo (Comp(), &desc, 0, h1, 0);
if (err) return;
HLock (h1);
const_cast<CAComponent*>(this)->mCompInfo = CFStringCreateWithPascalString(NULL, (const unsigned char*)*h1, kCFStringEncodingMacRoman);
DisposeHandle (h1);
}
}
开发者ID:DanielAeolusLaude,项目名称:ardour,代码行数:13,代码来源:CAComponent.cpp
示例15: allocBufferHandle
/*---------------------------------------------------------------------
* FUNCTION NAME
* allocBufferHandle (Macintosh Version)
*
* DESCRIPTION
* This function allocates a buffer and returns a handle to it. The
* DOS implementation fakes all this out, of course.
*
* AUTHOR
* Peter Tracy
*
* DATE CREATED
* May 24, 1991
*
---------------------------------------------------------------------*/
KpHandle_t allocBufferHandle (KpInt32_t numBytes)
{
Size blockSize; /* size of memory to allocate */
Handle hBuffer; /* handle to allocated buffer */
OSErr err;
blockSize = (Size) numBytes;
hBuffer = NewHandle (blockSize);
err = MemError();
if ((err != noErr) && (err != memFullErr)) {
DEBUGTRAP("\p allocBufferHandle NewHandle")
hBuffer = NULL;
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:29,代码来源:memory.c
示例16: DrawUsingCGImage
void DrawUsingCGImage( void )
{
OSErr err = noErr;
Handle hOpenTypeList = NewHandle(0);
long numTypes = 0;
FSSpec theFSSpec;
Rect bounds = { 45, 10, 100, 100 };
GraphicsImportComponent importer = 0;
CGImageRef imageRef = 0;
CGContextRef context = NULL;
CGRect rect;
BuildGraphicsImporterValidFileTypes( hOpenTypeList, &numTypes );
HLock( hOpenTypeList );
err = GetOneFileWithPreview(numTypes, (OSTypePtr)*hOpenTypeList, &theFSSpec, NULL);
DisposeHandle( hOpenTypeList );
if ( err ) return;
// locate and open a graphics importer component which can be used to draw the
// selected file. If a suitable importer is not found the ComponentInstance
// is set to NULL.
err = GetGraphicsImporterForFile( &theFSSpec, // specifies the file to be drawn
&importer ); // pointer to the returned GraphicsImporterComponent
window = NewCWindow( NULL, &bounds, "\pDraw Using CGImage", false, documentProc, (WindowPtr)-1, true, 0);
// import the image as a CGImage
err = GraphicsImportCreateCGImage( importer, &imageRef, kGraphicsImportCreateCGImageUsingCurrentSettings );
if (err) return;
SizeWindow( window, CGImageGetWidth( imageRef ), CGImageGetHeight( imageRef ), false );
ShowWindow(window);
// create a Core Graphics Context from the window port
err = QDBeginCGContext(GetWindowPort(window), &context);
if (err) return;
// make a rectangle designating the location and dimensions in user space of the bounding box in which to draw the image
rect = CGRectMake( 0, 0, CGImageGetWidth( imageRef ), CGImageGetHeight( imageRef ) );
// draw the image
CGContextDrawImage( context, rect, imageRef );
// end the the context we had for the port
QDEndCGContext(GetWindowPort(window), &context);
// close the importer instance
CloseComponent( importer );
}
开发者ID:fruitsamples,项目名称:ImproveYourImage,代码行数:50,代码来源:DrawUsingCGImage.c
示例17: gr_palette_load
void gr_palette_load( ubyte *pal )
{
int i, j;
GDHandle old_device;
ColorSpec colors[256];
// PaletteHandle palette;
// RGBColor color;
// CTabHandle ctable;
for (i=0; i<768; i++ ) {
// gr_current_pal[i] = pal[i] + gr_palette_gamma;
gr_current_pal[i] = pal[i];
if (gr_current_pal[i] > 63) gr_current_pal[i] = 63;
}
for (i = 0, j = 0; j < 256; j++) {
colors[j].value = j;
colors[j].rgb.red = gr_mac_gamma[gr_current_pal[i++]];
colors[j].rgb.green = gr_mac_gamma[gr_current_pal[i++]];
colors[j].rgb.blue = gr_mac_gamma[gr_current_pal[i++]];
}
old_device = GetGDevice();
SetGDevice(GameMonitor);
SetEntries(0, 255, colors);
SetGDevice(old_device);
#if 0
palette = GetPalette(GameWindow);
for (i = 0; i < 768; i += 3) {
color.red = gr_current_pal[i] << 9;
color.green = gr_current_pal[i+1] << 9;
color.blue = gr_current_pal[i+2] << 9;
SetEntryColor(palette, i / 3, &color);
}
ctable = (CTabHandle)NewHandle(sizeof(ColorTable));
Palette2CTab(palette, ctable);
AnimatePalette(GameWindow, ctable, 0, 0, 256);
ActivatePalette(GameWindow);
DisposeHandle((Handle)ctable);
if (GameGWorld != NULL) {
ctable = (**GetGWorldPixMap(GameGWorld)).pmTable; // get the color table for the gWorld.
CTabChanged(ctable);
(**ctable).ctSeed = (**(**(*(CGrafPtr)GameWindow).portPixMap).pmTable).ctSeed;
}
#endif
gr_palette_faded_out = 0;
init_computed_colors();
}
开发者ID:osgcc,项目名称:descent-mac,代码行数:50,代码来源:palette.c
示例18: MinimalSGSettingsDialog
// SGSettingsDialog with the "Compression" panel removed
static OSErr MinimalSGSettingsDialog(SeqGrabComponent seqGrab,
SGChannel sgchanVideo, WindowPtr gMonitor)
{
OSErr err;
Component *panelListPtr = NULL;
UInt8 numberOfPanels = 0;
ComponentDescription cd = { SeqGrabPanelType, VideoMediaType, 0, 0, 0 };
Component c = 0;
Component *cPtr = NULL;
numberOfPanels = CountComponents(&cd);
panelListPtr =
(Component *) NewPtr(sizeof(Component) * (numberOfPanels + 1));
cPtr = panelListPtr;
numberOfPanels = 0;
CFStringRef compressionCFSTR = CFSTR("Compression");
do {
ComponentDescription compInfo;
c = FindNextComponent(c, &cd);
if (c) {
Handle hName = NewHandle(0);
GetComponentInfo(c, &compInfo, hName, NULL, NULL);
CFStringRef nameCFSTR =
CFStringCreateWithPascalString(kCFAllocatorDefault,
(unsigned char
*)(*hName),
kCFStringEncodingASCII);
if (CFStringCompare
(nameCFSTR, compressionCFSTR,
kCFCompareCaseInsensitive) != kCFCompareEqualTo) {
*cPtr++ = c;
numberOfPanels++;
}
DisposeHandle(hName);
}
} while (c);
if ((err =
SGSettingsDialog(seqGrab, sgchanVideo, numberOfPanels,
panelListPtr, seqGrabSettingsPreviewOnly,
(SGModalFilterUPP)
NewSGModalFilterUPP(SeqGrabberModalFilterProc),
(long)gMonitor))) {
return err;
}
return 0;
}
开发者ID:MattHung,项目名称:sage-graphics,代码行数:50,代码来源:quicktime.c
示例19: DeleteCheatItem
static void DeleteCheatItem (void)
{
OSStatus err;
HIViewRef ctl, root;
HIViewID cid;
Handle selectedItems;
ItemCount selectionCount;
selectedItems = NewHandle(0);
if (!selectedItems)
return;
err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems);
selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID));
if (selectionCount == 0)
{
DisposeHandle(selectedItems);
return;
}
err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty);
for (unsigned int i = 0; i < selectionCount; i++)
{
citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid = false;
citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false;
numofcheats--;
}
DisposeHandle(selectedItems);
root = HIViewGetRoot(wRef);
cid.id = 0;
if (numofcheats < MAC_MAX_CHEATS)
{
cid.signature = kNewButton;
HIViewFindByID(root, cid, &ctl);
err = ActivateControl(ctl);
}
if (numofcheats == 0)
{
cid.signature = kAllButton;
HIViewFindByID(root, cid, &ctl);
err = DeactivateControl(ctl);
}
}
开发者ID:libretro,项目名称:snes9x,代码行数:49,代码来源:mac-cheat.cpp
示例20: WinList
/* FillWinMenu(MenuHandle theMenu, char *match, char *options, int afterItem)
Puts names of Igor windows into theMenu.
match and options are as for the Igor WinList() function:
match = "*" for all windows
options = "" for all windows
options = "WIN: 1" for all graphs ( bit 0 selects graphs)
options = "WIN: 2" for all tables ( bit 1 selects graphs)
options = "WIN: 4" for all layouts ( bit 2 selects graphs)
options = "WIN: 3" for all graphs and tables
afterItem is as for FillMenu, described above.
In contrast to Macintosh menu manager routines, this routine does not
treat any characters as meta-characters.
NOTE: You should not call this routine to update the contents of an existing
dialog popup menu item. Use FillWindowPopMenu instead.
Thread Safety: FillWinMenu is not thread-safe.
*/
int
FillWinMenu(MenuHandle theMenu, const char *match, const char *options, int afterItem)
{
Handle listHandle;
int result;
if (!CheckRunningInMainThread("FillWinMenu"))
return NOT_IN_THREADSAFE;
listHandle = NewHandle(0L);
result = WinList(listHandle, match, ";", options);
FillMenuNoMeta(theMenu, *listHandle, (int)GetHandleSize(listHandle), afterItem);
DisposeHandle(listHandle);
return(result);
}
开发者ID:prheenan,项目名称:IgorUtil,代码行数:37,代码来源:XOPMenus.c
注:本文中的NewHandle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论