Skip to content

Commit

Permalink
PRIVATE_COLORSET: always assume this is true
Browse files Browse the repository at this point in the history
For years, we've been setting FVWM_COLORSET_PRIVATE=1, so there
is no need for the include guards.
  • Loading branch information
ThomasAdam authored and Kangie committed Sep 23, 2024
1 parent 99b0c54 commit 51603b2
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 62 deletions.
3 changes: 1 addition & 2 deletions fvwm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ AM_CFLAGS = \
-DFVWM_MODULEDIR=\"$(FVWM_MODULEDIR)\" \
-DFVWM_DATADIR=\"$(FVWM_DATADIR)\" \
-DFVWM_CONFDIR=\"$(FVWM_CONFDIR)\" \
-DFVWM_COLORSET_PRIVATE=1 \
-DLOCALEDIR=\"$(LOCALEDIR)\"
-DLOCALEDIR=\"$(LOCALEDIR)\"
7 changes: 0 additions & 7 deletions libs/Colorset.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ typedef struct Colorset
unsigned int tint_percent : 7;
unsigned int icon_alpha_percent : 7;
unsigned int icon_tint_percent : 7;
#ifdef FVWM_COLORSET_PRIVATE
/* fvwm/colorset.c use only */
Pixel fg_tint;
Pixel fg_saved;
Pixel bg_tint;
Expand All @@ -53,7 +51,6 @@ typedef struct Colorset
Bool dither;
Bool allows_buffered_transparency;
Bool is_maybe_root_transparent;
#endif
} colorset_t;

#define PIXMAP_TILED 0
Expand All @@ -68,7 +65,6 @@ typedef struct Colorset
#define SHAPE_STRETCH 1
#define SHAPE_STRETCH_ASPECT 2

#ifdef FVWM_COLORSET_PRIVATE
#define FG_SUPPLIED 0x1
#define BG_SUPPLIED 0x2
#define HI_SUPPLIED 0x4
Expand All @@ -80,7 +76,6 @@ typedef struct Colorset
#define FG_TINT_SUPPLIED 0x100
#define BG_TINT_SUPPLIED 0x200
#define ICON_TINT_SUPPLIED 0x400
#endif

/* colorsets are stored as an array of structs to permit fast dereferencing */
extern colorset_t *Colorset;
Expand Down Expand Up @@ -155,11 +150,9 @@ extern colorset_t *Colorset;
(cset != NULL && cset->pixmap == ParentRelative && \
cset->tint_percent > 0)

#ifdef FVWM_COLORSET_PRIVATE
/* Create n new colorsets, fvwm/colorset.c does its own thing (different size)
*/
void AllocColorset(int n);
#endif

/* dump one */
char *DumpColorset(int n, colorset_t *colorset);
Expand Down
78 changes: 29 additions & 49 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ conf.set('SIGNAL_RETURN', 'return')
conf.set('ICONV_ARG_CONST', '')
conf.set('fd_set_size_t', 'int')
conf.set('EXECUTABLE_EXTENSION', 'NULL')
conf.set10('HAVE_XOUTPUT_METHOD', true)

# Enable FTMs
if host_machine.system() == 'linux'
Expand Down Expand Up @@ -270,16 +271,18 @@ endif
librsvg = dependency(
'librsvg-2.0',
version: '>=2.13.92',
required: get_option('rsvg'),
required: get_option('svg'),
)
if librsvg.found()
all_found_deps += librsvg
conf.set10('HAVE_RSVG', true)
# We need at least one of these dependencies
svg_opt_deps = ['cairo', 'cairo-svg', 'libsvg-cairo']
svg_backends = ['cairo', 'cairo-svg', 'libsvg-cairo']
svg_deps = []
foreach d : svg_opt_deps
svg_dep = dependency(d, required: false)
foreach d : svg_backends
# By treating these as features we can let automagic find one or more backends
# or we can explicitly set one or more backends as required, or disable ones we don't want to use.
svg_dep = dependency(d, required: get_option(d))
if svg_dep.found()
svg_deps += svg_dep
summary_depvals += {d: svg_dep}
Expand All @@ -288,8 +291,9 @@ if librsvg.found()
endif
endforeach
if svg_deps.length() == 0
# If everything is set to auto (or the user turns all the backends off) we need to explicitly fail here.
error(
'librsvg found but also require one of: ' + ', '.join(svg_opt_deps) +
'librsvg found but also require one of: ' + ', '.join(svg_backends) +
' to build SVG support.',
)
else
Expand All @@ -303,69 +307,40 @@ if sm.found()
conf.set10('SESSION', true)
endif

xcursor = dependency('xcursor', required: get_option('xcursor'))
if xcursor.found()
all_found_deps += xcursor
conf.set10('HAVE_XCURSOR', true)
endif

xext = dependency('xext', required: get_option('xext'))
if xext.found()
all_found_deps += xext
conf.set10('HAVE_SHAPE', true)
endif

