Lines Matching defs:tw

113 #define DefaultGCID(tw) \
114 XGContextFromGC(DefaultGC(XtDisplay(tw), \
115 DefaultScreen(XtDisplay(tw))))
154 #define BorderOf(tw) (TScreenOf((tw)->vt)->border)
155 #define ScaleOf(tw) TekScale(TekScreenOf(tw))
156 #define ScaledX(tw,x) (((x) * ScaleOf(tw)) + BorderOf(tw))
157 #define ScaledY(tw,y) ((BottomY(y) * ScaleOf(tw)) + BorderOf(tw))
159 #define TekMove(tw,x,y) do { tekscr->cur_X = x; tekscr->cur_Y = y; } while (0)
160 #define input() Tinput(tw)
281 static IChar Tinput(TekWidget /* tw */ );
282 static int getpoint(TekWidget /* tw */ );
283 static void TCursorBack(TekWidget /* tw */ );
284 static void TCursorDown(TekWidget /* tw */ );
285 static void TCursorForward(TekWidget /* tw */ );
286 static void TCursorUp(TekWidget /* tw */ );
287 static void TekBackground(TekWidget /* tw */ ,
290 static void TekDraw(TekWidget /* tw */ ,
293 static void TekEnq(TekWidget /* tw */ ,
297 static void TekFlush(TekWidget /* tw */ );
302 static void TekPage(TekWidget /* tw */ );
428 Tekparse(TekWidget tw)
430 TekScreen *tekscr = TekScreenOf(tw);
431 TScreen *screen = TScreenOf(tw->vt);
457 TekGINoff(tw);
458 TekEnqMouse(tw, 0);
463 TekEnq(tw, c, tekscr->cur_X, tekscr->cur_Y);
473 FlushLog(tw->vt);
479 TekGINoff(tw);
491 XDefineCursor(XtDisplay(tw), TWindow(tekscr),
500 TekGINoff(tw);
502 Bell(tw->vt, XkbBI_TerminalBell, 0);
509 TekGINoff(tw);
511 TCursorBack(tw);
517 TekGINoff(tw);
524 TekGINoff(tw);
537 TekGINoff(tw);
539 TCursorForward(tw);
545 TekGINoff(tw);
552 TekGINoff(tw);
555 TekFlush(tw);
562 TekGINoff(tw);
564 TCursorUp(tw);
570 TekGINoff(tw);
571 TekCopy(tw);
579 TekGINoff(tw);
580 TekPage(tw); /* clear bypass condition */
611 TekSetFontSize(tw, False, (int) (c & 03));
621 TekFlush(tw);
655 TekDraw(tw, x, y);
657 TekMove(tw, x, y);
664 if (getpoint(tw)) {
666 TekDraw(tw, tekscr->cur.x, tekscr->cur.y);
668 TekMove(tw, tekscr->cur.x, tekscr->cur.y);
677 if (getpoint(tw)) {
678 TekMove(tw, tekscr->cur.x, tekscr->cur.y);
679 TekDraw(tw, tekscr->cur.x, tekscr->cur.y);
686 if (getpoint(tw)) {
687 TekMove(tw, tekscr->cur.x, tekscr->cur.y);
688 TekDraw(tw, tekscr->cur.x, tekscr->cur.y);
695 TekGINoff(tw);
697 TekFlush(tw);
711 TekGINoff(tw);
712 TCursorDown(tw);
714 do_xevents(tw->vt);
719 TCursorForward(tw);
725 x = (int) ScaledX(tw, tekscr->cur_X);
726 y = (int) ScaledY(tw, tekscr->cur_Y);
734 XDrawImageString16(XtDisplay(tw),
745 XDrawString(XtDisplay(tw),
753 TCursorForward(tw);
779 do_osc(tw->vt, buf2, len, ANSI_BEL);
794 Tinput(TekWidget tw)
796 TekScreen *tekscr = TekScreenOf(tw);
797 TScreen *screen = TScreenOf(tw->vt);
809 TekSetFontSize(tw, False, tek->fontsize);
820 TekFlush(tw);
831 if (readPtyData(tw->vt, &Tselect_mask, VTbuffer)) {
835 TCursorToggle(tw, TOGGLE);
841 XFlush(XtDisplay(tw));
849 if (FD_ISSET(ConnectionNumber(XtDisplay(tw)), &Tselect_mask)) {
850 xevents(tw->vt);
856 TCursorToggle(tw, TOGGLE);
880 TekClear(TekWidget tw)
882 TekScreen *tekscr = TekScreenOf(tw);
888 XClearWindow(XtDisplay(tw), TWindow(tekscr));
892 TekSetWinSize(TekWidget tw)
894 if (TEK4014_ACTIVE(tw->vt)) {
895 TekScreen *tekscr = TekScreenOf(tw);
897 int rows = THeight(tekscr) / (int) (ScaleOf(tw) * t->vsize);
898 int cols = TWidth(tekscr) / (int) (ScaleOf(tw) * t->hsize);
900 update_winsize(TScreenOf(tw->vt),
908 compute_sizes(TekWidget tw)
910 TekScreen *tekscr = TekScreenOf(tw);
911 int border = 2 * BorderOf(tw);
915 const XFontStruct *fs = tw->tek.Tfont[tekscr->cur.fontsize];
919 TWidth(tekscr) = tw->core.width - border;
920 THeight(tekscr) = tw->core.height - border;
921 ScaleOf(tw) = (double) TWidth(tekscr) / TEKWIDTH;
923 if ((d = (double) THeight(tekscr) / FULL_HEIGHT) < ScaleOf(tw))
924 ScaleOf(tw) = d;
926 TFullWidth(tekscr) = tw->core.width;
927 TFullHeight(tekscr) = tw->core.height;
932 ScaleOf(tw)));
944 TekSetWinSize(tw);
950 TekWidget tw = getTekWidget(w);
951 if (tw != NULL) {
954 TekClear(tw);
956 compute_sizes(tw);
968 TekWidget tw = getTekWidget(w);
969 if (tw != NULL) {
970 TekScreen *tekscr = TekScreenOf(tw);
978 TCursorToggle(tw, CLEAR);
984 TekSetFontSize(tw, False, tekscr->cur.fontsize);
988 TekGINoff(tw);
997 TekRefresh(tw);
1003 TekRefresh(TekWidget tw)
1005 if (tw != NULL) {
1006 TScreen *screen = TScreenOf(tw->vt);
1007 TekScreen *tekscr = TekScreenOf(tw);
1014 XDefineCursor(XtDisplay(tw), TWindow(tekscr), wait_cursor);
1015 XFlush(XtDisplay(tw));
1017 Tekparse(tw);
1018 XDefineCursor(XtDisplay(tw), TWindow(tekscr),
1024 TekRepaint(TekWidget tw)
1027 TekClear(tw);
1028 TekExpose((Widget) tw, (XEvent *) NULL, (Region) NULL);
1032 TekPage(TekWidget tw)
1034 TekScreen *tekscr = TekScreenOf(tw);
1038 TekClear(tw);
1044 TekGINoff(tw);
1072 getpoint(TekWidget tw)
1075 TekScreen *tekscr = TekScreenOf(tw);
1120 TCursorBack(TekWidget tw)
1122 TekScreen *tekscr = TekScreenOf(tw);
1139 TCursorForward(TekWidget tw)
1141 TekScreen *tekscr = TekScreenOf(tw);
1156 TCursorUp(TekWidget tw)
1158 TekScreen *tekscr = TekScreenOf(tw);
1176 TCursorDown(TekWidget tw)
1178 TekScreen *tekscr = TekScreenOf(tw);
1196 AddToDraw(TekWidget tw, int x1, int y1, int x2, int y2)
1202 TekFlush(tw);
1205 lp->x1 = (short) ScaledX(tw, x1);
1206 lp->y1 = (short) ScaledY(tw, y1);
1207 lp->x2 = (short) ScaledX(tw, x2);
1208 lp->y2 = (short) ScaledY(tw, y2);
1214 TekDraw(TekWidget tw, int x, int y)
1216 TekScreen *tekscr = TekScreenOf(tw);
1225 TekFlush(tw);
1227 AddToDraw(tw, tekscr->cur_X, tekscr->cur_Y, x, y);
1233 TekFlush(TekWidget tw)
1235 TekScreen *tekscr = TekScreenOf(tw);
1238 XDrawSegments(XtDisplay(tw), TWindow(tekscr),
1248 TekGINoff(TekWidget tw)
1250 TekScreen *tekscr = TekScreenOf(tw);
1253 XDefineCursor(XtDisplay(tw), TWindow(tekscr), tekscr->arrow);
1255 XFreeCursor(XtDisplay(tw), GINcursor);
1263 TekEnqMouse(TekWidget tw, int c) /* character pressed */
1265 TekScreen *tekscr = TekScreenOf(tw);
1272 XtDisplay(tw), TWindow(tekscr),
1277 if ((mousex = (int) ((mousex - BorderOf(tw)) / ScaleOf(tw))) < 0)
1281 if ((mousey = (int) BottomY((mousey - BorderOf(tw)) / ScaleOf(tw))) < 0)
1285 TekEnq(tw, (unsigned) c, mousex, mousey);
1289 TekEnq(TekWidget tw,
1294 TScreen *screen = TScreenOf(tw->vt);
1295 TekScreen *tekscr = TekScreenOf(tw);
1588 TekWidget tw = (TekWidget) gw;
1589 TekScreen *tekscr = TekScreenOf(tw);
1590 TScreen *vtscr = TScreenOf(tw->vt);
1604 height = (unsigned) tw->hints.height;
1605 width = (unsigned) tw->hints.width;
1607 (void) REQ_RESIZE((Widget) tw,
1609 &tw->core.width, &tw->core.height);
1615 if (tw->hints.flags & USPosition)
1616 XMoveWindow(XtDisplay(tw), TShellWindow, tw->hints.x, tw->hints.y);
1618 XSetWMNormalHints(XtDisplay(tw), TShellWindow, &tw->hints);
1619 XFlush(XtDisplay(tw)); /* get it out to window manager */
1624 XtWindow(tw) = TWindow(tekscr) =
1625 XCreateWindow(XtDisplay(tw),
1626 VShellWindow(tw),
1627 tw->core.x, tw->core.y,
1628 tw->core.width, tw->core.height,
1629 BorderWidth(tw),
1630 (int) tw->core.depth,
1635 compute_sizes(tw);
1638 gcv.font = tw->tek.Tfont[tekscr->cur.fontsize]->fid;
1645 TEKgcFontMask = (unsigned long) ((gcv.font == DefaultGCID(tw))
1648 tekscr->TnormalGC = XCreateGC(XtDisplay(tw), TWindow(tekscr),
1658 tekscr->TcursorGC = XCreateGC(XtDisplay(tw), TWindow(tekscr),
1665 tekscr->linepat[i] = XCreateGC(XtDisplay(tw), TWindow(tekscr),
1667 XSetDashes(XtDisplay(tw), tekscr->linepat[i], 0,
1671 TekBackground(tw, vtscr);
1676 XDefineCursor(XtDisplay(tw), TWindow(tekscr), tekscr->arrow);
1692 XtGetValues(SHELL_OF(tw), args, 2);
1712 XtSetValues(SHELL_OF(tw), args, 2);
1757 TekSetFontSize(TekWidget tw, Bool fromMenu, int newitem)
1759 if (tw != NULL) {
1760 TekScreen *tekscr = TekScreenOf(tw);
1767 Bell(tw->vt, XkbBI_MinorError, 0);
1770 TCursorToggle(tw, TOGGLE);
1774 TekSetWinSize(tw);
1778 fid = tw->tek.Tfont[newsize]->fid;
1779 if (fid == DefaultGCID(tw)) {
1782 XCopyGC(XtDisplay(tw),
1783 DefaultGC(XtDisplay(tw), DefaultScreen(XtDisplay(tw))),
1786 XSetFont(XtDisplay(tw), tekscr->TnormalGC, fid);
1791 TCursorToggle(tw, TOGGLE);
1798 TekClear(tw);
1805 ChangeTekColors(TekWidget tw, TScreen *screen, ScrnColors * pNew)
1807 if (tw && screen) {
1808 TekScreen *tekscr = TekScreenOf(tw);
1828 XSetForeground(XtDisplay(tw), tekscr->TnormalGC,
1830 XSetBackground(XtDisplay(tw), tekscr->TnormalGC,
1832 if (BorderPixel(tw) == T_COLOR(screen, TEK_BG)) {
1833 BorderPixel(tw) = T_COLOR(screen, TEK_FG);
1834 BorderPixel(XtParent(tw)) = T_COLOR(screen, TEK_FG);
1835 if (XtWindow(XtParent(tw)))
1836 XSetWindowBorder(XtDisplay(tw),
1837 XtWindow(XtParent(tw)),
1838 BorderPixel(tw));
1842 XSetForeground(XtDisplay(tw), tekscr->linepat[i],
1848 XChangeGC(XtDisplay(tw), tekscr->TcursorGC, GCPlaneMask, &gcv);
1849 TekBackground(tw, screen);
1855 TekReverseVideo(XtermWidget xw, TekWidget tw)
1857 if (tw) {
1859 TekScreen *tekscr = TekScreenOf(tw);
1868 XSetForeground(XtDisplay(tw), tekscr->TnormalGC, T_COLOR(screen, TEK_FG));
1869 XSetBackground(XtDisplay(tw), tekscr->TnormalGC, T_COLOR(screen, TEK_BG));
1871 if (BorderPixel(tw) == T_COLOR(screen, TEK_BG)) {
1872 BorderPixel(tw) = T_COLOR(screen, TEK_FG);
1873 BorderPixel(XtParent(tw)) = T_COLOR(screen, TEK_FG);
1874 if (XtWindow(XtParent(tw)))
1875 XSetWindowBorder(XtDisplay(tw),
1876 XtWindow(XtParent(tw)),
1877 BorderPixel(tw));
1881 XSetForeground(XtDisplay(tw), tekscr->linepat[i],
1887 XChangeGC(XtDisplay(tw), tekscr->TcursorGC, GCPlaneMask, &gcv);
1888 TekBackground(tw, screen);
1893 TekBackground(TekWidget tw, TScreen *screen)
1895 TekScreen *tekscr = TekScreenOf(tw);
1898 XSetWindowBackground(XtDisplay(tw), TWindow(tekscr),
1906 TCursorToggle(TekWidget tw, int toggle) /* TOGGLE or CLEAR */
1913 if (tw == NULL)
1915 if ((tekscr = TekScreenOf(tw)) == NULL)
1917 if ((xw = tw->vt) == NULL)
1924 cellwidth = (unsigned) tw->tek.Tfont[c]->max_bounds.width;
1925 cellheight = (unsigned) (tw->tek.Tfont[c]->ascent +
1926 tw->tek.Tfont[c]->descent);
1928 x = (int) ScaledX(tw, tekscr->cur_X);
1929 y = (int) ScaledY(tw, tekscr->cur_Y) - tw->tek.tobaseline[c];
1934 XFillRectangle(XtDisplay(tw), TWindow(tekscr),
1938 XDrawRectangle(XtDisplay(tw), TWindow(tekscr),
1949 XClearArea(XtDisplay(tw), TWindow(tekscr), x, y,
1967 TekSimulatePageButton(TekWidget tw, Bool reset)
1969 if (tw != NULL) {
1970 TekScreen *tekscr = TekScreenOf(tw);
1976 TekPage(tw);
1985 TekCopy(TekWidget tw)
1988 if (tw != NULL) {
1989 TekScreen *tekscr = TekScreenOf(tw);
1990 TScreen *screen = TScreenOf(tw->vt);
1999 Bell(tw->vt, XkbBI_MinorError, 0);
2003 Bell(tw->vt, XkbBI_MinorError, 0);
2024 (void) tw;
2035 TekWidget tw = getTekWidget(w);
2037 if (tw != NULL) {
2038 TekScreen *tekscr = TekScreenOf(tw);
2051 Bell(tw->vt, XkbBI_MinorError, 0); /* let them know they goofed */
2054 TekEnqMouse(tw, c | 0x80);
2055 TekGINoff(tw);
2057 Bell(tw->vt, XkbBI_MinorError, 0);
2068 TekWidget tw;
2071 tw = (TekWidget) CURRENT_EMU();
2072 if (!IsTekWidget(tw)) {
2073 tw = NULL;
2076 tw = (TekWidget) w;
2078 tw = getTekWidget(XtParent(w));
2080 TRACE2(("getTekWidget %p -> %p\n", w, tw));
2081 return tw;