zapplication.h
上传用户:aso_neon
上传日期:2015-06-06
资源大小:779k
文件大小:8k
源码类别:

其他

开发平台:

Unix_Linux

  1. /*
  2.  * Unofficial EZX Native Software Development Kit
  3.  * Copyright (C) 2005 Sam Revitch <samr7@cs.washington.edu>
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License as
  7.  * published by the Free Software Foundation; either version 2.1 of
  8.  * the License, or (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  *
  15.  * Further, this software is distributed without any warranty that it is
  16.  * free of the rightful claim of any third person regarding infringement
  17.  * or the like.  Any license provided herein, whether implied or
  18.  * otherwise, applies only to this software file.  Patent licenses, if
  19.  * any, provided herein do not apply to combinations of this program with
  20.  * other software, or any other product whatsoever.
  21.  *
  22.  * You should have received a copy of the GNU General Public License
  23.  * along with this program; if not, write to the Free Software Foundation,
  24.  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  25.  */
  26. #if !defined(__ZAPPLICATION_H__)
  27. #define __ZAPPLICATION_H__
  28. /*
  29.  * This is the main application class for EZX applications.
  30.  * It supports a lot of stuff, including the native IPC,
  31.  * single-instancing mechanism, input method, theming, etc..
  32.  * I don't know how it all works, at least not yet.
  33.  */
  34. #include <qobject.h>
  35. #include <qapplication.h>
  36. #include <qlist.h>
  37. #include <quuid.h>
  38. #include <qwindowsystem_qws.h>
  39. #include <qintdict.h>
  40. #include <zglobal.h>
  41. /* Q prefix, but implemented in ezxappbase */
  42. class QTestCaptureHandler;
  43. class ZInputMethodState;
  44. class THEME_CONFIG {
  45. public:
  46. QString m_string_0;
  47. QString m_string_4;
  48. QPalette m_palette_8;
  49. int m_unk_c;
  50. QString m_string_10;
  51. QString m_string_14;
  52. QString m_string_18;
  53. QString m_string_1c;
  54. QString m_string_20;
  55. QString m_string_24;
  56. QString m_string_28;
  57. QString m_string_2c;
  58. QString m_string_30;
  59. };
  60. class UTIL_WordCompFilter {
  61. public:
  62. int m_unk_0;
  63. int m_unk_4;
  64. int m_unk_8;
  65. int m_unk_c;
  66. int m_unk_10;
  67. int m_i_14;
  68. QRect m_rect_18;
  69. int m_unk_28;
  70. int m_unk_2c;
  71. int m_unk_30;
  72. QPalette m_palette_34;
  73. };
  74. class ZKbContext : public QObject {
  75. Q_OBJECT
  76. public:
  77. ZKbContext(QWidget*);
  78. virtual ~ZKbContext();
  79. bool setupConnection(QWidget*);
  80. void destroyConnection(void);
  81. public slots:
  82. void slotBufferUpdate(int, int);
  83. void slotCursorChanged(int, int);
  84. void slotFeedbackContext(void);
  85. public:
  86. int m_unk_24;
  87. int m_i_28;
  88. int m_i_2c;
  89. };
  90. class ZApplicationData {
  91. public:
  92. ZApplicationData(void);
  93. void enqueueMsg(QCString const&, QCString const&, QArray<char> const&);
  94. bool needShowKB(QWidget*);
  95. QCollection::Item appendEditor(int, QCString const&);
  96. void destructData(void);
  97. void getTouchPanelSoundInfo(void);
  98. void getMsgs(QString);
  99. void getTheme(void);
  100. void sendMsgq(void);
  101. int m_unk_0;
  102. int m_unk_4;
  103. // "General_Mouse_PressHold_Ani.gif"
  104. QString m_string_8;
  105. // "General_Cursor_Waiting_Ani.gif"
  106. QString m_string_c;
  107. int m_unk_10;
  108. int m_unk_14;
  109. QString m_string_18;
  110. int m_unk_1c;
  111. int m_unk_20;
  112. bool m_b_24;
  113. bool m_b_25;
  114. int m_i_28;
  115. bool m_b_2c;
  116. bool m_b_2d;
  117. int m_i_30;
  118. int m_i_34;
  119. int m_i_38;
  120. int m_i_3c;
  121. int m_i_40;
  122. bool m_b_44;
  123. QStrList *m_editablewidgets_48;
  124. THEME_CONFIG m_themeconfig_4c;
  125. int m_unk_84;
  126. int m_unk_88;
  127. char m_tpsound_8c[256];
  128. int m_i_18c;
  129. int m_unk_190;
  130. bool m_b_194;
  131. QMovie *m_movie_198;
  132. int m_i_19c;
  133. QGList m_list_1a0;
  134. QIntDict<int> m_intdict_1c0;
  135. UTIL_WordCompFilter m_wordcompfilter_1dc;
  136. ZKbContext m_kbcontext_214;
  137. };
  138. class ZApplication : public QApplication {
  139. Q_OBJECT
  140. public:
  141. ZApplication(int &argc, char **argv,
  142.      QApplication::Type t = QApplication::GuiClient);
  143. /* Reimplemented virtual methods */
  144. virtual ~ZApplication();
  145. virtual bool eventFilter(QObject*, QEvent*);
  146. virtual bool vieventFilter(QObject*, QEvent*);
  147. virtual void timerEvent(QTimerEvent*);
  148. virtual void setMainWidget(QWidget*);
  149. virtual bool qwsEventFilter(QWSEvent*);
  150. /* New virtual methods */
  151. virtual void insertStr(QWSEvent*);
  152. virtual void tryQuit(void);
  153. virtual bool hardKeyEventFilter(QKeyEvent*);
  154. public slots:
  155. virtual void slotShutdown(void);
  156. virtual void slotQuickQuit(void);
  157. virtual void slotUsbStorageInOut(bool);
  158. virtual void slotClickAppIcon(void);
  159. virtual void slotRaise(void);
  160. /* Non-virtual methods */
  161. signals:
  162. void appMessage(QCString const&, QArray<char> const&);
  163. void shutdown(void);
  164. void usbStorageInOut(bool);
  165. void signalRaise(void);
  166. void clickAppIcon(void);
  167. void signalAppLaunched(int);
  168. void signalOpenDoc(QString const&);
  169. void signalCmdLine(QString const&);
  170. void signalBridgeMessage(QArray<char> const&);
  171. void signalBridgeMessage(QCString const&, QArray<char> const&);
  172. void signalBridgeMessageWithoutRaise(QCString const&,
  173.      QArray<char> const&);
  174. void kbStateChanged(bool, QUuid const&, int);
  175. void signalMasterClear(void);
  176. void signalMasterReset(void);
  177. void signalHomeKeyClicked(void);
  178. void editableWidgetClicked(int, bool);
  179. void systemMessage(QCString const&, QArray<char> const&);
  180. public slots:
  181. void animationTimeOut(void);
  182. void animationStatus(int);
  183. void animationUpdate(QRect const&);
  184. void slotCursorSelected(QWSCursor*);
  185. void slotSystemMessage(QCString const&, QArray<char> const&);
  186. void slotServerMessage(QCString const&, QArray<char> const&);
  187. void slotAppMessage(QCString const&, QArray<char> const&);
  188. void pidMessage(QCString const&, QArray<char> const&);
  189. void updateWindowInfo(QWSWindow*, QWSServer::WindowEvent);
  190. void resetMouseMode(void);
  191. void resetPressHoldStatus(void);
  192. public:
  193. int getMouseMode(QWidget*);
  194. bool setMouseMode(QWidget*, int);
  195. int applyStyle(void);
  196. bool getKBState(void);
  197. void loadString(QString const&);
  198. int initPalette(void);
  199. int applyPalette(void);
  200. EZX_FONT_SIZE_T initTextSize(void);
  201. EZX_FONT_SIZE_T changeTextSize(void);
  202. void loadEZXFonts(void);
  203. bool createChannel(void);
  204. void setAutoInvokeKb(bool);
  205. bool getAutoInvokeKb(void);
  206. void setAutoInvokeKb(QWidget*, bool);
  207. void setAutoHideKb(bool);
  208. bool getAutoHideKb(void);
  209. int resetPHTimer(void);
  210. void startShowPHCursor(int, QString const&);
  211. void stopShowPHCursor(void);
  212. void startShowWaitCursor(int, QString const&);
  213. void stopShowWaitCursor(void);
  214. QRect getEditorRect(int, int, bool);
  215. void registerEditor(int);
  216. void showMainWidget(QWidget*);
  217. ZInputMethodState *getKbStateAgent(void);
  218. void raiseAppWindows(void);
  219. void soundTouchPanel(QWSEvent*);
  220. void enableTouchSound(bool);
  221. void createTouchSoundMsgQueue(void);
  222. int getTouchSoundMsgQueue(void);
  223. void setMaxWindowRect(QRect const&);
  224. void updateIMNameList(void); // stub
  225. QUuid getDefaultKbMethod(bool);
  226. void setDefaultKbMethod(QUuid const&);
  227. void showInputWidgetAux(int, int, int, int);
  228. void manipulateAppWindows(int);
  229. void removeEditableWidget(char const*);
  230. void editableWidgetClicked(QWidget*, bool);
  231. void enableHardKeyEventFilter(bool);
  232. bool getHardKeyEventFilter(void);
  233. void registerEditableWidget(char const*);
  234. void setFocusToLatestWindow(int); // stub
  235. void clientManipulateAppWindows(int, QValueList<int>&);
  236. void serverManipulateAppWindows(int, QString const&);
  237. int exec(void);
  238. void setEnv(QString const&);
  239. void flushMsgs(void);
  240. QGList *getIMList(void);
  241. void quickQuit(void);
  242. ZApplicationData *m_zappdata_44;
  243. /*
  244.  * Init with "EZX/QtServer"
  245.  * Connect received to slotServerMessage
  246.  */
  247. QCopChannel *m_qcc_48;
  248. /*
  249.  * Init with "EZX/System"
  250.  * Connect received to slotSystemMessage
  251.  */
  252. QCopChannel *m_qcc_4c;
  253. /*
  254.  * Init with "EZX/Application/" + apptitle
  255.  * Connect received to slotAppMessage
  256.  */
  257. QCopChannel *m_qcc_50;
  258. /*
  259.  * createChannel()
  260.  * Init with "EZX/Application/" + apptitle
  261.  * Connect received to pidMessage
  262.  */
  263. QCopChannel *m_qcc_54;
  264. QString m_string_58;
  265. bool m_touchsound_5c;
  266. int m_tsmsgq_60;
  267. bool m_b_64;
  268. bool m_autohidekb_65;
  269. bool m_b_66;
  270. int m_i_68;
  271. int m_unk_6c;
  272. QTestCaptureHandler *m_caphand_70;
  273. };
  274. #endif /* !defined(__ZAPPLICATION_H__) */