HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Console.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * Authored by:
7  * Chris Thompson
8  * Side Effects Software Inc.
9  *
10  * NAME: Console handler for utility library (C++)
11  *
12  * COMMENTS:
13  *
14  */
15 
16 #ifndef __UT_Console_h__
17 #define __UT_Console_h__
18 
19 #include "UT_API.h"
20 #include "UT_Defines.h"
21 
22 class UT_ConsoleHandler;
23 
25 {
26 public:
27  // Any class in Houdini can call initConsole().
28  // Be sure to call this before using stdin/stdout/stderr.
29  // You can call this as many times as you'd like.
30  static void initConsole();
31 
32  // This function returns either zero or CREATE_NO_WINDOW, which is the
33  // process creation flag that prevents the process from communicating
34  // with a console. For graphical applications, we want CREATE_NO_WINDOW
35  // so that the application doesn't pop up a console window. For non-
36  // graphical applications, we want zero so that the spawned application
37  // can access the existing application's console.
38  static unsigned childProcessCreateWindowFlag();
39 
40  // This should only be called once (when Houdini terminates).
41  static void terminateConsole();
42 
43  static bool hasTextConsole();
44 
45  // This method allows you to control whether or not the
46  // application will be allowed to terminate while the console
47  // is displaying some text.
48  // If UT_TRUE, the user must explicitly close the console
49  // (this is useful for apps that display 'usage' messages
50  // then terminate immediately).
51  // If UT_FALSE, the console dies when the user closes the
52  // application.
53  //
54  // The default is UT_TRUE.
55  //
56  // In Houdini, the policy is this: setWaitForUserToClose()
57  // is UT_TRUE *until* the main window is opened, then
58  // it is switched off.
59  //
60  // Of course, if the console does not exist on a platform
61  // (eg. SGI), this has no effect.
62  static void setWaitForUserToClose( UT_Bool val );
63 
64 private:
65  static UT_Bool theConsoleInitialized;
66  static UT_ConsoleHandler *theConsoleHandler;
67  static UT_Bool theConsoleWaitForUser;
68  static bool theHasTextConsole;
69 };
70 
71 #endif // __UT_Console_h__
int UT_Bool
Definition: UT_Defines.h:46
#define UT_API
Definition: UT_API.h:12
GLuint GLfloat * val
Definition: glcorearb.h:1607