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
186 lines (171 loc) · 6.8 KB
/
p3dInstance.I
File metadata and controls
186 lines (171 loc) · 6.8 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// Filename: p3dInstance.I
// Created by: drose (29May09)
//
////////////////////////////////////////////////////////////////////
//
// 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."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_fparams
// Access: Public
// Description: Returns the current file parameters.
////////////////////////////////////////////////////////////////////
inline const P3DFileParams &P3DInstance::
get_fparams() const {
return _fparams;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_wparams
// Access: Public
// Description: Returns the current window parameters.
////////////////////////////////////////////////////////////////////
inline const P3DWindowParams &P3DInstance::
get_wparams() const {
return _wparams;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_instance_id
// Access: Public
// Description: Returns a unique integer for each instance in the
// system.
////////////////////////////////////////////////////////////////////
inline int P3DInstance::
get_instance_id() const {
return _instance_id;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_session_key
// Access: Public
// Description: 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 string &P3DInstance::
get_session_key() const {
return _session_key;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_session_platform
// Access: Public
// Description: 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 string &P3DInstance::
get_session_platform() const {
return _session_platform;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_session
// Access: Public
// Description: Returns the P3DSession that is hosting this instance,
// or NULL if the instance is not running.
////////////////////////////////////////////////////////////////////
inline P3DSession *P3DInstance::
get_session() const {
return _session;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_request_ready_func
// Access: Public
// Description: 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;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::is_trusted
// Access: Public
// Description: 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;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::get_matches_script_origin
// Access: Public
// Description: 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;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::is_started
// Access: Public
// Description: Returns true if this instance has already been
// started within some session, false otherwise.
////////////////////////////////////////////////////////////////////
inline bool P3DInstance::
is_started() const {
return (_session != NULL);
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::is_failed
// Access: Public
// Description: Returns true if this instance has tried and failed to
// launch for some reason.
////////////////////////////////////////////////////////////////////
inline bool P3DInstance::
is_failed() const {
return _failed;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::ImageFile::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
inline P3DInstance::ImageFile::
ImageFile() {
_use_standard_image = true;
_temp_filename = NULL;
_image_placement = P3DSplashWindow::IP_none;
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::ImageFile::Destructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
inline P3DInstance::ImageFile::
~ImageFile() {
cleanup();
}
////////////////////////////////////////////////////////////////////
// Function: P3DInstance::ImageFile::cleanup
// Access: Public
// Description: Removes the temporary file, if any.
////////////////////////////////////////////////////////////////////
inline void P3DInstance::ImageFile::
cleanup() {
if (_temp_filename != NULL) {
delete _temp_filename;
_temp_filename = NULL;
}
}