Added an executable to display the panel settings

This commit is contained in:
Pierre Pronchery 2011-02-05 02:41:35 +00:00
parent 283a0e63aa
commit 1fe4e3e8a4
25 changed files with 191 additions and 16 deletions

View File

@ -22,21 +22,27 @@ dist:
$(LN) -s -- . $(PACKAGE)-$(VERSION) $(LN) -s -- . $(PACKAGE)-$(VERSION)
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ @$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \
$(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/panel-settings.desktop \
$(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/data/16x16/Makefile \ $(PACKAGE)-$(VERSION)/data/16x16/Makefile \
$(PACKAGE)-$(VERSION)/data/16x16/panel-applet-bluetooth.png \ $(PACKAGE)-$(VERSION)/data/16x16/panel-applet-bluetooth.png \
$(PACKAGE)-$(VERSION)/data/16x16/panel-settings.png \
$(PACKAGE)-$(VERSION)/data/16x16/project.conf \ $(PACKAGE)-$(VERSION)/data/16x16/project.conf \
$(PACKAGE)-$(VERSION)/data/22x22/Makefile \ $(PACKAGE)-$(VERSION)/data/22x22/Makefile \
$(PACKAGE)-$(VERSION)/data/22x22/panel-applet-bluetooth.png \ $(PACKAGE)-$(VERSION)/data/22x22/panel-applet-bluetooth.png \
$(PACKAGE)-$(VERSION)/data/22x22/panel-settings.png \
$(PACKAGE)-$(VERSION)/data/22x22/project.conf \ $(PACKAGE)-$(VERSION)/data/22x22/project.conf \
$(PACKAGE)-$(VERSION)/data/24x24/Makefile \ $(PACKAGE)-$(VERSION)/data/24x24/Makefile \
$(PACKAGE)-$(VERSION)/data/24x24/panel-applet-bluetooth.png \ $(PACKAGE)-$(VERSION)/data/24x24/panel-applet-bluetooth.png \
$(PACKAGE)-$(VERSION)/data/24x24/panel-settings.png \
$(PACKAGE)-$(VERSION)/data/24x24/project.conf \ $(PACKAGE)-$(VERSION)/data/24x24/project.conf \
$(PACKAGE)-$(VERSION)/data/32x32/Makefile \ $(PACKAGE)-$(VERSION)/data/32x32/Makefile \
$(PACKAGE)-$(VERSION)/data/32x32/panel-applet-bluetooth.png \ $(PACKAGE)-$(VERSION)/data/32x32/panel-applet-bluetooth.png \
$(PACKAGE)-$(VERSION)/data/32x32/panel-settings.png \
$(PACKAGE)-$(VERSION)/data/32x32/project.conf \ $(PACKAGE)-$(VERSION)/data/32x32/project.conf \
$(PACKAGE)-$(VERSION)/data/48x48/Makefile \ $(PACKAGE)-$(VERSION)/data/48x48/Makefile \
$(PACKAGE)-$(VERSION)/data/48x48/panel-applet-bluetooth.png \ $(PACKAGE)-$(VERSION)/data/48x48/panel-applet-bluetooth.png \
$(PACKAGE)-$(VERSION)/data/48x48/panel-settings.png \
$(PACKAGE)-$(VERSION)/data/48x48/project.conf \ $(PACKAGE)-$(VERSION)/data/48x48/project.conf \
$(PACKAGE)-$(VERSION)/data/scalable/Makefile \ $(PACKAGE)-$(VERSION)/data/scalable/Makefile \
$(PACKAGE)-$(VERSION)/data/scalable/panel-applet-bluetooth.svg \ $(PACKAGE)-$(VERSION)/data/scalable/panel-applet-bluetooth.svg \
@ -52,6 +58,7 @@ dist:
$(PACKAGE)-$(VERSION)/src/panel.c \ $(PACKAGE)-$(VERSION)/src/panel.c \
$(PACKAGE)-$(VERSION)/src/window.c \ $(PACKAGE)-$(VERSION)/src/window.c \
$(PACKAGE)-$(VERSION)/src/main.c \ $(PACKAGE)-$(VERSION)/src/main.c \
$(PACKAGE)-$(VERSION)/src/settings.c \
$(PACKAGE)-$(VERSION)/src/run.c \ $(PACKAGE)-$(VERSION)/src/run.c \
$(PACKAGE)-$(VERSION)/src/Makefile \ $(PACKAGE)-$(VERSION)/src/Makefile \
$(PACKAGE)-$(VERSION)/src/common.h \ $(PACKAGE)-$(VERSION)/src/common.h \

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps $(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps
$(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-applet-bluetooth.png $(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-applet-bluetooth.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps
$(INSTALL) -m 0644 -- panel-settings.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-settings.png
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-applet-bluetooth.png $(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-applet-bluetooth.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/panel-settings.png
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

View File

@ -1,4 +1,7 @@
dist=Makefile,panel-applet-bluetooth.png dist=Makefile,panel-applet-bluetooth.png,panel-settings.png
[panel-applet-bluetooth.png] [panel-applet-bluetooth.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps install=$(PREFIX)/share/icons/hicolor/16x16/apps
[panel-settings.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps $(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps
$(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-applet-bluetooth.png $(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-applet-bluetooth.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps
$(INSTALL) -m 0644 -- panel-settings.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-settings.png
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-applet-bluetooth.png $(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-applet-bluetooth.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/22x22/apps/panel-settings.png
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

View File

@ -1,4 +1,7 @@
dist=Makefile,panel-applet-bluetooth.png dist=Makefile,panel-applet-bluetooth.png,panel-settings.png
[panel-applet-bluetooth.png] [panel-applet-bluetooth.png]
install=$(PREFIX)/share/icons/hicolor/22x22/apps install=$(PREFIX)/share/icons/hicolor/22x22/apps
[panel-settings.png]
install=$(PREFIX)/share/icons/hicolor/22x22/apps

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps $(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-applet-bluetooth.png $(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-applet-bluetooth.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- panel-settings.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-settings.png
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-applet-bluetooth.png $(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-applet-bluetooth.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/panel-settings.png
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

View File

@ -1,4 +1,7 @@
dist=Makefile,panel-applet-bluetooth.png dist=Makefile,panel-applet-bluetooth.png,panel-settings.png
[panel-applet-bluetooth.png] [panel-applet-bluetooth.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps install=$(PREFIX)/share/icons/hicolor/24x24/apps
[panel-settings.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps $(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps
$(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-applet-bluetooth.png $(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-applet-bluetooth.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps
$(INSTALL) -m 0644 -- panel-settings.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-settings.png
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-applet-bluetooth.png $(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-applet-bluetooth.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/panel-settings.png
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,4 +1,7 @@
dist=Makefile,panel-applet-bluetooth.png dist=Makefile,panel-applet-bluetooth.png,panel-settings.png
[panel-applet-bluetooth.png] [panel-applet-bluetooth.png]
install=$(PREFIX)/share/icons/hicolor/32x32/apps install=$(PREFIX)/share/icons/hicolor/32x32/apps
[panel-settings.png]
install=$(PREFIX)/share/icons/hicolor/32x32/apps

View File

@ -14,8 +14,11 @@ distclean: clean
install: install:
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps $(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-applet-bluetooth.png $(INSTALL) -m 0644 -- panel-applet-bluetooth.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-applet-bluetooth.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- panel-settings.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-settings.png
uninstall: uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-applet-bluetooth.png $(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-applet-bluetooth.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/panel-settings.png
.PHONY: all clean distclean install uninstall .PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,4 +1,7 @@
dist=Makefile,panel-applet-bluetooth.png dist=Makefile,panel-applet-bluetooth.png,panel-settings.png
[panel-applet-bluetooth.png] [panel-applet-bluetooth.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps install=$(PREFIX)/share/icons/hicolor/48x48/apps
[panel-settings.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps

View File

@ -1,4 +1,9 @@
SUBDIRS = 16x16 22x22 24x24 32x32 48x48 scalable SUBDIRS = 16x16 22x22 24x24 32x32 48x48 scalable
PREFIX = /usr/local
DESTDIR =
MKDIR = mkdir -p
INSTALL = install
RM = rm -f
all: subdirs all: subdirs
@ -14,8 +19,11 @@ distclean:
install: install:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
$(MKDIR) $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -m 0644 -- panel-settings.desktop $(DESTDIR)$(PREFIX)/share/applications/panel-settings.desktop
uninstall: uninstall:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
$(RM) -- $(DESTDIR)$(PREFIX)/share/applications/panel-settings.desktop
.PHONY: all subdirs clean distclean install uninstall .PHONY: all subdirs clean distclean install uninstall

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Panel settings
Exec=panel-settings
Icon=panel-settings
Type=Application
Categories=Settings;GTK;

View File

@ -1,2 +1,5 @@
subdirs=16x16,22x22,24x24,32x32,48x48,scalable subdirs=16x16,22x22,24x24,32x32,48x48,scalable
dist=Makefile dist=Makefile,panel-settings.desktop
[panel-settings.desktop]
install=$(PREFIX)/share/applications

View File

@ -1,3 +1,4 @@
.cvsignore .cvsignore
panel panel
panel-settings
run run

View File

@ -1,5 +1,5 @@
SUBDIRS = applets SUBDIRS = applets
TARGETS = panel run TARGETS = panel panel-settings run
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
@ -28,6 +28,13 @@ panel_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
panel: $(panel_OBJS) panel: $(panel_OBJS)
$(CC) -o panel $(panel_OBJS) $(panel_LDFLAGS) $(CC) -o panel $(panel_OBJS) $(panel_LDFLAGS)
panel-settings_OBJS = settings.o
panel-settings_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
panel-settings_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
panel-settings: $(panel-settings_OBJS)
$(CC) -o panel-settings $(panel-settings_OBJS) $(panel-settings_LDFLAGS)
run_OBJS = run.o run_OBJS = run.o
run_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D PREFIX=\"$(PREFIX)\" $(CFLAGSF) $(CFLAGS) run_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D PREFIX=\"$(PREFIX)\" $(CFLAGSF) $(CFLAGS)
run_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) run_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
@ -44,16 +51,19 @@ window.o: window.c common.h window.h
main.o: main.c common.h ../config.h main.o: main.c common.h ../config.h
$(CC) $(panel_CFLAGS) -c main.c $(CC) $(panel_CFLAGS) -c main.c
settings.o: settings.c
$(CC) $(panel-settings_CFLAGS) -c settings.c
run.o: run.c run.o: run.c
$(CC) $(run_CFLAGS) -c run.c $(CC) $(run_CFLAGS) -c run.c
clean: clean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
$(RM) -- $(panel_OBJS) $(run_OBJS) $(RM) -- $(panel_OBJS) $(panel-settings_OBJS) $(run_OBJS)
distclean: distclean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done
$(RM) -- $(panel_OBJS) $(run_OBJS) $(RM) -- $(panel_OBJS) $(panel-settings_OBJS) $(run_OBJS)
$(RM) -- $(TARGETS) $(RM) -- $(TARGETS)
install: $(TARGETS) install: $(TARGETS)
@ -61,11 +71,14 @@ install: $(TARGETS)
$(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 -- panel $(DESTDIR)$(BINDIR)/panel $(INSTALL) -m 0755 -- panel $(DESTDIR)$(BINDIR)/panel
$(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 -- panel-settings $(DESTDIR)$(BINDIR)/panel-settings
$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 -- run $(DESTDIR)$(BINDIR)/run $(INSTALL) -m 0755 -- run $(DESTDIR)$(BINDIR)/run
uninstall: uninstall:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
$(RM) -- $(DESTDIR)$(BINDIR)/panel $(RM) -- $(DESTDIR)$(BINDIR)/panel
$(RM) -- $(DESTDIR)$(BINDIR)/panel-settings
$(RM) -- $(DESTDIR)$(BINDIR)/run $(RM) -- $(DESTDIR)$(BINDIR)/run
.PHONY: all subdirs clean distclean install uninstall .PHONY: all subdirs clean distclean install uninstall

View File

@ -24,6 +24,16 @@
/* Panel */ /* Panel */
/* types */ /* types */
typedef enum _PanelMessage
{
PANEL_MESSAGE_SHOW = 0
} PanelMessage;
typedef enum _PanelMessageShow
{
PANEL_MESSAGE_SHOW_SETTINGS = 0
} PanelMessageShow;
typedef enum _PanelPosition typedef enum _PanelPosition
{ {
PANEL_POSITION_BOTTOM = 0x1, PANEL_POSITION_BOTTOM = 0x1,
@ -41,12 +51,15 @@ typedef struct _PanelPrefs
/* constants */ /* constants */
#define PANEL_BORDER_WIDTH 4 # define PANEL_BORDER_WIDTH 4
#define PANEL_ICON_SIZE_DEFAULT GTK_ICON_SIZE_LARGE_TOOLBAR
#define PANEL_ICON_SIZE_UNSET GTK_ICON_SIZE_INVALID # define PANEL_CLIENT_MESSAGE "DEFORAOS_DESKTOP_PANEL_CLIENT"
#define PANEL_ICON_SIZE_SMALL GTK_ICON_SIZE_SMALL_TOOLBAR
#define PANEL_ICON_SIZE_SMALLER GTK_ICON_SIZE_MENU # define PANEL_ICON_SIZE_DEFAULT GTK_ICON_SIZE_LARGE_TOOLBAR
#define PANEL_ICON_SIZE_LARGE GTK_ICON_SIZE_LARGE_TOOLBAR # define PANEL_ICON_SIZE_UNSET GTK_ICON_SIZE_INVALID
# define PANEL_ICON_SIZE_SMALL GTK_ICON_SIZE_SMALL_TOOLBAR
# define PANEL_ICON_SIZE_SMALLER GTK_ICON_SIZE_MENU
# define PANEL_ICON_SIZE_LARGE GTK_ICON_SIZE_LARGE_TOOLBAR
/* functions */ /* functions */

View File

@ -109,6 +109,8 @@ static GtkIconSize _new_size(Panel * panel, PanelPosition position);
static gboolean _on_idle(gpointer data); static gboolean _on_idle(gpointer data);
static void _idle_load(Panel * panel, PanelPosition position, static void _idle_load(Panel * panel, PanelPosition position,
char const * plugins); char const * plugins);
static GdkFilterReturn _on_root_event(GdkXEvent * xevent, GdkEvent * event,
gpointer data);
Panel * panel_new(PanelPrefs const * prefs) Panel * panel_new(PanelPrefs const * prefs)
{ {
@ -175,6 +177,10 @@ Panel * panel_new(PanelPrefs const * prefs)
panel->bottom = (prefs->position & PANEL_POSITION_BOTTOM) panel->bottom = (prefs->position & PANEL_POSITION_BOTTOM)
? panel_window_new(PANEL_POSITION_BOTTOM, ? panel_window_new(PANEL_POSITION_BOTTOM,
&panel->bottom_helper, &rect) : NULL; &panel->bottom_helper, &rect) : NULL;
/* manage root window events */
gdk_add_client_message_filter(gdk_atom_intern(PANEL_CLIENT_MESSAGE,
FALSE), _on_root_event, panel);
/* load plug-ins when idle */
g_idle_add(_on_idle, panel); g_idle_add(_on_idle, panel);
return panel; return panel;
} }
@ -297,6 +303,31 @@ static void _idle_load(Panel * panel, PanelPosition position,
free(p); free(p);
} }
static GdkFilterReturn _on_root_event(GdkXEvent * xevent, GdkEvent * event,
gpointer data)
{
Panel * panel = data;
XEvent * xe = xevent;
XClientMessageEvent * xcme;
PanelMessage message;
if(xe->type != ClientMessage)
return GDK_FILTER_CONTINUE;
xcme = &xe->xclient;
if(xcme->message_type != gdk_x11_get_xatom_by_name(
PANEL_CLIENT_MESSAGE))
return GDK_FILTER_CONTINUE;
message = xcme->data.b[0];
switch(message)
{
case PANEL_MESSAGE_SHOW:
if(xcme->data.b[1] == PANEL_MESSAGE_SHOW_SETTINGS)
panel_show_preferences(panel, TRUE);
break;
}
return GDK_FILTER_CONTINUE;
}
/* panel_delete */ /* panel_delete */
void panel_delete(Panel * panel) void panel_delete(Panel * panel)

View File

@ -1,5 +1,5 @@
subdirs=applets subdirs=applets
targets=panel,run targets=panel,panel-settings,run
cppflags_force=-I ../include cppflags_force=-I ../include
#cppflags=-D EMBEDDED #cppflags=-D EMBEDDED
cflags_force=-W `pkg-config --cflags libSystem gtk+-2.0` cflags_force=-W `pkg-config --cflags libSystem gtk+-2.0`
@ -23,6 +23,11 @@ depends=common.h,window.h,../include/Panel.h,../config.h
[window.c] [window.c]
depends=common.h,window.h depends=common.h,window.h
[panel-settings]
type=binary
sources=settings.c
install=$(BINDIR)
[run] [run]
type=binary type=binary
sources=run.c sources=run.c

58
src/settings.c Normal file
View File

@ -0,0 +1,58 @@
/* $Id$ */
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Panel */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
#include "common.h"
/* usage */
static int _usage(void)
{
fputs("Usage: panel-settings\n", stderr);
return 1;
}
/* main */
int main(int argc, char * argv[])
{
int o;
GdkEvent event;
GdkEventClient * client = &event.client;
gtk_init(&argc, &argv);
while((o = getopt(argc, argv, "")) != -1)
switch(o)
{
default:
return _usage();
}
memset(&event, 0, sizeof(event));
client->type = GDK_CLIENT_EVENT;
client->window = NULL;
client->send_event = TRUE;
client->message_type = gdk_atom_intern(PANEL_CLIENT_MESSAGE, FALSE);
client->data_format = 8;
client->data.b[0] = PANEL_MESSAGE_SHOW;
client->data.b[1] = PANEL_MESSAGE_SHOW_SETTINGS;
client->data.b[2] = TRUE;
gdk_event_send_clientmessage_toall(&event);
return 0;
}