Browse Source

Major rewrite several internals. Unify panel items and modules in PanelControl structure (and change the xml file format in the process), make all dialogs instant-apply, rearrange preferences dialog, add option to keep panel on top, probably more

(Old svn revision: 3302)
tags/xfce4-panel-4.10.0
Jasper Huijsmans 19 years ago
parent
commit
0b63ca0c3a
49 changed files with 4715 additions and 3741 deletions
  1. +3
    -0
      AUTHORS
  2. +13
    -0
      ChangeLog
  3. +3
    -3
      Makefile.in
  4. +14
    -10
      README
  5. +0
    -133
      README.xml
  6. +37
    -0
      TODO
  7. +24
    -38
      example.xfce4rc.in
  8. +2
    -1
      icons/Makefile.am
  9. +2
    -1
      icons/Makefile.in
  10. +6
    -2
      panel/Makefile.am
  11. +78
    -31
      panel/Makefile.in
  12. +254
    -372
      panel/builtins.c
  13. +9
    -2
      panel/builtins.h
  14. +51
    -80
      panel/callbacks.c
  15. +12
    -16
      panel/callbacks.h
  16. +298
    -267
      panel/central.c
  17. +14
    -24
      panel/central.h
  18. +426
    -0
      panel/controls.c
  19. +94
    -0
      panel/controls.h
  20. +330
    -0
      panel/controls_dialog.c
  21. +27
    -0
      panel/controls_dialog.h
  22. +284
    -109
      panel/dialogs.c
  23. +2
    -2
      panel/dialogs.h
  24. +63
    -42
      panel/global.h
  25. +117
    -0
      panel/iconbutton.c
  26. +37
    -0
      panel/iconbutton.h
  27. +23
    -14
      panel/icons.c
  28. +1
    -1
      panel/icons.h
  29. +47
    -42
      panel/info.c
  30. +112
    -120
      panel/item.c
  31. +13
    -22
      panel/item.h
  32. +588
    -496
      panel/item_dialog.c
  33. +6
    -2
      panel/item_dialog.h
  34. +0
    -312
      panel/module.c
  35. +0
    -94
      panel/module.h
  36. +17
    -14
      panel/move.c
  37. +361
    -306
      panel/popup.c
  38. +19
    -15
      panel/popup.h
  39. +79
    -53
      panel/settings.c
  40. +3
    -1
      panel/settings.h
  41. +427
    -417
      panel/side.c
  42. +15
    -44
      panel/side.h
  43. +53
    -30
      panel/wmhints.c
  44. +2
    -2
      panel/wmhints.h
  45. +339
    -339
      panel/xfce.c
  46. +14
    -18
      panel/xfce.h
  47. +70
    -44
      panel/xfce_support.c
  48. +14
    -2
      panel/xfce_support.h
  49. +312
    -220
      plugins/mailcheck/mailcheck.c

+ 3
- 0
AUTHORS View File

@@ -0,0 +1,3 @@
Jasper Huijsmans <huysmans@users.sourceforge.net>
Olivier Fourdan <fourdan@xfce.org>
Xavier Maillard

+ 13
- 0
ChangeLog View File

@@ -1,3 +1,16 @@
2002-08-11 23:04 huysmans

* panel/info.c: fix deprecated gtk function

2002-08-11 22:55 huysmans

* panel/xfce.c: temporarily comment out the DOCK_TYPE window hint

2002-08-11 21:38 huysmans

* ChangeLog, panel/info.c: Update ChangeLog and update info panel a
bit

2002-08-11 08:29 huysmans

* ChangeLog, icons/xfce_slogan.xpm, panel/info.c: Really add info


+ 3
- 3
Makefile.in View File

@@ -114,9 +114,9 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
install-exec-recursive installdirs-recursive install-recursive \
uninstall-recursive check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS aclocal.m4 compile config.guess config.h.in \
config.sub configure configure.ac depcomp install-sh ltmain.sh \
missing mkinstalldirs xfce4.spec.in
Makefile.in NEWS TODO aclocal.m4 compile config.guess \
config.h.in config.sub configure configure.ac depcomp \
install-sh ltmain.sh missing mkinstalldirs xfce4.spec.in
DIST_SUBDIRS = $(SUBDIRS)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive


+ 14
- 10
README View File

@@ -35,24 +35,28 @@ The panel design is a hierarchy of components:
- Side panels (file side.c): Left and right panel containing several panel groups.
A panel group consists of a top widget and a bottom widget. The top widget is
usually a popup button, but for the outermost groups it is a move handle. The
bottom widget is either a panel item (a button with an icon) or a panel module
(dynamically updated).
bottom widget is called panel control and can be either a panel item (a button
with an icon) or a panel module (dynamically updated).

- Panel popup (file popup.c): Popup button and popup menu containing menu items.
Other files:
- popup.c: function for the popup menu inlcuding menu items.

- Panel item (file item.c): Tradioanl panel item consisting of an icon button,
which starts an application.
- control.c: panel control interface

- Panel module (files module.c and builtins.c): New panel control, which is
dynamically updated. Modules can be builtin or external using the gmodule
interface.
- item.c: traditional panel control (icon button that launches programs)

- iconbutton.c: icon button used by panel items. Separate for easy use by other
modules.

- builtin.c: builtin dynamic panel controls (e.g. clock and trash can).

Other files:
- callbacks.c: most callback functions are defined here.

- dialogs.c: panel configuration dialogs.

- item_dialog.c: configuration dialog for item/module and menuitem
- controls_dialog.c: configuration of panel controls

- item_dialog.c: configuration dialog for panel item or menu item

- xfce_support.c: convenience dialogs and general convenience functions.



+ 0
- 133
README.xml View File

@@ -1,133 +0,0 @@
Proposal for xml config file for xfce
-------------------------------------
See example.xfce4rc for an example

namespace: xfce:"http://www.xfce.org/xfce" (not implemented)

==============================================================================
root: Xfce
children:
Panel
Central
Left
Right

==============================================================================
name: Panel
parent: Xfce
properties: size (int), popupsize (int), style (int), icontheme (string),
left (int), right (int), screens (int)
children:
Position
Lock
Exit

name: Central
parent: Xfce
properties: none
content: none
children:
Screens
Lock
Power

name: Left
parent: Xfce
properties: visible
content: none
children:
Group

name Right
parent: Xfce
properties: visible
content: none
children:
Group

==============================================================================
name: Position
parent: Panel
properties: x (int), y (int)
content: none
children: none

name: Lock
parent: Panel
properties: none
content: lock command
children: none

name: Exit
parent: Panel
properties: none
content: command run at exit
children: none

------------------------------------------------------------------------------
name: Screen
parent: Central
properties: none
content: screen name
children: none

------------------------------------------------------------------------------
name: Group
parent: Left, Right
properties: none
content: none
children:
Popup
Item
Module

==============================================================================
name: Popup
parent: Group
properties: none
content: none
children:
Item

name: Module
parent: Group
properties: id (int)
content: module name
children: none

------------------------------------------------------------------------------
name: Item
parent: Group, Popup
properties: none
content: none
children:
Caption
Command
Tooltip
Icon

==============================================================================
name: Caption
parent: Item
properties: none
content: label for item
children: none

name: Command
parent: Item
properties: none
content: command to execute
children: none

name: Tooltip
parent: Item
properties: none
content: tooltip for item
children: none

name: Icon
parent: Item
properties: id (int)
content: path to icon
children: none


+ 37
- 0
TODO View File

@@ -0,0 +1,37 @@
TODO list for xfce4
===================

