Beispiel #1
0
void
rxvt_term::im_set_preedit_area (XRectangle &preedit_rect,
                                XRectangle &status_rect,
                                const XRectangle &needed_rect)
{
  preedit_rect.x      = needed_rect.width;
  preedit_rect.y      = 0;
  preedit_rect.width  = Width2Pixel (ncol) - needed_rect.width + 1;
  preedit_rect.height = fheight;

  status_rect.x       = 0;
  status_rect.y       = 0;
  status_rect.width   = needed_rect.width ? needed_rect.width : Width2Pixel (ncol) + 1;
  status_rect.height  = fheight;
}
Beispiel #2
0
/* INTPROTO */
void
rxvt_Gr_Text(rxvt_t *r, grwin_t *grwin, grcmd_t *data)
{
    int             x, y, align;

    if (data->ncoords < 4 || data->text == NULL || *(data->text) == '\0')
	return;

    x = data->coords[0] * grwin->w / GRX_SCALE;
    y = data->coords[1] * grwin->h / GRX_SCALE;
    align = data->coords[2];

    if ((align & HORIZONTAL_ALIGNMENT) == RIGHT_TEXT)
	x -= XTextWidth(r->TermWin.font, data->text, data->coords[3]);
    else if ((align & HORIZONTAL_ALIGNMENT) == HCENTER_TEXT)
	x -= (XTextWidth(r->TermWin.font, data->text, data->coords[3]) >> 1);

    if ((align & VERTICAL_ALIGNMENT) == TOP_TEXT)
	y += r->TermWin.font->ascent;
    else if ((align & VERTICAL_ALIGNMENT) == BOTTOM_TEXT)
	y -= r->TermWin.font->descent;

    if ((align & VERTICAL_ALIGNMENT) == VCENTER_TEXT)
	y -= r->TermWin.font->descent
	     + ((r->TermWin.font->ascent + r->TermWin.font->descent) >> 1);
    if ((align & VERTICAL_ALIGNMENT) == VCAPS_CENTER_TEXT)
	y += (r->TermWin.font->ascent >> 1);

    XPMClearArea(r->Xdisplay, grwin->win, x, y - r->TermWin.font->ascent,
		 Width2Pixel(data->coords[3]), Height2Pixel(1), 0);
    XDrawString(r->Xdisplay, grwin->win, r->TermWin.gc, x, y,
		data->text, data->coords[3]);
}
Beispiel #3
0
void
rxvt_term::im_set_size (XRectangle &size)
{
  // the int_bwidth terms make no sense to me
  size.x      = int_bwidth;
  size.y      = int_bwidth;
  size.width  = Width2Pixel (ncol) + int_bwidth;
  size.height = Height2Pixel (nrow) + int_bwidth;
}