本文整理汇总了C++中TScreenOf函数的典型用法代码示例。如果您正苦于以下问题:C++ TScreenOf函数的具体用法?C++ TScreenOf怎么用?C++ TScreenOf使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TScreenOf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CursorRestore
/*
* Restore Cursor and Attributes
*/
void
CursorRestore(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
SavedCursor *sc = &screen->sc[screen->whichBuf];
/* Restore the character sets, unless we never did a save-cursor op.
* In that case, we'll reset the character sets.
*/
if (sc->saved) {
memmove(screen->gsets, sc->gsets, sizeof(screen->gsets));
screen->curgl = sc->curgl;
screen->curgr = sc->curgr;
} else {
resetCharsets(screen);
}
UIntClr(xw->flags, DECSC_FLAGS);
UIntSet(xw->flags, sc->flags & DECSC_FLAGS);
CursorSet(screen,
((xw->flags & ORIGIN)
? sc->row - screen->top_marg
: sc->row),
sc->col, xw->flags);
#if OPT_ISO_COLORS
xw->sgr_foreground = sc->sgr_foreground;
SGR_Foreground(xw, xw->flags & FG_COLOR ? sc->cur_foreground : -1);
SGR_Background(xw, xw->flags & BG_COLOR ? sc->cur_background : -1);
#endif
update_autowrap();
}
示例2: AlternateScroll
static void
AlternateScroll(Widget w, long amount)
{
XtermWidget xw;
TScreen *screen;
if ((xw = getXtermWidget(w)) != 0 &&
(screen = TScreenOf(xw)) != 0 &&
screen->alternateScroll && screen->whichBuf) {
ANSI reply;
amount /= FontHeight(screen);
memset(&reply, 0, sizeof(reply));
reply.a_type = ((xw->keyboard.flags & MODE_DECCKM)
? ANSI_SS3
: ANSI_CSI);
if (amount > 0) {
reply.a_final = 'B';
} else {
amount = -amount;
reply.a_final = 'A';
}
while (amount-- > 0) {
unparseseq(xw, &reply);
}
} else {
ScrollTextUpDownBy(w, (XtPointer) 0, (XtPointer) amount);
}
}
示例3: initLineData
void
initLineData(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
initLineExtra(screen);
TRACE(("initLineData %lu\n", (unsigned long) screen->lineExtra));
TRACE(("...sizeof(LineData) %lu\n", (unsigned long) sizeof(LineData)));
#if OPT_ISO_COLORS
TRACE(("...sizeof(CellColor) %lu\n", (unsigned long) sizeof(CellColor)));
#endif
TRACE(("...sizeof(RowData) %lu\n", (unsigned long) sizeof(RowData)));
TRACE(("...offset(lineSize) %lu\n", (unsigned long) offsetof(LineData, lineSize)));
TRACE(("...offset(bufHead) %lu\n", (unsigned long) offsetof(LineData, bufHead)));
#if OPT_WIDE_CHARS
TRACE(("...offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize)));
#endif
TRACE(("...offset(attribs) %lu\n", (unsigned long) offsetof(LineData, attribs)));
#if OPT_ISO_COLORS
TRACE(("...offset(color) %lu\n", (unsigned long) offsetof(LineData, color)));
#endif
TRACE(("...offset(charData) %lu\n", (unsigned long) offsetof(LineData, charData)));
TRACE(("...offset(combData) %lu\n", (unsigned long) offsetof(LineData, combData)));
}
示例4: ScrollTextUpDownBy
/*ARGSUSED*/
static void
ScrollTextUpDownBy(
Widget scrollbarWidget,
XtPointer client_data GCC_UNUSED,
XtPointer call_data)
{
XtermWidget xw = getXtermWidget(scrollbarWidget);
if (xw != 0) {
long pixels = (long) call_data;
TScreen *screen = TScreenOf(xw);
int rowOnScreen, newTopLine;
rowOnScreen = (int) (pixels / FontHeight(screen));
if (rowOnScreen == 0) {
if (pixels < 0)
rowOnScreen = -1;
else if (pixels > 0)
rowOnScreen = 1;
}
newTopLine = ROW2INX(screen, rowOnScreen);
WindowScroll(xw, newTopLine, True);
}
}
示例5: freeCgs
/*
* Free any GC associated with the given id.
*/
GC
freeCgs(XtermWidget xw, VTwin *cgsWin, CgsEnum cgsId)
{
CgsCache *me;
int j;
if ((me = myCache(xw, cgsWin, cgsId)) != 0) {
for (j = 0; j < DEPTH; ++j) {
if (LIST(j).gc != 0) {
TRACE(("freeCgs(%s, %s) gc %p(%d)\n",
traceVTwin(xw, cgsWin),
traceCgsEnum(cgsId), (void *) LIST(j).gc, j));
clrCgsFonts(xw, cgsWin, LIST(j).font);
#if OPT_BOX_CHARS
if (cgsId == gcDots) {
XmuReleaseStippledPixmap(XtScreen((Widget) xw), LIST(j).tile);
}
#endif
XFreeGC(TScreenOf(xw)->display, LIST(j).gc);
memset(&LIST(j), 0, sizeof(LIST(j)));
}
LINK(0);
}
}
return 0;
}
示例6: ResizeScrollBar
void
ResizeScrollBar(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
if (screen->scrollWidget != 0) {
int height = screen->fullVwin.height + screen->border * 2;
int width = screen->scrollWidget->core.width;
int ypos = -ScrollBarBorder(xw);
#ifdef SCROLLBAR_RIGHT
int xpos = ((xw->misc.useRight)
? (screen->fullVwin.fullwidth -
screen->scrollWidget->core.width -
BorderWidth(screen->scrollWidget))
: -ScrollBarBorder(xw));
#else
int xpos = -ScrollBarBorder(xw);
#endif
TRACE(("ResizeScrollBar at %d,%d %dx%d\n", ypos, xpos, height, width));
XtConfigureWidget(
screen->scrollWidget,
(Position) xpos,
(Position) ypos,
(Dimension) width,
(Dimension) height,
BorderWidth(screen->scrollWidget));
ScrollBarDrawThumb(screen->scrollWidget);
}
}
示例7: xterm_Double_index
int
xterm_Double_index(XtermWidget xw, unsigned chrset, unsigned flags)
{
int n;
int result = -1;
TScreen *screen = TScreenOf(xw);
XTermFonts *data = screen->double_fonts;
flags &= BOLD;
TRACE(("xterm_Double_index chrset=%#x, flags=%#x\n", chrset, flags));
for (n = 0; n < screen->fonts_used; n++) {
if (data[n].chrset == chrset
&& data[n].flags == flags) {
if (n != 0) {
XTermFonts save;
TRACE(("...xterm_Double_index -> %d (OLD:%d)\n", n, screen->fonts_used));
save = data[n];
while (n > 0) {
data[n] = data[n - 1];
n--;
}
data[n] = save;
}
result = n;
break;
}
}
return result;
}
示例8: redoCgs
/*
* Interchange colors in the cache, e.g., for reverse-video.
*/
void
redoCgs(XtermWidget xw, Pixel fg, Pixel bg, CgsEnum cgsId)
{
int n;
VTwin *cgsWin = WhichVWin(TScreenOf(xw));
CgsCache *me = myCache(xw, cgsWin, cgsId);
if (me != 0) {
CgsCacheData *save_data = me->data;
for (n = 0; n < DEPTH; ++n) {
if (LIST(n).gc != 0 && HaveFont(LIST(n).font)) {
LINK(n);
if (LIST(n).fg == fg
&& LIST(n).bg == bg) {
setCgsFore(xw, cgsWin, cgsId, bg);
setCgsBack(xw, cgsWin, cgsId, fg);
} else if (LIST(n).fg == bg
&& LIST(n).bg == fg) {
setCgsFore(xw, cgsWin, cgsId, fg);
setCgsBack(xw, cgsWin, cgsId, bg);
} else {
continue;
}
(void) chgCache(xw, cgsId, me, False);
}
}
me->data = save_data;
}
}
示例9: CursorBack
/*
* moves the cursor left n, no wrap around
*/
void
CursorBack(XtermWidget xw, int n)
{
#define WRAP_MASK (REVERSEWRAP | WRAPAROUND)
TScreen *screen = TScreenOf(xw);
int offset, in_row, length, rev;
int left = ScrnLeftMargin(xw);
int before = screen->cur_col;
if ((rev = (xw->flags & WRAP_MASK) == WRAP_MASK) != 0
&& screen->do_wrap) {
n--;
}
/* if the cursor is already before the left-margin, we have to let it go */
if (before < left)
left = 0;
if ((screen->cur_col -= n) < left) {
if (rev) {
in_row = ScrnRightMargin(xw) - left + 1;
offset = (in_row * screen->cur_row) + screen->cur_col - left;
if (offset < 0) {
length = in_row * MaxRows(screen);
offset += ((-offset) / length + 1) * length;
}
set_cur_row(screen, (offset / in_row));
set_cur_col(screen, (offset % in_row) + left);
do_xevents();
} else {
set_cur_col(screen, left);
}
}
ResetWrap(screen);
}
示例10: xterm_ResetDouble
/*
* Reset all lines on the screen to single-width/single-height.
*/
void
xterm_ResetDouble(XtermWidget xw)
{
#if OPT_DEC_CHRSET
TScreen *screen = TScreenOf(xw);
Boolean changed = False;
LineData *ld;
unsigned code;
int row;
for (row = 0; row < screen->max_row; ++row) {
if ((ld = getLineData(screen, ROW2INX(screen, row))) != 0) {
code = GetLineDblCS(ld);
if (code != CSET_SWL) {
SetLineDblCS(ld, CSET_SWL);
changed = True;
}
}
}
if (changed) {
xtermRepaint(xw);
}
#else
(void) xw;
#endif
}
示例11: TabToNextStop
/*
* Tab to the next stop, returning true if the cursor moved
*/
Bool
TabToNextStop(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int saved_column = screen->cur_col;
int next = TabNext(xw, xw->tabs, screen->cur_col);
int max = LineMaxCol(screen, getLineData(screen, screen->cur_row));
if (IsLeftRightMode(xw))
max = TScreenOf(xw)->rgt_marg;
if (next > max)
next = max;
set_cur_col(screen, next);
return (screen->cur_col > saved_column);
}
示例12: CursorPrevLine
/*
* Move the cursor to the first column of the n-th previous line.
*/
void
CursorPrevLine(XtermWidget xw, int count)
{
TScreen *screen = TScreenOf(xw);
CursorUp(screen, count < 1 ? 1 : count);
CarriageReturn(xw);
do_xevents();
}
示例13: WindowScroll
void
WindowScroll(XtermWidget xw, int top, Bool always GCC_UNUSED)
{
TScreen *screen = TScreenOf(xw);
#if OPT_SCROLL_LOCK
if (screen->allowScrollLock && (screen->scroll_lock && !always)) {
if (screen->scroll_dirty) {
screen->scroll_dirty = False;
ScrnRefresh(xw, 0, 0, MaxRows(screen), MaxCols(screen), False);
}
} else
#endif
{
int i;
if (top < -screen->savedlines) {
top = -screen->savedlines;
} else if (top > 0) {
top = 0;
}
if ((i = screen->topline - top) != 0) {
int lines;
int scrolltop, scrollheight, refreshtop;
if (screen->cursor_state)
HideCursor();
lines = i > 0 ? i : -i;
if (lines > MaxRows(screen))
lines = MaxRows(screen);
scrollheight = screen->max_row - lines + 1;
if (i > 0)
refreshtop = scrolltop = 0;
else {
scrolltop = lines;
refreshtop = scrollheight;
}
scrolling_copy_area(xw, scrolltop, scrollheight, -i);
screen->topline = top;
ScrollSelection(screen, i, True);
xtermClear2(xw,
OriginX(screen),
OriginY(screen) + refreshtop * FontHeight(screen),
(unsigned) Width(screen),
(unsigned) (lines * FontHeight(screen)));
ScrnRefresh(xw, refreshtop, 0, lines, MaxCols(screen), False);
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
RestartBlinking(screen);
#endif
}
}
ScrollBarDrawThumb(screen->scrollWidget);
}
示例14: Resolve_XMC
/*
* After writing text to the screen, resolve mismatch between the current
* location and any attributes that would have been set by preceding locations.
*/
void
Resolve_XMC(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
LineData *ld;
Bool changed = False;
Char start;
Char my_attrs = CharOf(screen->xmc_attributes & XMC_FLAGS);
int row = screen->cur_row;
int col = screen->cur_col;
/* Find the preceding cell.
*/
ld = getLineData(screen, row);
if (ld->charData[col] != XMC_GLITCH) {
if (col != 0) {
col--;
} else if (!screen->xmc_inline && row != 0) {
ld = getLineData(screen, --row);
col = LineMaxCol(screen, ld);
}
}
start = (ld->attribs[col] & my_attrs);
/* Now propagate the starting state until we reach a cell which holds
* a glitch.
*/
for (;;) {
if (col < LineMaxCol(screen, ld)) {
col++;
} else if (!screen->xmc_inline && row < screen->max_row) {
col = 0;
ld = getLineData(screen, ++row);
} else
break;
if (ld->charData[col] == XMC_GLITCH)
break;
if ((ld->attribs[col] & my_attrs) != start) {
ld->attribs[col] =
CharOf(start | (ld->attribs[col] & ~my_attrs));
changed = True;
}
}
TRACE(("XMC %s (%s:%d/%d) from %d,%d to %d,%d\n",
changed ? "Ripple" : "Nochange",
BtoS(xw->flags & my_attrs),
my_attrs, start,
screen->cur_row, screen->cur_col,
row, col));
if (changed) {
ScrnUpdate(xw, screen->cur_row, 0, row + 1 - screen->cur_row,
MaxCols(screen), True);
}
}
示例15: newCellData
CellData *
newCellData(XtermWidget xw, Cardinal count)
{
CellData *result;
TScreen *screen = TScreenOf(xw);
initLineExtra(screen);
result = (CellData *) calloc((size_t) count, (size_t) CellDataSize(screen));
return result;
}