Major features for 4.0
----------------------
* port clock widget In progress (zeDek)
* unify panel controls Done
(make everything a module)
* improve module configuration
- add chosen module to panel Done
- direct-apply options Done
- save config in main file Done
(pass xmlNodePtr to module)
* improve global configuration
- add stay-on-top option Done
- split up dialog In progress
- port to new xfce-wide system
* write API docs for plugin writers
* write user docs
* provide good default configuration
* allow different positions for
popup button in all sizes Done

Nice to have for 4.0
--------------------
* more themes: Night, KDE, Next, WindowsXP, BeOS, ...
(not too many released with xfce4; < 10)
* volume control plugin

Possible future features (after 4.0)
------------------------------------
* optional pager instead of desktop buttons
* swallow apps
* hide popup buttons
* 'Eugenia'-like design with vertical move
handles and variable size plugins


+ 24
- 38
example.xfce4rc.in View File

@@ -1,27 +1,13 @@
<?xml version="1.0"?>
<Xfce>
<Panel size="1" popupsize="1" style="1" left="5" right="5" screens="4">
<Position x="269" y="955"/>
<Panel>
<Position x="-1" y="-1"/>
<Lock>xflock</Lock>
<Exit>Apps/ROX-Session/AppRun</Exit>
</Panel>
<Central>
<Screen>One</Screen>
<Screen>Two</Screen>
<Screen>Three</Screen>
<Screen>Four</Screen>
<Screen>Five</Screen>
<Screen>Six</Screen>
<Screen>Seven</Screen>
<Screen>Eight</Screen>
<Screen>Nine</Screen>
<Screen>Ten</Screen>
<Screen>Eleven</Screen>
<Screen>Twelve</Screen>
</Central>
<Central/>
<Left>
<Group>
<Module id="0"/>
<Control id="0"/>
</Group>
<Group>
<Popup>
@@ -62,11 +48,11 @@
<Icon id="-1">_pkgdatadir_/icons/DiskFloppy.xpm</Icon>
</Item>
</Popup>
<Item>
<Control id="-2">
<Command term="0">xftree</Command>
<Tooltip>Bestandsbeheer</Tooltip>
<Icon id="2"/>
</Item>
</Control>
</Group>
<Group>
<Popup>
@@ -77,11 +63,11 @@
<Icon id="1"/>
</Item>
</Popup>
<Item>
<Control id="-2">
<Command term="0">gvim</Command>
<Tooltip>Editor</Tooltip>
<Icon id="1"/>
</Item>
</Control>
</Group>
<Group>
<Popup>
@@ -92,7 +78,7 @@
<Icon id="-1">_pkgdatadir_/pixmaps/Bookshelf.xpm</Icon>
</Item>
</Popup>
<Module id="-1">libmailcheck.so</Module>
<Control id="-1">libmailcheck.so</Control>
</Group>
<Group>
<Popup>
@@ -103,24 +89,24 @@
<Icon id="-1">_pkgdatadir_/pixmaps/gnome-globe.png</Icon>
</Item>
</Popup>
<Item>
<Control id="-2">
<Command term="0">galeon -w</Command>
<Tooltip>Galeon internet browser</Tooltip>
<Icon id="7"/>
</Item>
</Control>
</Group>
<Group>
<Popup/>
<Item>
<Control id="-2">
<Command term="0"/>
<Tooltip>Click Mouse 3 to change item</Tooltip>
<Icon id="0"/>
</Item>
</Control>
</Group>
</Left>
<Right>
<Group>
<Module id="1"/>
<Control id="1"/>
</Group>
<Group>
<Popup>
@@ -136,11 +122,11 @@
<Icon id="-1">_pkgdatadir_/icons/Pencils.xpm</Icon>
</Item>
</Popup>
<Item>
<Control id="-2">
<Command term="0">xfhelp</Command>
<Tooltip>Xfce Handleiding</Tooltip>
<Icon id="5"/>
</Item>
</Control>
</Group>
<Group>
<Popup>
@@ -157,35 +143,35 @@
<Icon id="-1">_pkgdatadir_/icons/Mouse.xpm</Icon>
</Item>
</Popup>
<Item>
<Control id="-2">
<Command term="0">xfstyle</Command>
<Tooltip>XFce Style Manager</Tooltip>
<Icon id="3"/>
</Item>
</Control>
</Group>
<Group>
<Popup/>
<Item>
<Control id="-2">
<Command term="0">anjuta</Command>
<Tooltip>Anjuta C/C++ IDE</Tooltip>
<Icon id="-1">/usr/share/pixmaps/anjuta/applogo.png</Icon>
</Item>
</Control>
</Group>
<Group>
<Popup/>
<Item>
<Control id="-2">
<Command term="0">xfprint</Command>
<Tooltip>Drag file to print</Tooltip>
<Icon id="9"/>
</Item>
</Control>
</Group>
<Group>
<Popup/>
<Item>
<Control id="-2">
<Command term="0"/>
<Tooltip>Click Mouse 3 to change item</Tooltip>
<Icon id="0"/>
</Item>
</Control>
</Group>
</Right>
</Xfce>

+ 2
- 1
icons/Makefile.am View File

@@ -29,6 +29,7 @@ trash_empty.xpm \
trash_full.xpm \
unknown.xpm \
up.xpm \
xfce_icon.xpm
xfce_icon.xpm \
xfce_slogan.xpm

EXTRA_DIST = $(noinst_DATA)

+ 2
- 1
icons/Makefile.in View File

@@ -121,7 +121,8 @@ trash_empty.xpm \
trash_full.xpm \
unknown.xpm \
up.xpm \
xfce_icon.xpm
xfce_icon.xpm \
xfce_slogan.xpm


EXTRA_DIST = $(noinst_DATA)


+ 6
- 2
panel/Makefile.am View File

@@ -3,12 +3,14 @@ xfce4_SOURCES = \
builtins.c \
callbacks.c \
central.c \
controls.c \
controls_dialog.c \
dialogs.c \
iconbutton.c \
icons.c \
info.c \
item.c \
item_dialog.c \
module.c \
move.c \
popup.c \
settings.c \
@@ -17,6 +19,7 @@ wmhints.c \
builtins.h \
callbacks.h \
central.h \
controls_dialog.h \
dialogs.h \
item_dialog.h \
move.h \
@@ -28,9 +31,10 @@ xfce.c \
xfce_support.c

pkginclude_HEADERS = \
iconbutton.h \
icons.h \
item.h \
module.h \
controls.h \
xfce.h \
xfce_support.h \
global.h


+ 78
- 31
panel/Makefile.in View File

@@ -95,12 +95,14 @@ xfce4_SOURCES = \
builtins.c \
callbacks.c \
central.c \
controls.c \
controls_dialog.c \
dialogs.c \
iconbutton.c \
icons.c \
info.c \
item.c \
item_dialog.c \
module.c \
move.c \
popup.c \
settings.c \
@@ -109,6 +111,7 @@ wmhints.c \
builtins.h \
callbacks.h \
central.h \
controls_dialog.h \
dialogs.h \
item_dialog.h \
move.h \
@@ -121,15 +124,16 @@ xfce_support.c


pkginclude_HEADERS = \
iconbutton.h \
icons.h \
item.h \
module.h \
controls.h \
xfce.h \
xfce_support.h \
global.h


