Esempio n. 1
0
LPPALETTE Palette_Delete( LPPALETTE lpHeadPalette, int iPalette )
/************************************************************************/
{
LPPALETTE lpNextPalette, lpPrevPalette;
int	nPalettes;

lpNextPalette = lpHeadPalette;
lpPrevPalette = NULL;
nPalettes = 0;
while (lpNextPalette)
	{
	if (nPalettes == iPalette)
		{
		if (lpPrevPalette)
			lpPrevPalette->lpNext = lpNextPalette->lpNext;
		else
			lpHeadPalette = lpNextPalette->lpNext;
		if (lpNextPalette->lpColorInfo)
			FreeUp((LPTR)lpNextPalette->lpColorInfo);
		if (lpNextPalette->lpLabels)
			FreeUp(lpNextPalette->lpLabels);
		FreeUp((LPTR)lpNextPalette);
		break;
		}
	++nPalettes;
	lpPrevPalette = lpNextPalette;
	lpNextPalette = lpNextPalette->lpNext;
	}
return(lpHeadPalette);
}
Esempio n. 2
0
static void Video_OnDestroy(HWND hWindow)
/***********************************************************************/
{
	LPVIDEO lpVideo;

	if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) )
		return;

	if ( lpVideo->lpSwitches )
	{
		FreeUp( (LPTR)lpVideo->lpSwitches );
		lpVideo->lpSwitches = NULL;
	}
	if ( lpVideo->idLoopTimer )
	{
		KillTimer( hWindow, lpVideo->idLoopTimer );
		lpVideo->idLoopTimer = NULL;
	}
	Video_DrawProcInstall( hWindow, NULL/*lpSetProc*/, NULL/*lpDrawProc*/, 33/*wTimeDelay*/ );
	Video_Close( hWindow, lpVideo );
	if ( lpVideo->lpAllShots )
		FreeUp( lpVideo->lpAllShots );
	FreeUp( lpVideo );
	if ( bTrack )
	{
		ReleaseCapture();
		bTrack = NO;
	}
}
Esempio n. 3
0
void FreeCTHeader( LPCTHEADER lpTH)
   {
   if (!lpTH)
	   return;
   if (lpTH->lpCTLine)
	   FreeUp(lpTH->lpCTLine);
   FreeUp((LPTR)lpTH);
   }
Esempio n. 4
0
BOOL CScene::OnInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
	// Force the caption flag off for win95
	DWORD dwStyle = GetWindowLong( hWnd, GWL_STYLE );
	SetWindowLong( hWnd, GWL_STYLE, dwStyle & (~WS_CAPTION) );

	// Get the command string
	STRING szString;
	GetWindowText( hWnd, szString, sizeof(STRING)-1 );
	FNAME szMidi;
	GetStringParm( szString, 1/*nIndex*/, ',', szMidi );
	LPLONG lpSwitches = ExtractSwitches( szString );

	// Create the sound class with or w/o wavemix
	m_pSound = new CSound((BOOL)GetSwitchValue( 'w', lpSwitches));
	if (m_pSound)
		m_pSound->Open( NULL/*"powersnd.dll"*/ );

	if ( lpSwitches )
		FreeUp( (LPTR)lpSwitches );

	// Fix the coordinates from the resource file
	RepositionDialogControls( hWnd );

	// Center the scene within the app's client area
	CenterWindow( hWnd );

	// This should not be necessary, since it's done in the OnClose()
	if ( m_hMidiTheme )
	{ // close any looping midi theme
		MCIClose( m_hMidiTheme );
		m_hMidiTheme = NULL;
	}

	if ( *szMidi )
	{ // The scene has a midi theme, so start it
		LPLONG lpMidiSwitches = ExtractSwitches( szMidi );
		if ( m_hMidiTheme = MCIOpen( GetApp()->m_hDeviceMID, szMidi, NULL/*lpAlias*/ ) )
		{
			if ( lpMidiSwitches )
				MCILoop( m_hMidiTheme, (BOOL)GetSwitchValue( 'l', lpMidiSwitches ) );
			if ( !MCIPlay( m_hMidiTheme, GetApp()->GetMainWnd() ) )
			{
				MCIClose( m_hMidiTheme );
				m_hMidiTheme = NULL;
			} // if it's not looping, it will close itself when it ends
		}
		if ( lpMidiSwitches )
			FreeUp( (LPTR)lpMidiSwitches );
	}

	// if we have an animation object then setup a timer for it
	m_idAnimatorTimer = SetTimer(hWnd, ANIMATOR_TIMER_ID, 1, NULL);

	return(TRUE);
}
Esempio n. 5
0
BOOL Palette_DeleteEntries( LPPALETTE lpHeadPalette, int iPalette, int iStart,
                              int iCount )