# Automagic optional dependencies
# TODO: Automagic dependencies are a nightmare for
# downstream packagers who need to know what is
# and is not enabled for a package at build-time
# not what was randomly also found on their system.

# We should either make these required or hide them behind
# a feature flag.

freetype = dependency('freetype2', required: false)
if freetype.found()
all_found_deps += freetype
summary_depvals += {'freetype': freetype}
conf.set10('HAVE_XFT', true)
freetype_opt_deps = ['xft', 'fontconfig']
freetype_deps = []
foreach d : freetype_opt_deps
# These deps were previously listed as 'optional', but with 'required: true'
freetype_dep = dependency(d, required: false)
if freetype_dep.found()
freetype_deps += freetype_dep
summary_depvals += {d: freetype_dep}
conf.set10('HAVE_' + d.to_upper().underscorify(), true)
endif
endforeach
if freetype_deps.length() > 0
all_found_deps += freetype_deps
endif
endif

xkbcommon = dependency('xkbcommon', required: false)
xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'))
if xkbcommon.found()
all_found_deps += xkbcommon
conf.set10('HAVE_X11_XKBLIB_H', true)
summary_depvals += {'xkbcommon': xkbcommon}
endif

xpm = dependency('xpm', required: false)
xpm = dependency('xpm', required: get_option('xpm'))
if xpm.found()
all_found_deps += xpm
conf.set10('HAVE_XPM', true)
summary_depvals += {'xpm': xpm}
endif

automagic_opt_deps = ['xcursor', 'xrender']
foreach ad : automagic_opt_deps
this_dep = dependency(ad, required: true)
summary_depvals += {ad: this_dep}
conf.set10('HAVE_' + ad.to_upper().underscorify(), true)
all_found_deps += this_dep
endforeach
xrender = dependency('xrender', required: get_option('xrender'))
if xrender.found()
all_found_deps += xrender
conf.set10('HAVE_XRENDER', true)
endif

# Hard-coded
non_configurable_ops = [
'FMiniIconsSupported',
'HAVE_XSM',
'FVWM_COLORSET_PRIVATE',
]

foreach nco : non_configurable_ops
Expand Down Expand Up @@ -551,14 +526,19 @@ summary(
)

featurevals = {
'bidi': fribidi.found() ? fribidi : false,
'BiDi': fribidi.found() ? fribidi : false,
'FreeType': freetype.found() ? freetype : false,
'Go Modules': golang.found(),
'iconv': iconv.found(),
'NLS': libintl.found(),
'PNG support': libpng.found() ? libpng : false,
'Session Management': sm.found() ? sm : false,
'Shaped Windows': xext.found() ? xext : false,
'PNG support': libpng.found() ? libpng : false,
'SVG support': librsvg.found() ? librsvg : false,
'Xcursor': xcursor.found() ? xcursor : false,
'xkbcommon': xkbcommon.found() ? xkbcommon : false,
'XPM support': xpm.found() ? xpm : false,
'XRender': xrender.found() ? xrender : false,
}

if not golang.found()
Expand Down
56 changes: 52 additions & 4 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ option(
value: 'auto',
description: 'Enable fribidi support',
)
option(
'cairo',
type: 'feature',
value: 'auto',
description: 'Use Cairo as a librsvg backend',
)
option(
'cairo-svg',
type: 'feature',
value: 'auto',
description: 'Use CairoSVG as a librsvg backend',
)
option(
'freetype',
type: 'feature',
value: 'auto',
description: 'Enable freetype support',
)
option(
'golang',
type: 'feature',
Expand All @@ -27,6 +45,12 @@ option(
value: 'auto',
description: 'Enable iconv support',
)
option(
'libsvg-cairo',
type: 'feature',
value: 'auto',
description: 'Use librsvg as a librsvg backend',
)
option(
'mandoc',
type: 'boolean',
Expand All @@ -47,20 +71,44 @@ option(
description: 'Enable readline support for FvwmConsole (disabled if using Go)',
)
option(
'rsvg',
'sm',
type: 'feature',
value: 'auto',
description: 'Enable session management support',
)
option(
'svg',
type: 'feature',
value: 'auto',
description: 'Enable svg support',
)
option(
'sm',
'xcursor',
type: 'feature',
value: 'auto',
description: 'Enable session management support',
description: 'Enable Xcursor support',
)
option(
'xext',
type: 'feature',
value: 'auto',
description: 'Enable shaped window support',
description: 'Enable shaped window support via Xext',
)
option(
'xkbcommon',
type: 'feature',
value: 'auto',
description: 'Enable xkbcommon support',
)
option(
'xrender',
type: 'feature',
value: 'auto',
description: 'Enable XRender support',
)
option(
'xpm',
type: 'feature',
value: 'auto',
description: 'Enable X PixMap (xpm) support',
)

0 comments on commit 51603b2

Please sign in to comment.