Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
export CC_LD=lld
fi
export CC=${{ matrix.compiler }}
./autogen.sh && ./configure --enable-mandoc --enable-golang && make -j
./autogen.sh && ./configure --enable-mandoc --enable-golang --enable-mpack && make -j
fi
if [ "${{ matrix.build-system }}" = "meson" ]; then
if [ "${{ matrix.compiler }}" = "gcc" ]; then
Expand All @@ -46,7 +46,7 @@ jobs:
export CC_LD=lld
fi
export CC=${{ matrix.compiler }}
meson setup builddir -Dhtmldoc=true -Dmandoc=true && ninja -C builddir
meson setup builddir -Dhtmldoc=true -Dmandoc=true -Dmcomms=true && ninja -C builddir
fi

notification:
Expand Down
23 changes: 23 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ fi
AM_CONDITIONAL([FVWM_BUILD_GOLANG], [test x"$with_golang" = xyes])
AC_SUBST(GO)

# mpack
problem_mpack=""
AH_TEMPLATE([HAVE_MPACK], [Define MPACK])
AC_ARG_ENABLE(mpack,
AS_HELP_STRING([--enable-mpack],[enable mpack module comms]),
[ if test x"$enableval" = "xyes"; then
with_mpack="yes"
else
with_mpack="no"
problem_mpack=": Explicitly disabled"
fi ],
[ with_mpack="no" ]
)


#!!!
PERL=""
REQUIRED_PERL_VERSION=5.004
Expand Down Expand Up @@ -745,6 +760,13 @@ fi
AC_SUBST(png_LIBS)
AC_SUBST(png_CFLAGS)

yes_to_mpack="no"
if test "$with_mpack" = "yes"; then
PKG_CHECK_MODULES([mpack], [mpack], [yes_to_mpack="yes"], [])
fi

AM_CONDITIONAL([HAVE_MPACK], [test x"$yes_to_mpack" = xyes])

# ********* rsvg
rsvg_min_version=2.13.92
AH_TEMPLATE([HAVE_RSVG], [Define if librsvg library is used.])
Expand Down Expand Up @@ -1508,6 +1530,7 @@ Fvwm3 Configuration:
With XPM image support? $with_xpm$problem_xpm
With Xrender image support? $with_xrender$problem_xrender
With Golang support? $with_golang$problem_golang
With mpack support? $with_mpack$problem_mpack
Build man pages? $with_mandoc$problem_mandoc
Build html man pages? $with_htmldoc$problem_htmldoc

Expand Down
1 change: 1 addition & 0 deletions fvwm/module_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ void CMD_ModuleSynchronous(F_CMD_ARGS)
token = PeekToken(next, &next);
if (token)
{
free(expect);
expect = fxstrdup(token);
}
action = next;
Expand Down
4 changes: 4 additions & 0 deletions libs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ else
libfvwm3_a_SOURCES += strlcpy.h strlcat.h strlcpy.c strlcat.c
endif

if HAVE_MPACK
libfvwm3_a_SOURCES += mcomms.c mcomms.h
endif

libfvwm3_a_LIBADD = @LIBOBJS@

AM_CPPFLAGS = -I$(top_srcdir) $(xpm_CFLAGS) $(Xft_CFLAGS) $(X_CFLAGS) \
Expand Down
63 changes: 63 additions & 0 deletions libs/mcomms.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* 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; if not, see: <http://www.gnu.org/licenses/>
*/

#include <stdio.h>
#include <stdint.h>

#include "config.h"
#include "log.h"
#include "safemalloc.h"
#include "mcomms.h"

uint64_t m_find_bit(const char *);

static const struct {
uint64_t bits;
const char *name;
} all_mcomm_types[] = {
{ MCOMMS_NEW_WINDOW, "new-window" },
{ 0, NULL },
};

uint64_t
m_find_bit(const char *name)
{
int i = 0;

for (i = 0; all_mcomm_types[i].name != NULL; i++) {
if (strcmp(all_mcomm_types[i].name, name) == 0) {
return all_mcomm_types[i].bits;
}
}
fprintf(stderr, "%s: Invalid module interest: %s\n", __func__, name);
return 0;
}

uint64_t
m_register_interest(int *fd, const char *me)
{
char *me1;
const char *component;
uint64_t m_bits = 0;

if (me == NULL)
return 0;
me1 = fxstrdup(me);

while ((component = strsep(&me1, " ")) != NULL)
m_bits |= m_find_bit(component);

free(me1);
return m_bits;
}
44 changes: 44 additions & 0 deletions libs/mcomms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef FVWMLIB_MCOMMS_H
#define FVWMLIB_MCOMMS_H

#include <stdbool.h>

#define MCOMMS_NEW_WINDOW 0x0000000000000001ULL
#define MCOMMS_ALL 0xffffffffffffffffULL

struct m_add_window {
char *window;
int title_height;
int border_width;

struct {
int window;
int x;
int y;
int width;
int height;
} frame;

struct {
int base_width;
int base_height;
int inc_width;
int inc_height;
int orig_inc_width;
int orig_inc_height;
int min_width;
int min_height;
int max_width;
int max_height;
} hints;

struct {
int layer;
int desktop;
int window_type;
} ewmh;
};

uint64_t m_register_interest(int *, const char *);

#endif
6 changes: 6 additions & 0 deletions libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ string_sources = files(
'strlcpy.c',
)

if (mpack.found())
libfvwm3_sources += files(
'mcomms.c'
)
endif

# We don't build the string sources on macOS
# We probably could check for target_system, but nobody is cross-compiling _to_ macOS
if not (host_machine.system() == 'darwin')
Expand Down
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ foreach rd : all_req_deps
all_found_deps += this_dep
endforeach

mpack = dependency('mpack', required: get_option('mcomms'))
if mpack.found()
all_found_deps += mpack
summary_depvals += {'mpack': mpack}
conf.set10('HAVE_MPACK', true)
endif

xext = dependency('xext', required: true)
all_found_deps += xext
summary_depvals += {'xext': xext}
Expand Down
6 changes: 6 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ option(
value: false,
description: 'Enable generation of man pages',
)
option(
'mcomms',
type: 'boolean',
value: false,
description: 'Enable new module comms',
)
option('nls', type: 'feature', value: 'auto', description: 'Enable NLS')
option('png', type: 'feature', value: 'auto', description: 'Enable png support')
option(
Expand Down
9 changes: 8 additions & 1 deletion modules/FvwmIdent/FvwmIdent.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#include "libs/XError.h"
#include "libs/log.h"

#ifdef HAVE_MPACK
#include "libs/mcomms.h"
#endif

#include "FvwmIdent.h"

static RETSIGTYPE TerminateHandler(int);
Expand Down Expand Up @@ -213,7 +217,10 @@ int main(int argc, char **argv)

InitGetConfigLine(fd, mname);
GetConfigLine(fd,&tline);

#ifdef HAVE_MPACK
fprintf(stderr, "GOT: %lu\n",
m_register_interest(fd, "new-window this that the-other"));
#endif
while (tline != (char *)0)
{
if (strlen(tline) <= 1)
Expand Down