xfce4_CFLAGS = @CFLAGS@ @X_CFLAGS@ @BASE_DEPENDENCIES_CFLAGS@ -DG_DISABLE_DEPRECATED -DDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -DVERSION=\"@VERSION@\"
xfce4_CFLAGS = @CFLAGS@ @X_CFLAGS@ @BASE_DEPENDENCIES_CFLAGS@ -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -DVERSION=\"@VERSION@\"
xfce4_LDADD = @LIBS@ @X_LIBS@ @BASE_DEPENDENCIES_LIBS@
subdir = panel
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -139,13 +143,14 @@ bin_PROGRAMS = xfce4$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)

am_xfce4_OBJECTS = xfce4-builtins.$(OBJEXT) xfce4-callbacks.$(OBJEXT) \
xfce4-central.$(OBJEXT) xfce4-dialogs.$(OBJEXT) \
xfce4-icons.$(OBJEXT) xfce4-info.$(OBJEXT) xfce4-item.$(OBJEXT) \
xfce4-item_dialog.$(OBJEXT) xfce4-module.$(OBJEXT) \
xfce4-move.$(OBJEXT) xfce4-popup.$(OBJEXT) \
xfce4-settings.$(OBJEXT) xfce4-side.$(OBJEXT) \
xfce4-wmhints.$(OBJEXT) xfce4-xfce.$(OBJEXT) \
xfce4-xfce_support.$(OBJEXT)
xfce4-central.$(OBJEXT) xfce4-controls.$(OBJEXT) \
xfce4-controls_dialog.$(OBJEXT) xfce4-dialogs.$(OBJEXT) \
xfce4-iconbutton.$(OBJEXT) xfce4-icons.$(OBJEXT) \
xfce4-info.$(OBJEXT) xfce4-item.$(OBJEXT) \
xfce4-item_dialog.$(OBJEXT) xfce4-move.$(OBJEXT) \
xfce4-popup.$(OBJEXT) xfce4-settings.$(OBJEXT) \
xfce4-side.$(OBJEXT) xfce4-wmhints.$(OBJEXT) \
xfce4-xfce.$(OBJEXT) xfce4-xfce_support.$(OBJEXT)
xfce4_OBJECTS = $(am_xfce4_OBJECTS)
xfce4_DEPENDENCIES =
xfce4_LDFLAGS =
@@ -160,11 +165,13 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/xfce4-builtins.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-callbacks.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-central.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-controls.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-controls_dialog.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-dialogs.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-iconbutton.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-icons.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-info.Po ./$(DEPDIR)/xfce4-item.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-item_dialog.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-module.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-move.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-popup.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/xfce4-settings.Po \
@@ -227,12 +234,14 @@ clean-binPROGRAMS:
xfce4-builtins.$(OBJEXT): builtins.c
xfce4-callbacks.$(OBJEXT): callbacks.c
xfce4-central.$(OBJEXT): central.c
xfce4-controls.$(OBJEXT): controls.c
xfce4-controls_dialog.$(OBJEXT): controls_dialog.c
xfce4-dialogs.$(OBJEXT): dialogs.c
xfce4-iconbutton.$(OBJEXT): iconbutton.c
xfce4-icons.$(OBJEXT): icons.c
xfce4-info.$(OBJEXT): info.c
xfce4-item.$(OBJEXT): item.c
xfce4-item_dialog.$(OBJEXT): item_dialog.c
xfce4-module.$(OBJEXT): module.c
xfce4-move.$(OBJEXT): move.c
xfce4-popup.$(OBJEXT): popup.c
xfce4-settings.$(OBJEXT): settings.c
@@ -253,12 +262,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-builtins.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-callbacks.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-central.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-controls.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-controls_dialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-dialogs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-iconbutton.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-icons.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-item.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-item_dialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-module.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-move.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-popup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfce4-settings.Po@am__quote@
@@ -342,6 +353,42 @@ xfce4-central.lo: central.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-central.lo `test -f 'central.c' || echo '$(srcdir)/'`central.c

xfce4-controls.o: controls.c
@AMDEP_TRUE@ source='controls.c' object='xfce4-controls.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls.Po' tmpdepfile='$(DEPDIR)/xfce4-controls.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls.o `test -f 'controls.c' || echo '$(srcdir)/'`controls.c

xfce4-controls.obj: controls.c
@AMDEP_TRUE@ source='controls.c' object='xfce4-controls.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls.Po' tmpdepfile='$(DEPDIR)/xfce4-controls.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls.obj `cygpath -w controls.c`

xfce4-controls.lo: controls.c
@AMDEP_TRUE@ source='controls.c' object='xfce4-controls.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls.Plo' tmpdepfile='$(DEPDIR)/xfce4-controls.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls.lo `test -f 'controls.c' || echo '$(srcdir)/'`controls.c

xfce4-controls_dialog.o: controls_dialog.c
@AMDEP_TRUE@ source='controls_dialog.c' object='xfce4-controls_dialog.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls_dialog.Po' tmpdepfile='$(DEPDIR)/xfce4-controls_dialog.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls_dialog.o `test -f 'controls_dialog.c' || echo '$(srcdir)/'`controls_dialog.c

xfce4-controls_dialog.obj: controls_dialog.c
@AMDEP_TRUE@ source='controls_dialog.c' object='xfce4-controls_dialog.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls_dialog.Po' tmpdepfile='$(DEPDIR)/xfce4-controls_dialog.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls_dialog.obj `cygpath -w controls_dialog.c`

xfce4-controls_dialog.lo: controls_dialog.c
@AMDEP_TRUE@ source='controls_dialog.c' object='xfce4-controls_dialog.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-controls_dialog.Plo' tmpdepfile='$(DEPDIR)/xfce4-controls_dialog.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-controls_dialog.lo `test -f 'controls_dialog.c' || echo '$(srcdir)/'`controls_dialog.c

xfce4-dialogs.o: dialogs.c
@AMDEP_TRUE@ source='dialogs.c' object='xfce4-dialogs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-dialogs.Po' tmpdepfile='$(DEPDIR)/xfce4-dialogs.TPo' @AMDEPBACKSLASH@
@@ -360,6 +407,24 @@ xfce4-dialogs.lo: dialogs.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-dialogs.lo `test -f 'dialogs.c' || echo '$(srcdir)/'`dialogs.c

xfce4-iconbutton.o: iconbutton.c
@AMDEP_TRUE@ source='iconbutton.c' object='xfce4-iconbutton.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-iconbutton.Po' tmpdepfile='$(DEPDIR)/xfce4-iconbutton.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-iconbutton.o `test -f 'iconbutton.c' || echo '$(srcdir)/'`iconbutton.c

xfce4-iconbutton.obj: iconbutton.c
@AMDEP_TRUE@ source='iconbutton.c' object='xfce4-iconbutton.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-iconbutton.Po' tmpdepfile='$(DEPDIR)/xfce4-iconbutton.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-iconbutton.obj `cygpath -w iconbutton.c`

xfce4-iconbutton.lo: iconbutton.c
@AMDEP_TRUE@ source='iconbutton.c' object='xfce4-iconbutton.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-iconbutton.Plo' tmpdepfile='$(DEPDIR)/xfce4-iconbutton.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-iconbutton.lo `test -f 'iconbutton.c' || echo '$(srcdir)/'`iconbutton.c

xfce4-icons.o: icons.c
@AMDEP_TRUE@ source='icons.c' object='xfce4-icons.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-icons.Po' tmpdepfile='$(DEPDIR)/xfce4-icons.TPo' @AMDEPBACKSLASH@
@@ -432,24 +497,6 @@ xfce4-item_dialog.lo: item_dialog.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-item_dialog.lo `test -f 'item_dialog.c' || echo '$(srcdir)/'`item_dialog.c

