mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Merged changed pkg.m4 from edelib
ede-panel has alternative way of calling ede-about dialog Dumped SettingsApplicator.* code from evoke. They are replaced with ede-settings-apply script which should call all programs that needs to apply stored settings. This will reduce code entropy evoke will call ede-settings-apply at the startup ede-bell-conf modified to use "--apply" arg and to apply known settings ede-desktop will start icon exec path via ede-launch Fixed freebsd specific code in ede-panel's battery code
This commit is contained in:
@@ -46,8 +46,8 @@ EDELIB_NS_USING(str_trim)
|
||||
#define CONFIG_GET_STRVAL(object, section, key, buff) object.get(section, key, buff, sizeof(buff), RES_SYS_ONLY)
|
||||
#endif
|
||||
|
||||
static Atom XA_EDE_EVOKE_SHUTDOWN_ALL;
|
||||
static Atom XA_EDE_EVOKE_QUIT;
|
||||
static Atom XA_EDE_EVOKE_SHUTDOWN_ALL;
|
||||
static Atom XA_EDE_EVOKE_QUIT;
|
||||
|
||||
static int get_int_property_value(Atom at) {
|
||||
Atom real;
|
||||
|
@@ -26,6 +26,7 @@ struct StartupItem {
|
||||
|
||||
typedef edelib::list<StartupItem*> StartupItemList;
|
||||
typedef edelib::list<StartupItem*>::iterator StartupItemListIter;
|
||||
|
||||
class Xsm;
|
||||
|
||||
class EvokeService {
|
||||
|
@@ -16,8 +16,7 @@ SOURCE = evoke.cpp
|
||||
Xsm.cpp
|
||||
Logout.cpp
|
||||
Autostart.cpp
|
||||
Xshutdown.cpp
|
||||
SettingsApplicator.cpp ;
|
||||
Xshutdown.cpp ;
|
||||
|
||||
CONFIG = ede-settings.conf
|
||||
ede-startup.conf ;
|
||||
@@ -31,8 +30,12 @@ ObjectC++Flags EvokeService.cpp : $(EDELIB_DBUS_INCLUDE) ;
|
||||
LinkAgainstAsFirst evoke : $(EDELIB_DBUS_LIB) ;
|
||||
|
||||
EdeProgram evoke : $(SOURCE) ;
|
||||
|
||||
ObjectC++Flags ede-startup : $(X_CFLAGS) ;
|
||||
ProgramBare ede-shutdown : ede-shutdown.cpp ;
|
||||
LinkAgainst ede-shutdown : -lX11 ;
|
||||
LinkAgainst ede-shutdown : $(X_LIBS) -lX11 ;
|
||||
|
||||
InstallEdeProgram ede-settings-apply ;
|
||||
|
||||
EdeManualWithToc [ FFileName doc evoke.txt ] ;
|
||||
TranslationStrings locale : $(SOURCE) ;
|
||||
|
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Evoke, head honcho of everything
|
||||
* Part of Equinox Desktop Environment (EDE).
|
||||
* Copyright (c) 2007-2009 EDE Authors.
|
||||
*
|
||||
* This program is licensed under terms of the
|
||||
* GNU General Public License version 2 or newer.
|
||||
* See COPYING for details.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <edelib/XSettingsClient.h>
|
||||
#include <edelib/Debug.h>
|
||||
#include "SettingsApplicator.h"
|
||||
|
||||
EDELIB_NS_USING(XSettingsClient)
|
||||
EDELIB_NS_USING(XSettingsAction)
|
||||
EDELIB_NS_USING(XSettingsSetting)
|
||||
EDELIB_NS_USING(XSETTINGS_ACTION_NEW)
|
||||
EDELIB_NS_USING(XSETTINGS_ACTION_CHANGED)
|
||||
EDELIB_NS_USING(XSETTINGS_ACTION_DELETED)
|
||||
EDELIB_NS_USING(XSETTINGS_TYPE_INT)
|
||||
|
||||
static XSettingsClient* client = NULL;
|
||||
static Display* client_display = NULL;
|
||||
static int client_screen;
|
||||
|
||||
static void xsettings_cb(const char* name, XSettingsAction a, XSettingsSetting* s, void* data) {
|
||||
if(!client)
|
||||
return;
|
||||
|
||||
if(strcmp(name, "Bell/Volume") == 0 && s->type == XSETTINGS_TYPE_INT) {
|
||||
XKeyboardControl kc;
|
||||
|
||||
kc.bell_percent = s->data.v_int;
|
||||
XChangeKeyboardControl(client_display, KBBellPercent, &kc);
|
||||
return;
|
||||
}
|
||||
|
||||
if(strcmp(name, "Bell/Pitch") == 0 && s->type == XSETTINGS_TYPE_INT) {
|
||||
XKeyboardControl kc;
|
||||
|
||||
kc.bell_pitch = s->data.v_int;
|
||||
XChangeKeyboardControl(client_display, KBBellPitch, &kc);
|
||||
return;
|
||||
}
|
||||
|
||||
if(strcmp(name, "Bell/Duration") == 0 && s->type == XSETTINGS_TYPE_INT) {
|
||||
XKeyboardControl kc;
|
||||
|
||||
kc.bell_duration = s->data.v_int;
|
||||
XChangeKeyboardControl(client_display, KBBellDuration, &kc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void xsettings_applicator_init(Display* dpy, int scr) {
|
||||
/*
|
||||
* make sure we set display first, because after 'init()' callback
|
||||
* will be imediately called
|
||||
*/
|
||||
client_display = dpy;
|
||||
client_screen = scr;
|
||||
|
||||
client = new XSettingsClient;
|
||||
if(!client->init(dpy, scr, xsettings_cb, NULL)) {
|
||||
delete client;
|
||||
client = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void xsettings_applicator_shutdown(void) {
|
||||
delete client;
|
||||
client = NULL;
|
||||
}
|
||||
|
||||
void xsettings_applicator_process_event(const XEvent* xev) {
|
||||
if(client)
|
||||
client->process_xevent(xev);
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Evoke, head honcho of everything
|
||||
* Part of Equinox Desktop Environment (EDE).
|
||||
* Copyright (c) 2007-2009 EDE Authors.
|
||||
*
|
||||
* This program is licensed under terms of the
|
||||
* GNU General Public License version 2 or newer.
|
||||
* See COPYING for details.
|
||||
*/
|
||||
|
||||
#ifndef __SETTINGSAPPLICATOR_H__
|
||||
#define __SETTINGSAPPLICATOR_H__
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
/*
|
||||
* Settings applicator are bunch of functions to run XSettingsClient
|
||||
* and apply known settings.
|
||||
*/
|
||||
void xsettings_applicator_init(Display* dpy, int scr);
|
||||
void xsettings_applicator_shutdown(void);
|
||||
void xsettings_applicator_process_event(const XEvent* xev);
|
||||
|
||||
#endif
|
@@ -19,10 +19,13 @@
|
||||
#include <stdio.h>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/x.H>
|
||||
#include <edelib/Run.h>
|
||||
|
||||
#include "EvokeService.h"
|
||||
#include "Autostart.h"
|
||||
|
||||
EDELIB_NS_USING(run_async)
|
||||
|
||||
#define FOREVER 1e20
|
||||
#define LOCK_FILE "/tmp/.evoke.lock"
|
||||
|
||||
@@ -104,8 +107,8 @@ int main(int argc, char** argv) {
|
||||
return 0;
|
||||
|
||||
if(!service->setup_lock(LOCK_FILE)) {
|
||||
printf("Either another evoke instance is running or I can't create lock file\n");
|
||||
printf("If program abnormaly crashed before, just remove '%s' and start it again\n", LOCK_FILE);
|
||||
printf("*** Either another evoke instance is running or I can't create lock file.\n");
|
||||
printf("*** If program abnormaly crashed before, just remove '%s' and start it again.\n", LOCK_FILE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -134,6 +137,10 @@ int main(int argc, char** argv) {
|
||||
PropertyChangeMask | SubstructureNotifyMask | ClientMessage);
|
||||
Fl::add_handler(xmessage_handler);
|
||||
|
||||
/* run applicator for settings; it must be done after manager is fully on */
|
||||
if(do_startup)
|
||||
run_async("ede-settings-apply");
|
||||
|
||||
service->start();
|
||||
|
||||
while(service->running()) {
|
||||
|
Reference in New Issue
Block a user