1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-19 11:35:12 +00:00

Swap to internal C++ logging.h

Along with some other minor merge / C++ fixes.`
This commit is contained in:
Simon Lees 2024-02-26 22:04:42 +10:30 committed by Brenden Matthews
parent 96337be28f
commit 304e4f3823
3 changed files with 5 additions and 47 deletions

View File

@ -44,7 +44,7 @@ if(BUILD_X11)
endif(BUILD_LUA_CAIRO) endif(BUILD_LUA_CAIRO)
if(BUILD_LUA_IMLIB2) if(BUILD_LUA_IMLIB2)
include_directories(${luaimlib2_includes} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${luaimlib2_includes} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ../src)
if(IMLIB2_VERSION VERSION_GREATER_EQUAL "1.10.0") if(IMLIB2_VERSION VERSION_GREATER_EQUAL "1.10.0")
wrap_tolua(luaimlib2_src imlib2.pkg) wrap_tolua(luaimlib2_src imlib2.pkg)

View File

@ -46,7 +46,7 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
return; return;
} }
image = imlib_load_image(file); image = (Imlib_Image *)imlib_load_image(file);
if (!image) { if (!image) {
NORM_ERR("cairoimagehelper: Couldn't load %s\n", file); NORM_ERR("cairoimagehelper: Couldn't load %s\n", file);
return; return;
@ -87,7 +87,7 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
/* now pass the result to cairo */ /* now pass the result to cairo */
result = cairo_image_surface_create_for_data( result = cairo_image_surface_create_for_data(
(void *)imlib_image_get_data_for_reading_only(), CAIRO_FORMAT_ARGB32, (unsigned char *)imlib_image_get_data_for_reading_only(), CAIRO_FORMAT_ARGB32,
width, height, stride); width, height, stride);
cairo_set_source_surface(cr, result, x, y); cairo_set_source_surface(cr, result, x, y);
@ -124,7 +124,7 @@ void cairo_draw_image(const char *file, cairo_surface_t *cs, int x, int y,
return; return;
} }
Imlib_Image *image = imlib_load_image(file); Imlib_Image *image = (Imlib_Image *)imlib_load_image(file);
if (!image) { if (!image) {
NORM_ERR("cairoimagehelper: Couldn't load %s\n", file); NORM_ERR("cairoimagehelper: Couldn't load %s\n", file);
return; return;

View File

@ -1,42 +0,0 @@
/*
*
* Conky, a system monitor, based on torsmo
*
* Any original torsmo code is licensed under the BSD license
*
* All code written since the fork of torsmo is licensed under the GPL
*
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2021 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _LOGGING_H
#define _LOGGING_H
#include "config.h"
/* Very basic reimplementation of logging.h in c for bindings. */
#define NORM_ERR(...) \
fprintf(stderr, PACKAGE_NAME ": "); \
fprintf (stderr, __VA_ARGS__); \
fputs("\n", stderr);
#endif /* _LOGGING_H */