/************************************************************************/
{
LPPALETTE lpPalette;
LPCOLORINFO lpNewColors, lpSrc, lpDst;
int iBefore, iAfter, iColors, iEnd;

lpPalette = Palette_Get(lpHeadPalette, NULL, iPalette);
if (lpPalette)
	{
	if (!lpPalette->iColors || iStart < 0 || iStart >= lpPalette->iColors)
		return(FALSE);
	if (!Palette_DeleteLabels(lpHeadPalette, iPalette, iStart, iCount))
		return(FALSE);
	iEnd = iStart + iCount - 1;
	iEnd = bound(iEnd, 0, lpPalette->iColors-1);
	iCount = iEnd - iStart + 1;
	iColors = lpPalette->iColors - iCount;
	if (iColors < 0)
		iColors = 0;
	if (!iColors)
		{
		if (lpPalette->lpColorInfo)
			{
			FreeUp((LPTR)lpPalette->lpColorInfo);
			lpPalette->lpColorInfo = NULL;
			}
		lpPalette->iColors = iColors;
		return(TRUE);
		}
	lpNewColors = (LPCOLORINFO)Alloc((long)iColors*(long)sizeof(COLORINFO));
	if (!lpNewColors)
		return(FALSE);
	lpSrc = lpPalette->lpColorInfo;
	lpDst = lpNewColors;
	iBefore = iStart;
	if (lpPalette->iColors && iBefore > 0)
		{
		copy((LPTR)lpSrc, (LPTR)lpDst, iBefore*sizeof(COLORINFO));
		lpSrc += iBefore;
		lpDst += iBefore;
		}
	lpSrc += iCount;
	iAfter = lpPalette->iColors - iStart - iCount;
	if (lpPalette->iColors && iAfter > 0)
		copy((LPTR)lpSrc, (LPTR)lpDst, iAfter*sizeof(COLORINFO));
	if (lpPalette->lpColorInfo)
		FreeUp((LPTR)lpPalette->lpColorInfo);
	lpPalette->lpColorInfo = lpNewColors;
	lpPalette->iColors = iColors;
	return(TRUE);
	}
return(FALSE);
}
Esempio n. 6
0
BOOL CParser::ParseTable(DWORD dwUserData)
/***********************************************************************/
{
	BOOL fRet = TRUE;
	LPSTR lpString, lpEntryString, lpKey, lpValues;
	int nIndex, nValues;
	HPTR lpData;
	LPSTR lpStringBuf, lpEntryStringBuf;

	if (!InitTable(dwUserData))
		return(FALSE);

	lpStringBuf = (LPSTR)Alloc(BUFFER_SIZE);
	lpEntryStringBuf = (LPSTR)Alloc(BUFFER_SIZE);
	if (!lpStringBuf || !lpEntryStringBuf)
	{
		if (lpStringBuf)
			FreeUp(lpStringBuf);
		if (lpEntryStringBuf)
			FreeUp(lpEntryStringBuf);
		return(FALSE);
	}
	nIndex = 0;
	lpData = m_lpTableData;
	while ( GetEntryString( &lpData, lpEntryStringBuf, BUFFER_SIZE ) )
	{
		// Keep a copy of the Entry string for error messages
		lpString = lpStringBuf;
		lpEntryString = lpEntryStringBuf;
		lstrcpy(lpString, lpEntryString);

		// get key
		while (lpKey = GetKey( &lpEntryString ))
		{
			// get value
			if (lpValues = GetValues( &lpEntryString, &nValues ))
			{
				// handle this entry
				if (!HandleKey(lpString, lpKey, lpValues, nValues, nIndex, dwUserData))
				{
					fRet = FALSE;
					break;
				}
			}
		}

		// process next entry
		++nIndex;
	}
	FreeUp(lpStringBuf);
	FreeUp(lpEntryStringBuf);
	return(fRet);
}
Esempio n. 7
0
LOCAL void Lut_OnDestroy(HWND hWindow)
/***********************************************************************/
{
	LPLUTCTL lpdata;

	if (lpdata = GET_LPLUTCTL(hWindow))
	{
		if (lpdata->lpLut)
			FreeUp(lpdata->lpLut);
		FreeUp((LPTR)lpdata);
		SetWindowLong( hWindow, GWL_LUTSTRUCT, (long)NULL);
	}
	Control_OnDestroy(hWindow);
}
Esempio n. 8
0
LOCAL BOOL	FindCommand(MACRO_FILE_HANDLE fh, ITEMID idCommand)
/***********************************************************************/
{
LPVOID lpParms;
LPTSTR lpCommand;
int i;
BOOL found;

if (!(lpCommand = (LPTSTR)Alloc(MAX_CMD_LEN)))
	{
	Message(IDS_EMEMALLOC);
	return(FALSE);
	}
found = FALSE;
while (ReadLine(fh, lpCommand, MAX_CMD_LEN))
	{
	i = ReadParms(fh, lpCommand, &lpParms);
	if (i < 0)
		continue;
	if (lpParms)
		FreeUpParms(GetCommandId(i), lpParms);
	if (GetCommandId(i) == idCommand)
		{
		found = TRUE;
		break;
		}
	}
FreeUp(lpCommand);
return(found);
}
Esempio n. 9
0
void Palette_FreeUp( LPPALETTE lpPalette )
/************************************************************************/
{
LPPALETTE lpNextPalette;

while (lpPalette)
	{
	lpNextPalette = lpPalette->lpNext;
	if (lpPalette->lpColorInfo)
		FreeUp((LPTR)lpPalette->lpColorInfo);
	if (lpPalette->lpLabels)
		FreeUp((LPTR)lpPalette->lpLabels);
	FreeUp((LPTR)lpPalette);
	lpPalette = lpNextPalette;
	}
}
Esempio n. 10
0
//=======================================================================
//	BOOL CPoly::poly_make_room(int needed)
//		Ensures that there is at least 'needed' room at the end of lpPoint.
//
//		Returns FALSE if the memory can not be allocated.
//=======================================================================
BOOL CPoly::poly_make_room(int needed)
//=======================================================================
{
	int alloc;
	LPPOINT lpNewMem = NULL;
	
	needed = (needed + EntriesUsed) - EntriesAllocated;
	if (needed <= 0)
		return(TRUE);
	alloc = Max(needed, Min(EntriesAllocated/2, POLY_MAX_ALLOC));
	if (lpPoints)
		lpNewMem = (LPPOINT)AllocExtend((LPTR)lpPoints, sizeof(POINT)*(alloc+EntriesAllocated));
	if (!lpNewMem)
	{
		// get what we need
		lpNewMem = (LPPOINT)Alloc(sizeof(POINT)*(alloc+EntriesAllocated));
		if (!lpNewMem)
			return(FALSE);
		if (lpPoints)
		{
			copy((LPTR)lpPoints, (LPTR)lpNewMem, sizeof(POINT)*EntriesUsed);
			FreeUp(lpPoints);
		}
	}
	lpPoints = lpNewMem;
	EntriesAllocated += alloc;
	return(TRUE);
}
Esempio n. 11
0
//**************************************************************************
//**************************************************************************
//	Reads the thumb from a 3.1 thumbnail (if available) for the file.
//	lpThumbDir is where 3.1 dbf's and thumbs are.
//	Note: this thumbnail can not be modified
// 	Call CTHMClose when done with the thumbnail. 
//**************************************************************************
LPCTHMNAIL	CReadOldThumb(LPTSTR lpFileName, LPTSTR lpThumbDir)
//**************************************************************************
{
	LPCTHMNAIL lpCThm;
	FILELOC File;
	
	// try cache
	lstrcpy(File.szFile, lpFileName);
	CLEARVOLUME(File.volume);
	lpCThm = cthm_get_cached(&File, YES);
	if (!lpCThm)
	{
		if (!(lpCThm = cthm_new()))
			return(NULL);
		if(!ReadOldThumb(&lpCThm->thm, lpFileName, lpThumbDir))
		{
			FreeUp((LPTR)lpCThm);
			return(NULL);			
		}
		lpCThm->thm.Thumb = File;
		cthm_cache(lpCThm);
	}
	lpCThm->iOut++;
	return(lpCThm);
}
Esempio n. 12
0
//************************************************************************
PDIB CDib::GetDib(BOOL fDecodeRLE)
//************************************************************************
{
	if ((GetCompression() == BI_RLE8) && fDecodeRLE)
	{	
		DWORD dwSize = (long)GetWidthBytes() * (long)abs(GetHeight());
		LPTR lp = AllocX(dwSize, GMEM_ZEROINIT );
		if (!lp)
			return(NULL);
		PDIB pDib = new CDib(this, lp, FALSE);
		if (!pDib)
		{
			FreeUp(lp);
			return(NULL);
		}
		DecodeRLE(lp);
		pDib->SetCompression(BI_RGB);
		pDib->SetSizeImage(dwSize);
		return(pDib);
	}
	else
	{
		AddRef();
		return(this);
	}
}
Esempio n. 13
0
BOOL ReadMacro(HPTR hpBuf, LPLIST lpMacroList, BOOL fReadFirstPacketOnly)
/***********************************************************************/
{
LPTSTR lpCommand;
MACRO_FILE_HANDLE fh;
LPCMDPKT lpCmdPkt;
BOOL fError;

// zero out the list
ListInit(lpMacroList);

// Allocate a buffer to read the commands into
if (!(lpCommand = (LPTSTR)Alloc(MAX_CMD_LEN)))
	{
	Message(IDS_EMEMALLOC);
	return(FALSE);
	}
while (lpCmdPkt = ReadPacket(&hpBuf, lpCommand, &fError))
	{
	ListAddTail(lpMacroList, lpCmdPkt);
	if (fReadFirstPacketOnly)
		break;
	}
FreeUp(lpCommand);
if (fError)
	{
	DestroyPacketList(lpMacroList);
	return(FALSE);
	}
return(TRUE);
}
Esempio n. 14
0
//************************************************************************
//	Lut_SetLut
//
//	PARAMETERS:
//				LPTR lpLut - lookup table to draw.
//				LPRGB lpRGB - pointer to color to draw lookup table with.
//	DESCRIPTION: 
//			Sets the above parameters and redraws the control.
//	RETURNS: 
//		   	FALSE if too many adds. 
//************************************************************************
BOOL Lut_SetLut(HWND hWindow, int nLuts, LPTR lpLut)
//************************************************************************
{
	LPLUTCTL lpdata;
	
	if (!(lpdata = GET_LPLUTCTL(hWindow)))
		return(FALSE);

	if (lpdata->lpLut)
	{
		FreeUp(lpdata->lpLut);
		lpdata->lpLut = NULL;
		lpdata->nLuts = 0;
	}
	if (nLuts && lpLut)
	{
		lpdata->nLuts = nLuts;
		lpdata->lpLut = Alloc(256L*lpdata->nLuts);
		if (!lpdata->lpLut)
		{
			lpdata->nLuts = 0;
			return(FALSE);
		}
		copy(lpLut, lpdata->lpLut, 256*lpdata->nLuts);
	}

    InvalidateRect (hWindow, NULL, FALSE);
	return(TRUE);
}
Esempio n. 15
0
static BOOL PasteBitmap(
/************************************************************************/
HWND	hWindow,
LPSTR	lpImageFile,
LPSTR	lpMaskFile)
{
BOOL bRet;
HBITMAP hBitmap;
HPALETTE hPal;
LPBITMAPINFOHEADER lpDIB;

if ( !OpenClipboard( hWindow ) )
	return( FALSE );

if ( !(hPal = (HPALETTE)GetClipboardData(CF_PALETTE)) )
	hPal = lpBltScreen->hPal;
if ( !(hBitmap = (HBITMAP)GetClipboardData(CF_BITMAP)) )
	{
	CloseClipboard();
	return( NO );
	}

if ( !(lpDIB = BitmapToDIB( NULL/*hDC*/, hBitmap, hPal )) )
	{
	CloseClipboard();
	return( NO );
	}

bRet = WriteDIBClip( lpDIB, lpImageFile, lpMaskFile );
FreeUp( (LPTR)lpDIB );
CloseClipboard();
return( bRet );
}
Esempio n. 16
0
LOCAL int CountType(LPTSTR lpFileName, COMMAND_TYPE Type)
/***********************************************************************/
{
LPVOID lpParms;
LPTSTR lpCommand;
int i;
int nType = 0;
MACRO_FILE_HANDLE fh;
FNAME       OEMName;

if (!(lpCommand = (LPTSTR)Alloc(MAX_CMD_LEN)))
	{
	Message(IDS_EMEMALLOC);
	return(-1);
	}

#ifdef BUFFERED_IO
AnsiToOem(lpFileName, OEMName);
fh = fopen(OEMName, _T("rb"));
if (fh == NULL)
#else
fh = FileOpen(lpFileName, FO_READ);
if (fh == MACRO_FILE_HANDLE_INVALID)
#endif
	{
	FreeUp((LPTR)lpCommand);
	Message(IDS_EOPEN, lpFileName);
	return(-1);
	}
while (ReadLine(fh, lpCommand, MAX_CMD_LEN))
	{
	i = ReadParms(fh, lpCommand, &lpParms);
	if (i < 0)
		continue;
	if (GetCommandType(GetCommandId(i)) == Type)
		++nType;
	if (lpParms)
		FreeUpParms(GetCommandId(i), lpParms);
	}
#ifdef BUFFERED_IO
fclose(fh);
#else
FileClose(fh);
#endif
FreeUp((LPTR)lpCommand);
return(nType);
}
Esempio n. 17
0
// This frees our instance structure, and everything within the structure.
//***************************************************************************
static long AVIDrawClose(PINSTINFO pi)
//***************************************************************************
{
	if (pi->hdd)
		DrawDibClose(pi->hdd);
	FreeUp((LPTR)pi);
	return ICERR_OK;
}
Esempio n. 18
0
CPuzzle::~CPuzzle()
/***********************************************************************/
{
	if (m_pDib)
		delete m_pDib;
	if (m_lpSwitches)
		FreeUp(m_lpSwitches);
}
Esempio n. 19
0
void Dialog_OnDestroy(HWND hDlg)
/***************************************************************************/
{
	LPTR lptr;
	
	lptr = (LPTR)GetWindowLong(hDlg, DWL_USER);
	if (lptr)
		FreeUp(lptr);
}			  
Esempio n. 20
0
//************************************************************************
CDib::~CDib()
//************************************************************************
{
	--m_iRefCount;
	if (m_iRefCount > 0)
		Print("%d references still exist for object %lx", m_iRefCount, (long)this);
	if (m_lp)
		FreeUp(m_lp);
}
Esempio n. 21
0
BOOL ReadMacro(LPTSTR lpFileName, LPLIST lpMacroList, BOOL fReadFirstPacketOnly)
/***********************************************************************/
{
LPTSTR lpCommand;
MACRO_FILE_HANDLE fh;
LPCMDPKT lpCmdPkt;
BOOL fError;
FNAME OEMName;

// zero out the list
ListInit(lpMacroList);

// Open the macro file
#ifdef BUFFERED_IO
AnsiToOem(lpFileName, OEMName);
fh = fopen(OEMName, _T("rb"));
if (fh == NULL)
#else
fh = FileOpen(lpFileName, FO_READ);
if (fh == MACRO_FILE_HANDLE_INVALID)
#endif
	{
	Message(IDS_EOPEN, lpFileName);
	return(FALSE);
	}
// Allocate a buffer to read the commands into
if (!(lpCommand = (LPTSTR)Alloc(MAX_CMD_LEN)))
	{
#ifdef BUFFERED_IO
	fclose(fh);
#else
	FileClose(fh);
#endif
	Message(IDS_EMEMALLOC);
	return(FALSE);
	}
AstralCursor(IDC_WAIT);
while (lpCmdPkt = ReadPacket(fh, lpCommand, &fError))
	{
	ListAddTail(lpMacroList, lpCmdPkt);
	if (fReadFirstPacketOnly)
		break;
	}
AstralCursor(NULL);
FreeUp(lpCommand);
#ifdef BUFFERED_IO
fclose(fh);
#else
FileClose(fh);
#endif
if (fError)
	{
	DestroyPacketList(lpMacroList);
	return(FALSE);
	}
return(TRUE);
}
Esempio n. 22
0
BOOL PosterizeImage(LPIMAGE lpImage, LPPOSTERIZE_PARMS lpParms)
/************************************************************************/
{
	LPMAPS lpMaps;
	RECT rUpdate;
	UPDATE_TYPE UpdateType;

   FRMDATATYPE type;
	ImgGetInfo(lpImage, NULL, NULL, NULL, &type);
	if (type == FDT_LINEART)
		return(FALSE);
   else if (type == FDT_PALETTECOLOR && ImgGetMask(lpImage))
		return(FALSE);
	if (!(lpMaps = (LPMAPS)Alloc((long)sizeof(MAPS))))
	{
		lpParms->Common.StatusCode = SC_MEMERROR;
		Message(IDS_EMEMALLOC);
		return(FALSE);
	}

	ProgressBegin(1, lpParms->Common.idDirty-IDS_UNDOFIRST+IDS_PROGFIRST);

	ResetMap( &lpMaps->MasterMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->RedMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->GreenMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->BlueMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->BlackMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->HueMap,    MAXPOINTS, NO );
	ResetMap( &lpMaps->SatMap,    MAXPOINTS, NO );

	lpMaps->MasterMap.Levels = lpParms->MasterInfo.Levels;
	lpMaps->MasterMap.Threshold = lpParms->MasterInfo.Threshold;
	lpMaps->RedMap.Levels = lpParms->RedInfo.Levels;
	lpMaps->RedMap.Threshold = lpParms->RedInfo.Threshold;
	lpMaps->GreenMap.Levels = lpParms->GreenInfo.Levels;
	lpMaps->GreenMap.Threshold = lpParms->GreenInfo.Threshold;
	lpMaps->BlueMap.Levels = lpParms->BlueInfo.Levels;
	lpMaps->BlueMap.Threshold = lpParms->BlueInfo.Threshold;
	lpMaps->BlackMap.Levels = lpParms->BlackInfo.Levels;
	lpMaps->BlackMap.Threshold = lpParms->BlackInfo.Threshold;

	MakeMap(&lpMaps->MasterMap);
	MakeMap(&lpMaps->RedMap);
	MakeMap(&lpMaps->GreenMap);
	MakeMap(&lpMaps->BlueMap);
	MakeMap(&lpMaps->BlackMap);

	lpParms->Common.StatusCode = ApplyMaps(lpImage, lpMaps, lpParms->Common.idDirty, &rUpdate, &UpdateType);
	if (UpdateType)
	{
		lpParms->Common.UpdateType = UpdateType;
		lpParms->Common.rUpdateArea = rUpdate;
	}
	FreeUp(lpMaps);
	ProgressEnd();
	return(lpParms->Common.StatusCode == SC_SUCCESS);
}
Esempio n. 23
0
BOOL RecordMacro(LPTSTR lpFileName)
/***********************************************************************/
{
STRING szString, szAppName;
FNAME  OEMName;

lpMacroFormat = (LPTSTR)Alloc(MAX_CMD_LEN);
lpMacroString = (LPTSTR)Alloc(MAX_CMD_LEN);
if (!lpMacroString || !lpMacroFormat)
	{
	Message(IDS_EMEMALLOC);
	if (lpMacroFormat)
		FreeUp(lpMacroFormat);
	if (lpMacroString)
		FreeUp(lpMacroString);
	return(FALSE);
	}
#ifdef BUFFERED_IO
AnsiToOem(lpFileName, OEMName);
MacroFileHandle = fopen(OEMName, _T("w+b"));
if (MacroFileHandle == NULL)
#else
MacroFileHandle = FileOpen(lpFileName, FO_CREATE|FO_WRITE);
if (MacroFileHandle == MACRO_FILE_HANDLE_INVALID)
#endif
	{
	FreeUp(lpMacroFormat);
	FreeUp(lpMacroString);
	return(FALSE);
	}
lstrcpy(szMacroFileName, lpFileName);

if ( AstralStrEx( IDS_APPNAME, szAppName, sizeof(szAppName) ) )
	{
	if ( AstralStrEx( IDS_MACRORECORD, szString, sizeof(szString) ) )
		{
		lstrcat( szAppName, szString );
		SetWindowText( PictPubApp.Get_hWndAstral(), szAppName );
		}
	}
Control.UntitledNo = 0;
MacroMode = MM_RECORD;
return(TRUE);
}
Esempio n. 24
0
/*
  Foo - clean up before return from rasterizer
*/
static int
Foo(int code)				/* returns status code */
{
    if ( debug ) fprintf(stderr, "Foo(%d)\n", code);
    fb_close( fbp );		/* release framebuffer */

    FreeUp();			/* deallocate descriptors */

    return code;
}
Esempio n. 25
0
static void FreeCracks( LPCRACK lpCrack )
/***********************************************************************/
{
	while ( lpCrack )
	{
		LPCRACK lpNextCrack = lpCrack->lpNext;
		FreeUp( (LPTR)lpCrack );
		lpCrack = lpNextCrack;
	}
}
Esempio n. 26
0
//**************************************************************************
//	Closes a thumnail and purges from cache (if not in use).
//	Destroys frame if any and frees all memory associated with the cthmnail.
//**************************************************************************
void		CTHMPurge(LPCTHMNAIL lpCThm)
//**************************************************************************
{
	lpCThm->iOut--;
	if (lpCThm->iOut > 0)
		return;
	cthm_decache(lpCThm);
	THMClose(&lpCThm->thm);
	FreeUp((LPTR)lpCThm);
}
Esempio n. 27
0
void ImgColorMapChanged(LPIMAGE lpImage)
/***********************************************************************/
{
// free up display info that is based on colormap
if (lpImage->lpPaletteLUT)
    {
    FreeUp(lpImage->lpPaletteLUT);
    lpImage->lpPaletteLUT = NULL;
    }
}
Esempio n. 28
0
LOCAL void ZoomBox_OnDestroy(HWND hWnd)
/***********************************************************************/
{
LPDISPLAY lpMyDisplay;

if (lpMyDisplay = (LPDISPLAY)GetDisplayPtr(hWnd) )
	FreeUp((LPTR)lpMyDisplay);
hZoomWindow = NULL;
if (Tool.hRibbon)
	SendMessage( Tool.hRibbon, WM_DOCACTIVATED, 0, 1L );
}
Esempio n. 29
0
LOCAL  void PalPicker_Draw( HWND hWindow, HDC hDC )
/***********************************************************************/
{
RECT ClientRect, rPatch;
LPCOLORMAP lpColorMap;
LPTR lpData;
FRMTYPEINFO TypeInfo;
int iWidth, iHeight, c, r, n;
BYTE value;

lpColorMap = PalPicker_GetColorMap(hWindow);
if (lpColorMap)
	n = lpColorMap->NumEntries;
else
	n = 256;

// fill background with white
GetClientRect(hWindow, &ClientRect);
FillRect( hDC, &ClientRect, (HBRUSH)GetStockObject(WHITE_BRUSH) );

// frame the picker
FrameRect(hDC, &ClientRect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
InflateRect(&ClientRect, -3, -3);

WindowsToAstralRect(&ClientRect);

iWidth = RectWidth(&ClientRect);
iHeight = RectHeight(&ClientRect);

lpData = Alloc((long)iWidth);
if (!lpData)
	return;

if (lpColorMap)
	FrameSetTypeInfo(&TypeInfo, FDT_PALETTECOLOR, lpColorMap);
else
	FrameSetTypeInfo(&TypeInfo, FDT_GRAYSCALE, NULL);

value = 0;
for (r = 0; r < 16; ++r)
	{
	for (c = 0; c < 16; ++c)
		{
		PalPicker_GetRect(hWindow, r, c, &rPatch);
		PalPicker_DrawPatch(hDC, &rPatch, value, TypeInfo, lpData);
		++value;
		if (value >= n)
			break;
		}
	if (value >= n)
		break;
	}
FreeUp(lpData);
}
Esempio n. 30
0
LOCAL void ListBox_OnDestroy(HWND hWindow)
/***********************************************************************/
{
// get the listbox data pointer
LPLISTBOXDATA lpData = ListBox_GetData(hWindow);
if (lpData)
	{
	if (lpData->hCursor)
		DestroyCursor(lpData->hCursor);
	FreeUp(lpData);
	}
}