From 42eb413737eb6e911867e1b9c0f5b6cf81c677fd Mon Sep 17 00:00:00 2001 From: alwin Date: Thu, 26 Feb 2004 15:33:31 +0000 Subject: Yeah - zkb fixed and working within OPIE. --- (limited to 'noncore/apps/keyz-cfg/zkbcfg.h') diff --git a/noncore/apps/keyz-cfg/zkbcfg.h b/noncore/apps/keyz-cfg/zkbcfg.h new file mode 100644 index 0000000..dc1ac07 --- a/dev/null +++ b/noncore/apps/keyz-cfg/zkbcfg.h @@ -0,0 +1,69 @@ +#ifndef ZKBCFG_H +#define ZKBCFG_H + +#include +#include "zkb.h" +#include "zkbxml.h" + +class ZkbConfig : public QXmlErrorHandler { +public: + ZkbConfig(const QString& dir); + virtual ~ZkbConfig(); + + bool load(const QString& file, Keymap& keymap, const QString& prefix); + + virtual bool warning(const QXmlParseException& e); + virtual bool error(const QXmlParseException& e); + virtual bool fatalError(const QXmlParseException& e); + virtual QString errorString(); + +protected: + QString path; + QMap includedFiles; + QString err; +}; + +class ZkbHandler : public ZkbXmlHandler { +public: + ZkbHandler(ZkbConfig& zkc, Keymap& keymap, const QString& prefix); + virtual ~ZkbHandler(); + +protected: + ZkbConfig& zkc; + Keymap& keymap; + QString prefix; + + // stuff for keymap tag + int ardelay; + int arperiod; + + // stuff for state tag + QString currentStateName; + State* currentState; + + // stuff for map tag + Action* currentAction; + + virtual bool startKeymapElement(int ardelay, int arperiod, + const QString& author); + virtual bool startIncludeElement(const QString& file, + const QString& prfix); + virtual bool startLabelElement(const QString& label, + const QString& state); + virtual bool startStateElement(const QString& name, + const QString& parent, bool dflt); + virtual bool startMapElement(int key, bool pressed); + virtual bool startEventElement(int keycode, int unicode, int modifiers, + bool pressed, bool autorepeat); + virtual bool startNextStateElement(const QString& state); + + virtual bool endKeymapElement(); + virtual bool endIncludeElement(); + virtual bool endLabelElement(); + virtual bool endStateElement(); + virtual bool endMapElement(); + virtual bool endEventElement(); + virtual bool endNextStateElement(); +}; + +#endif -- cgit v0.9.0.2