예제 #1
0
void SaveObject( void )
{
    /* remember the previous object */
    OBJPTR  currobj;

    currobj = GetEditCurrObject();
    if( currobj != NULL ) {
        State->prevobject = GetObjptr( currobj );
    }
}
예제 #2
0
static bool CurrObjExist( OBJPTR findobj )
/****************************************/
{
    OBJPTR      currobj;

    for( currobj = GetEditCurrObject(); currobj != NULL; currobj = GetNextEditCurrObject( currobj ) ) {
        if( currobj == findobj ) {
            return( true );
        }
    }
    return( false );
}
예제 #3
0
OBJPTR GetCurrObjptr( OBJPTR obj )
/********************************/
{
    OBJPTR      currobj;

    for( currobj = GetEditCurrObject(); currobj != NULL; currobj = GetNextEditCurrObject( currobj ) ) {
        if( GetObjptr( currobj ) == obj ) {
            return( currobj );
        }
    }
    return( NULL );
}
예제 #4
0
bool FMEDITAPI ExecuteCurrObject( ACTION_ID id, void *p1, void *p2 )
/******************************************************************/
{
    /* Perform action id on each of the objects in the current object list.
     * Always ensure that each object about to have the action performed
     * on it is still valid.  Remember that the action can be destroy,
     * which will make that object no longer in the current object list,
     * and can also affect other objects in that list (ie it's children).
     */
    OBJPTR      currobj;
    OBJPTR      nextobj;

    for( currobj = GetEditCurrObject(); currobj != NULL; currobj = nextobj ) {
        nextobj = GetNextEditCurrObject( currobj );
        if( nextobj == NULL && !CurrObjExist( currobj ) ) {
            currobj = GetEditCurrObject();
            nextobj = GetNextEditCurrObject( currobj );
        }
        if( GetEditCurrObject() != NULL ) {
            Forward( currobj, id, p1, p2 );
        }
    }
    return( true );
}
예제 #5
0
LIST *FMEDITAPI GetCurrObjectList( void )
/***************************************/
{
    /* return pointer to the current object */
    OBJPTR      currobj;
    OBJPTR      userobj;
    LIST        *objlist;

    objlist = NULL;
    for( currobj = GetEditCurrObject(); currobj != NULL; currobj = GetNextEditCurrObject( currobj ) ) {
        userobj = NULL;
        OBJ_DISPATCHER( currobj )( GET_OBJPTR, currobj, &userobj, NULL );
        if( userobj != NULL ) {
            ListAddElt( &objlist, userobj );
        }
    }
    return( objlist );
}
예제 #6
0
void FMEDITAPI ResetCurrObject( bool draw )
/*****************************************/
{
    /* reset the current object */
    OBJPTR      currobj;
    OBJPTR      nextobj;

    for( currobj = GetEditCurrObject(); currobj != NULL; currobj = nextobj ) {
        nextobj = GetNextEditCurrObject( currobj );
        if( draw ) {
            if( GetObjptr( currobj ) != GetMainObject() ) {
                ObjMark( currobj );
            }
        }
        DeleteCurrObject( currobj );
    }
    if( draw ) {
        UpdateWindow( GetAppWnd() );
    }
}