xfce4-module.o: module.c
@AMDEP_TRUE@ source='module.c' object='xfce4-module.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-module.Po' tmpdepfile='$(DEPDIR)/xfce4-module.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-module.o `test -f 'module.c' || echo '$(srcdir)/'`module.c

xfce4-module.obj: module.c
@AMDEP_TRUE@ source='module.c' object='xfce4-module.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-module.Po' tmpdepfile='$(DEPDIR)/xfce4-module.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-module.obj `cygpath -w module.c`

xfce4-module.lo: module.c
@AMDEP_TRUE@ source='module.c' object='xfce4-module.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-module.Plo' tmpdepfile='$(DEPDIR)/xfce4-module.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfce4_CFLAGS) $(CFLAGS) -c -o xfce4-module.lo `test -f 'module.c' || echo '$(srcdir)/'`module.c

xfce4-move.o: move.c
@AMDEP_TRUE@ source='move.c' object='xfce4-move.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/xfce4-move.Po' tmpdepfile='$(DEPDIR)/xfce4-move.TPo' @AMDEPBACKSLASH@


+ 254
- 372
panel/builtins.c View File

@@ -1,6 +1,6 @@
/* builtins.c
*
* Copyright (C) 2002 Jasper Huijsmans (j.b.huijsmans@hetnet.nl)
* Copyright (C) 2002 Jasper Huijsmans (huysmans@users.sourceforge.net)
*
* 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
@@ -24,59 +24,28 @@
#include <time.h>

#include "builtins.h"
#include "xfce.h"
#include "controls.h"
#include "iconbutton.h"
#include "xfce_support.h"
#include "module.h"
#include "item.h"
#include "icons.h"
#include "dialogs.h"
#include "iconbutton.h"
#include "callbacks.h"
#include "xfce.h"

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Builtin modules
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
static gboolean create_clock_module(PanelModule * pm);

static gboolean create_trash_module(PanelModule * pm);

static gboolean create_exit_module(PanelModule * pm);

static gboolean create_config_module(PanelModule * pm);

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* panel control configuration
*/
GtkWidget *revert_button;

