Пример #1
0
/*
 * setTheCursor - set the cursor to be appropriate for the given window
 */
static void setTheCursor( int cursor_index, HWND hwnd )
{
#ifndef __OS2_PM__
    img_node    *node;

    if( hwnd != NULL ) {
        SET_CLASSCURSOR( hwnd, hCursor[cursorIndex] );
        return;
    }

    cursorIndex = cursor_index;
    node = GetHeadNode();
    if( node == NULL ) {
        return;
    }

    while( node != NULL ) {
        SET_CLASSCURSOR( node->hwnd, hCursor[cursorIndex] );
        node = node->next;
    }
#else
    hwnd = hwnd;
    cursorIndex = cursor_index;
#endif

} /* setTheCursor */
Пример #2
0
/*
 * CloseAllImages - used in the close all menu option
 */
void CloseAllImages( void )
{
    img_node    *head;
    img_node    *current;
    WPI_PARAM1  p1;
    HWND        parent;

    head = GetHeadNode();
    if( !head ) {
        PrintHintTextByID( WIE_NOIMAGESTOCLOSE, NULL );
        return;
    }

    current = head;
    while( current ) {
        if( !(current->issaved) ) {
            p1 = WPI_MAKEP1( current->hwnd, 0 );
            parent = _wpi_getparent( current->hwnd );
#ifdef __OS2_PM__
            _wpi_sendmessage(parent, WM_ACTIVATE, (WPI_PARAM1)p1, 0L);
#else
            _wpi_sendmessage( parent, WM_MDIRESTORE, (WPI_PARAM1)p1, 0L );
            _wpi_sendmessage(ClientWindow, WM_MDIACTIVATE, (WPI_PARAM1)p1, 0L);
#endif

            if( !(lastChanceSave(current)) ) {
                return;
            }
        }
        current = current->next;
    }

    DeleteActiveImage();
    while( head ) {
        closeTheImage( head );
        head = GetHeadNode();
    }

    ClearImageText();
    GrayEditOptions();
    PrintHintTextByID( WIE_ALLIMAGESCLOSED, NULL );
    _wpi_setwindowtext( _wpi_getframe(HMainWindow), IEAppTitle );
} /* CloseAllImages */
Пример #3
0
void WZQueue::DeleteAllNodes()
{
	ListNode*	pNode = NULL;

	EnterCriticalSection(&m_CriticalSection);
	// DO NOT DELETE Object that pointed by pObject!!!!
	while(pNode = GetHeadNode())
	{
		HeapFree(GetProcessHeap(), 0, pNode);
	}
	LeaveCriticalSection(&m_CriticalSection);
}
Пример #4
0
/*
 * SaveAllImages - save all currently open images
 */
void SaveAllImages( void )
{
    img_node    *head;
    img_node    *current;

    head = GetHeadNode();
    if( head == NULL ) {
        return;
    }

    for( current = head; current != NULL; current = current->next ) {
        if( !current->issaved ) {
            SaveFileFromNode( current, SB_SAVE );
        }
    }

} /* SaveAllImages */
Пример #5
0
/*
 * SaveAllImages -
 */
void SaveAllImages( void )
{
    img_node    *head;
    img_node    *current;

    head = GetHeadNode();
    if( !head ) {
        return;
    }

    current = head;
    while( current ) {
        if( !(current->issaved) ) {
            SaveFileFromNode( current, SB_SAVE );
        }
        current = current->next;
    }

} /* SaveAllImages */
Пример #6
0
BOOL WZQueue::GetFromQueue(BYTE* pObject, unsigned int * pSize, BYTE * headcode, int * uindex)
{
	ListNode*	pNode = NULL;
	//ASSERT( pObject );
	
	EnterCriticalSection(&m_CriticalSection);
	pNode = GetHeadNode();
	if(pNode)
	{
		
		memcpy(pObject, pNode->pObject, pNode->nSize);
		*pSize = pNode->nSize;
		*headcode =pNode->headcode;
		*uindex = pNode->uindex;
		
		HeapFree(GetProcessHeap(), 0, pNode->pObject);
		HeapFree(GetProcessHeap(), 0, pNode);
		LeaveCriticalSection(&m_CriticalSection);
		return TRUE;
	}

	LeaveCriticalSection(&m_CriticalSection);
	return FALSE;
}