[Xcb] How to implement rectangle selection in XCB?

Michael Enright mike at kmcardiff.com
Mon Jun 1 15:00:22 PDT 2015


Part of this is fundamentally knowing how to display a selection.
That's described in graphics text books. The discussion will even
cover how you don't permanently damage the graphics you drew before
the selection process started. In reality the pixels on the screen
MUST change, the engineering is in how to restore the original
afterwards. Again, standard graphics text books. This one
(http://www.amazon.com/Computer-Graphics-Principles-Practice-Edition/dp/0201848406)
is an old, respected book and there's a newer edition.
Part of this is deciding if your application uses mainly XCB (aka
X-Windows) directly or does the graphics on something like a Cairo
surface that you transfer to the screen using XCB.
Because I don't know why you "want to use XCB to develop an
application" I won't judge. I have done some simple apps directly with
XCB or with XCB and a Cairo XCB Surface. However, some say that it's
better to use higher level stuff like GTK or QT rather than XCB.

On Sun, May 31, 2015 at 10:25 PM, Maeglin Vardamir <belcon at gmail.com> wrote:
> Hi guys,
>
> I am a newbie to XCB. I want to use XCB to develop an application. Here is
> what I need to do: select part of one window and save the selected
> content(picture) to a file. Later, I can use this file to check whether this
> picture exists in the other window or not.
>
> Here I have one question about picture selection
> Like GIMP, when I click the button of the mice and move it to another
> position of the specified window, I should draw a rectangle from the point I
> clicked to where I moved my mice. During the process, the rectangle is
> growing up. Since I can't change data of the specified window, should I
> create a transparent window over the target window? Or any other ideas?
>
>
> Thanks,
>   Belcon
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb


More information about the Xcb mailing list