Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Benjamin Herrenschmidt <benh@pasglop.(none)>
|
|
We're currently getting TwinEventKeyDowns for key ups, and vice versa.
This change fixes the problem.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Add a simple event layer for joystick devices.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Convert twin_linux_mouse_accel() to twin_fixed_t arithmetic to avoid
dependency on libm.
Depends on separate patch which actually fixes twin_fixed_sqrt()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Twin_fixed_sqrt() suffers from overflow. Fix it.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The cursors used by twin compress well, so allow twin_cursor to load a
compressed cursor file when zlib is present. In both cases,
uncomressed cursors still work.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
No need to have it in the user header
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
twin_def.h wasn't defined in Makefile.am's sources list correctly, so
make dist fails. This change fixes the problem, referring to twin_def.h
in its proper location.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
As usual with glyph metrics, I only half understand what's going on there :-) From trial and error, it looks like the margin thing we apply for stroke font is no good for ttf, at least not using a margin does make things much nicer for me using ttf fonts
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
libtwin expects pixmaps to be premultiplied with their alpha channel,
but loaded PNGs aren't. This change adds a generic function to do alpha
premulitplication, and uses it on pixmaps loaded from PNG.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This adds altivec versions of argb32_over_argb32 and
argb32_source_argb32 operations and a bit of altivec
optimisation to the fbdev put span code as well.
It could probably be further optimized, and with some
patience, one could implement the full set of primitives
for altivec instead of just those two, but that's at
least a beginning. I haven't properly measured the
difference in performances yet. It is definitely faster
on my powerbook though.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change to the libtwin build system detects altivec support, and
sets cflags and a #define HAVE_ALTIVEC if found.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change modifies the twin sources to expect twin libraries in the
libtwin/ directory. Consequently, we need to move the headers (and
sources to keep things clean) into the libtwin/ directory in the source
tree.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Remove -fno-struict-aliasing as I think the code is generally
safe due to the proper use of unions when an object can have
multiple different types. twin_timeout.c did have some dodgy
casts that I removed.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch disables refresh around widget refresh operations
(from the toplevel object) so that individual widgets get
refreshed at once and thus don't flicker. This fixes the
flicker with the demos
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This makes the fbdev backend refresh damaged areas directly from
the screen->damaged callback instead of delayed to a "work". The
work is still there to handle console switches. In order to avoid
flicker and artifacts, we also disable refresh around cursor
updates and window content.
The demos flicker a lot in this mode, so they'll have to be fixed
to disable / enable refresh around some operations too (probably in
the widget code), but the overall performances are better for my
application as mouse cursor no longer triggers giant updates when
moving while something else is updating
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
First, don't destroy the previous cursor when relacing it as it's
common for applications to store a bunch of cursor images and flipping
them in, they don't want to have to re-create them each time.
Then, there was a NULL-deref when setting the cursor to NULL to
remove it
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Gives me some air to breath
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This is temporary as I need to implement a proper keyboard handling,
probably via the event device, and an input method mecanism for
translating unhandled raw key down events into ucs4.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
can be used to handle global application events, like console
switch related events (once I take the primitive keyboard stuff
out of twin_fbdev)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
who have a drawproc installed. I intend to use that for some apps that
directly paint in windows rather than using the widgets mecanism
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
are now two different things, so that you can clip drawing within
changing your coordinate system.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Oops, introduced by the transform changes, I wasn't testing
msk for NULL before dereferencing it in one spot.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The existing twin.pc file was generated, but not installed. This change
installs it (as libtwin.pc), and uses the more flexible TWIN_DEP
variables.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change adds twin_png to the default build of libtwin.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change adds --disable options to prevent building
the x11, fbdev, linux-mouse and ttf components, even if
they're found by pkgconfig.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Looks like the idea of splitting up the twin libraries into
componenets (eg, libtwin-x11.so for x11-specific stuff) wasn't
working too well.
Instead, we should stick to the one shared library, whose contents
change depending on the available dependencies.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change moved the twin demo binaries to the twin_demos
subdirectory.
Also, don't include these demos in the install - they can be run from
the build directory instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Change the Makefile.am to not use recursive make - this will allow
future dependencies on the twin library without too much automake pain.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This patch installs the libtwin headers in
$prefix/include/libtwin/ during make install
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Small cleanup of libtool version arguments - only specify
-version-info when building libraries.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The current "target" is the one under the mouse and also
receives mouse movements and button down events. However,
once the button has been pressed in a window, all subsequent
mouse events will be sent to that window (and no mouse leave
will be generated) until the button has been released.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change moves the twin demo applications to a new subdirectory
(twin_demos), and updates the auto{conf,make} setup to suit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
This change separates twin into a set of libraries (libtwin,
libtwin-x11, libtwin-fbdev and libtwin-mouse).
Also, generally improve the autoconf magic to make this all work.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The transform matrix is currently stored in the pixmap, though
it is only ever used when that pixmap is a source of a composite
operation (not for windows refresh, damage, etc...) thus I might
move it to twin_operand_t.
The implementation is totally sub-optimal but it gives a working
basis. As Keith suggested, we could use a bresenham-type algorithm
in the transform loop to avoiding having to transform every pixel
through the matrix. That will probably significantly improve
performances. There are also minor optimisations that can be done
in a few corners.
Also the matrix is used as a reverse transform, which can
be confusing. I'll fix it one of these days to operate on an
inverted matrix instead.
While playing with it, I noticed several issues with the existing
non-transform composite function. A bug I fixed related to masks,
but also the source clipping seems to be busted.
It adds the clip top/left to the src_x/y & msk_x/y which doesn't
make much sense to me and doesn't clip when fetching pixels, thus
forcing you to have perfectly adjusted width and height args to
twin_composite() that match the source image size (which stops
making sense when using transforms). I haven't fixed it yet but
I will do so, possibly by merging xform and simple into one
function (thus always using a temporary span buffer) or by adding
a bit of clipping code to the simple function's inner loop.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
The code would do a delete/insert pass while walking the
queue which had the effect of breaking the "order" linkage
(insert re-initializes pretty much everything).
I fixed that by adding a new _twin_queue_reorder() which
is to be called on an element that is to be re-ordered and
which works at any time, even during a queue walking and
using it from the timeout code.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
If you use that, you also need to link on libpng.
Only quickly tested for now, there are some weird things with
libpng that I might not have gotten right, some comments are
welcome.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
the converter might still be a bit dodgy, I'd appreciate somebody who
knows that stuff better to have a look :-)
Basically, I added back the type '2' operation to the glyph data parser
that was used by the previous ttf parser before it got removed and fixed
it up to work in the new context. I pondered using the 'c' "generic"
curve operation instead and put the burden of conversion in the converter
application, but that would have caused bigger converted font files,
so I chose to keep the old op.
Various bits & pieces of the font code are modified to cope with the
non-stroke fonts (mostly there is no "pen" to account for and we don't
convolve but just append the glyph path to the current path).
Full support for unicode pages is back. The stroke font has only page 0
for now (the initial code seemed to have more tables I didn't feel like
re-converting that so if you want stroke font with more unicode pages,
it's up to you to dig the old format and convert it to detect snaps and
use curves). We may want to add arguments to twin_ttf converter to only
convert a subset of the pages in a font for compactness.
Examples still use the built-in font but it's easy enough to change the
g_twin_font global and link a generated font file in (tested with
Vera.ttf). I still need to add a better way to deal with multiple fonts
at once.
|
|
|
|
|
|
|