forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp3dInstance.I
More file actions
147 lines (133 loc) · 3.38 KB
/
p3dInstance.I
File metadata and controls
147 lines (133 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file p3dInstance.I
* @author drose
* @date 2009-05-29
*/
/**
* Returns the current file parameters.
*/
inline const P3DFileParams &P3DInstance::
get_fparams() const {
return _fparams;
}
/**
* Returns the current window parameters.
*/
inline const P3DWindowParams &P3DInstance::
get_wparams() const {
return _wparams;
}
/**
* Returns a unique integer for each instance in the system.
*/
inline int P3DInstance::
get_instance_id() const {
return _instance_id;
}
/**
* Returns a string that uniquely identifies this session. This is a
* constructed string that includes the supplied session_name, the python and
* panda version, and the publisher, as well as any other relevant details; it
* is guaranteed to be unique for each unique session required for different
* P3DInstances.
*/
inline const std::string &P3DInstance::
get_session_key() const {
return _session_key;
}
/**
* Returns the platform of this particular session. Before the panda3d
* package has been seen, this is the empty string; once we have downloaded
* the info file for the panda3d package, it is filled in with whatever
* platform is provided (that we're also runtime-compatible with).
*
* Presumably all of the platform-specific packages that are downloaded
* subsequently must be of the exact same platform.
*/
inline const std::string &P3DInstance::
get_session_platform() const {
return _session_platform;
}
/**
* Returns the P3DSession that is hosting this instance, or NULL if the
* instance is not running.
*/
inline P3DSession *P3DInstance::
get_session() const {
return _session;
}
/**
* Returns a pointer to the asynchronous notification function that was passed
* to the constructor, if any, or NULL if asynchronous notifications are not
* required.
*/
inline P3D_request_ready_func *P3DInstance::
get_request_ready_func() const {
return _func;
}
/**
* Returns true if this instance's p3d file is trusted and ready to launch,
* false if it needs to be approved by the user.
*/
inline bool P3DInstance::
is_trusted() const {
return _p3d_trusted;
}
/**
* Returns true if this instance is allowed to be scripted by its embedding
* web page, false otherwise. This may not be known until the p3d file has
* been fully downloaded and opened.
*/
inline bool P3DInstance::
get_matches_script_origin() const {
return _matches_script_origin;
}
/**
* Returns true if this instance has already been started within some session,
* false otherwise.
*/
inline bool P3DInstance::
is_started() const {
return (_session != nullptr);
}
/**
* Returns true if this instance has tried and failed to launch for some
* reason.
*/
inline bool P3DInstance::
is_failed() const {
return _failed;
}
/**
*
*/
inline P3DInstance::ImageFile::
ImageFile() {
_use_standard_image = true;
_temp_filename = nullptr;
_image_placement = P3DSplashWindow::IP_none;
}
/**
*
*/
inline P3DInstance::ImageFile::
~ImageFile() {
cleanup();
}
/**
* Removes the temporary file, if any.
*/
inline void P3DInstance::ImageFile::
cleanup() {
if (_temp_filename != nullptr) {
delete _temp_filename;
_temp_filename = nullptr;
}
}