Browse Source

* libxfce4panel: Add visibility support to reduce the library size a bit.

* Various code cleanups and improvements.

(Old svn revision: 25192)
upstream/xfce4-panel-4.10.1
Nick Schermer 15 years ago
parent
commit
0f526e3a6f
  1. 7
      ChangeLog
  2. 22
      NEWS
  3. 96
      configure.in.in
  4. 94
      libxfce4panel/Makefile.am
  5. 24
      libxfce4panel/abicheck.sh
  6. 0
      libxfce4panel/libxfce4panel-marshal.list
  7. 199
      libxfce4panel/libxfce4panel.symbols
  8. 155
      libxfce4panel/make-libxfce4panel-alias.pl
  9. 55
      libxfce4panel/xfce-arrow-button.c
  10. 3
      libxfce4panel/xfce-arrow-button.h
  11. 36
      libxfce4panel/xfce-hvbox.c
  12. 3
      libxfce4panel/xfce-hvbox.h
  13. 123
      libxfce4panel/xfce-itembar.c
  14. 31
      libxfce4panel/xfce-itembar.h
  15. 9
      libxfce4panel/xfce-panel-convenience.c
  16. 85
      libxfce4panel/xfce-panel-external-item.c
  17. 6
      libxfce4panel/xfce-panel-external-item.h
  18. 82
      libxfce4panel/xfce-panel-external-plugin.c
  19. 6
      libxfce4panel/xfce-panel-external-plugin.h
  20. 116
      libxfce4panel/xfce-panel-internal-plugin.c
  21. 6
      libxfce4panel/xfce-panel-internal-plugin.h
  22. 132
      libxfce4panel/xfce-panel-item-iface.c
  23. 6
      libxfce4panel/xfce-panel-item-iface.h
  24. 8
      libxfce4panel/xfce-panel-macros.c
  25. 63
      libxfce4panel/xfce-panel-macros.h
  26. 34
      libxfce4panel/xfce-panel-plugin-iface-private.h
  27. 345
      libxfce4panel/xfce-panel-plugin-iface.c
  28. 9
      libxfce4panel/xfce-panel-plugin-messages.c
  29. 63
      libxfce4panel/xfce-panel-window.c
  30. 11
      panel/panel-properties.c
  31. 15
      panel/panel.c
  32. 6
      plugins/launcher/launcher.c

7
ChangeLog

@ -1,3 +1,10 @@
2007-03-18 15:23 nick
* libxfce4panel: Add visibility support to reduce the library size a bit.
* libxfce4panel/xfce-panel-macros.h: Add macros to disable debugging for
release builds.
* Various code cleanups and improvements.
2007-03-18 11:40 nick
* plugins/launcher/launcher.c: Fix insensitive button after adding items to the panel.

22
NEWS