gboolean create_builtin_module(PanelModule * pm)
{
switch (pm->id)
{
case CLOCK_MODULE:
return create_clock_module(pm);
break;
case TRASH_MODULE:
return create_trash_module(pm);
break;
case EXIT_MODULE:
return create_exit_module(pm);
break;
case CONFIG_MODULE:
return create_config_module(pm);
break;
default:
return FALSE;
}
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Clock module
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* Clock module
* ------------
* To be replaced by the 'real clock widget'
*/
enum
{ ANALOG, DIGITAL, LED };

typedef struct
{
int size;

int type;
gboolean twentyfour;

@@ -92,7 +61,6 @@ static t_clock *clock_new(void)
{
t_clock *clock = g_new(t_clock, 1);

clock->size = MEDIUM;
clock->show_colon = TRUE;
clock->type = DIGITAL;
clock->twentyfour = TRUE;
@@ -101,8 +69,6 @@ static t_clock *clock_new(void)
gtk_container_set_border_width(GTK_CONTAINER(clock->frame), 0);
gtk_frame_set_shadow_type(GTK_FRAME(clock->frame), GTK_SHADOW_IN);
gtk_widget_show(clock->frame);
/* protect against destruction when unpacking */
g_object_ref(clock->frame);

clock->eventbox = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(clock->frame), clock->eventbox);
@@ -115,16 +81,14 @@ static t_clock *clock_new(void)
return clock;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static gboolean adjust_time(PanelModule * pm)
static gboolean adjust_time(PanelControl * pc)
{
time_t t;
struct tm *tm;
int hrs, mins;
char *text, *markup;

t_clock *clock = (t_clock *) pm->data;
t_clock *clock = (t_clock *) pc->data;

t = time(0);
tm = localtime(&t);
@@ -132,25 +96,30 @@ static gboolean adjust_time(PanelModule * pm)
hrs = tm->tm_hour;
mins = tm->tm_min;

text = g_strdup_printf("%.2d%c%.2d", hrs, clock->show_colon ? ':' : ' ', mins);
text =
g_strdup_printf("%.2d%c%.2d", hrs, clock->show_colon ? ':' : ' ', mins);

switch (clock->size)
switch (settings.size)
{
case TINY:
markup = g_strconcat("<tt><span size=\"x-small\">",
text, "</span></tt>", NULL);
markup =
g_strconcat("<tt><span size=\"x-small\">", text, "</span></tt>",
NULL);
break;
case SMALL:
markup = g_strconcat("<tt><span size=\"small\">",
text, "</span></tt>", NULL);
markup =
g_strconcat("<tt><span size=\"small\">", text, "</span></tt>",
NULL);
break;
case LARGE:
markup = g_strconcat("<tt><span size=\"large\">",
text, "</span></tt>", NULL);
markup =
g_strconcat("<tt><span size=\"large\">", text, "</span></tt>",
NULL);
break;
default:
markup = g_strconcat("<tt><span size=\"medium\">",
text, "</span></tt>", NULL);
markup =
g_strconcat("<tt><span size=\"medium\">", text, "</span></tt>",
NULL);
break;
}

@@ -164,48 +133,25 @@ static gboolean adjust_time(PanelModule * pm)
return TRUE;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

void clock_pack(PanelModule * pm, GtkBox * box)
void clock_free(PanelControl * pc)
{
t_clock *clock = (t_clock *) pm->data;

gtk_box_pack_start(box, clock->frame, TRUE, TRUE, 0);
}

void clock_unpack(PanelModule * pm, GtkContainer * container)
{
t_clock *clock = (t_clock *) pm->data;

gtk_container_remove(container, clock->frame);
}

void clock_free(PanelModule * pm)
{
t_clock *clock = (t_clock *) pm->data;

if(GTK_IS_WIDGET(clock->frame))
gtk_widget_destroy(clock->frame);
t_clock *clock = (t_clock *) pc->data;

g_free(clock);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

void clock_set_size(PanelModule * pm, int size)
void clock_set_size(PanelControl * pc, int size)
{
int s = icon_size(size);
t_clock *clock = (t_clock *) pm->data;

clock->size = size;
int s = icon_size[size];
t_clock *clock = (t_clock *) pc->data;

gtk_widget_set_size_request(clock->label, -1, s);
adjust_time(pm);
adjust_time(pc);
}

void clock_set_style(PanelModule * pm, int style)
void clock_set_style(PanelControl * pc, int style)
{
t_clock *clock = (t_clock *) pm->data;
t_clock *clock = (t_clock *) pc->data;

if(style == OLD_STYLE)
{
@@ -274,13 +220,34 @@ static GtkWidget *create_clock_24hrs_button(t_clock * clock)
return cb;
}

void clock_add_options(PanelModule * pm, GtkContainer * container)
static void clock_create_backup(t_clock *clock)
{
}

static void clock_clean_backup(void)
{
}

static void clock_revert(t_clock *clock)
{
}

static void clock_apply_configuration(PanelControl * pc)
{
}

void clock_add_options(PanelControl * pc, GtkContainer * container,
GtkWidget * revert, GtkWidget * done)
{
GtkWidget *vbox, *om, *hbox, *label, *checkbutton;
GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

t_clock *clock = (t_clock *) pm->data;
t_clock *clock = (t_clock *) pc->data;

clock_create_backup(clock);
revert_button = revert;
vbox = gtk_vbox_new(FALSE, 4);
gtk_widget_show(vbox);

@@ -312,102 +279,113 @@ void clock_add_options(PanelModule * pm, GtkContainer * container)
gtk_widget_show(checkbutton);
gtk_box_pack_start(GTK_BOX(hbox), checkbutton, FALSE, FALSE, 0);

/* signals */
g_signal_connect_swapped(revert, "clicked",
G_CALLBACK(clock_revert), clock);
g_signal_connect_swapped(done, "clicked",
G_CALLBACK(clock_clean_backup), NULL);
g_signal_connect_swapped(done, "clicked",
G_CALLBACK(clock_apply_configuration), pc);
gtk_container_add(container, vbox);
}

static void clock_apply_configuration(PanelModule * pm)
{
}

void clock_configure(PanelModule * pm)
{
report_error(_("No configuration possible (yet)."));
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static gboolean create_clock_module(PanelModule * pm)
/* create clock panel control
*/
void create_clock(PanelControl * pc)
{
t_clock *clock = clock_new();

pm->caption = g_strdup(_("XFce clock"));
pm->data = (gpointer) clock;
pm->main = clock->eventbox;

pm->interval = 1000; /* 1 sec */
pm->update = (gpointer) adjust_time;
gtk_container_add(GTK_CONTAINER(pc->base), clock->frame);

pm->pack = (gpointer) clock_pack;
pm->unpack = (gpointer) clock_unpack;
pm->free = (gpointer) clock_free;
pc->caption = g_strdup(_("XFce clock"));
pc->data = (gpointer) clock;
pc->main = clock->eventbox;

pm->set_size = (gpointer) clock_set_size;
pm->set_style = (gpointer) clock_set_style;
pc->interval = 1000; /* 1 sec */
pc->update = (gpointer) adjust_time;

pm->add_options = (gpointer) clock_add_options;
pm->apply_configuration = (gpointer) clock_apply_configuration;
/* pm->configure = (gpointer) clock_configure;*/
pc->free = (gpointer) clock_free;

if(pm->parent)
adjust_time(pm);
pc->set_size = (gpointer) clock_set_size;
pc->set_style = (gpointer) clock_set_style;

return TRUE;
pc->add_options = (gpointer) clock_add_options;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Trash module
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* Trash module
* ------------
*/
typedef struct
{
char *dirname;
int size;
char *command;
gboolean in_terminal;

gboolean empty;

GdkPixbuf *empty_pb;
GdkPixbuf *full_pb;

/* we just overload the panel item a bit */
PanelItem *item;
IconButton *button;
}
t_trash;

static t_trash *trash_new(PanelGroup * pg)
static void trash_run(t_trash * trash)
{
exec_cmd(trash->command, trash->in_terminal);
}

void trash_dropped(GtkWidget *widget, GList *drop_data, gpointer data)
{
t_trash *trash = (t_trash *)data;
char *cmd;
GList *li;

for (li = drop_data; li && li->data; li = li->next)
{
cmd = g_strconcat(trash->command, " ", (char *)li->data, NULL);

exec_cmd_silent(cmd, FALSE);

g_free(cmd);
}
}

static t_trash *trash_new(void)
{
t_trash *trash = g_new(t_trash, 1);
const char *home = g_getenv("HOME");
GtkWidget *b;

trash->dirname = g_strconcat(home, "/.xfce/trash", NULL);

trash->size = MEDIUM;

trash->empty = TRUE;

trash->item = panel_item_new(pg);
trash->item->command = g_strdup("xftrash");
trash->command = g_strdup("xftrash");
trash->in_terminal = FALSE;

trash->empty_pb = get_module_pixbuf(TRASH_EMPTY_ICON);
trash->full_pb = get_module_pixbuf(TRASH_FULL_ICON);

create_panel_item(trash->item);

g_object_unref(trash->item->pb);
trash->item->pb = trash->empty_pb;
trash->button = icon_button_new(trash->empty_pb);

panel_item_set_size(trash->item, MEDIUM);
b = icon_button_get_button(trash->button);
add_tooltip(b, _("Trashcan: 0 files"));

add_tooltip(trash->item->button, _("Trashcan: 0 files"));
/* signals */
dnd_set_drag_dest(b);
dnd_set_callback(b, DROP_CALLBACK(trash_dropped), trash);

g_signal_connect_swapped(b, "clicked", G_CALLBACK(trash_run), trash);
return trash;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static gboolean check_trash(PanelModule * pm)
static gboolean check_trash(PanelControl * pc)
{
t_trash *trash = (t_trash *) pm->data;
PanelItem *pi = trash->item;
t_trash *trash = (t_trash *) pc->data;

GDir *dir;
const char *file;
@@ -425,10 +403,11 @@ static gboolean check_trash(PanelModule * pm)
{
if(!trash->empty)
{
pi->pb = trash->empty_pb;
trash->empty = TRUE;
changed = TRUE;
add_tooltip(pi->button, _("Trashcan: 0 files"));
icon_button_set_pixbuf(trash->button, trash->empty_pb);
add_tooltip(icon_button_get_button(trash->button),
_("Trashcan: 0 files"));
}
}
else
@@ -440,12 +419,11 @@ static gboolean check_trash(PanelModule * pm)

chdir(trash->dirname);


if(trash->empty)
{
pi->pb = trash->full_pb;
trash->empty = FALSE;
changed = TRUE;
icon_button_set_pixbuf(trash->button, trash->full_pb);
}

while(file)
@@ -469,68 +447,39 @@ static gboolean check_trash(PanelModule * pm)
sprintf(text, _("Trashcan: %d files / %d MB"), number,
size / (1024 * 1024));

add_tooltip(pi->button, text);
add_tooltip(icon_button_get_button(trash->button), text);
}

if(dir)
g_dir_close(dir);

if(changed)
{
panel_item_set_size(trash->item, settings.size);
}

return TRUE;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void trash_pack(PanelModule * pm, GtkBox * box)
{
t_trash *trash = (t_trash *) pm->data;

panel_item_pack(trash->item, box);
}

static void trash_unpack(PanelModule * pm, GtkContainer * container)
{
t_trash *trash = (t_trash *) pm->data;

panel_item_unpack(trash->item, container);
}

static void trash_free(PanelModule * pm)
static void trash_free(PanelControl * pc)
{
t_trash *trash = (t_trash *) pm->data;
t_trash *trash = (t_trash *) pc->data;

g_free(trash->dirname);

/* will be unreffed in panel_item_free() */
g_object_ref(trash->item->pb);
panel_item_free(trash->item);
icon_button_free(trash->button);

g_object_unref(trash->empty_pb);
g_object_unref(trash->full_pb);

if(GTK_IS_WIDGET(pm->main))
gtk_widget_destroy(pm->main);

g_free(trash);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void trash_set_size(PanelModule * pm, int size)
static void trash_set_size(PanelControl * pc, int size)
{
t_trash *trash = (t_trash *) pm->data;
t_trash *trash = (t_trash *) pc->data;

trash->size = size;
panel_item_set_size(trash->item, size);
icon_button_set_size(trash->button, size);
}

static void trash_set_icon_theme(PanelModule * pm, const char *theme)
static void trash_set_theme(PanelControl * pc, const char *theme)
{
t_trash *trash = (t_trash *) pm->data;
t_trash *trash = (t_trash *) pc->data;

g_object_unref(trash->empty_pb);
g_object_unref(trash->full_pb);
@@ -539,42 +488,36 @@ static void trash_set_icon_theme(PanelModule * pm, const char *theme)
trash->full_pb = get_module_pixbuf(TRASH_FULL_ICON);

if(trash->empty)
trash->item->pb = trash->empty_pb;
icon_button_set_pixbuf(trash->button, trash->empty_pb);
else
trash->item->pb = trash->full_pb;

panel_item_set_size(trash->item, trash->size);
icon_button_set_pixbuf(trash->button, trash->full_pb);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
static gboolean create_trash_module(PanelModule * pm)
/* create trash panel control
*/
void create_trash(PanelControl * pc)
{
t_trash *trash = trash_new(pm->parent);

pm->caption = g_strdup(_("Trash can"));
pm->data = (gpointer) trash;
pm->main = trash->item->button;
t_trash *trash = trash_new();
GtkWidget *b = icon_button_get_button(trash->button);

pm->interval = 2000; /* 2 sec */
pm->update = (gpointer) check_trash;
gtk_container_add(GTK_CONTAINER(pc->base), b);

pm->pack = (gpointer) trash_pack;
pm->unpack = (gpointer) trash_unpack;
pm->free = (gpointer) trash_free;
pc->caption = g_strdup(_("Trash can"));
pc->data = (gpointer) trash;
pc->main = b;

pm->set_size = (gpointer) trash_set_size;
pm->set_icon_theme = (gpointer) trash_set_icon_theme;
pc->interval = 2000; /* 2 sec */
pc->update = (gpointer) check_trash;

if(pm->parent)
check_trash(pm);
pc->free = (gpointer) trash_free;

return TRUE;
pc->set_size = (gpointer) trash_set_size;
pc->set_theme = (gpointer) trash_set_theme;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Exit module
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* Exit module
* -----------
*/
typedef struct
{
GtkWidget *vbox;
@@ -587,24 +530,18 @@ t_exit;
static t_exit *exit_new(void)
{
GtkWidget *im;
GdkPixbuf *pb = NULL;
t_exit *exit = g_new(t_exit, 1);

exit->vbox = gtk_vbox_new(TRUE, 0);
gtk_widget_show(exit->vbox);

/* protect against destruction when unpacking */
g_object_ref(exit->vbox);

exit->lock_button = gtk_button_new();
gtk_button_set_relief(GTK_BUTTON(exit->lock_button), GTK_RELIEF_NONE);
gtk_widget_show(exit->lock_button);
gtk_box_pack_start(GTK_BOX(exit->vbox), exit->lock_button, TRUE, TRUE, 0);

pb = get_system_pixbuf(MINILOCK_ICON);
im = gtk_image_new_from_pixbuf(pb);
im = gtk_image_new();
gtk_widget_show(im);
g_object_unref(pb);
gtk_container_add(GTK_CONTAINER(exit->lock_button), im);

exit->exit_button = gtk_button_new();
@@ -612,68 +549,48 @@ static t_exit *exit_new(void)
gtk_widget_show(exit->exit_button);
gtk_box_pack_start(GTK_BOX(exit->vbox), exit->exit_button, TRUE, TRUE, 0);

pb = get_system_pixbuf(MINIPOWER_ICON);
im = gtk_image_new_from_pixbuf(pb);
im = gtk_image_new();
gtk_widget_show(im);
g_object_unref(pb);
gtk_container_add(GTK_CONTAINER(exit->exit_button), im);

add_tooltip(exit->lock_button, _("Lock the screen"));
add_tooltip(exit->exit_button, _("Exit"));

g_signal_connect_swapped(exit->lock_button, "clicked",
G_CALLBACK(mini_lock_cb), NULL);

g_signal_connect_swapped(exit->exit_button, "clicked",
G_CALLBACK(quit), NULL);
return exit;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void exit_pack(PanelModule * pm, GtkBox * box)
{
t_exit *exit = (t_exit *) pm->data;
g_signal_connect_swapped(exit->lock_button, "clicked",
G_CALLBACK(mini_lock_cb), NULL);

gtk_box_pack_start(box, exit->vbox, TRUE, TRUE, 0);
}
g_signal_connect_swapped(exit->exit_button, "clicked", G_CALLBACK(quit),
NULL);

static void exit_unpack(PanelModule * pm, GtkContainer * container)
{
t_exit *exit = (t_exit *) pm->data;

gtk_container_remove(container, exit->vbox);
return exit;
}

static void exit_free(PanelModule * pm)
static void exit_free(PanelControl * pc)
{
t_exit *exit = (t_exit *) pm->data;
t_exit *exit = (t_exit *) pc->data;

if(GTK_IS_WIDGET(pm->main))
gtk_widget_destroy(pm->main);
if(GTK_IS_WIDGET(pc->main))
gtk_widget_destroy(pc->main);

g_free(exit);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void exit_set_size(PanelModule * pm, int size)
static void exit_set_size(PanelControl * pc, int size)
{
t_exit *exit = (t_exit *) pm->data;
t_exit *exit = (t_exit *) pc->data;
GdkPixbuf *pb1, *pb2;
GtkWidget *im;
int width, height;

width = icon_size(size);
height = icon_size(size) / 2;
width = icon_size[size];
height = icon_size[size] / 2;

gtk_widget_set_size_request(exit->exit_button, width + 4, height + 2);
gtk_widget_set_size_request(exit->lock_button, width + 4, height + 2);

pb1 = get_system_pixbuf(MINIPOWER_ICON);
im = gtk_bin_get_child(GTK_BIN(exit->exit_button));
pb2 = get_scaled_pixbuf(pb1, height-4);
pb2 = get_scaled_pixbuf(pb1, height - 4);
gtk_image_set_from_pixbuf(GTK_IMAGE(im), pb2);

g_object_unref(pb1);
@@ -681,23 +598,46 @@ static void exit_set_size(PanelModule * pm, int size)

pb1 = get_system_pixbuf(MINILOCK_ICON);
im = gtk_bin_get_child(GTK_BIN(exit->lock_button));
pb2 = get_scaled_pixbuf(pb1, height-4);
pb2 = get_scaled_pixbuf(pb1, height - 4);
gtk_image_set_from_pixbuf(GTK_IMAGE(im), pb2);

g_object_unref(pb1);
g_object_unref(pb2);
}

static void exit_set_icon_theme(PanelModule * pm, const char *theme)
static void exit_set_theme(PanelControl * pc, const char *theme)
{
exit_set_size(pm, settings.size);
exit_set_size(pc, settings.size);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
GtkWidget *lock_entry;
GtkWidget *exit_entry;

void exit_add_options(PanelModule * pm, GtkContainer * container)
static void exit_apply_configuration(PanelControl * pc)
{
const char *tmp;

tmp = gtk_entry_get_text(GTK_ENTRY(lock_entry));

g_free(settings.lock_command);

if(tmp && *tmp)
settings.lock_command = g_strdup(tmp);
else
settings.lock_command = NULL;

tmp = gtk_entry_get_text(GTK_ENTRY(exit_entry));

g_free(settings.exit_command);

if(tmp && *tmp)
settings.exit_command = g_strdup(tmp);
else
settings.exit_command = NULL;
}

void exit_add_options(PanelControl * pc, GtkContainer * container,
GtkWidget * revert, GtkWidget * done)
{
GtkWidget *vbox, *hbox, *label;
GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -716,8 +656,8 @@ void exit_add_options(PanelModule * pm, GtkContainer * container)
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);

lock_entry = gtk_entry_new();
if (settings.lock_command)
gtk_entry_set_text(GTK_ENTRY(lock_entry), settings.lock_command);
if(settings.lock_command)
gtk_entry_set_text(GTK_ENTRY(lock_entry), settings.lock_command);
gtk_widget_show(lock_entry);
gtk_box_pack_start(GTK_BOX(hbox), lock_entry, FALSE, FALSE, 0);

@@ -732,161 +672,103 @@ void exit_add_options(PanelModule * pm, GtkContainer * container)
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);

exit_entry = gtk_entry_new();
if (settings.exit_command)
gtk_entry_set_text(GTK_ENTRY(exit_entry), settings.exit_command);
if(settings.exit_command)
gtk_entry_set_text(GTK_ENTRY(exit_entry), settings.exit_command);
gtk_widget_show(exit_entry);
gtk_box_pack_start(GTK_BOX(hbox), exit_entry, FALSE, FALSE, 0);

gtk_container_add(container, vbox);
}

static void exit_apply_configuration(PanelModule * pm)
{
const char *tmp;

tmp = gtk_entry_get_text(GTK_ENTRY(lock_entry));

g_free(settings.lock_command);

if (tmp && *tmp)
settings.lock_command = g_strdup(tmp);
else
settings.lock_command = NULL;

tmp = gtk_entry_get_text(GTK_ENTRY(exit_entry));

g_free(settings.exit_command);

if (tmp && *tmp)
settings.exit_command = g_strdup(tmp);
else
settings.exit_command = NULL;
g_signal_connect_swapped(done, "clicked",
G_CALLBACK(exit_apply_configuration), pc);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
static gboolean create_exit_module(PanelModule * pm)
void create_exit(PanelControl * pc)
{
t_exit *exit = exit_new();

pm->caption = g_strdup(_("Exit/Lock"));
pm->data = (gpointer) exit;
pm->main = exit->exit_button;
gtk_container_add(GTK_CONTAINER(pc->base), exit->vbox);
pc->caption = g_strdup(_("Exit/Lock"));
pc->data = (gpointer) exit;
pc->main = exit->exit_button;

pm->interval = 0;
pm->update = NULL;
pc->interval = 0;
pc->update = NULL;

pm->pack = (gpointer) exit_pack;
pm->unpack = (gpointer) exit_unpack;
pm->free = (gpointer) exit_free;
pc->free = (gpointer) exit_free;

pm->set_size = (gpointer) exit_set_size;
pm->set_icon_theme = (gpointer) exit_set_icon_theme;
pc->set_size = (gpointer) exit_set_size;
pc->set_theme = (gpointer) exit_set_theme;

pm->add_options = (gpointer) exit_add_options;
pm->apply_configuration = (gpointer) exit_apply_configuration;
pc->add_options = (gpointer) exit_add_options;

return TRUE;
exit_set_size(pc, settings.size);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Config module
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
static GtkWidget *config_new(void)
/* Config module
* -------------
*/
static IconButton *config_new(void)
{
GtkWidget *button;
GtkWidget *im;
IconButton *button;
GtkWidget *b;
GdkPixbuf *pb = NULL;

button = gtk_button_new();
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_widget_show(button);
/* protect against destruction when unpacking */
g_object_ref(button);

pb = get_system_pixbuf(MINIPALET_ICON);
im = gtk_image_new_from_pixbuf(pb);
gtk_widget_show(im);
button = icon_button_new(pb);
g_object_unref(pb);
gtk_container_add(GTK_CONTAINER(button), im);

add_tooltip(button, _("Setup..."));
b = icon_button_get_button(button);
add_tooltip(b, _("Setup..."));

g_signal_connect_swapped(button, "clicked",
G_CALLBACK(mini_palet_cb), NULL);
g_signal_connect_swapped(b, "clicked", G_CALLBACK(mini_palet_cb),
NULL);

return button;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void config_pack(PanelModule * pm, GtkBox * box)
static void config_free(PanelControl * pc)
{
GtkWidget *config = (GtkWidget *) pm->data;
IconButton *b = (IconButton *)pc->data;

gtk_box_pack_start(box, config, TRUE, TRUE, 0);
icon_button_free(b);
}

static void config_unpack(PanelModule * pm, GtkContainer * container)
static void config_set_size(PanelControl * pc, int size)
{
GtkWidget *config = (GtkWidget *) pm->data;
IconButton *b = (IconButton *)pc->data;

gtk_container_remove(container, config);
icon_button_set_size(b, size);
}

static void config_free(PanelModule * pm)
static void config_set_theme(PanelControl * pc, const char *theme)
{
if(GTK_IS_WIDGET(pm->main))
gtk_widget_destroy(pm->main);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

static void config_set_size(PanelModule * pm, int size)
{
GtkWidget *config = (GtkWidget *) pm->data;
GdkPixbuf *pb1, *pb2;
GtkWidget *im;
int width, height;

width = icon_size(size);
height = icon_size(size);

gtk_widget_set_size_request(config, width + 4, height + 4);

pb1 = get_system_pixbuf(MINIPALET_ICON);
im = gtk_bin_get_child(GTK_BIN(config));
pb2 = get_scaled_pixbuf(pb1, height);
gtk_image_set_from_pixbuf(GTK_IMAGE(im), pb2);
GdkPixbuf *pb;
IconButton *b = (IconButton *)pc->data;

g_object_unref(pb1);
g_object_unref(pb2);
}

static void config_set_icon_theme(PanelModule * pm, const char *theme)
{
config_set_size(pm, settings.size);
pb = get_system_pixbuf(MINIPALET_ICON);
icon_button_set_pixbuf(b, pb);
g_object_unref(pb);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
static gboolean create_config_module(PanelModule * pm)
void create_config(PanelControl * pc)
{
GtkWidget *config = config_new();

pm->caption = g_strdup(_("Setup"));
pm->data = (gpointer) config;
pm->main = config;
IconButton *config = config_new();
GtkWidget *b = icon_button_get_button(config);

pm->interval = 0;
pm->update = NULL;
gtk_container_add(GTK_CONTAINER(pc->base), b);
pc->caption = g_strdup(_("Setup"));
pc->data = (gpointer) config;
pc->main = b;

pm->pack = (gpointer) config_pack;
pm->unpack = (gpointer) config_unpack;
pm->free = (gpointer) config_free;
pc->interval = 0;
pc->update = NULL;

pm->set_size = (gpointer) config_set_size;
pm->set_icon_theme = (gpointer) config_set_icon_theme;
pc->free = (gpointer) config_free;

return TRUE;
pc->set_size = (gpointer) config_set_size;
pc->set_theme = (gpointer) config_set_theme;
}



+ 9
- 2
panel/builtins.h View File

@@ -1,6 +1,6 @@
/* builtins.h
*
* Copyright (C) 2002 Jasper Huijsmans (j.b.huijsmans@hetnet.nl)
* Copyright (C) 2002 Jasper Huijsmans (huysmans@users.sourceforge.net)
*
* 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
@@ -22,6 +22,13 @@

#include "global.h"

gboolean create_builtin_module(PanelModule * pm);
void create_clock(PanelControl * pc);

void create_trash(PanelControl * pc);

void create_exit(PanelControl * pc);

void create_config(PanelControl * pc);

#endif /* __XFCE_BUILTINS_H__ */


+ 51
- 80
panel/callbacks.c View File

@@ -1,6 +1,6 @@
/* callbacks.c
*
* Copyright (C) 2002 Jasper Huijsmans <j.b.huijsmans@hetnet.nl>
* Copyright (C) 2002 Jasper Huijsmans <huysmans@users.sourceforge.net>
*
* 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
@@ -21,58 +21,64 @@
#include <string.h>
#include <ctype.h>


#include "callbacks.h"

#include "xfce.h"
#include "xfce_support.h"
#include "dialogs.h"
#include "item_dialog.h"
#include "xfce.h"
#include "central.h"
#include "side.h"
#include "item.h"
#include "popup.h"
#include "icons.h"
#include "dialogs.h"
#include "controls_dialog.h"
#include "settings.h"


static PanelPopup *open_popup = NULL;

void hide_current_popup_menu(void);

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Panel callbacks
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
/* Panel callbacks
* ---------------
*/
gboolean panel_delete_cb(GtkWidget * window, GdkEvent * ev, gpointer data)
{
char *text = _("The panel recieved a request from the window "
"manager to quit. Usually this is by accident.\n"
"If you want to continue using the panel choose "
"\'No\'\n\n" "Do you want to quit the panel?");

if(confirm(text, GTK_STOCK_QUIT, NULL))
quit();
quit();

return TRUE;
}

gboolean panel_destroy_cb(GtkWidget * window, GdkEvent * ev, gpointer data)
{
quit();
write_panel_config();
panel_cleanup();

gtk_main_quit();

return TRUE;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Central panel callbacks
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
void iconify_cb(void)
{
hide_current_popup_menu();

gtk_window_iconify(GTK_WINDOW(toplevel));
}

/* Central panel callbacks
* -----------------------
*/
void screen_button_click(GtkWidget * b, ScreenButton * sb)
{
if(sb->index == settings.current)
int n =screen_button_get_index(sb);
if(n == current_screen)
{
central_panel_set_current(sb->index);
/* keep the button depressed */
central_panel_set_current(n);
return;
}

request_net_current_desktop(sb->index);
request_net_current_desktop(n);
}

gboolean
@@ -108,7 +114,6 @@ void mini_info_cb(void)
hide_current_popup_menu();

info_panel_dialog();

}

void mini_palet_cb(void)
@@ -125,64 +130,35 @@ void mini_palet_cb(void)
global_settings_dialog();
}

void mini_power_cb(GtkButton * b, GdkEventButton * ev, char *cmd)
void mini_power_cb(GtkButton * b, GdkEventButton * ev, gpointer data)
{
int w, h;

hide_current_popup_menu();

gdk_window_get_size(ev->window, &w, &h);

/* we have to check if the pointer is still inside the button */
if(ev->x < 0 || ev->x > w || ev->y < 0 || ev->y > h)
{
gtk_button_released(b);
return;
}

if(ev->button == 1)
{
exec_cmd(cmd, FALSE);
quit();
}
else
restart();
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Panel group callbacks

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

void iconify_cb(void)
{
hide_current_popup_menu();

gtk_window_iconify(GTK_WINDOW(toplevel));
quit();
}

gboolean panel_group_press_cb(GtkButton * b, GdkEventButton * ev, PanelGroup * pg)
/* Panel control callbacks
* -----------------------
*/
gboolean panel_control_press_cb(GtkButton * b, GdkEventButton * ev,
PanelControl * pc)
{
hide_current_popup_menu();

if(ev->button != 3)
return FALSE;

if(disable_user_config)
return FALSE;

edit_panel_group_dialog(pg);
hide_current_popup_menu();

change_panel_control_dialog(pc);

return TRUE;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Panel popup callbacks

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

/* Panel popup callbacks
* ---------------------
*/
static void hide_popup(PanelPopup * pp)
{
if(open_popup == pp)
@@ -311,12 +287,9 @@ gboolean delete_popup(GtkWidget * window, GdkEvent * ev, PanelPopup * pp)
return TRUE;
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Panel item callbacks

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

/* Panel item callbacks
* --------------------
*/
void
panel_item_drop_cb(GtkWidget * widget, GdkDragContext * context,
gint x, gint y, GtkSelectionData * data,
@@ -357,12 +330,9 @@ void panel_item_click_cb(GtkButton * b, PanelItem * pi)
exec_cmd(pi->command, pi->in_terminal);
}

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Menu item callbacks

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

/* Menu item callbacks
* -------------------
*/
void
addtomenu_item_drop_cb(GtkWidget * widget, GdkDragContext * context,
gint x, gint y, GtkSelectionData * data,
@@ -464,3 +434,4 @@ void menu_item_click_cb(GtkButton * b, MenuItem * mi)
hide_current_popup_menu();
exec_cmd(mi->command, mi->in_terminal);
}


+ 12
- 16
panel/callbacks.h View File

@@ -1,6 +1,6 @@
/* callback.h
*
* Copyright (C) 2002 Jasper Huijsmans <j.b.huijsmans@hetnet.nl>
* Copyright (C) 2002 Jasper Huijsmans <huysmans@users.sourceforge.net>
*
* 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
@@ -22,13 +22,14 @@

#include "global.h"

/*****************************************************************************/

/* global */
gboolean panel_delete_cb(GtkWidget * window, GdkEvent * ev, gpointer data);

gboolean panel_destroy_cb(GtkWidget * window, GdkEvent * ev, gpointer data);

/*****************************************************************************/
void iconify_cb(void);

/* central panel */
void screen_button_click(GtkWidget * b, ScreenButton * sb);

gboolean screen_button_pressed_cb(GtkButton * b, GdkEventButton * ev,
@@ -38,15 +39,11 @@ void mini_lock_cb(void);
void mini_info_cb(void);
void mini_palet_cb(void);

void mini_power_cb(GtkButton * b, GdkEventButton * ev, char *cmd);

/*****************************************************************************/

void iconify_cb(void);

gboolean panel_group_press_cb(GtkButton * b, GdkEventButton * ev, PanelGroup * pg);
void mini_power_cb(GtkButton * b, GdkEventButton * ev, gpointer data);

/*****************************************************************************/
/* side panel */
gboolean panel_control_press_cb(GtkButton * b, GdkEventButton * ev,
PanelControl * pc);

void toggle_popup(GtkWidget * button, PanelPopup * pp);

@@ -54,16 +51,14 @@ void tearoff_popup(GtkWidget * button, PanelPopup * pp);

gboolean delete_popup(GtkWidget * window, GdkEvent * ev, PanelPopup * pp);

/*****************************************************************************/

/* panel items */
void panel_item_drop_cb(GtkWidget * widget, GdkDragContext * context,
gint x, gint y, GtkSelectionData * data,
guint info, guint time, PanelItem * pi);

void panel_item_click_cb(GtkButton * b, PanelItem * pi);

/*****************************************************************************/

/* menu items */
void addtomenu_item_drop_cb(GtkWidget * widget, GdkDragContext * context,
gint x, gint y, GtkSelectionData * data,
guint info, guint time, PanelPopup * pp);
@@ -79,3 +74,4 @@ void menu_item_drop_cb(GtkWidget * widget, GdkDragContext * context,
void menu_item_click_cb(GtkButton * b, MenuItem * mi);

#endif /* __XFCE_CALLBACKS_H__ */


+ 298
- 267
panel/central.c View File

@@ -1,6 +1,6 @@
/* central.c
*
* Copyright (C) 2002 Jasper Huijsmans <j.b.huijsmans@hetnet.nl>
* Copyright (C) 2002 Jasper Huijsmans <huysmans@users.sourceforge.net>
*
* 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
@@ -17,12 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/* central.c
*
* Contains functions for the central part of the panel, which consists of the
* desktop switcher and four mini-buttons.
*
*/
/* central.c
* ---------
* Contains functions for the central part of the panel, which consists of