/* Move down by COUNT lines */ static gboolean move_down_lines(TilemDisasmView *dv, int count) { TilemCalc *calc; dword startpos, selpos; int linenum; if (!get_cursor_line(dv, NULL, &linenum)) linenum = -1; if (linenum + count < dv->nlines) return FALSE; tilem_calc_emulator_lock(dv->dbg->emu); calc = dv->dbg->emu->calc; startpos = get_next_pos(dv, calc, dv->startpos); selpos = dv->endpos; count -= dv->nlines - linenum; while (count > 0) { startpos = get_next_pos(dv, calc, startpos); selpos = get_next_pos(dv, calc, selpos); count--; } tilem_calc_emulator_unlock(dv->dbg->emu); refresh_disassembly(dv, startpos, dv->nlines, selpos); return TRUE; }
void WnCourt::CreateNode(const char *text, const char *type) { newobj = _court->create_ball(text, type); wnobj *top = get_top(); if (top) { _court->create_spring(newobj, top, init_spring_length, 0.4f); newobj->getP().getP() = get_next_pos(top->getP().getP()); } else { newobj->getP().getP() = get_center_pos(); } }
void WnCourt::CreateWord(const char *text) { wnobj *top = get_top(); if (top) { PangoLayout *layout = gtk_widget_create_pango_layout(drawing_area, text); newobj = _court->create_word(layout); _court->create_spring(newobj, top, init_spring_length); newobj->getP().getP() = get_next_pos(get_top()->getP().getP()); } else { PangoLayout *layout = gtk_widget_create_pango_layout(drawing_area, ""); gchar *str = g_markup_printf_escaped("<big><b>%s</b></big>", text); pango_layout_set_markup(layout, str, -1); g_free(str); newobj = _court->create_word(layout); newobj->getP().getP() = get_center_pos(); _court->set_center(newobj); } }
/* Move down by COUNT pages */ static void move_down_pages(TilemDisasmView *dv, int count) { TilemCalc *calc; int i; dword pos; tilem_calc_emulator_lock(dv->dbg->emu); calc = dv->dbg->emu->calc; pos = dv->endpos; count--; while (count > 0) { for (i = 0; i < dv->nlines; i++) pos = get_next_pos(dv, calc, pos); count--; } tilem_calc_emulator_unlock(dv->dbg->emu); refresh_disassembly(dv, pos, dv->nlines, pos - 1); }