@ -2,7 +2,7 @@
=====
- Completely rewritten launcher (Bugs 2336, 2365, 1323, 2262 and 1225)
- Various improvements in libxfce4panel (memory leaks, G_GNUC_INTERNAL,
GSList, canonical strings and fixed pedantic warnings).
GSList, visibility support, canonical strings and fixed pedantic warnings).
- Libxfce4panel does no longer depend on libxfcegui4. This might cause
some problems with plugins. Plugin developers should add libxfcegui4
to the dependencies of their package (including cflags and libadd in
@ -12,7 +12,7 @@
4.3.99.3 (4.4-RC3)
==================
- Update or add blinking for urgent windows in taslist, windowlist and iconbox.
- Update or add blinking for urgent windows in taslist, windowlist and iconbox.
(Jasper)
- Move test plugin to Xfce Goodies. (Nick)
- Several fixes for (re)sizing and positioning behavior. (Jasper)
@ -23,7 +23,7 @@
4.3.99.2 (4.4-RC2)
==================
- Adjust the plugin system to improve support for other platforms
- Adjust the plugin system to improve support for other platforms
(read: windows). (Jasper, Olivier)
- Many small fixes. (Jasper, Nick, Olivier, Jean-Francois)
- Translation updates. (Xfce Translation Team)
@ -76,7 +76,7 @@
- Increase API version, but still support old plugins (Jasper)
- Use new gtk 2.4 file chooser (Jasper)
- Improve focus management (in combination with xfwm4) by setting the dock
type hint. Panel will now always be on top; the option is gone.
type hint. Panel will now always be on top; the option is gone.
(Olivier, Jasper)
- Transparency is always on, but toggled off when the mouse is over the panel
(Jasper)
@ -87,7 +87,7 @@
- Several translation updates (Jean-Francois)
- Some autohide fixes with open dialogs (Jasper)
- Fix multihead support (Jasper)
- Translucent panel when set on top. Needs xfwm4 with composite support
- Translucent panel when set on top. Needs xfwm4 with composite support
and XOrg >= 6.8.0 with composite extension enabled. (Olivier)
@ -95,28 +95,28 @@
==================
- Use basedir spec to locate config file. (Jasper)
- Rename xfce4rc to contents.xml. (Jasper)
- Change the fallback (default) icons to the ones from the Rodent theme
- Change the fallback (default) icons to the ones from the Rodent theme
by Francois, very pretty. (Jasper)
- Add support for new KIOSK mode. Much better than env variables. (Benedikt)
- Fix autohide and right-click menu interaction. (Jasper)
- Icon theme support : no more panel-specific themes, the panel will now
follow the icon theme set in the user interface dialog. (Jasper)
- Set partial struts (Jasper)
- Add multihead support. The user needs to set DISPLAY properly to start a
- Add multihead support. The user needs to set DISPLAY properly to start a
new panel on another screen. (Jasper)
- Update list of module list when opening dialog: remove uninstalled modules
(when not in use) and add newly installed ones. Based on idea of Scott
(when not in use) and add newly installed ones. Based on idea of Scott
Barron. (Jasper)
- Use a dialog to add items to the panel, instead of a submenu. (Jasper)
- Reduce handle width to show only one line of dots. (Jasper)
- Split out the code for choosing a command and choosing an icon from
item_dialog.c. to make it available for use in other dialogs (plugins).
The mailcheck plugin makes use of it and of course the launcher dialog.
item_dialog.c. to make it available for use in other dialogs (plugins).
The mailcheck plugin makes use of it and of course the launcher dialog.
(Jasper)
- Implement module unloading. Add uniqueness setting to plugins. (Jasper)
- Add pop3 email checking: Use 'pop3://username:password@host' as mailbox.
(Olivier)
- Properly update arrow direction. Use this info to position the menus.
- Properly update arrow direction. Use this info to position the menus.
Much better. (Jasper)
- Add xrandr awareness. (Jasper)
- Add xinerama aware smart positioning. (Jasper)

96
configure.in.in

@ -19,6 +19,11 @@ m4_define([xfce4_panel_version_build], [r@REVISION@])
m4_define([xfce4_panel_version_tag], [svn])
m4_define([xfce4_panel_version], [xfce4_panel_version_major().xfce4_panel_version_minor().xfce4_panel_version_micro()ifelse(xfce4_panel_version_nano(), [], [], [.xfce4_panel_version_nano()])ifelse(xfce4_panel_version_tag(), [svn], [xfce4_panel_version_tag()-xfce4_panel_version_build()], [xfce4_panel_version_tag()])])
dnl *******************************************
dnl *** Debugging support for SVN snapshots ***
dnl *******************************************
m4_define([panel_debug_default], [ifelse(panel_version_tag(), [svn], [yes], [minimum])])
dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
@ -49,9 +54,10 @@ dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AC_PROG_CC()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_LN_S()
AC_PROG_INTLTOOL([0.31], [no-xml])
AC_PROG_INTLTOOL()
AC_CHECK_PROGS([PERL], [perl5 perl])
dnl **************************
dnl *** Initialize libtool ***
@ -138,7 +144,91 @@ GTK_DOC_CHECK([1.0])
dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG()
dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes/full@:>@], [Turn on debugging @<:@default=panel_debug_default@:>@]),
[], [enable_debug=thunar_debug_default])
AC_MSG_CHECKING([whether to enable debugging support])
if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Make sure we detect possible errors (if supported)
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
PLATFORM_CFLAGS="$PLATFORM_CFLAGS -Wall -Werror"
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
dnl Paranoia for --enable-debug=full
if test x"$enable_debug" = x"full"; then
dnl Enable extensive debugging
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_ENABLE_DEBUG"
dnl Use -O0 -g3 if the compiler supports it
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -O0 -g3"
AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
PLATFORM_CFLAGS="$PLATFORM_CFLAGS -O0 -g3"
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
fi
else
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Disable debugging (release build)
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DNDEBUG"
dnl Disable object cast checks
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_CAST_CHECKS"
dnl Disable all checks for --enable-debug=no
if test x"$enable_debug" = x"no"; then
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
fi
fi
dnl ****************************************
dnl *** Check for ELF visibility support ***
dnl ****************************************
AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Don't use ELF visibility attributes]), [], [enable_visibility=yes])
have_gnuc_visibility=no
if test x"$enable_visibility" != x"no"; then
dnl Check whether the compiler supports the visibility attribute
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
AC_COMPILE_IFELSE(AC_LANG_SOURCE(
[
void __attribute__ ((visibility("default"))) test_default (void) {}
void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
]),
[
have_gnuc_visibility=yes
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
fi
if test x"$have_gnuc_visibility" = x"yes"; then
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DHAVE_GNUC_VISIBILITY"
fi
AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"])
dnl *********************************
dnl *** Substitute platform flags ***

94
libxfce4panel/Makefile.am

@ -10,13 +10,15 @@ lib_LTLIBRARIES = \
libxfce4panel.la
libxfce4panel_public_built_sources = \
xfce-panel-enum-types.h
libxfce4panel-enum-types.h
libxfce4panel_built_sources = \
$(libxfce4panel_public_built_sources) \
xfce-panel-enum-types.c \
xfce-marshal.c \
xfce-marshal.h
libxfce4panel-enum-types.c \
libxfce4panel-alias.h \
libxfce4panel-aliasdef.c \
libxfce4panel-marshal.c \
libxfce4panel-marshal.h
libxfce4panel_headers = \
xfce-panel-window.h \
@ -65,6 +67,7 @@ libxfce4panel_la_CFLAGS = \
libxfce4panel_la_LDFLAGS = \
-export-dynamic \
-export-symbols-regex "^[^_].*" \
-version-info $(LIBXFCE4PANEL_VERINFO) \
$(PLATFORM_LDFLAGS)
@ -77,60 +80,93 @@ libxfce4panel_la_LIBADD = \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS)
##
## Pkg-config information
##
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxfce4panel-1.0.pc
CLEANFILES = \
actual-abi \
expected-abi \
xgen-etc \
xgen-eth \
xgen-mh \
xgen-mc
EXTRA_DIST = \
xfce-marshal.list
abicheck.sh \
make-libxfce4panel-alias.pl \
libxfce4panel.symbols \
libxfce4panel-alias.h \
libxfce4panel-aliasdef.c \
libxfce4panel-marshal.list
##
## Rules to auto-generate built sources
##
if MAINTAINER_MODE
DISTCLEANFILES = \
stamp-libxfce4panel-enum-types.h \
stamp-libxfce4panel-marshal.h \
$(libxfce4panel_built_sources)
BUILT_SOURCES = \
$(libxfce4panel_built_sources)
xfce-panel-enum-types.h: $(libxfce4panel_headers)
if HAVE_GNUC_VISIBILITY
TESTS = \
abicheck.sh
endif
libxfce4panel-alias.h: make-libxfce4panel-alias.pl libxfce4panel.symbols
$(PERL) $(srcdir)/make-libxfce4panel-alias.pl < $(srcdir)/libxfce4panel.symbols > libxfce4panel-alias.h
libxfce4panel-aliasdef.c: make-libxfce4panel-alias.pl libxfce4panel.symbols
$(PERL) $(srcdir)/make-libxfce4panel-alias.pl -def < $(srcdir)/libxfce4panel.symbols > libxfce4panel-aliasdef.c
libxfce4panel-enum-types.h: stamp-libxfce4panel-enum-types.h
@true
stamp-libxfce4panel-enum-types.h: $(libxfce4panel_headers) Makefile
( cd $(srcdir) && glib-mkenums \
--fhead "#ifndef __XFCE_PANEL_ENUM_TYPES_H__\n#define __XFCE_PANEL_ENUM_TYPES_H__\n#include <libxfce4util/libxfce4util.h>\nG_BEGIN_DECLS\n" \
--fhead "#ifndef __LIBXFCE4PANEL_ENUM_TYPES_H__\n#define __LIBXFCE4PANEL_ENUM_TYPES_H__\n#include <libxfce4util/libxfce4util.h>\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n#include <libxfce4panel/@filename@>\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define XFCE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* !__XFCE_PANEL_ENUM_TYPES_H__ */" \
--ftail "G_END_DECLS\n\n#endif /* !__LIBXFCE4PANEL_ENUM_TYPES_H__ */" \
$(libxfce4panel_headers) ) >> xgen-eth \
&& (cmp -s xgen-eth xfce-panel-enum-types.h || cp xgen-eth xfce-panel-enum-types.h ) \
&& rm -f xgen-eth xgen-eth~
&& (cmp -s xgen-eth libxfce4panel-enum-types.h || cp xgen-eth libxfce4panel-enum-types.h ) \
&& rm -f xgen-eth \
&& echo timestamp > $(@F)
xfce-panel-enum-types.c: xfce-panel-enum-types.h
libxfce4panel-enum-types.c: $(libxfce4panel_headers) Makefile
( cd $(srcdir) && glib-mkenums \
--fhead "#include <xfce-panel-enum-types.h>\n" \
--fhead "#include <libxfce4panel-enum-types.h>\n#include <libxfce4panel/libxfce4panel-alias.h>" \
--fprod "\n/* enumerations from \"@filename@\" */\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n\tstatic GType type = 0;\n\tif (type == 0) {\n\tstatic const G@Type@Value values[] = {" \
--vprod "\t{ @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail "\t{ 0, NULL, NULL }\n\t};\n\ttype = g_@type@_register_static (\"@EnumName@\", values);\n }\n\treturn type;\n}\n" \
$(libxfce4panel_headers) ) > xgen-etc \
&& cp xgen-etc xfce-panel-enum-types.c \
&& rm -f xgen-etc xgen-etc~
xfce-marshal.h: $(srcdir)/xfce-marshal.list
--ftail "\n#define __LIBXFCE4PANEL_ENUM_TYPES_C__\n#include \"libxfce4panel-aliasdef.c\"\n" \
$(libxfce4panel_headers) ) >> xgen-etc \
&& cp xgen-etc libxfce4panel-enum-types.c \
&& rm -f xgen-etc
libxfce4panel-marshal.h: stamp-libxfce4panel-marshal.h
@true
stamp-libxfce4panel-marshal.h: $(srcdir)/libxfce4panel-marshal.list Makefile
( cd $(srcdir) && glib-genmarshal \
--prefix="_xfce_marshal" \
--header xfce-marshal.list \
| sed -e 's/marshal_data);$$/marshal_data) G_GNUC_INTERNAL;/' ) > xgen-mh \
&& cp xgen-mh $(@F) \
&& rm -f xgen-mh xgen-mh~
xfce-marshal.c: xfce-marshal.h
--prefix="_libxfce4panel_marshal" \
--header libxfce4panel-marshal.list \
| sed -e 's/marshal_data);$$/marshal_data) G_GNUC_INTERNAL;/' ) >> xgen-mh \
&& ( cmp -s xgen-mh libxfce4panel-marshal.h || cp xgen-mh libxfce4panel-marshal.h ) \
&& rm -f xgen-mh \
&& echo timestamp > $(@F)
libxfce4panel-marshal.c: libxfce4panel-marshal.h Makefile
( cd $(srcdir) && glib-genmarshal \
--prefix="_xfce_marshal" \
--body xfce-marshal.list ) > xgen-mc \
&& cp xgen-mc xfce-marshal.c \
&& rm -f xgen-mc xgen-mc~
--prefix="_libxfce4panel_marshal" \
--body libxfce4panel-marshal.list ) >> xgen-mc \
&& cp xgen-mc libxfce4panel-marshal.c \
&& rm -f xgen-mc
endif
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:

