6 #ifndef KWAYLAND_TOOLS_GENERATOR_H
7 #define KWAYLAND_TOOLS_GENERATOR_H
12 #include <QThreadStorage>
13 #include <QWaitCondition>
14 #include <QXmlStreamReader>
49 bool isNullAllowed()
const
63 Type m_type = Type::Unknown;
64 bool m_allowNull =
false;
72 explicit Request(
const QString &name);
75 void addArgument(
const Argument &arg)
90 bool isDestructor()
const
94 bool isFactory()
const;
96 void markAsDestructor()
104 bool m_destructor =
false;
111 explicit Event(
const QString &name);
114 void addArgument(
const Argument &arg)
137 explicit Interface();
139 virtual ~Interface();
141 void addRequest(
const Request &request)
143 m_requests << request;
145 void addEvent(
const Event &event)
158 QString kwaylandClientName()
const
162 QString kwaylandServerName()
const
164 return m_clientName + QStringLiteral(
"Interface");
181 bool isGlobal()
const
185 void setFactory(Interface *factory)
189 Interface *factory()
const
194 bool isUnstableInterface()
const
205 bool m_global =
false;
206 Interface *m_factory;
216 void setXmlFileName(
const QString &name)
218 m_xmlFileName = name;
220 void setBaseFileName(
const QString &name)
222 m_baseFileName = name;
227 void generateCopyrightHeader();
228 void generateStartIncludeGuard();
229 void generateEndIncludeGuard();
230 void generateStartNamespace();
231 void generateEndNamespace();
232 void generateHeaderIncludes();
233 void generateCppIncludes();
234 void generatePrivateClass(
const Interface &interface);
235 void generateClientPrivateClass(
const Interface &interface);
236 void generateClientPrivateResourceClass(
const Interface &interface);
237 void generateClientPrivateGlobalClass(
const Interface &interface);
238 void generateServerPrivateGlobalClass(
const Interface &interface);
239 void generateServerPrivateResourceClass(
const Interface &interface);
240 void generateServerPrivateInterfaceClass(
const Interface &interface);
241 void generateServerPrivateGlobalCtorBindClass(
const Interface &interface);
242 void generateServerPrivateResourceCtorDtorClass(
const Interface &interface);
243 void generateServerPrivateCallbackDefinitions(
const Interface &interface);
244 void generateServerPrivateCallbackImpl(
const Interface &interface);
245 void generateClientCpp(
const Interface &interface);
246 void generateClass(
const Interface &interface);
247 void generateClientGlobalClass(
const Interface &interface);
248 void generateClientResourceClass(
const Interface &interface);
249 void generateServerGlobalClass(
const Interface &interface);
250 void generateServerGlobalClassUnstable(
const Interface &interface);
251 void generateServerResourceClass(
const Interface &interface);
252 void generateServerResourceClassUnstable(
const Interface &interface);
253 void generateClientClassQObjectDerived(
const Interface &interface);
254 void generateClientGlobalClassDoxy(
const Interface &interface);
255 void generateClientGlobalClassCtor(
const Interface &interface);
256 void generateClientGlobalClassSetup(
const Interface &interface);
257 void generateClientResourceClassSetup(
const Interface &interface);
258 void generateClientClassDtor(
const Interface &interface);
259 void generateClientClassReleaseDestroy(
const Interface &interface);
260 void generateClientClassStart(
const Interface &interface);
261 void generateClientClassCasts(
const Interface &interface);
262 void generateClientClassSignals(
const Interface &interface);
263 void generateClientClassDptr(
const Interface &interface);
264 void generateClientGlobalClassEnd(
const Interface &interface);
265 void generateClientResourceClassEnd(
const Interface &interface);
266 void generateClientClassRequests(
const Interface &interface);
267 void generateClientCppRequests(
const Interface &interface);
268 void generateWaylandForwardDeclarations();
269 void generateNamespaceForwardDeclarations();
270 void startParseXml();
271 void startAuthorNameProcess();
272 void startAuthorEmailProcess();
273 void startGenerateHeaderFile();
274 void startGenerateCppFile();
275 void startGenerateServerHeaderFile();
276 void startGenerateServerCppFile();
280 void parseProtocol();
281 Interface parseInterface();
282 Request parseRequest();
303 int m_finishedCounter = 0;