Пример #1
0
void TypeConf( void )
/*******************/
{
    type_display *curr;
    type_display *fcurr;

    StrCopy( " {", StrCopy( NameBuff, TxtBuff ) );
    DUIDlgTxt( TxtBuff );
    for( curr = TypeDisplay; curr != NULL; curr = curr->next ) {
        if( !curr->dirty ) continue;
        Attributes( curr,
                    StrCopy( " { ",
                    StrCopy( curr->name,
                    StrCopy( " ",
                    GetCmdEntry( TypeSettings, TY_STRUCT,
                    StrCopy( "  ", TxtBuff ) ) ) ) ) );
        DUIDlgTxt( TxtBuff );
        for( fcurr = curr->fields; fcurr != NULL; fcurr = fcurr->next ) {
            if( !fcurr->dirty ) continue;
            StrCopy( "}",
            Attributes( fcurr,
            StrCopy( " { ",
            StrCopy( fcurr->name,
            StrCopy( " ",
            GetCmdEntry( TypeSettings, TY_FIELD,
            StrCopy( "   ", TxtBuff ) ) ) ) ) ) );
            DUIDlgTxt( TxtBuff );
        }
        DUIDlgTxt( "  }" );
    }
    DUIDlgTxt( "}" );
}
Пример #2
0
static  void    PrintPosition( disp_optn optn, wnd_class_wv wndclass,
                               gui_rect *rect, char *buff, char *buff2 )
{
    GetCmdEntry( WndNameTab, wndclass, buff );
    GetCmdEntry( DispOptions, optn, buff2 );
    Format( TxtBuff, "%s %s /%s %d,%d,%d,%d", GetCmdName( CMD_DISPLAY ), buff, buff2,
                     rect->x, rect->y, rect->width, rect->height );
    WndDlgTxt( TxtBuff );
}
Пример #3
0
void GetBreakOnImageCmd( const char *name, char *buff, bool clear )
{
    char        *p;

    p = Format( buff, "%s", GetCmdName( CMD_BREAK ) );
    *p++ = '/';
    p = GetCmdEntry( PointNameTab, B_IMAGE, p );
    if( clear ) {
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, B_CLEAR, p );
    }
    *p++ = ' ';
    p = StrCopy( name, p );
}
Пример #4
0
static void GetColourName( gui_colour colour, char *buff )
{
    colour_bits bits = 0;
    int         i;
    char        *p;

    for( i = 0; i < ArraySize( ColourMap ); ++i ) {
        if( ColourMap[i].colour == colour ) {
            bits = ColourMap[i].bits;
            break;
        }
    }
    p = buff;
    if( bits & CLR_BRIGHT ) {
        p = StrCopy( "bright ", p );
        bits &= ~CLR_BRIGHT;
    }
    for( i = 0;; ++i ) {
        if( bits & 1 ) {
            p = GetCmdEntry( ColourNameTab, i, p );
            break;
        }
        bits >>= 1;
    }
    *p = '\0';
}
Пример #5
0
char *GetCmdName( wd_cmd cmd )
{
    static char buff[MAX_CMD_NAME + 1];

    GetCmdEntry( CmdNameTab, (int)cmd, buff );
    return( buff );
}
Пример #6
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( &OnOffNameTab, _IsOn( SW_FLIP ) ? 1 : 2, p );
    DUIDlgTxt( TxtBuff );
}
Пример #7
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( "ON\0OFf\0", _IsOff( SW_FLIP ), p );
    DUIDlgTxt( TxtBuff );
}
Пример #8
0
static void PrintFont( wnd_class_wv wndclass, char *def )
{
    char        wndname[20];
    char        *font;

    font = WndFontInfo[wndclass];
    if( font == NULL )
        return;
    if( def == NULL || strcmp( font, def ) != 0 ) {
        GetCmdEntry( WndNameTab, wndclass, wndname );
        Format( TxtBuff, "%s %s {%s}", GetCmdName( CMD_FONT ), wndname, font );
        WndDlgTxt( TxtBuff );
    }
}
Пример #9
0
static void PrintColours( wnd_class wndcls, gui_colour_set *set, gui_colour_set *def )
{
    char        wndname[20];
    char        attr[30];
    char        fore[20];
    char        back[20];
    int         i;
    wnd_class   wndcls1;

    GetCmdEntry( WndNameTab, wndcls, wndname );
    for( i = 0; i < ArraySize( AttrMap ); ++i ) {
        wndcls1 = AttrMap[i].attr;
        if( def == NULL || memcmp( &set[wndcls1], &def[wndcls1], sizeof( *set ) ) != 0 ) {
            GetAttrName( AttrMap, i, attr );
            GetColourName( set[wndcls1].fore, fore );
            GetColourName( set[wndcls1].back, back );
            Format( TxtBuff, "%s %s %s %s on %s", GetCmdName( CMD_PAINT ), wndname, attr, fore, back );
            WndDlgTxt( TxtBuff );
        }
    }
}
Пример #10
0
static void GetAttrName( attr_map *map, int i, char *buff )
{
    attr_bits   bits;
    bool        blank;
    char        *p;

    bits = map[i].bits;
    p = buff;
    for( i = 0;; ++i ) {
        if( bits & 1 ) {
            p = GetCmdEntry( AttrNameTab, i, p );
            blank = TRUE;
        } else {
            blank = FALSE;
        }
        bits >>= 1;
        if( bits == 0 ) break;
        if( blank ) {
            *p++ = ' ';
        }
    }
    *p = '\0';
}
Пример #11
0
void ShowSwitch( bool on )
{
    GetCmdEntry( "ON\0OFf\0", on ? 0 : 1, TxtBuff );
    ConfigLine( TxtBuff );
}
Пример #12
0
void ConfigDisp( void )
{

    a_window        *wnd, *scan;
    char            buff[20];
    char            buff2[20];
    a_window        *head, *next;
    int             h;
    wnd_class_wv    wndclass;
    gui_rect        rect;

    ReqEOC();
    GetCmdEntry( WndNameTab, WND_ALL, buff );
    GetCmdEntry( DispOptions, CLOSE, buff2 );
    Format( TxtBuff, "%s %s /%s", GetCmdName( CMD_DISPLAY ), buff, buff2 );
    WndDlgTxt( TxtBuff );
    if( WndHaveStatusWindow() ) {
        GetCmdEntry( MiscTab, MISC_STATUS, buff );
        Format( TxtBuff, "%s %s", GetCmdName( CMD_DISPLAY ), buff );
        WndDlgTxt( TxtBuff );
    }
    if( WndHaveToolBar() ) {
        h = WndToolHeight();
        GetCmdEntry( MiscTab, MISC_TOOL, buff );
        GetCmdEntry( DispOptions, WndToolFixed() ? FIXED : FLOATING, buff2 );
        Format( TxtBuff, "%s %s /%s %d", GetCmdName( CMD_DISPLAY ),
                buff, buff2, h );
        WndDlgTxt( TxtBuff );
    }
    for( wndclass = 0; wndclass < WND_NUM_CLASSES; ++wndclass ) {
        if( wndclass == WND_ALL )
            continue;
        if( WndFindClass( NULL, wndclass ) != NULL )
            continue;
        WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
        if( rect.width == 0 )
            continue;
        if( rect.height == 0 )
            continue;
        PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
    }
    head = WndNext( NULL );
    if( head == NULL )
        return;
    // traverse in reverse order so that windows get created in correct order
    for( wnd = head; (next = WndNext( wnd )) != NULL; wnd = next )
        ;
    for( ;; ) {
        if( WndHasClass( wnd ) ) {
            wndclass = WndClass( wnd );
            switch( wndclass ) {
            case WND_ALL:
                break;
            case WND_BINARY:
            case WND_FILE:
            case WND_MEMORY:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
                break;
            case WND_VARIABLE:
            case WND_TMPFILE:
                break;
            default:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( OPEN, wndclass, &rect, buff, buff2 );
                break;
            }
        }
        if( wnd == head )
            break;
        for( scan = head; (next = WndNext( scan )) != wnd; scan = next )
            ;
        wnd = scan;
    }
}
Пример #13
0
char *Attributes( type_display *curr, char *p )
{
    type_display        *alias;

    if( curr->is_struct ) {
        // On load some our fields are set to the alias' fields
        // but we don't want to override that, so this must come FIRST
        for( alias = curr->alias; alias != curr; alias = alias->alias ) {
            if( !alias->is_field && alias->is_struct ) {
                p = GetCmdEntry( TypeSettings, TY_ISSTRUCT, p );
                p = StrCopy( " ", p );
                p = StrCopy( alias->name, p );
                p = StrCopy( " ", p );
                break;
            }
        }
    }
    if( curr->on_top ) {
        p = GetCmdEntry( TypeSettings, TY_ONTOP, p );
        p = StrCopy( " ", p );
    }
    if( curr->has_top ) {
        p = GetCmdEntry( TypeSettings, TY_HASTOP, p );
        p = StrCopy( " ", p );
    }
    if( curr->autoexpand ) {
        p = GetCmdEntry( TypeSettings, TY_AUTOEXPAND, p );
        p = StrCopy( " ", p );
    }
    if( curr->display & VARDISP_HEX ) {
        p = GetCmdEntry( TypeSettings, TY_HEX, p );
        p = StrCopy( " ", p );
    }
    if( curr->display & VARDISP_DECIMAL ) {
        p = GetCmdEntry( TypeSettings, TY_DECIMAL, p );
        p = StrCopy( " ", p );
    }
    if( curr->display & VARDISP_CHARACTER ) {
        p = GetCmdEntry( TypeSettings, TY_CHARACTER, p );
        p = StrCopy( " ", p );
    }
    if( curr->display & VARDISP_STRING ) {
        p = GetCmdEntry( TypeSettings, TY_STRING, p );
        p = StrCopy( " ", p );
    }
    if( curr->display & VARDISP_POINTER ) {
        p = GetCmdEntry( TypeSettings, TY_POINTER, p );
        p = StrCopy( " ", p );
    }
#ifdef I_EVER_SOLVE_THIS_THORNY_HIDE_PROBLEM
    if( curr->display & VARDISP_HIDE ) {
        p = GetCmdEntry( TypeSettings, TY_HIDE, p );
        p = StrCopy( " ", p );
    }
#endif
    if( VarDisplayIsHidden( NULL, VARNODE_CODE ) !=
      ( ( ( curr->hide & VARNODE_CODE ) != 0 ) ) ) {
        if( curr->hide & VARNODE_CODE ) {
            p = GetCmdEntry( TypeSettings, TY_NOCODE, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_CODE, p );
        }
        p = StrCopy( " ", p );
    }
    if( VarDisplayIsHidden( NULL, VARNODE_INHERIT ) !=
      ( ( ( curr->hide & VARNODE_INHERIT ) != 0 ) ) ) {
        if( curr->hide & VARNODE_INHERIT ) {
            p = GetCmdEntry( TypeSettings, TY_NOINHERIT, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_INHERIT, p );
        }
        p = StrCopy( " ", p );
    }
    if( VarDisplayIsHidden( NULL, VARNODE_COMPILER ) !=
      ( ( ( curr->hide & VARNODE_COMPILER ) != 0 ) ) ) {
        if( curr->hide & VARNODE_COMPILER ) {
            p = GetCmdEntry( TypeSettings, TY_NOCOMPILER, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_COMPILER, p );
        }
        p = StrCopy( " ", p );
    }
    if( VarDisplayIsHidden( NULL, VARNODE_PRIVATE ) !=
      ( ( ( curr->hide & VARNODE_PRIVATE ) != 0 ) ) ) {
        if( curr->hide & VARNODE_PRIVATE ) {
            p = GetCmdEntry( TypeSettings, TY_NOPRIVATE, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_PRIVATE, p );
        }
        p = StrCopy( " ", p );
    }
    if( VarDisplayIsHidden( NULL, VARNODE_PROTECTED ) !=
      ( ( ( curr->hide & VARNODE_PROTECTED ) != 0 ) ) ) {
        if( curr->hide & VARNODE_PROTECTED ) {
            p = GetCmdEntry( TypeSettings, TY_NOPROTECTED, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_PROTECTED, p );
        }
        p = StrCopy( " ", p );
    }
    if( VarDisplayIsHidden( NULL, VARNODE_STATIC ) !=
      ( ( ( curr->hide & VARNODE_STATIC ) != 0 ) ) ) {
        if( curr->hide & VARNODE_STATIC ) {
            p = GetCmdEntry( TypeSettings, TY_NOSTATIC, p );
        } else {
            p = GetCmdEntry( TypeSettings, TY_STATIC, p );
        }
        p = StrCopy( " ", p );
    }
    return( p );
}
Пример #14
0
static char *GetBPCmd( brkp *bp, brk_event event, char *buff, unsigned buff_len )
{
    char        *cmds;
    char        *cond;
    char        *p;
    char        *end = buff + buff_len ;

    cmds = cond = LIT_ENG( Empty );
    if( bp != NULL ) {
        if( bp->cmds != NULL ) cmds = bp->cmds->buff;
        if( bp->condition != NULL ) cond = bp->condition;
    }
    p = Format( buff, "%s", GetCmdName( CMD_BREAK ) );
    switch( event ) {
    case B_SET:
        *p++ = '/';
        if( IS_BP_EXECUTE( bp->th ) ) {
            p = GetCmdEntry( PointNameTab, B_SET, p );
        } else {
            p += GetMADTypeNameForCmd( bp->th, p, end - p );
            *p++ = ' ';
        }
        if( bp->status.b.resume ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_RESUME, p );
        }
        if( !bp->status.b.active ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_DEACTIVATE, p );
        }
        *p++ = ' ';
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, B_INDEX, p );
        p = Format( p, " %d, ", bp->index );
        if( bp->loc.image_name != NULL ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_UNMAPPED, p );
            *p++ = ' ';
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_MAPADDRESS, p );
            *p++ = ' ';
            p = StrCopy( bp->loc.image_name, p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->loc.addr.mach.segment, p, end - p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->loc.addr.mach.offset, p, end - p );
            *p++ = ',';
        } else if( bp->image_name != NULL && bp->mod_name != NULL ) {
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_UNMAPPED, p );
            *p++ = ' ';
            *p++ = '/';
            p = GetCmdEntry( PointNameTab, B_SYMADDRESS, p );
            *p++ = ' ';
            p = StrCopy( bp->image_name, p );
            *p++ = ' ';
            p = StrCopy( bp->mod_name, p );
            *p++ = ' ';
            p = StrCopy( bp->sym_name, p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->cue_diff, p, end - p );
            *p++ = ' ';
            p = AddHexSpec( p );
            p = CnvULongHex( bp->addr_diff, p, end - p );
            *p++ = ',';
        } else {
            p = AddrToString( &bp->loc.addr, MAF_FULL, p, end - p );
//          p = Format( p, " %A", bp->loc.addr );
        }
        p = Format( p, " {%s} {%s}", cmds, cond );
        if( bp->initial_countdown != 0 ) {
            p = StrCopy( " ", p );
            p = AddHexSpec( p );
            p = CnvULongHex( bp->initial_countdown, p, end - p );
        }
        return( p );
    case B_CLEAR:
    case B_ACTIVATE:
    case B_DEACTIVATE:
    case B_RESUME:
    case B_UNRESUME:
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, event, p );
        if( bp == NULL ) {
            p = StrCopy( "*", p );
        } else {
            p = AddrToString( &bp->loc.addr, MAF_FULL, p, end - p );
//          p = Format( p, " %A", bp->loc.addr );
        }
        return( p );
    }
    return( NULL );
}