24
libxfce4panel/abicheck.sh

@ -0,0 +1,24 @@
#!/bin/sh
#
# Copyright (c) 2004 The GLib Development Team
# Copyright (c) 2007 Nick Schermer <nick@xfce.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
cpp -P -DINCLUDE_INTERNAL_SYMBOLS -DALL_FILES ${srcdir:-.}/libxfce4panel.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi
nm -D .libs/libxfce4panel.so | grep " R\|T " | cut -d ' ' -f 3 | grep -v '^_.*' | sort > actual-abi
diff -u expected-abi actual-abi && rm expected-abi actual-abi

0
libxfce4panel/xfce-marshal.list → libxfce4panel/libxfce4panel-marshal.list

199
libxfce4panel/libxfce4panel.symbols

@ -0,0 +1,199 @@
/* $Id$ */
/*-
* Copyright (c) 2007 Nick Schermer <nick@xfce.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* This file lists all exported symbols. It is used to generate
* the gobject.def file used to control exports on Windows and the
* libxfce4panelvfs-alias.h/libxfce4panel-aliasdef.c files used to avoid PLT
* entries for * internal uses of exported functions (see
* make-libxfce4panel-alias.pl).
*
* Every symbol must be included in the right
* #ifdef IN_HEADER(sym) #endif and
* #ifdef IN_SOURCE(sym) #endif sections.
*/
#ifdef ALL_FILES
#define IN_SOURCE(x) 1
#define IN_HEADER(x) 1
#endif
#if IN_HEADER(__XFCE_ARROW_BUTTON_H__)
#if IN_SOURCE(__XFCE_ARROW_BUTTON_C__)
xfce_arrow_button_get_type G_GNUC_CONST
xfce_arrow_button_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_arrow_button_set_arrow_type
xfce_arrow_button_get_arrow_type
#endif
#endif
#if IN_HEADER(__XFCE_HVBOX_H__)
#if IN_SOURCE(__XFCE_HVBOX_C__)
xfce_hvbox_get_type G_GNUC_CONST
xfce_hvbox_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_hvbox_set_orientation
#endif
#endif
#if IN_HEADER(__XFCE_ITEMBAR_H__)
#if IN_SOURCE(__XFCE_ITEMBAR_C__)
xfce_itembar_get_type G_GNUC_CONST
xfce_itembar_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_itembar_set_orientation
xfce_itembar_get_orientation
xfce_itembar_insert
xfce_itembar_append
xfce_itembar_prepend
xfce_itembar_reorder_child
xfce_itembar_set_child_expand
xfce_itembar_get_child_expand
xfce_itembar_get_n_items
xfce_itembar_get_item_index
xfce_itembar_get_nth_item G_GNUC_WARN_UNUSED_RESULT
xfce_itembar_raise_event_window
xfce_itembar_lower_event_window
xfce_itembar_event_window_is_raised
xfce_itembar_get_item_at_point G_GNUC_WARN_UNUSED_RESULT
xfce_itembar_get_drop_index
#endif
#endif
#if IN_HEADER(__XFCE_PANEL_CONVENIENCE_H__)
#if IN_SOURCE(__XFCE_PANEL_CONVENIENCE_C__)
xfce_create_panel_button G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_create_panel_toggle_button G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_allow_panel_customization
#endif
#endif
#if IN_HEADER(__XFCE_EXTERNAL_PANEL_ITEM_H__)
#if IN_SOURCE(__XFCE_EXTERNAL_PANEL_ITEM_C__)
xfce_external_panel_item_get_type G_GNUC_CONST
xfce_external_panel_item_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
#endif
#endif
#if IN_HEADER(__XFCE_EXTERNAL_PANEL_PLUGIN_H__)
#if IN_SOURCE(__XFCE_EXTERNAL_PANEL_PLUGIN_C__)
xfce_external_panel_plugin_get_type G_GNUC_CONST
xfce_external_panel_plugin_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
#endif
#endif
#if IN_HEADER(__XFCE_INTERNAL_PANEL_PLUGIN_H__)
#if IN_SOURCE(__XFCE_INTERNAL_PANEL_PLUGIN_C__)
xfce_internal_panel_plugin_get_type G_GNUC_CONST
xfce_internal_panel_plugin_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
#endif
#endif
#if IN_HEADER(__XFCE_PANEL_ITEM_IFACE_H__)
#if IN_SOURCE(__XFCE_PANEL_ITEM_IFACE_C__)
xfce_panel_item_get_type G_GNUC_CONST
xfce_panel_item_focus_panel
xfce_panel_item_expand_changed
xfce_panel_item_menu_deactivated
xfce_panel_item_menu_opened
xfce_panel_item_customize_panel
xfce_panel_item_customize_items
xfce_panel_item_move
xfce_panel_item_set_panel_hidden
xfce_panel_item_get_name
xfce_panel_item_get_id
xfce_panel_item_get_display_name
xfce_panel_item_get_expand
xfce_panel_item_save
xfce_panel_item_free_data
xfce_panel_item_set_size
xfce_panel_item_set_screen_position
xfce_panel_item_set_sensitive
xfce_panel_item_remove
xfce_panel_item_configure
#endif
#endif
#if IN_HEADER(__XFCE_PANEL_PLUGIN_IFACE_H__)
#if IN_SOURCE(__XFCE_PANEL_PLUGIN_IFACE_C__)
xfce_panel_plugin_get_type G_GNUC_CONST
xfce_panel_plugin_get_name G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_plugin_get_id G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_plugin_get_display_name G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_plugin_get_size
xfce_panel_plugin_get_screen_position
xfce_panel_plugin_set_expand
xfce_panel_plugin_get_expand
xfce_panel_plugin_get_orientation
xfce_panel_plugin_add_action_widget
xfce_panel_plugin_menu_insert_item
xfce_panel_plugin_menu_show_about
xfce_panel_plugin_menu_show_configure
xfce_panel_plugin_block_menu
xfce_panel_plugin_unblock_menu
xfce_panel_plugin_register_menu
xfce_panel_plugin_lookup_rc_file G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_plugin_save_location G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_plugin_focus_widget
xfce_panel_plugin_set_panel_hidden
#endif
#endif
#if IN_HEADER(__XFCE_PANEL_PLUGIN_MESSAGES_H__)
#if IN_SOURCE(__XFCE_PANEL_PLUGIN_MESSAGES_C__)
xfce_panel_plugin_message_send
#endif
#endif
#if IN_HEADER(__XFCE_PANEL_WINDOW_H__)
#if IN_SOURCE(__XFCE_PANEL_WINDOW_C__)
xfce_panel_window_get_type G_GNUC_CONST
xfce_panel_window_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
xfce_panel_window_set_orientation
xfce_panel_window_get_orientation
xfce_panel_window_set_handle_style
xfce_panel_window_get_handle_style
xfce_panel_window_set_show_border
xfce_panel_window_get_show_border
xfce_panel_window_set_resize_function
xfce_panel_window_set_move_function
xfce_panel_window_set_movable
xfce_panel_window_get_movable
#endif
#endif

