ede/evoke/EvokeService.h

75 lines
1.8 KiB
C
Raw Normal View History

2007-07-11 20:03:18 +04:00
/*
* $Id$
*
* Evoke, head honcho of everything
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2007 EDE Authors.
*
* This program is licensed under terms of the
* GNU General Public License version 2 or newer.
* See COPYING for details.
*/
#ifndef __EVOKESERVICE_H__
#define __EVOKESERVICE_H__
#include "Log.h"
2007-07-30 17:25:13 +04:00
#include <edelib/List.h>
2007-07-11 20:03:18 +04:00
#include <edelib/String.h>
2007-07-30 17:25:13 +04:00
#include <FL/x.h>
2007-07-11 20:03:18 +04:00
struct EvokeClient {
2007-07-30 17:25:13 +04:00
edelib::String desc; // short program description (used in Starting... message)
2007-07-11 20:03:18 +04:00
edelib::String icon; // icon for this client
edelib::String exec; // program name/path to run
};
2007-07-30 17:25:13 +04:00
typedef edelib::list<EvokeClient> ClientList;
typedef edelib::list<EvokeClient>::iterator ClientListIter;
typedef edelib::list<edelib::String> StringList;
typedef edelib::list<edelib::String>::iterator StringListIter;
class Fl_Double_Window;
2007-07-11 20:03:18 +04:00
class EvokeService {
private:
2007-07-30 17:25:13 +04:00
bool is_running;
2007-07-11 20:03:18 +04:00
Log* logfile;
char* pidfile;
2007-07-30 17:25:13 +04:00
char* lockfile;
Fl_Double_Window* top_win;
2007-07-11 20:03:18 +04:00
Atom _ede_shutdown_all;
Atom _ede_spawn;
2007-07-30 17:25:13 +04:00
Atom _ede_evoke_quit;
2007-07-11 20:03:18 +04:00
2007-07-30 17:25:13 +04:00
ClientList clients;
2007-07-11 20:03:18 +04:00
public:
EvokeService();
~EvokeService();
static EvokeService* instance(void);
2007-07-30 17:25:13 +04:00
void start(void) { is_running = true; }
void stop(void) { is_running = false; }
bool running(void) { return is_running; }
2007-07-11 20:03:18 +04:00
bool setup_logging(const char* file);
2007-07-30 17:25:13 +04:00
bool setup_pid(const char* file, const char* lock);
2007-07-11 20:03:18 +04:00
void setup_atoms(Display* d);
2007-07-30 17:25:13 +04:00
bool init_splash(const char* config, bool no_splash, bool dry_run);
int handle(const XEvent* ev);
2007-07-11 20:03:18 +04:00
Log* log(void) { return logfile; }
2007-07-30 17:25:13 +04:00
void register_top(Fl_Double_Window* win) { top_win = win; }
void unregister_top(void) { top_win = NULL; }
2007-07-11 20:03:18 +04:00
};
#define EVOKE_LOG EvokeService::instance()->log()->printf
#endif