aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llplugin/llpluginprocesschild.cpp
diff options
context:
space:
mode:
authorDavid Seikel2011-06-04 00:17:28 +1000
committerDavid Seikel2011-06-04 00:17:28 +1000
commit492eaaf4eec82327116f2605e3d8becf94bec1b3 (patch)
treedcddd674cb4861445c3ec5aaa59325b99a437614 /linden/indra/llplugin/llpluginprocesschild.cpp
parentSet the real bare minimum prim size to 0.00001, as 0 sized objects cause bugs. (diff)
parentFixing the menu to actually use its color options reveals how broken the whol... (diff)
downloadmeta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.zip
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.gz
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.bz2
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.xz
Merge branch 'next' of git://github.com/jacek/imprudence into next
Conflicts (manually merged): linden/indra/llcommon/llversionviewer.h linden/indra/llvfs/lldir.cpp linden/indra/llvfs/lldir_mac.cpp linden/indra/newview/CMakeLists.txt linden/indra/newview/English.lproj/InfoPlist.strings linden/indra/newview/Info-Imprudence.plist linden/indra/newview/Info-meta-impy.plist linden/indra/newview/llappviewer.cpp linden/indra/newview/llpanellogin.cpp linden/indra/newview/packaging/mac/Info.plist.in linden/indra/newview/res/viewerRes.rc linden/indra/newview/skins/default/xui/en-us/floater_about.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml linden/indra/newview/skins/default/xui/zh/menu_viewer.xml linden/indra/newview/skins/default/xui/zh/panel_group_general.xml linden/indra/newview/viewer_manifest.py linden/indra/newview/viewerversion.cpp linden/indra/newview/viewerversion.h linden/install.xml Also some post merge tweaks.
Diffstat (limited to 'linden/indra/llplugin/llpluginprocesschild.cpp')
-rwxr-xr-xlinden/indra/llplugin/llpluginprocesschild.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/linden/indra/llplugin/llpluginprocesschild.cpp b/linden/indra/llplugin/llpluginprocesschild.cpp
index 0d95cac..168236e 100755
--- a/linden/indra/llplugin/llpluginprocesschild.cpp
+++ b/linden/indra/llplugin/llpluginprocesschild.cpp
@@ -42,6 +42,14 @@
42#include "llpluginmessagepipe.h" 42#include "llpluginmessagepipe.h"
43#include "llpluginmessageclasses.h" 43#include "llpluginmessageclasses.h"
44 44
45#if LL_WINDOWS
46#include <windows.h>
47#include <fcntl.h>
48#include <io.h>
49#include <iostream>
50#include <fstream>
51#endif
52
45static const F32 HEARTBEAT_SECONDS = 1.0f; 53static const F32 HEARTBEAT_SECONDS = 1.0f;
46static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time. 54static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time.
47 55
@@ -420,6 +428,12 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
420 { 428 {
421 mSleepTime = parsed.getValueReal("time"); 429 mSleepTime = parsed.getValueReal("time");
422 } 430 }
431 #if LL_WINDOWS
432 else if(message_name == "show_console")
433 {
434 createConsole();
435 }
436 #endif
423 else if(message_name == "crash") 437 else if(message_name == "crash")
424 { 438 {
425 // Crash the plugin 439 // Crash the plugin
@@ -569,3 +583,46 @@ void LLPluginProcessChild::deliverQueuedMessages()
569 } 583 }
570 } 584 }
571} 585}
586
587#if LL_WINDOWS
588void LLPluginProcessChild::createConsole()
589{
590 const S32 MAX_CONSOLE_LINES = 500;
591
592 int h_con_handle;
593 long l_std_handle;
594
595 CONSOLE_SCREEN_BUFFER_INFO coninfo;
596 FILE *fp;
597
598 // allocate a console for this app
599 AllocConsole();
600
601 // set the screen buffer to be big enough to let us scroll text
602 GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
603 coninfo.dwSize.Y = MAX_CONSOLE_LINES;
604 SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
605
606 // redirect unbuffered STDOUT to the console
607 l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
608 h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
609 fp = _fdopen( h_con_handle, "w" );
610 *stdout = *fp;
611 setvbuf( stdout, NULL, _IONBF, 0 );
612
613 // redirect unbuffered STDIN to the console
614 l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE);
615 h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
616 fp = _fdopen( h_con_handle, "r" );
617 *stdin = *fp;
618 setvbuf( stdin, NULL, _IONBF, 0 );
619
620 // redirect unbuffered STDERR to the console
621 l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE);
622 h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
623 fp = _fdopen( h_con_handle, "w" );
624 *stderr = *fp;
625 setvbuf( stderr, NULL, _IOFBF, 1024 ); //Assigning a buffer improves speed a LOT, esp on vista/win7
626 //_IOLBF is borked.
627}
628#endif \ No newline at end of file