155
libxfce4panel/make-libxfce4panel-alias.pl

@ -0,0 +1,155 @@
#!/usr/bin/env perl -w
#
# Copyright (c) 2004 The GLib Development Team.
# Copyright (c) 2007 Nick Schermer <nick@xfce.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
my $option_def = 0;
if (($#ARGV >= 0) && ($ARGV[0] eq "-def"))
{
shift;
$option_def = 1;
}
print <<EOF;
/* Generated by make-libxfce4panel-alias.pl. Do not edit this file. */
#ifdef HAVE_GNUC_VISIBILITY
#include <glib.h>
EOF
if ($option_def)
{
print <<EOF
#undef IN_HEADER
#define IN_HEADER(x) 1
#undef IN_SOURCE
#define IN_SOURCE defined
EOF
}
else
{
print <<EOF
#define IN_HEADER defined
#define IN_SOURCE(x) 1
EOF
}
my $in_comment = 0;
my $in_skipped_section = 0;
while (<>)
{
# ignore empty lines
next if /^\s*$/;
# skip comments
if ($_ =~ /^\s*\/\*/)
{
$in_comment = 1;
}
if ($in_comment)
{
if ($_ =~ /\*\/\s$/)
{
$in_comment = 0;
}
next;
}
# handle ifdefs
if ($_ =~ /^\#endif/)
{
if (!$in_skipped_section)
{
print $_;
}
$in_skipped_section = 0;
next;
}
if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES)/)
{
$in_skipped_section = 1;
}
if ($in_skipped_section)
{
next;
}
if ($_ =~ /^\#ifn?def\s+G/)
{
print $_;
next;
}
if ($_ =~ /^\#if.*(IN_SOURCE|IN_HEADER)/)
{
print $_;
next;
}
chop;
my $line = $_;
my @words;
my $attributes = "";
@words = split (/ /, $line);
my $symbol = shift (@words);
chomp ($symbol);
my $alias = "IA__".$symbol;
# Drop any Win32 specific .def file syntax, but keep attributes
foreach $word (@words)
{
$attributes = "$attributes $word" unless $word eq "PRIVATE";
}
if (!$option_def)
{
print <<EOF
extern __typeof ($symbol) $alias __attribute((visibility("hidden")))$attributes;
\#define $symbol $alias
EOF
}
else
{
print <<EOF
\#undef $symbol
extern __typeof ($symbol) $symbol __attribute((alias("$alias"), visibility("default")));
EOF
}
}
print <<EOF;
#endif /* HAVE_GNUC_VISIBILITY */
EOF

55
libxfce4panel/xfce-arrow-button.c

@ -22,15 +22,19 @@
#include <config.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <gtk/gtk.h>
#include "xfce-marshal.h"
#include "xfce-panel-macros.h"
#include "xfce-panel-enum-types.h"
#include "xfce-arrow-button.h"
#include <libxfce4panel/libxfce4panel-marshal.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/libxfce4panel-enum-types.h>
#include <libxfce4panel/xfce-arrow-button.h>
#include <libxfce4panel/libxfce4panel-alias.h>
#define ARROW_WIDTH 8
#define ARROW_PADDING 2
@ -106,17 +110,17 @@ xfce_arrow_button_class_init (XfceArrowButtonClass * klass)
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
parent_class = g_type_class_peek_parent (klass);
gobject_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
container_class = (GtkContainerClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = xfce_arrow_button_get_property;
gobject_class->set_property = xfce_arrow_button_set_property;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->expose_event = xfce_arrow_button_expose;
widget_class->size_request = xfce_arrow_button_size_request;
container_class = GTK_CONTAINER_CLASS (klass);
container_class->add = xfce_arrow_button_add;
container_class->child_type = xfce_arrow_button_child_type;
@ -131,14 +135,13 @@ xfce_arrow_button_class_init (XfceArrowButtonClass * klass)
* This value also determines the direction of the popup menu.
**/
arrow_button_signals[ARROW_TYPE_CHANGED] =
g_signal_new (I_("arrow-type-changed"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (XfceArrowButtonClass,
arrow_type_changed),
NULL, NULL,
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE, 1, GTK_TYPE_ARROW_TYPE);
g_signal_new (I_("arrow-type-changed"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (XfceArrowButtonClass, arrow_type_changed),
NULL, NULL,
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE, 1, GTK_TYPE_ARROW_TYPE);
/* properties */
@ -155,7 +158,7 @@ xfce_arrow_button_class_init (XfceArrowButtonClass * klass)
"The arrow type of the menu button",
GTK_TYPE_ARROW_TYPE,
GTK_ARROW_UP,
G_PARAM_READWRITE));
PANEL_PARAM_READWRITE));
}
@ -281,11 +284,7 @@ xfce_arrow_button_child_type (GtkContainer *container)
GtkWidget *
xfce_arrow_button_new (GtkArrowType type)
{
XfceArrowButton *button;
button = g_object_new (XFCE_TYPE_ARROW_BUTTON, "arrow_type", type, NULL);
return GTK_WIDGET (button);
return g_object_new (XFCE_TYPE_ARROW_BUTTON, "arrow_type", type, NULL);
}
@ -301,7 +300,7 @@ void
xfce_arrow_button_set_arrow_type (XfceArrowButton *button,
GtkArrowType type)
{
g_return_if_fail (XFCE_IS_ARROW_BUTTON (button));
_panel_return_if_fail (XFCE_IS_ARROW_BUTTON (button));
button->arrow_type = type;
@ -323,7 +322,13 @@ xfce_arrow_button_set_arrow_type (XfceArrowButton *button,
GtkArrowType
xfce_arrow_button_get_arrow_type (XfceArrowButton *button)
{
g_return_val_if_fail (XFCE_IS_ARROW_BUTTON (button), DEFAULT_ARROW_TYPE);
_panel_return_val_if_fail (XFCE_IS_ARROW_BUTTON (button), DEFAULT_ARROW_TYPE);
return button->arrow_type;
}
#define __XFCE_ARROW_BUTTON_C__
#include <libxfce4panel/libxfce4panel-aliasdef.c>

3
libxfce4panel/xfce-arrow-button.h

@ -52,9 +52,12 @@ struct _XfceArrowButtonClass
};
GType xfce_arrow_button_get_type (void) G_GNUC_CONST;
GtkWidget *xfce_arrow_button_new (GtkArrowType type) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
void xfce_arrow_button_set_arrow_type (XfceArrowButton *button,
GtkArrowType type);
GtkArrowType xfce_arrow_button_get_arrow_type (XfceArrowButton *button);
G_END_DECLS

36
libxfce4panel/xfce-hvbox.c

@ -28,14 +28,14 @@
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
#include "xfce-panel-macros.h"
#include "xfce-hvbox.h"
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-hvbox.h>
#include <libxfce4panel/libxfce4panel-alias.h>
/* prototypes */
static void xfce_hvbox_class_init (XfceHVBoxClass *klass);
static void xfce_hvbox_init (XfceHVBox *hvbox);
static void xfce_hvbox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void xfce_hvbox_size_allocate (GtkWidget *widget,
@ -55,7 +55,7 @@ xfce_hvbox_get_type (void)
sizeof (XfceHVBoxClass),
xfce_hvbox_class_init,
sizeof (XfceHVBox),
xfce_hvbox_init);
NULL);
}
return type;
@ -76,14 +76,6 @@ xfce_hvbox_class_init (XfceHVBoxClass *klass)
static void
xfce_hvbox_init (XfceHVBox *hvbox)
{
/* empty */
}
static GtkWidgetClass *
get_class (XfceHVBox *hvbox)
{
@ -155,13 +147,11 @@ xfce_hvbox_new (GtkOrientation orientation,
gboolean homogeneous,
gint spacing)
{
GtkWidget *box = GTK_WIDGET (g_object_new (xfce_hvbox_get_type (), NULL));
XFCE_HVBOX (box)->orientation = orientation;
GTK_BOX (box)->spacing = spacing;
GTK_BOX (box)->homogeneous = homogeneous;
return box;
return g_object_new (XFCE_TYPE_HVBOX,
"orientation", orientation,
"homogeneous", homogeneous,
"spacing", spacing,
NULL);
}
@ -177,7 +167,7 @@ void
xfce_hvbox_set_orientation (XfceHVBox *hvbox,
GtkOrientation orientation)
{
g_return_if_fail (XFCE_IS_HVBOX (hvbox));
_panel_return_if_fail (XFCE_IS_HVBOX (hvbox));
if (G_UNLIKELY (hvbox->orientation == orientation))
return;
@ -186,3 +176,9 @@ xfce_hvbox_set_orientation (XfceHVBox *hvbox,
gtk_widget_queue_resize (GTK_WIDGET (hvbox));
}
#define __XFCE_HVBOX_C__
#include <libxfce4panel/libxfce4panel-aliasdef.c>

3
libxfce4panel/xfce-hvbox.h

@ -49,11 +49,14 @@ struct _XfceHVBoxClass
};
GType xfce_hvbox_get_type (void) G_GNUC_CONST;
GtkWidget *xfce_hvbox_new (GtkOrientation orientation,
gboolean homogeneous,
gint spacing) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
void xfce_hvbox_set_orientation (XfceHVBox *hvbox,
GtkOrientation orientation);
G_END_DECLS
#endif /* !__XFCE_HVBOX_H__ */

123
libxfce4panel/xfce-itembar.c

@ -30,13 +30,13 @@
#include <gtk/gtk.h>
#include "xfce-marshal.h"
#include "xfce-panel-enum-types.h"
#include "xfce-itembar.h"
#include "xfce-panel-macros.h"
#include <libxfce4panel/libxfce4panel-marshal.h>
#include <libxfce4panel/libxfce4panel-enum-types.h>
#include <libxfce4panel/xfce-itembar.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/libxfce4panel-alias.h>
#define XFCE_ITEMBAR_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_ITEMBAR, XfceItembarPrivate))
#define XFCE_ITEMBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_ITEMBAR, XfceItembarPrivate))
#define DEFAULT_ORIENTATION GTK_ORIENTATION_HORIZONTAL
#define DEFAULT_CHILD_EXPAND FALSE
@ -174,25 +174,25 @@ xfce_itembar_class_init (XfceItembarClass *klass)
g_type_class_add_private (klass, sizeof (XfceItembarPrivate));
parent_class = g_type_class_peek_parent (klass);
gobject_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
container_class = (GtkContainerClass *) klass;
gobject_class->finalize = xfce_itembar_finalize;
gobject_class->get_property = xfce_itembar_get_property;
gobject_class->set_property = xfce_itembar_set_property;
widget_class->expose_event = xfce_itembar_expose;
widget_class->size_request = xfce_itembar_size_request;
widget_class->size_allocate = xfce_itembar_size_allocate;
widget_class->realize = xfce_itembar_realize;
widget_class->unrealize = xfce_itembar_unrealize;
widget_class->map = xfce_itembar_map;
widget_class->unmap = xfce_itembar_unmap;
widget_class->drag_leave = xfce_itembar_drag_leave;
widget_class->drag_motion = xfce_itembar_drag_motion;
parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = xfce_itembar_finalize;
gobject_class->get_property = xfce_itembar_get_property;
gobject_class->set_property = xfce_itembar_set_property;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->expose_event = xfce_itembar_expose;
widget_class->size_request = xfce_itembar_size_request;
widget_class->size_allocate = xfce_itembar_size_allocate;
widget_class->realize = xfce_itembar_realize;
widget_class->unrealize = xfce_itembar_unrealize;
widget_class->map = xfce_itembar_map;
widget_class->unmap = xfce_itembar_unmap;
widget_class->drag_leave = xfce_itembar_drag_leave;
widget_class->drag_motion = xfce_itembar_drag_motion;
container_class = GTK_CONTAINER_CLASS (klass);
container_class->forall = xfce_itembar_forall;
container_class->child_type = xfce_itembar_child_type;
container_class->add = xfce_itembar_add;
@ -213,8 +213,7 @@ xfce_itembar_class_init (XfceItembarClass *klass)
g_signal_new (I_("orientation-changed"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (XfceItembarClass,
orientation_changed),
G_STRUCT_OFFSET (XfceItembarClass, orientation_changed),
NULL, NULL,
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE, 1, GTK_TYPE_ORIENTATION);
@ -230,8 +229,7 @@ xfce_itembar_class_init (XfceItembarClass *klass)
g_signal_new (I_("contents-changed"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (XfceItembarClass,
contents_changed),
G_STRUCT_OFFSET (XfceItembarClass, contents_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@ -250,7 +248,7 @@ xfce_itembar_class_init (XfceItembarClass *klass)
"The orientation of the itembar",
GTK_TYPE_ORIENTATION,
DEFAULT_ORIENTATION,
G_PARAM_READWRITE));
PANEL_PARAM_READWRITE));
/* child properties */
@ -265,7 +263,7 @@ xfce_itembar_class_init (XfceItembarClass *klass)
"Expand",
"Whether to grow with parent",
DEFAULT_CHILD_EXPAND,
G_PARAM_READWRITE));
PANEL_PARAM_READWRITE));
}
@ -343,7 +341,7 @@ static gint
xfce_itembar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
XfceItembarPrivate *priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (widget));
XfceItembarPrivate *priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (widget));
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
@ -851,8 +849,8 @@ xfce_itembar_remove (GtkContainer *container,
gboolean was_visible;
GSList *l;
g_return_if_fail (XFCE_IS_ITEMBAR (container));
g_return_if_fail (child != NULL && child->parent == GTK_WIDGET (container));
_panel_return_if_fail (XFCE_IS_ITEMBAR (container));
_panel_return_if_fail (child != NULL && child->parent == GTK_WIDGET (container));
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (container));
@ -1023,12 +1021,8 @@ _find_drop_index (XfceItembar *itembar,
GtkWidget *
xfce_itembar_new (GtkOrientation orientation)
{
XfceItembar *itembar;
itembar = g_object_new (XFCE_TYPE_ITEMBAR, "orientation", orientation,
NULL);
return GTK_WIDGET (itembar);
return g_object_new (XFCE_TYPE_ITEMBAR,
"orientation", orientation, NULL);
}
@ -1044,7 +1038,7 @@ xfce_itembar_get_orientation (XfceItembar *itembar)
{
XfceItembarPrivate *priv;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), DEFAULT_ORIENTATION);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), DEFAULT_ORIENTATION);
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1066,7 +1060,7 @@ xfce_itembar_set_orientation (XfceItembar *itembar,
{
XfceItembarPrivate *priv;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1101,8 +1095,8 @@ xfce_itembar_insert (XfceItembar *itembar,
XfceItembarPrivate *priv;
XfceItembarChild *child;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
g_return_if_fail (item != NULL && GTK_WIDGET (item)->parent == NULL);
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (item != NULL && GTK_WIDGET (item)->parent == NULL);
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1170,8 +1164,8 @@ xfce_itembar_reorder_child (XfceItembar *itembar,
XfceItembarChild *child;
GSList *l;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
g_return_if_fail (item != NULL
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (item != NULL
&& GTK_WIDGET (item)->parent == GTK_WIDGET (itembar));
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (itembar));
@ -1214,10 +1208,9 @@ xfce_itembar_get_child_expand (XfceItembar *itembar,
XfceItembarChild *child;
GSList *l;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
g_return_val_if_fail (item != NULL &&
GTK_WIDGET (item)->parent == GTK_WIDGET (itembar),
FALSE);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
_panel_return_val_if_fail (item != NULL && GTK_WIDGET (item)->parent == GTK_WIDGET (itembar),
FALSE);
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (itembar));
@ -1251,9 +1244,8 @@ xfce_itembar_set_child_expand (XfceItembar *itembar,
XfceItembarChild *child;
GSList *l;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
g_return_if_fail (item != NULL
&& GTK_WIDGET (item)->parent == GTK_WIDGET (itembar));
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (item != NULL && GTK_WIDGET (item)->parent == GTK_WIDGET (itembar));
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (itembar));
@ -1284,7 +1276,7 @@ xfce_itembar_get_n_items (XfceItembar *itembar)
{
XfceItembarPrivate *priv;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), 0);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), 0);
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (itembar));
@ -1309,10 +1301,8 @@ xfce_itembar_get_item_index (XfceItembar *itembar,
GSList *l;
gint n;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), -1);
g_return_val_if_fail (item != NULL
&& GTK_WIDGET (item)->parent
== GTK_WIDGET (itembar), -1);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), -1);
_panel_return_val_if_fail (item != NULL && GTK_WIDGET (item)->parent == GTK_WIDGET (itembar), -1);
priv = XFCE_ITEMBAR_GET_PRIVATE (XFCE_ITEMBAR (itembar));
@ -1347,7 +1337,7 @@ xfce_itembar_get_nth_item (XfceItembar *itembar,
XfceItembarChild *child;
gint n_items;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), NULL);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), NULL);
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1378,7 +1368,7 @@ xfce_itembar_raise_event_window (XfceItembar *itembar)
{
XfceItembarPrivate *priv;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1405,7 +1395,7 @@ xfce_itembar_lower_event_window (XfceItembar *itembar)
{
XfceItembarPrivate *priv;
g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
_panel_return_if_fail (XFCE_IS_ITEMBAR (itembar));
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1428,7 +1418,7 @@ xfce_itembar_event_window_is_raised (XfceItembar *itembar)
{
XfceItembarPrivate *priv;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1456,7 +1446,7 @@ xfce_itembar_get_item_at_point (XfceItembar *itembar,
GtkWidget *w;
GtkAllocation *a;
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), NULL);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), NULL);
priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
@ -1502,7 +1492,12 @@ xfce_itembar_get_drop_index (XfceItembar *itembar,
gint x,
gint y)
{
g_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
_panel_return_val_if_fail (XFCE_IS_ITEMBAR (itembar), FALSE);
return _find_drop_index (itembar, x, y);
}
#define __XFCE_ITEMBAR_C__
#include <libxfce4panel/libxfce4panel-aliasdef.c>

