HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
21 class UT_ConsoleHandler;
22 
24 {
25 public:
26  // Any class in Houdini can call initConsole().
27  // Be sure to call this before using stdin/stdout/stderr.
28  // You can call this as many times as you'd like.
29  static void initConsole();
30 
31  // This function returns either zero or CREATE_NO_WINDOW, which is the
32  // process creation flag that prevents the process from communicating
33  // with a console. For graphical applications, we want CREATE_NO_WINDOW
34  // so that the application doesn't pop up a console window. For non-
35  // graphical applications, we want zero so that the spawned application
36  // can access the existing application's console.
37  static unsigned childProcessCreateWindowFlag();
38 
39  // This should only be called once (when Houdini terminates).
40  static void terminateConsole();
41 
42  static bool hasTextConsole();
43 
44  // This method allows you to control whether or not the
45  // application will be allowed to terminate while the console
46  // is displaying some text.
47  // If true, the user must explicitly close the console
48  // (this is useful for apps that display 'usage' messages
49  // then terminate immediately).
50  // If false, the console dies when the user closes the
51  // application.
52  //
53  // The default is true.
54  //
55  // In Houdini, the policy is this: setWaitForUserToClose()
56  // is true *until* the main window is opened, then
57  // it is switched off.
58  //
59  // Of course, if the console does not exist on a platform
60  // (eg. SGI), this has no effect.
61  static void setWaitForUserToClose(bool val);
62 
63 private:
64  static bool theConsoleInitialized;
65  static UT_ConsoleHandler *theConsoleHandler;
66  static bool theConsoleWaitForUser;
67  static bool theHasTextConsole;
68 };
69 
70 #endif // __UT_Console_h__
#define UT_API
Definition: UT_API.h:14
GLuint GLfloat * val
Definition: glcorearb.h:1608