Debian Codegraph @

src/qdjviewplugin.h

raw
1 //C- -*- C++ -*-
2 //C- -------------------------------------------------------------------
3 //C- DjView4
4 //C- Copyright (c) 2006- Leon Bottou
5 //C-
6 //C- This software is subject to, and may be distributed under, the
7 //C- GNU General Public License, either version 2 of the license,
8 //C- or (at your option) any later version. The license should have
9 //C- accompanied the software or you may obtain a copy of the license
10 //C- from the Free Software Foundation at http://www.fsf.org .
11 //C-
12 //C- This program is distributed in the hope that it will be useful,
13 //C- but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 //C- GNU General Public License for more details.
16 //C- ------------------------------------------------------------------
17
18 #ifndef QDJVIEWPLUGIN_H
19 #define QDJVIEWPLUGIN_H
20
21 #if AUTOCONF
22 # include "config.h"
23 #endif
24
25 #include <QApplication>
26 #include <QByteArray>
27 #include <QList>
28 #include <QObject>
29 #include <QSet>
30 #include <QString>
31 #include <QStringList>
32 #include <QUrl>
33
34 #include "qdjvu.h"
35 #include "qdjview.h"
36 #include "djview.h"
37
38
39 class QMutex;
40 class QSocketNotifier;
41 class QTimer;
42 class QEventLoop;
43
44
45 class QDjViewPlugin
46 {
47 public:
48 ~QDjViewPlugin();
49 QDjViewPlugin(const char *progname);
50 static QDjViewPlugin *instance();
51 int exec();
52 void exit(int retcode);
53 void quit();
54
55 class Document;
56 class Forwarder;
57 struct Instance;
58 struct Stream;
59
60 private:
61 void write(int fd, const char *buffer, int size);
62 void read(int fd, char *buffer, int size);
63 void writeString(int fd, QByteArray x);
64 void writeString(int fd, QString x);
65 void writeInteger(int fd, int x);
66 void writeDouble(int fd, double x);
67 void writePointer(int fd, const void *x);
68 void writeArray(int fd, QByteArray x);
69 QString readString(int fd);
70 QByteArray readRawString(int fd);
71 int readInteger(int fd);
72 double readDouble(int fd);
73 void * readPointer(int fd);
74 QByteArray readArray(int fd);
75
76 void cmdNew();
77 void cmdAttachWindow();
78 void cmdDetachWindow();
79 void cmdResize();
80 void cmdDestroy();
81 void cmdNewStream();
82 void cmdWrite();
83 void cmdDestroyStream();
84 void cmdUrlNotify();
85 void cmdPrint();
86 void cmdHandshake();
87 void cmdShutdown();
88 void cmdSetDjVuOpt();
89 void cmdGetDjVuOpt();
90 void cmdOnChange();
91
92 void reportError(int err);
93 void streamCreated(Stream *s);
94 void streamDestroyed(Stream *s);
95 Instance *findInstance(QWidget *widget);
96 void getUrl(Instance *instance, QUrl url, QString target);
97 void showStatus(Instance *instance, QString message);
98 void onChange(Instance *instance);
99 void continueExec();
100 void dispatch();
101 void lastViewerClosed();
102 void registerForDeletion(QObject*);
103
104 QByteArray progname;
105 QDjVuContext *context;
106 QTimer *timer;
107 QSocketNotifier *notifier;
108 QDjViewApplication *application;
109 Forwarder *forwarder;
110 QSet<Instance*> instances;
111 QSet<Stream*> streams;
112 bool xembedFlag;
113 int argc;
114 const char* argv[4];
115 QEventLoop *eventLoop;
116 QObjectList pendingDelete;
117 int returnCode;
118 bool quitFlag;
119 int pipeRead;
120 int pipeWrite;
121 int pipeRequest;
122 };
123
124
125 #endif // QDJVIEWPLUGIN_H
126
127 /* -------------------------------------------------------------
128 Local Variables:
129 c++-font-lock-extra-types: ( "\\sw+_t" "Q[A-Z]\\sw*[a-z]\\sw*" )
130 End:
131 ------------------------------------------------------------- */