Re: RE : INS, caret colour, etc.

From: Patrick Lam (plam@plam.lcs.mit.edu)
Date: Sun Jan 26 2003 - 00:18:16 EST

  • Next message: Patrick Lam: "Re: RE : commit: Layout horizontally with screen units."

    On Fri, Jan 24, 2003 at 10:06:56AM -0000, Tomas Frydrych wrote:
    >
    > > Patrick Lam <plam@plam.lcs.mit.edu> wrote:
    >
    > > The problem was that I couldn't coordinate redraws with xors. That
    > > is, when the window system went behind my back to redraw something
    > > (for instance, if you obscure part of the caret) I couldn't redraw
    > > just part of the caret; I don't think GTK, at least tells you enough
    > > to do this. You would have to enlarge the draw region to encompass the
    > > whole caret and redraw it entirely (from scratch). save/restore
    > > doesn't depend on the underlying redraw state of the window, so it
    > > seems a lot more robust to me.
    >
    > OK, after reading this a few times, I think I understood :). However,
    > one way or another the appearance of the caret needs to be
    > sensitive to what it is being drawn over, and xor seems to be the only
    > simple way to do this. Perhaps what we need is to separate the first
    > draw from the subsequent re-draws; the first draw done using xor
    > and imediately saving what we have drawn, the subequent draws
    > using the save/restore mechanism we now use for clearing.

    There's still the problem of xor not being available on all platforms.
    We may be better off asking about the background colour and xoring to
    get the colour we want to draw the caret in, and then using
    save/restore.

    > The save/restore can now handle an unlimited number of separate
    > rectangles, so in that regard that would be a trivial change. The real
    > problem is how do we distinguish the primary draw from the
    > redraws. Coordinances are not enough, for example in right-aligned
    > text the caret remains static while the text beneath it moves. We
    > would need some dirtiness mechanism through which the caret
    > would be notified of any real draws in the window.

    This is a bit difficult, I think. I can't think of any simple way to do
    this. But I don't think we care about what's mostly under the caret;
    we just need it to be the right colour.

    pat



    This archive was generated by hypermail 2.1.4 : Sun Jan 26 2003 - 00:21:49 EST