Panel plugin development

Alexis BRENON @Xfce brenon.alexis+xfce at gmail.com
Wed Apr 3 22:35:35 CEST 2019


Le mer. 3 avr. 2019 à 01:59, Matthew Brush <mbrush at codebrainz.ca> a écrit :
>
> On 2019-04-02 1:48 p.m., Alexis BRENON @Xfce wrote:
> > Hi all,
> >
> > I am working on the xkb-keyboard panel plugin
> > (https://github.com/AlexisBRENON/xfce4-xkb-plugin/tree/variant) and
> > use some `DBG(...)` call to debug my code. However, some do not appear
> > in the panel output.
> >
> > In my case, the calls in the xkb-plugin.c file (around lines 644 to
> > 650, https://github.com/AlexisBRENON/xfce4-xkb-plugin/blob/5951e1e6ea376bbb1516d17e267a47fb06b05504/panel-plugin/xkb-plugin.c#L644)
> > print the right text in the panel output.
> > However, the calls inside the function `xkb_keyboard_get_pixbuf`
> > (called line 645) are never displayed
> > (https://github.com/AlexisBRENON/xfce4-xkb-plugin/blob/variant/panel-plugin/xkb-keyboard.c#L853).
> >
> > Do you know why all my debug messages are not printed? Is there a way
> > to connect to the gdb instances if I run the xfce panel with the gdb
> > debug mode (to make sure that the function is actually called)?
> >
> > Thanks for your help. So hurry to share my contribution to the community.
> >
>
> Hi,
>
> I'm not familiar with that (terribly named) macro, but it sounds as if
> perhaps it's not being defined in some of your translation units. The
> compiler warnings should hint at what's going on if you've got them
> enabled (ex. -Wall -Wextra).
>
> That said, it sounds like it is perhaps this:
> https://forum.xfce.org/viewtopic.php?pid=30829#p30829
>
> Regards,
> Matthew Brush

Hi,

Thanks for the answer. For sure, I think that is a problem with the
compilation... I tried to compile with full debug:

$ ./autogen.sh --enable-debug=full
[...]
Build Configuration:

* Debug Support:    full

Now type "make" to compile.

$ make
[...]
  CC       libxkb_la-xkb-plugin.lo
In file included from
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/libxfce4panel.h:29,
                 from
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-plugin-provider.h:23,
                 from
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros-46.h:26,
                 from
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-plugin.h:28,
                 from xkb-plugin.h:29,
                 from xkb-plugin.c:34:
xkb-plugin.c: In function 'xkb_plugin_register_type':
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:189:7:
error: cast between incompatible function types from 'void (*)(void
*)' to 'void (*)(void *, void *)' [-Werror=cast-function-type]
       (GClassInitFunc) type_name##_class_intern_init, \
       ^
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:211:3:
note: in expansion of macro 'XFCE_PANEL_DEFINE_TYPE'
   XFCE_PANEL_DEFINE_TYPE (TypeName, type_name, XFCE_TYPE_PANEL_PLUGIN) \
   ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:122:3:
note: in expansion of macro '_XPP_DEFINE_PLUGIN'
   _XPP_DEFINE_PLUGIN (TypeName, type_name, FALSE, args)
   ^~~~~~~~~~~~~~~~~~
xkb-plugin.c:128:1: note: in expansion of macro 'XFCE_PANEL_DEFINE_PLUGIN'
 XFCE_PANEL_DEFINE_PLUGIN (XkbPlugin, xkb_plugin)
 ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:194:7:
error: cast between incompatible function types from 'void
(*)(XkbPlugin *)' {aka 'void (*)(struct _XkbPlugin *)'} to 'void
(*)(GTypeInstance *, void *)' {aka 'void (*)(struct _GTypeInstance *,
void *)'} [-Werror=cast-function-type]
       (GInstanceInitFunc) type_name##_init, \
       ^
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:211:3:
note: in expansion of macro 'XFCE_PANEL_DEFINE_TYPE'
   XFCE_PANEL_DEFINE_TYPE (TypeName, type_name, XFCE_TYPE_PANEL_PLUGIN) \
   ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/xfce4/libxfce4panel-2.0/libxfce4panel/xfce-panel-macros.h:122:3:
note: in expansion of macro '_XPP_DEFINE_PLUGIN'
   _XPP_DEFINE_PLUGIN (TypeName, type_name, FALSE, args)
   ^~~~~~~~~~~~~~~~~~
xkb-plugin.c:128:1: note: in expansion of macro 'XFCE_PANEL_DEFINE_PLUGIN'
 XFCE_PANEL_DEFINE_PLUGIN (XkbPlugin, xkb_plugin)
 ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[...]

I know makefile but not autogen... Do I need to recompile xfce4-panel
instead of using the one provided by ArchLinux (xfce4-panel 4.12.2
(Xfce 4.12))?

Kind,
Alexis.


More information about the Xfce4-dev mailing list