xref: /haiku/src/kits/app/Server.cpp (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
1 /*
2  * Copyright 2005-2015, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  *		Ingo Weinhold <bonefish@cs.tu-berlin.de>
8  */
9 
10 
11 #include <Server.h>
12 
13 
14 BServer::BServer(const char* signature, bool initGUI, status_t *error)
15 	:
16 	BApplication(signature, NULL, -1, initGUI, error),
17 	fGUIContextInitialized(false)
18 {
19 	fGUIContextInitialized = initGUI && (error == NULL || *error == B_OK);
20 }
21 
22 
23 BServer::BServer(const char* signature, const char* looperName, port_id port,
24 	bool initGUI, status_t *error)
25 	:
26 	BApplication(signature, looperName, port, initGUI, error),
27 	fGUIContextInitialized(false)
28 {
29 	fGUIContextInitialized = initGUI && (error == NULL || *error == B_OK);
30 }
31 
32 
33 status_t
34 BServer::InitGUIContext()
35 {
36 	if (fGUIContextInitialized)
37 		return B_OK;
38 
39 	status_t error = _InitGUIContext();
40 	fGUIContextInitialized = (error == B_OK);
41 	return error;
42 }
43