Exemple #1
0
void
ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
{
  bs_rect(x, y, cx, cy, 0, opcode);
  ui_invalidate(x, y, cx, cy);
  /* todo */
}
Exemple #2
0
static LRESULT
handle_WM_PAINT(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
  PAINTSTRUCT ps;
  RECT rect;
  HBRUSH brush;

  BeginPaint(hWnd, &ps);
  /* paint the area outside the rdp screen with one colour */
  rect = ps.rcPaint;
  rect.left = UI_MAX(rect.left, g_width);
  if (!IsRectEmpty(&rect))
  {
    brush = CreateSolidBrush(RGB(0, 0, 255));
    FillRect(ps.hdc, &rect, brush);
    DeleteObject(brush);
  }
  rect = ps.rcPaint;
  rect.top = UI_MAX(rect.top, g_height);
  if (!IsRectEmpty(&rect))
  {
    brush = CreateSolidBrush(RGB(0, 0, 255));
    FillRect(ps.hdc, &rect, brush);
    DeleteObject(brush);
  }
  rect = ps.rcPaint;
  EndPaint(hWnd, &ps);
  ui_invalidate(rect.left + g_xscroll,
                rect.top + g_yscroll,
                (rect.right - rect.left) + 1,
                (rect.bottom - rect.top) + 1);
  return 0;
}
Exemple #3
0
void
ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
          BRUSH * brush, int bgcolour, int fgcolour)
{
  bs_patblt(opcode, x, y, cx, cy, brush->style, (char *)brush->pattern,
            brush->xorigin, brush->yorigin, bgcolour, fgcolour);
  ui_invalidate(x, y, cx, cy);
}
Exemple #4
0
void
ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
          void * src, int srcx, int srcy)
{
  struct bitmap* b;

  b = (struct bitmap*)src;
  bs_memblt(opcode, x, y, cx, cy, b->data, b->width, b->height,
            srcx, srcy);
  ui_invalidate(x, y, cx, cy);
}
Exemple #5
0
void
ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
             int srcx, int srcy)
{
  bs_screenblt(opcode, x, y, cx, cy, srcx, srcy);
  if (opcode == 12)
  {
    mi_screen_copy(x, y, cx, cy, srcx, srcy);
  }
  else
  {
    ui_invalidate(x, y, cx, cy);
  }
}
Exemple #6
0
void
ui_line(uint8 opcode, int startx, int starty, int endx, int endy,
        PEN * pen)
{
  int x;
  int y;
  int cx;
  int cy;

  bs_line(opcode, startx, starty, endx, endy, pen->width, pen->style,
          pen->colour);
  if (pen->style == 0 && pen->width < 2 && opcode == 12)
  {
    mi_line(startx, starty, endx, endy, pen->colour);
  }
  else
  {
    x = MIN(startx, endx);
    y = MIN(starty, endy);
    cx = (MAX(startx, endx) + 1) - x;
    cy = (MAX(starty, endy) + 1) - y;
    ui_invalidate(x, y, cx, cy);
  }
}
Exemple #7
0
void
ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
             int x, int y,
             int clipx, int clipy, int clipcx, int clipcy,
             int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
             int bgcolour, int fgcolour, uint8 * text, uint8 length)
{
  int i;
  int j;
  int xyoffset;
  DATABLOB * entry;
  FONTGLYPH * glyph;

  if (boxx + boxcx > g_width)
  {
    boxcx = g_width - boxx;
  }
  if (boxcx > 1)
  {
    bs_rect(boxx, boxy, boxcx, boxcy, bgcolour, 0xc);
  }
  else
  {
    if (mixmode == MIX_OPAQUE)
    {
      bs_rect(clipx, clipy, clipcx, clipcy, bgcolour, 0xc);
    }
  }
  /* Paint text, character by character */
  for (i = 0; i < length;)
  {
    switch (text[i])
    {
      case 0xff:
        if (i + 2 < length)
        {
          cache_put_text(text[i + 1], text, text[i + 2]);
        }
        else
        {
          error("this shouldn't be happening\n");
          exit(1);
        }
        /* this will move pointer from start to first character after */
        /* FF command */
        length -= i + 3;
        text = &(text[i + 3]);
        i = 0;
        break;
      case 0xfe:
        entry = cache_get_text(text[i + 1]);
        if (entry != NULL)
        {
          if ((((uint8 *) (entry->data))[1] == 0) &&
                              (!(flags & TEXT2_IMPLICIT_X)))
          {
            if (flags & TEXT2_VERTICAL)
            {
              y += text[i + 2];
            }
            else
            {
              x += text[i + 2];
            }
          }
          for (j = 0; j < entry->size; j++)
          {
            DO_GLYPH(((uint8 *) (entry->data)), j);
          }
        }
        if (i + 2 < length)
        {
          i += 3;
        }
        else
        {
          i += 2;
        }
        length -= i;
        /* this will move pointer from start to first character after */
        /* FE command */
        text = &(text[i]);
        i = 0;
        break;
      default:
        DO_GLYPH(text, i);
        i++;
        break;
    }
  }
  if (boxcx > 1)
  {
    ui_invalidate(boxx, boxy, boxcx, boxcy);
  }
  else
  {
    ui_invalidate(clipx, clipy, clipcx, clipcy);
  }
}