1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 03:50:30 +01:00

WRaster: Create header for i18n helper functions

This patch is just adding a single header, but because it also modifies
all the C files to add the #include, it was made as a patch on its own to
ease review.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2021-05-17 16:32:12 +02:00
committed by Carlos R. Mafra
parent aadd694a6b
commit 19202fd2db
28 changed files with 88 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ libwraster_la_SOURCES = \
flip.c \
convolve.c \
save_xpm.c \
wr_i18n.h \
xutil.c \
xutil.h \
load_ppm.c

View File

@@ -18,7 +18,11 @@
* MA 02110-1301, USA.
*/
#include "config.h"
#include "wraster.h"
#include "wr_i18n.h"
void RCombineAlpha(unsigned char *d, unsigned char *s, int s_has_alpha,
int width, int height, int dwi, int swi, int opacity) {

View File

@@ -30,6 +30,8 @@
#include <assert.h>
#include "wraster.h"
#include "wr_i18n.h"
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MAX(a,b) ((a)>(b) ? (a) : (b))

View File

@@ -39,6 +39,7 @@
#include "wraster.h"
#include "scale.h"
#include "wr_i18n.h"
#ifndef HAVE_FLOAT_MATHFUNC

View File

@@ -36,6 +36,7 @@
#include "wraster.h"
#include "convert.h"
#include "xutil.h"
#include "wr_i18n.h"
#define NFREE(n) if (n) free(n)

View File

@@ -25,7 +25,10 @@
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include "wraster.h"
#include "wr_i18n.h"
/*
*----------------------------------------------------------------------

View File

@@ -28,6 +28,8 @@
#include <assert.h>
#include "wraster.h"
#include "wr_i18n.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))

View File

@@ -30,6 +30,7 @@
#include "wraster.h"
#include "rotate.h"
#include "wr_i18n.h"
static RImage *r_flip_vertically(RImage *source);

View File

@@ -30,6 +30,8 @@
#include <assert.h>
#include "wraster.h"
#include "wr_i18n.h"
static RImage *renderHGradient(unsigned width, unsigned height, int r0, int g0, int b0, int rf, int gf, int bf);
static RImage *renderVGradient(unsigned width, unsigned height, int r0, int g0, int b0, int rf, int gf, int bf);

View File

@@ -36,6 +36,7 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
typedef struct RCachedImage {

View File

@@ -30,6 +30,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
static int InterlacedOffset[] = { 0, 4, 2, 1 };
static int InterlacedJumps[] = { 8, 8, 4, 2 };

View File

@@ -37,6 +37,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* <setjmp.h> is used for the optional error recovery mechanism shown in

View File

@@ -32,6 +32,7 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
static int RInitMagickIfNeeded(void);

View File

@@ -30,6 +30,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
RImage *RLoadPNG(RContext *context, const char *file)
{

View File

@@ -31,6 +31,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* fileio.c - routines to read elements based on Netpbm

View File

@@ -31,6 +31,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
RImage *RLoadTIFF(const char *file, int index)
{

View File

@@ -30,6 +30,7 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
RImage *RLoadWEBP(const char *file_name)

View File

@@ -31,6 +31,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
static RImage *create_rimage_from_xpm(RContext *context, XpmImage xpm)
{

View File

@@ -30,6 +30,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* Restricted support for XPM images.

View File

@@ -28,6 +28,7 @@
#include "wraster.h"
#include "imgformat.h"
#include "convert.h"
#include "wr_i18n.h"
void RBevelImage(RImage * image, int bevel_type)

View File

@@ -26,7 +26,9 @@
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include "wraster.h"
#include "wr_i18n.h"
#include <assert.h>

View File

@@ -30,6 +30,7 @@
#include "wraster.h"
#include "rotate.h"
#include "wr_i18n.h"
#include <math.h>

View File

@@ -33,6 +33,7 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
Bool RSaveImage(RImage * image, const char *filename, const char *format)

View File

@@ -30,6 +30,8 @@
#include "wraster.h"
#include "imgformat.h"
#include "wr_i18n.h"
/*
* Restricted support for XPM images.

View File

@@ -31,6 +31,8 @@
#include "wraster.h"
#include "scale.h"
#include "wr_i18n.h"
/*
*----------------------------------------------------------------------

41
wrlib/wr_i18n.h Normal file
View File

@@ -0,0 +1,41 @@
/*
* Window Maker window manager
*
* Copyright (c) 2021 Window Maker Team
*
* 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 2 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, see the file COPYING.
*/
/*
* This file defines the basic stuff for WRaster's message
* internationalization in the code
*/
#ifndef WRASTER_I18N_H
#define WRASTER_I18N_H
#if defined(HAVE_LIBINTL_H) && defined(I18N)
# include <libintl.h>
# define _(text) dgettext("WRaster", (text))
#else
# define _(text) (text)
#endif
/*
* the N_ macro is used for initializers, it will make xgettext pick the
* string for translation when generating PO files
*/
#define N_(text) (text)
#endif

View File

@@ -30,6 +30,8 @@
#include <assert.h>
#include "wraster.h"
#include "wr_i18n.h"
static int get_shifts(unsigned long mask)
{

View File

@@ -37,6 +37,8 @@
#include "wraster.h"
#include "xutil.h"
#include "wr_i18n.h"
#ifdef USE_XSHM