mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
hidden plugins
This commit is contained in:
parent
8db00b4f74
commit
f3751431b5
@ -16,7 +16,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
static const bool debug_xml_output = false;
|
static const bool debug_xml_output = true;
|
||||||
|
|
||||||
#define DO_BINARY_XML 1
|
#define DO_BINARY_XML 1
|
||||||
|
|
||||||
|
@ -184,48 +184,51 @@ set_wparams(const P3DWindowParams &wparams) {
|
|||||||
nout << "set_wparams, _session = " << _session << "\n";
|
nout << "set_wparams, _session = " << _session << "\n";
|
||||||
_got_wparams = true;
|
_got_wparams = true;
|
||||||
_wparams = wparams;
|
_wparams = wparams;
|
||||||
|
nout << "set window_type = " << _wparams.get_window_type() << "\n";
|
||||||
|
|
||||||
// Update or create the splash window.
|
if (_wparams.get_window_type() != P3D_WT_hidden) {
|
||||||
if (!_instance_window_opened) {
|
// Update or create the splash window.
|
||||||
if (_splash_window == NULL) {
|
if (!_instance_window_opened) {
|
||||||
make_splash_window();
|
if (_splash_window == NULL) {
|
||||||
|
make_splash_window();
|
||||||
|
}
|
||||||
|
_splash_window->set_wparams(_wparams);
|
||||||
}
|
}
|
||||||
_splash_window->set_wparams(_wparams);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// On Mac, we have to communicate the results of the rendering
|
// On Mac, we have to communicate the results of the rendering
|
||||||
// back via shared memory, instead of directly parenting windows
|
// back via shared memory, instead of directly parenting windows
|
||||||
// to the browser. Set up this mechanism.
|
// to the browser. Set up this mechanism.
|
||||||
int x_size = _wparams.get_win_width();
|
int x_size = _wparams.get_win_width();
|
||||||
int y_size = _wparams.get_win_height();
|
int y_size = _wparams.get_win_height();
|
||||||
nout << "x_size, y_size = " << x_size << ", " << y_size << "\n";
|
nout << "x_size, y_size = " << x_size << ", " << y_size << "\n";
|
||||||
if (x_size != 0 && y_size != 0) {
|
if (x_size != 0 && y_size != 0) {
|
||||||
if (_swbuffer == NULL || _swbuffer->get_x_size() != x_size ||
|
if (_swbuffer == NULL || _swbuffer->get_x_size() != x_size ||
|
||||||
_swbuffer->get_y_size() != y_size) {
|
_swbuffer->get_y_size() != y_size) {
|
||||||
// We need to open a new shared buffer.
|
// We need to open a new shared buffer.
|
||||||
if (_swbuffer != NULL) {
|
if (_swbuffer != NULL) {
|
||||||
SubprocessWindowBuffer::destroy_buffer(_shared_fd, _shared_mmap_size,
|
SubprocessWindowBuffer::destroy_buffer(_shared_fd, _shared_mmap_size,
|
||||||
_shared_filename, _swbuffer);
|
_shared_filename, _swbuffer);
|
||||||
_swbuffer = NULL;
|
_swbuffer = NULL;
|
||||||
}
|
}
|
||||||
if (_reversed_buffer != NULL) {
|
if (_reversed_buffer != NULL) {
|
||||||
delete[] _reversed_buffer;
|
delete[] _reversed_buffer;
|
||||||
_reversed_buffer = NULL;
|
_reversed_buffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
_swbuffer = SubprocessWindowBuffer::new_buffer
|
||||||
|
(_shared_fd, _shared_mmap_size, _shared_filename, x_size, y_size);
|
||||||
|
if (_swbuffer != NULL) {
|
||||||
|
_reversed_buffer = new char[_swbuffer->get_framebuffer_size()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_swbuffer = SubprocessWindowBuffer::new_buffer
|
if (_swbuffer == NULL) {
|
||||||
(_shared_fd, _shared_mmap_size, _shared_filename, x_size, y_size);
|
nout << "Could not open swbuffer\n";
|
||||||
if (_swbuffer != NULL) {
|
|
||||||
_reversed_buffer = new char[_swbuffer->get_framebuffer_size()];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_swbuffer == NULL) {
|
|
||||||
nout << "Could not open swbuffer\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
}
|
||||||
|
|
||||||
// Update the instance in the sub-process.
|
// Update the instance in the sub-process.
|
||||||
if (_session != NULL) {
|
if (_session != NULL) {
|
||||||
|
@ -257,10 +257,10 @@ paint_window() {
|
|||||||
PaintRect(&rdone);
|
PaintRect(&rdone);
|
||||||
EraseRect(&rneed);
|
EraseRect(&rneed);
|
||||||
|
|
||||||
if (!_install_label.empty()) {
|
RGBColor black = { 0, 0, 0 };
|
||||||
RGBColor black = { 0, 0, 0 };
|
RGBForeColor(&black);
|
||||||
RGBForeColor(&black);
|
|
||||||
|
|
||||||
|
if (!_install_label.empty()) {
|
||||||
TextFont(0);
|
TextFont(0);
|
||||||
TextFace(bold);
|
TextFace(bold);
|
||||||
TextMode(srcOr);
|
TextMode(srcOr);
|
||||||
|
@ -1064,8 +1064,18 @@ send_window() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
P3D_window_type window_type = P3D_WT_embedded;
|
||||||
|
if (_window.window == NULL) {
|
||||||
|
// No parent window: it must be a hidden window.
|
||||||
|
window_type = P3D_WT_hidden;
|
||||||
|
} else if (_window.width == 0 || _window.height == 0) {
|
||||||
|
// No size: hidden.
|
||||||
|
window_type = P3D_WT_hidden;
|
||||||
|
}
|
||||||
|
nout << "window_type = " << window_type << "\n";
|
||||||
|
|
||||||
P3D_instance_setup_window
|
P3D_instance_setup_window
|
||||||
(_p3d_inst, P3D_WT_embedded,
|
(_p3d_inst, window_type,
|
||||||
x, y, _window.width, _window.height,
|
x, y, _window.width, _window.height,
|
||||||
parent_window);
|
parent_window);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static ofstream logfile;
|
static ofstream logfile;
|
||||||
ostream *nout_stream = &logfile;
|
ostream *nout_stream = &logfile;
|
||||||
|
|
||||||
@ -129,6 +133,12 @@ NP_Initialize(NPNetscapeFuncs *browserFuncs,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
// On Mac, we'd better ignore SIGPIPE, or this signal will shut down
|
||||||
|
// the application if the plugin exits unexpectedly.
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
#endif // __APPLE__
|
||||||
|
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user