1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Simon Lees
8800c645f2 Fix Memory Leak 2024-03-11 16:08:32 -04:00
Simon Lees
304e4f3823 Swap to internal C++ logging.h
Along with some other minor merge / C++ fixes.`
2024-03-11 16:08:32 -04:00
Simon Lees
96337be28f Split cairo_draw_image into two functions
In some cases you are already working with a cairo_t and know
your destination image size, this adds an API that allows you
to handle these cases more easily. Along with now being able to
draw images with an alpha level. It also leaves the original API
unchanged.
2024-03-11 16:08:32 -04:00
Simon Lees
b79d465ed3 lua-imlib2: move to conky style logging
Unfortunately we can't use logging.h directly from conky as its
in C++ and lua bindings only have access to a C compiler.

Instead we now have a very simple C implementation of logging.h to
use within the bindings.

This change also adds NULL checks to catch some extra invalid
states
2024-03-11 16:08:32 -04:00
Simon Lees
2e54b29450 lua-imlib2: Fix alpha mask so that its scaled
Previously if the source image was a different to the displayed
image the alpha channel was incorrect, as it wasn't scaled leading
to a series of artifacts.
2024-03-11 16:08:32 -04:00
Simon Lees
01ca581259 lua-imlib2: Implement Stride in a standard way 2024-03-11 16:08:32 -04:00
Simon Lees
3397155da4 lua-imlib2: Improve Error handling
Each of the following cases cause large numbers of cryptic imlib2
prints, so detect them and print a single error for each.
2024-03-11 16:08:32 -04:00
Brenden Matthews
e4bdabc538 Compile tolua++ output as C++ 2024-02-23 13:10:12 -05:00
Brenden Matthews
35357e437c Update copyright 2024-02-22 08:53:35 -05:00
Brenden Matthews
308f2cb8ea
Update copyright, authors. 2021-02-27 09:14:19 -06:00
lasers
7eec746b82 update copyright year to 2019 2019-01-05 11:15:36 -06:00
Brenden Matthews
dfd10667fd
More build fixes, warning fixes. 2018-12-22 15:37:53 -05:00
Brenden Matthews
eebc8c653b
Add formatting/static analysis (#486)
* Reform source with clang-format.

Rules applied with:
    $ find . -iname *.h -o -iname *.cc | xargs clang-format \
        -style=file -i -fallback-style=google

* Add clang-format and analyze to build.

Based on the excellent work at: https://github.com/ttroy50/cmake-examples

* Clean up CMake stuff on macOS.

* Remove vim/emacs modelines.

* Update copyright dates.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.

* Build fixes.
2018-05-12 12:03:00 -04:00
Jochen Keil
56b5a7eeca Wrapper for drawing images with imlib2 and cairo
One problem is, that tolua/lua does not handle plain data pointers
properly. Therefore something like

local surface = cairo_image_surface_create_for_data(
    imlib_image_get_data_for_reading_only(), ..

will fail using the lua bindings. Hence this wrapper, which adds
a function which be used to draw an imlib image to a cairo surface.

This also addresses another issue, drawing images with a transparent
background (e.g. gifs or pngs) to the cairo surface properly. Apparently
the image format of imlib is incompatible to cairos which uses
pre-multiplied data. This is also explained in the cairo documentation.
A fix for this issue is to blend the image with another alpha mask to
get the correct values. The code and explanation for this was taken from

  http://lists.cairographics.org/archives/cairo/2008-March/013492.html

Executive Summary: This wrapper function can load (transparent) images
(e.g. gif or png) from a file by using imlib and draw them on a cairo
surface.
2013-06-08 12:09:35 +02:00