1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00
Commit Graph

78 Commits

Author SHA1 Message Date
Tin Švagelj
45500b1439
Separate cairo-xlib.h Lua bindings from cairo.h (#1844)
- Separate cairo-xlib.h Lua bindings from cairo.h
  - This allows cairo.h to be used from Lua on Wayland without X11 as requirement.
- Add pango dependency for Wayland (adds pangocairo).
- Make graphics related bindings depend on BUILD_GUI.
- Remove BUILD_GUI guard around options in platform checks.
  - Keeping only checks that **directly contain module requirements**

A way of creating surfaces in Lua that uses Shm allocated buffers should
be added in future. This commit only cleans up build options to avoid weird
errors.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-19 15:31:23 +00:00
Simon Lees
4119af0ffe cmake: use full path rather then relative.
Co-authored-by: Brenden Matthews <github@brenden.brndn.io>
2024-03-11 16:08:32 -04:00
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
2ade1e292b lua-imlib2: Add missing logging.h file 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
f02cb2ad07 Actually that won't work 2024-03-08 18:58:21 -05:00
Brenden Matthews
85056408ce This is duplicated 2024-03-08 18:58:21 -05:00
Brenden Matthews
e22e081aee Fix bad imlib2 typedefs for imlib<1.10
This should (properly) resolve #1743.
2024-03-08 18:58:21 -05:00
Brenden Matthews
56a81ef4fd Fix build for imlib2 <1.10.0
This fixes #1743
2024-02-24 14:07:55 -05: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
Simon Lees
752d1394fb lua cairo: Add mesh patterns.
Copied in the mesh pattern related functions from the upstream
cairo.h file, also updated cairo_status_t and cairo_pattern_type_t
to include an updated list as both have mesh related values

Fixes #912
2023-04-12 11:11:19 -04:00
Simon Lees
468488677a
lua cairo: Add cairo_surface_create_for_rectangle (#1492)
Adds the function for cairo_surface_create_for_rectangle copied
from the cairo header files. Personally I use this to ensure that
Items can't draw outside there designated area.
2023-04-05 09:07:05 -04:00
Brenden Matthews
0ccf7f01de
chore: Fix imlib2 Lua bindings (#1405)
* chore: Fix imlib2 Lua bindings

The API changed in a backward-incompatible way around 1.10 of imlib2
(though it's not clear which version broke it).

This resolves #1404.
2023-02-17 11:49:04 -05:00
Brenden Matthews
8c6257d925 Update Lua cairo bindings.
This adds 2 missing functions: cairo_surface_set_device_scale and
cairo_surface_get_device_scale, and also requires cario 1.14 or newer.

This addresses the comments in #1083.
2022-11-11 12:58:04 -05:00
Brenden Matthews
589b240360 Fix create/destroy/set/get Lua Rsvg functions.
We need an interface to be able to create/destroy/set/get the
RsvgRectangle and RsvgDimensionData structs via Lua, which were missing
or incomplete.

Documentation was also missing, which has been updated.
2022-10-16 13:00:05 -04:00
Brenden Matthews
5d5ee12c67
Require librsvg >=2.52. 2022-09-10 11:58:27 -05:00
Brenden Matthews
5d02762903
Comment out rsvg_handle_get_intrinsic_size_in_pixels for now. 2022-09-10 11:57:16 -05:00
Brenden Matthews
182b4f0c11
Don't include version header directly. 2022-09-10 11:24:58 -05:00
Brenden Matthews
d3d804ef0f
rsvg_handle_get_intrinsic_size_in_pixels only available on librsvg 2.52
or newer.
2022-09-10 11:23:00 -05:00
Brenden Matthews
12452f8896
Remove deprecated rsvg_handle_get_dimensions, add
rsvg_handle_get_intrinsic_size_in_pixels.
2022-09-10 10:51:38 -05:00
Brenden Matthews
f156de5a4f
Remove deprecated rsvg_handle_render_cairo, add
rsvg_handle_render_document.
2022-09-10 10:47:31 -05:00
Brenden Matthews
7a5c27a585
Remove deprecated rsvg_handle_render_cairo_sub, add
rsvg_handle_render_layer in place.
2022-09-10 10:44:45 -05:00
Brenden Matthews
9f2b71b0a7
Require librsvg>=2.46, fix lua interface. 2021-02-27 10:18:25 -06:00
Brenden Matthews
05fff02e70
Remove librsvg deprecated definitins. 2021-02-27 10:01:03 -06:00
Brenden Matthews
6eae8e8c24
Remove use of deprecated librsvg functions. 2021-02-27 09:50:44 -06:00
Brenden Matthews
308f2cb8ea
Update copyright, authors. 2021-02-27 09:14:19 -06:00
Brenden Matthews
b8d956f884 Add clang 8 to builds.
Also added new librsvg functions, and ignore deprecation warnings on new
versions of librsvg.

Disable sccache on FreeBSD.
2019-04-14 14:42:59 -04:00
Brenden Matthews
90673cf161 Make GitLab build work with clang checks. 2019-02-23 17:13:19 -05:00
lasers
7eec746b82 update copyright year to 2019 2019-01-05 11:15:36 -06:00
Brenden Matthews
03f3ce7bdc Reformat CMake files.
Applied `cmake_format`.
2019-01-03 09:48:43 -05:00
Brenden Matthews
bc60fb2c2f
More build fixes. 2018-12-22 18:34:29 -05:00
Brenden Matthews
dfd10667fd
More build fixes, warning fixes. 2018-12-22 15:37:53 -05:00
Brenden Matthews
bb8723dd36
Add toluapp subtree (#712)
* First commit!

* Import to git

* Droping down CMake requirement

* Corrected installation of libraries

* Adding travis build

* Updated cmake macros

* Fixed find package

* Updated travis hook

* Updated travis hook

* Patch to support Lua 5.3.

* Fix Lua header include directives in tolua++.h

Use angle bracket rather than double quotes when including Lua headers in the tolua++ header. This fixes a problem on systems that default to a Lua version newer than 5.1 and install the tolua++ header to the same directory as newer Lua headers.

As there are (usually) no Lua headers in the same directory when building tolua++ itself, the preprocessor will look to the include directories passed to the compiler, one of which would be the Lua 5.1 include directory, and tolua++ will build with those (correct) headers. Then the tolua++ header is usually installed in the default include directory, alongside the newer Lua headers, which you wouldn't expect to cause any trouble.

But it does cause trouble when trying to build other programs that include the tolua++ header, because now the preprocessor does find Lua headers in the same directory as the tolua++ header, which are the newer (incorrect) headers. Now the program will either fail to compile, because it doesn't support the newer headers, or fail to link with the tolua++ shared object because they were compiled against different Lua headers.

Using angle brackets instead of double quotes in the include directives will fix the problem, because then the preprocessor will look to the include directories passed to the compiler first.

See http://www.cegui.org.uk/forum/viewtopic.php?f=10&t=7195

* Remove email notifications.

* Update travis build.

* Build shared and static libs.

* Patch toluapp to support Lua 5.3.

With this change, support for Lua 5.1 is dropped.

This resolve #116.

* Add some comments to clarify the toluapp handling.

* Add minor sonar fix.
2018-12-20 15:18:51 -05:00
Nikolas Garofil
4d5db325d9 Fix problems found when fixing docker (#575)
* Require at least glib-2.36 (from 03/2013) to remove deprecated g_type_init()

* Fix empty continuation line in Dockerfile

* Require at least libmicrohttpd 0.9.25 (from 09/2012) to replace deprecated MHD_create_response_from_data()

* fix versioncheck libmicrohttpd

* Missing char for null-terminator in print_v6addrs()

* safe_asprintf to fix /proc/subdir bufferoverflows

There is no max length of /proc/subdir, increasing the value of /proc/sys/kernel/pid_max is one way this can happen

* Fix conversion constant c++ string to variable char array

* Fix strncpy using unrelated MPD_BUFFER_MAX_LENGTH

* Use strncpy instead of strcpy in eve.cc

* Use strncpy instead of strcpy in libmpdclient.cc

* move safe_asprintf back and use ostreams in proc.cc to make sonarcloud happy
2018-08-07 09:38:36 -04:00
Brenden Matthews
124b3dfaa4
Added destroy methods to some functions to fix memory leaks. (#535) 2018-07-08 20:51:44 -04: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
marguerite
89f9a6bdf1 respect LIB_INSTALL_DIR 2016-01-07 14:42:14 +08:00
Miroslav Lichvar
2231588b28 Use LIB_SUFFIX when installing libraries
This is needed on systems with /usr/lib64.
2015-11-18 09:08:06 +01:00
Vincent Cheng
b8082ca1fa Avoid clobbering CFLAGS/CXXFLAGS set by user 2015-07-07 01:38:12 -07:00
Oliver Wilkerson
935280e36c Added cairo blending modes to support libcairo-1.10.0 2013-10-31 18:12:57 -05: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
Jochen Keil
550d644e6c Add rsvg bindings to cmake build framework 2013-05-22 22:39:41 +02:00
Jochen Keil
bec61e922c Include header file for helper functions
Also add function declarations
2013-05-22 22:38:17 +02:00
Jochen Keil
dee71f4eb2 Functions for creating and accessing Dimension/Position structs 2013-05-22 22:37:05 +02:00