#include "GizmoDaemon.hpp"
#include "GizmoDaemonDefs.hpp"
#include "../libGizmod/GizmodThread.hpp"
#include "../libGizmod/GizmodTimer.hpp"
#include "../libGizmod/GizmoEventATIX10.hpp"
#include "../libGizmod/GizmoEventCPUUsage.hpp"
#include "../libGizmod/GizmoEventLIRC.hpp"
#include "../libGizmod/GizmoEventPowermate.hpp"
#include "../libGizmod/GizmoEventSoundCard.hpp"
#include "../libGizmod/GizmoEventStandard.hpp"
#include "../libGizmod/GizmoEventSoundVisualization.hpp"
#include "../libGizmod/GizmoEventWindowFocus.hpp"
#include "../libGizmod/GizmoATIX10.hpp"
#include "../libGizmod/GizmoLIRC.hpp"
#include "../libGizmod/GizmoPowermate.hpp"
#include "../libGizmod/GizmoStandard.hpp"
#include "../libH/Debug.hpp"
#include "../libH/Exception.hpp"
#include "../libH/Util.hpp"
#include "../libH/UtilFile.hpp"
#include "../libH/SocketException.hpp"
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fstream>
#include <list>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/python.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/list.hpp>
#include <boost/tokenizer.hpp>
#include <fcntl.h>
#include <pystate.h>
#include "GizmoKeyDefPythonExposures.hpp"
Go to the source code of this file.
Namespaces | |
namespace | boost |
namespace | boost::program_options |
namespace | boost::python |
namespace | boost::filesystem |
Classes | |
struct | GizmodEventHandlerInterfaceWrap |
Wrapper for GizmodEventHandlerInterface so Python can inherit the abstract class. More... | |
Defines | |
#define | CONFIG_FILE PACKAGE ".conf" |
The default path of the config file. | |
#define | SCRIPT_DIR SYSCONFDIR "/gizmod/" |
The default path of the config file. | |
#define | HOME_SCRIPT_DIR "~/.gizmod/" |
The default path of the users home script dir. | |
#define | CONFIG_FILE_PATH HOME_SCRIPT_DIR PACKAGE ".conf" |
The default full path of the config file. | |
#define | USER_SCRIPT_DIR "modules.d" |
The default path of the modules.d dir. | |
#define | SCRIPT_DISPATCHER "GizmodDispatcher.py" |
The path of the initial config script. | |
#define | SCRIPT_USER "GizmodUser.py" |
The path of the user config script that gets run after SCRIPT_DISPATCH. | |
#define | EVENT_NODE_DIR "/dev/input" |
Default path to the event nodes. | |
#define | LIRC_DEV "/dev/lircd" |
Default path to the LIRC device node. | |
#define | NO_GETTER python::object() |
Used when adding properties to pythong classes without a getter. | |
#define | DEFAULT_PORT 30303 |
Default port to start the server on. | |
#define | DEFAULT_PORT_STR "30303" |
Default port to start the server on. | |
Functions | |
GizmoDaemon::GizmoDaemon () | |
Default Constructor. | |
GizmoDaemon::~GizmoDaemon () | |
Default Destructor. | |
bool | GizmoDaemon::checkVersion (double Version, bool Strict) |
See if a script's version matches GizmoDaemon. | |
void | GizmoDaemon::deleteGizmo (std::string FileName) |
Delete a Gizmo. | |
void | GizmoDaemon::deserializeMessage (GizmoEventClass EventClass, std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageATIX10 (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageCPUUsage (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageLIRC (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessagePowermate (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageSoundcard (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageSoundVisualization (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageStandard (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::deserializeMessageWindowFocus (std::string const &Message) |
Deserialize a network message into event Objects. | |
void | GizmoDaemon::enterLoop () |
Enter the main run loop. | |
X11FocusEvent | GizmoDaemon::getCurrentFocus () |
Get currently focused window. | |
bool | GizmoDaemon::getDebugEnabled () |
Return whether debug mode is enabled or not. | |
GizmodEventHandlerInterface * | GizmoDaemon::getDispatcher () |
Get the event handler / dispatcher. | |
boost::shared_ptr < Gizmo > | GizmoDaemon::getGizmoByFileName (std::string FileName) |
Get a Gizmo by its file name. | |
int | GizmoDaemon::getNumGizmosByClass (GizmoClass Class) |
Get the number of Gizmos of a particular class. | |
int | GizmoDaemon::getGizmoClassID (GizmoClass Class) |
Get a Gizmo Class ID. | |
string | GizmoDaemon::getProps () |
Get the program's propers. | |
bool | GizmoDaemon::getReloadConfig () |
Get whether or not to reload the config. | |
bool | GizmoDaemon::getUseKeyboardLEDs () |
Get whether or not to visualize on the keyboard LEDs. | |
bool | GizmoDaemon::getUseRemoteControl () |
Get whether or not to load the remote control script. | |
std::string | GizmoDaemon::getUserScriptDirPaths () |
Get all the directories inside the user script dir. | |
double | GizmoDaemon::getVersion () |
Get the program's version information. | |
void | GizmoDaemon::handleFileEventReadATIX10 (GizmoATIX10 &Gizmo, DynamicBuffer< char > const &ReadBuffer) |
Handle incoming ATIX10 events. | |
void | GizmoDaemon::handleFileEventReadLIRC (GizmoLIRC &Gizmo, DynamicBuffer< char > const &ReadBuffer) |
Handle incoming LIRC events. | |
void | GizmoDaemon::handleFileEventReadPowermate (GizmoPowermate &Gizmo, DynamicBuffer< char > const &ReadBuffer) |
Handle incoming Powermate events. | |
void | GizmoDaemon::handleFileEventReadStandard (GizmoStandard &Gizmo, DynamicBuffer< char > const &ReadBuffer) |
Handle incoming Standard events. | |
void | GizmoDaemon::initGizmod () |
Setup GizmoDaemon. | |
void | GizmoDaemon::initPython () |
Initialize the Python interpreter. | |
bool | GizmoDaemon::initialize (int argc, char **argv) |
generic Init stuff | |
void | GizmoDaemon::loadUserScripts () |
Load user scripts. | |
void | GizmoDaemon::loadUserScriptsFunctor (std::string UserScript) |
Load user scripts functor. | |
void | GizmoDaemon::printNiceScriptInit (int Width, std::string Text1, std::string Text2, std::string Text3) |
Scripts can call this to print a nice looking init string. | |
void | GizmoDaemon::printNiceScriptRegister (int Width, std::string Text1, std::string Text2, std::string Text3, std::string Text4, std::string Text5) |
Scripts can call this to print a nice looking register string. | |
void | GizmoDaemon::onAlsaEventMixerElementAttach (AlsaEvent const &Event, AlsaSoundCard const &SoundCard, AlsaMixer const &Mixer) |
Triggered when a mixer element is discovered. | |
void | GizmoDaemon::onAlsaEventMixerElementChange (AlsaEvent const &Event, AlsaSoundCard const &SoundCard, AlsaMixer const &Mixer) |
Triggered when a mixer element is changed. | |
void | GizmoDaemon::onAlsaEventMixerElementDetach (AlsaEvent const &Event, AlsaSoundCard const &SoundCard, AlsaMixer const &Mixer) |
Triggered when a mixer element is detached. | |
void | GizmoDaemon::onAlsaEventSoundCardAttach (AlsaEvent const &Event, AlsaSoundCard const &SoundCard) |
Triggered when a new sound card is detected. | |
void | GizmoDaemon::onAlsaEventSoundCardDetach (AlsaEvent const &Event, AlsaSoundCard const &SoundCard) |
Triggered when a sound card is removed. | |
void | GizmoDaemon::onCPUUsage (std::vector< boost::shared_ptr< CPUUsageInfo > > const &Event) |
Event triggered when CPU Usage stats are updated. | |
void | GizmoDaemon::onFileEventCreate (boost::shared_ptr< H::FileWatchee > pWatchee, std::string FullPath, std::string FileName) |
Event triggered when a new file is created. | |
void | GizmoDaemon::onFileEventDelete (boost::shared_ptr< H::FileWatchee > pWatchee, std::string FullPath, std::string FileName) |
Event triggered when a file is deleted. | |
void | GizmoDaemon::onFileEventDisconnect (boost::shared_ptr< H::FileWatchee > pWatchee) |
Event triggered when a file is disconnected. | |
void | GizmoDaemon::onFileEventRead (boost::shared_ptr< H::FileWatchee > pWatchee, DynamicBuffer< char > const &ReadBuffer) |
Event triggered when data is waiting on a device. | |
void | GizmoDaemon::onFileEventRegister (boost::shared_ptr< H::FileWatchee > pWatchee) |
Event triggered when a new device is registered. | |
void | GizmoDaemon::onFileEventWatchBegin () |
Event called when the class will begin watching for events (and blocking). | |
void | GizmoDaemon::onFileEventWatchEnd () |
Event called when the class has ended watching for events (and done blocking). | |
void | GizmoDaemon::onFocusIn (X11FocusEvent const &Event) |
Event triggered on a Focus In. | |
void | GizmoDaemon::onFocusOut (X11FocusEvent const &Event) |
Event triggered on a Focus Out. | |
void | GizmoDaemon::onSignalSegv () |
Signal handler for SEGV. | |
void | GizmoDaemon::onSignalInt () |
Signal handler for INT. | |
void | GizmoDaemon::onSignalHup () |
Signal handler for HUP. | |
void | GizmoDaemon::onSignalQuit () |
Signal handler for QUIT. | |
void | GizmoDaemon::onSignalKill () |
Signal handler for KILL. | |
void | GizmoDaemon::onSignalTerm () |
Signal handler for TERM. | |
void | GizmoDaemon::onSignalStop () |
Signal handler for STOP. | |
void | GizmoDaemon::onSignalUnknown (int Signal) |
Signal handler for Unknown Signals. | |
void | GizmoDaemon::onSocketClientConnect (Socket const &socket) |
Event triggered when a new connection is detected. | |
void | GizmoDaemon::onSocketClientDisconnect (Socket const &socket) |
Event triggered on a socket disconnect. | |
void | GizmoDaemon::onSocketClientMessage (Socket const &socket, std::string const &Message) |
Event triggered on a socket server message. | |
void | GizmoDaemon::onSocketClientRead (Socket const &socket, DynamicBuffer< char > &ReadBuffer) |
Event triggered on a socket read. | |
void | GizmoDaemon::onSocketServerConnect (boost::shared_ptr< Socket > pSocket) |
Event triggered when a new connection is detected. | |
void | GizmoDaemon::onSocketServerDisconnect (Socket const &socket) |
Event triggered on a socket disconnect. | |
void | GizmoDaemon::onSocketServerMessage (Socket const &socket, std::string const &Message) |
Event triggered on a socket server message. | |
void | GizmoDaemon::onSocketServerRead (Socket const &socket, DynamicBuffer< char > &ReadBuffer) |
Event triggered on a socket read. | |
void | GizmoDaemon::registerDevices () |
Register all the system devices with Gizmo Daemon. | |
void | GizmoDaemon::registerInputEventDevices () |
Register all of the input event devices with Gizmo Daemon. | |
void | GizmoDaemon::registerLircDevice () |
Register the LIRC device. | |
void | GizmoDaemon::setConfigDir () |
Set the config directory. | |
void | GizmoDaemon::setVersionInfo () |
Set the version information. | |
void | GizmoDaemon::signalShutdown () |
Shutdown Gizmo Daemon. |
Definition in file GizmoDaemon.cpp.