31
libxfce4panel/xfce-itembar.h

@ -38,17 +38,17 @@ typedef struct _XfceItembarClass XfceItembarClass;
struct _XfceItembar
{
GtkContainer parent;
GtkContainer __parent__;
};
struct _XfceItembarClass
{
GtkContainerClass parent_class;
GtkContainerClass __parent__;
/* signals */
void (*orientation_changed) (XfceItembar *itembar,
GtkOrientation orientation);
void (*contents_changed) (XfceItembar *itembar);
void (*orientation_changed) (XfceItembar *itembar,
GtkOrientation orientation);
void (*contents_changed) (XfceItembar *itembar);
/* reserved for future expansion */
void (*reserved1) (void);
@ -58,36 +58,53 @@ struct _XfceItembarClass
};
GType xfce_itembar_get_type (void) G_GNUC_CONST;
GtkWidget *xfce_itembar_new (GtkOrientation orientation) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
void xfce_itembar_set_orientation (XfceItembar *itembar,
GtkOrientation orientation);
GtkOrientation xfce_itembar_get_orientation (XfceItembar *itembar);
void xfce_itembar_insert (XfceItembar *itembar,
GtkWidget *item,
gint position);
void xfce_itembar_append (XfceItembar *itembar,
GtkWidget *item);
void xfce_itembar_prepend (XfceItembar *itembar,
GtkWidget *item);
void xfce_itembar_reorder_child (XfceItembar *itembar,
GtkWidget *item,
gint position);
void xfce_itembar_set_child_expand (XfceItembar *itembar,
GtkWidget *item,
gboolean expand);
gboolean xfce_itembar_get_child_expand (XfceItembar *itembar,
GtkWidget *item);
gint xfce_itembar_get_n_items (XfceItembar *itembar);
gint xfce_itembar_get_item_index (XfceItembar *itembar,
GtkWidget *item);
GtkWidget *xfce_itembar_get_nth_item (XfceItembar *itembar,
gint n) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
gint n) G_GNUC_WARN_UNUSED_RESULT;
void xfce_itembar_raise_event_window (XfceItembar *itembar);
void xfce_itembar_lower_event_window (XfceItembar *itembar);
gboolean xfce_itembar_event_window_is_raised (XfceItembar *itembar);
GtkWidget *xfce_itembar_get_item_at_point (XfceItembar *itembar,
gint x,
gint y) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
gint y) G_GNUC_WARN_UNUSED_RESULT;
gint xfce_itembar_get_drop_index (XfceItembar *itembar,
gint x,
gint y);

