//--------------------------------------------------------------------------- uchar out_nodelist(uval_t nodeid, uchar pos, const char *pref) { uval_t cnt, off = 0; netnode node(nodeid); if ( (cnt = node.altval(0)) == 0) DESTROYED("out::nodelist" ); if ( pref ) { // jasmin if ( change_line() ) { bad: return(0); } off = strlen(pref); } for(register unsigned i = 0; ; ) { if ( pref) { // jasmin (single directive per line ) curpos = pos; out_keyword(pref); outcnt = (size_t)off; } else if ( i && chkOutSymSpace(',') ) goto bad; // prompted list if ( out_alt_ind((uint32)node.altval(++i)) ) goto bad; if ( i >= cnt) return(1 ); if ( pref && change_line() ) goto bad; // jasmin } }
static void fix_box(int x, int y) { canvas_ref_proc = canvas_locmove_proc = null_proc; elastic_box(fix_x, fix_y, cur_x, cur_y); /* erase last lengths if appres.showlengths is true */ erase_box_lengths(); adjust_box_pos(x, y, from_x, from_y, &x, &y); new_l = copy_line(cur_l); if (new_l->type == T_PICTURE) { if (signof(fix_x - from_x) != signof(fix_x - x)) new_l->pic->flipped = 1 - new_l->pic->flipped; if (signof(fix_y - from_y) != signof(fix_y - y)) new_l->pic->flipped = 1 - new_l->pic->flipped; } assign_newboxpoint(new_l, fix_x, fix_y, x, y); change_line(cur_l, new_l); /* redraw anything under the old line */ redisplay_line(cur_l); /* and the new line */ redisplay_line(new_l); /* turn back on all relevant markers */ update_markers(new_objmask); wrapup_movepoint(); }
//---------------------------------------------------------------------- size_t debLine(void) { OutChar('"'); out_tagoff(COLOR_STRING); if ( change_line()) return(0 ); return(putDeb(1)); }
int get_nof_tabs_between(sptr_t edit, int start, int end) { int current_pos = get_line_start(edit,start); int max_tabs = 0; do { unsigned char current_char = (unsigned char)call_edit(edit,SCI_GETCHARAT,current_pos); bool current_char_ends_line = is_line_end(edit,current_pos); int tabs_on_line = 0; while (current_char != '\0' && !current_char_ends_line) { if (current_char == '\t') { tabs_on_line++; if (tabs_on_line > max_tabs) { max_tabs = tabs_on_line; } } current_pos = call_edit(edit,SCI_POSITIONAFTER,current_pos); current_char = (unsigned char)call_edit(edit,SCI_GETCHARAT,current_pos); current_char_ends_line = is_line_end(edit,current_pos); } } while (change_line(edit,current_pos,FORWARDS) && current_pos < end); return max_tabs; }
//--------------------------------------------------------------------------- uchar out_nodelist(uval_t nodeid, uchar pos, const char *pref) { netnode node(nodeid); uval_t cnt = node.altval(0); if ( cnt == 0 ) DESTROYED("out::nodelist"); uval_t off = 0; if ( pref ) // jasmin { if ( change_line() ) { bad: return 0; } off = strlen(pref); } for ( uint i = 0; ; ) { if ( pref ) // jasmin (single directive per line) { curpos = pos; out_keyword(pref); outcnt = off; } else if ( i && chkOutSymSpace(',') ) { goto bad; // prompted list } if ( out_alt_ind((uint32)node.altval(++i)) ) goto bad; if ( i >= cnt ) return 1; if ( pref && change_line() ) goto bad; // jasmin } }
static void init_flipline(F_line *old_l, int px, int py) { F_line *new_l; new_l = copy_line(old_l); flip_line(new_l, px, py, flip_axis); if (copy) { add_line(new_l); } else { toggle_linemarker(old_l); draw_line(old_l, ERASE); change_line(old_l, new_l); } /* redisplay objects under this object before it was rotated */ redisplay_line(old_l); /* and this object and any other objects on top */ redisplay_line(new_l); }
int get_block_boundary(sptr_t edit, int& location, direction which_dir) { int current_pos; int max_tabs = 0; bool orig_line = true; location = get_line_start(edit,location); do { int tabs_on_line = 0; current_pos = location; unsigned char current_char = (unsigned char)call_edit(edit,SCI_GETCHARAT,current_pos); bool current_char_ends_line = is_line_end(edit,current_pos); while (current_char != '\0' && !current_char_ends_line) { if (current_char == '\t') { tabs_on_line++; if (tabs_on_line > max_tabs) { max_tabs = tabs_on_line; } } current_pos = call_edit(edit,SCI_POSITIONAFTER,current_pos); current_char = (unsigned char)call_edit(edit,SCI_GETCHARAT,current_pos); current_char_ends_line = is_line_end(edit,current_pos); } if (tabs_on_line == 0 && !orig_line) { return max_tabs; } orig_line = false; } while (change_line(edit,location,which_dir)); return max_tabs; }
//---------------------------------------------------------------------- static size_t putLine(void) { color_t color = COLOR_NONE; out_zero(); if ( g_bufbeg != NULL ) { char *p = strrchr(g_bufbeg, COLOR_ON); if ( p != NULL && p[1] && strchr(p+2, COLOR_OFF) == NULL ) // second - PARANOYA { color = (color_t)*(p + 1); out_tagoff(color); } } out_symbol('\\'); if ( change_line(curpos != 0 && !no_prim) ) return 0; curpos = 0; if ( color != COLOR_NONE ) out_tagon(color); ref_pos = get_output_ptr(); return maxpos; }
//---------------------------------------------------------------------- static size_t putLine(void) { register color_t ntag = _CURCOL; out_zero(); { register char *p = strrchr(bufbeg, COLOR_ON); if ( p && p[1] && !strchr(p+2, COLOR_OFF) ) { // second - PARANOYA ntag = (color_t)*(p + 1); out_tagoff(ntag); } } out_symbol('\\'); if ( change_line(curpos != 0 && !no_prim)) return(0 ); curpos = 0; #ifdef __BORLANDC__ #if _CURCOL != 0 #error #endif #endif if ( ntag) out_tagon(ntag ); ref_pos = get_output_ptr(); return(maxpos); }