9
libxfce4panel/xfce-panel-convenience.c

@ -25,7 +25,8 @@
#include <libxfce4util/libxfce4util.h>
#include <gtk/gtk.h>
#include "xfce-panel-convenience.h"
#include <libxfce4panel/xfce-panel-convenience.h>
#include <libxfce4panel/libxfce4panel-alias.h>
/**
* xfce_create_panel_button:
@ -101,3 +102,9 @@ xfce_allow_panel_customization (void )
return allow_customization;
}
#define __XFCE_PANEL_CONVENIENCE_C__
#include <libxfce4panel/libxfce4panel-aliasdef.c>

85
libxfce4panel/xfce-panel-external-item.c

@ -29,14 +29,14 @@
#include <sys/types.h>
#include <unistd.h>
#include "xfce-panel-enum-types.h"
#include "xfce-panel-item-iface.h"
#include "xfce-panel-external-item.h"
#include "xfce-panel-plugin-messages.h"
#include <libxfce4panel/libxfce4panel-enum-types.h>
#include <libxfce4panel/xfce-panel-item-iface.h>
#include <libxfce4panel/xfce-panel-external-item.h>
#include <libxfce4panel/xfce-panel-plugin-messages.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/libxfce4panel-alias.h>
#define XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_EXTERNAL_PANEL_ITEM, \
XfceExternalPanelItemPrivate))
#define XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_EXTERNAL_PANEL_ITEM, XfceExternalPanelItemPrivate))
@ -127,13 +127,11 @@ xfce_external_panel_item_class_init (XfceExternalPanelItemClass *klass)
g_type_class_add_private (klass, sizeof (XfceExternalPanelItemPrivate));
object_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = xfce_external_panel_item_finalize;
widget_class->button_press_event =
xfce_external_panel_item_button_press_event;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->button_press_event = xfce_external_panel_item_button_press_event;
}
@ -214,10 +212,9 @@ xfce_external_panel_item_get_name (XfcePanelItem *item)
{
XfceExternalPanelItemPrivate *priv;
g_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
_panel_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
return priv->name;
}
@ -229,10 +226,9 @@ xfce_external_panel_item_get_id (XfcePanelItem *item)
{
XfceExternalPanelItemPrivate *priv;
g_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
_panel_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
return priv->id;
}
@ -244,10 +240,9 @@ xfce_external_panel_item_get_display_name (XfcePanelItem *item)
{
XfceExternalPanelItemPrivate *priv;
g_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
_panel_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), NULL);
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
return priv->display_name;
}
@ -259,10 +254,9 @@ xfce_external_panel_item_get_expand (XfcePanelItem *item)
{
XfceExternalPanelItemPrivate *priv;
g_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), FALSE);
_panel_return_val_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item), FALSE);
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
return priv->expand;
}
@ -274,10 +268,9 @@ xfce_external_panel_item_free_data (XfcePanelItem *item)
{
XfceExternalPanelItemPrivate *priv;
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv->to_be_removed = TRUE;
@ -292,7 +285,7 @@ xfce_external_panel_item_free_data (XfcePanelItem *item)
static void
xfce_external_panel_item_save (XfcePanelItem *item)
{
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
if (!GDK_IS_WINDOW (GTK_SOCKET (item)->plug_window))
return;
@ -311,10 +304,9 @@ xfce_external_panel_item_set_size (XfcePanelItem *item,
{
XfceExternalPanelItemPrivate *priv;
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
if (size != priv->size)
{
@ -335,10 +327,9 @@ xfce_external_panel_item_set_screen_position (XfcePanelItem *item,
{
XfceExternalPanelItemPrivate *priv;
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
priv =
XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv = XFCE_EXTERNAL_PANEL_ITEM_GET_PRIVATE (XFCE_EXTERNAL_PANEL_ITEM (item));
priv->screen_position = position;
@ -368,7 +359,7 @@ static void
xfce_external_panel_item_set_sensitive (XfcePanelItem *item,
gboolean sensitive)
{
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
if (GDK_IS_WINDOW (GTK_SOCKET (item)->plug_window))
{
@ -391,8 +382,8 @@ xfce_external_panel_item_set_sensitive (XfcePanelItem *item,
static void
xfce_external_panel_item_remove (XfcePanelItem *item)
{
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
_panel_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item));
xfce_panel_plugin_message_send (GTK_WIDGET (item)->window,
GDK_WINDOW_XID (GTK_SOCKET (item)->plug_window),
XFCE_PANEL_PLUGIN_REMOVE, 0);
@ -414,7 +405,7 @@ delayed_configure(XfcePanelItem *item)
static void
xfce_external_panel_item_configure (XfcePanelItem * item)
{
g_return_if_fail (XFCE_IS_EXTERNAL_PANEL_ITEM (item))