Panda3D
config_x11display.cxx
1 // Filename: config_x11display.cxx
2 // Created by: rdb (07Jul09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_x11display.h"
16 #include "x11GraphicsPipe.h"
17 #include "x11GraphicsWindow.h"
18 #include "graphicsPipeSelection.h"
19 #include "dconfig.h"
20 #include "pandaSystem.h"
21 
22 Configure(config_x11display);
23 NotifyCategoryDef(x11display, "display");
24 
25 ConfigureFn(config_x11display) {
26  init_libx11display();
27 }
28 
29 ConfigVariableString display_cfg
30 ("display", "",
31  PRC_DESC("Specify the X display string for the default display. If this "
32  "is not specified, $DISPLAY is used."));
33 
34 ConfigVariableBool x_error_abort
35 ("x-error-abort", false,
36  PRC_DESC("Set this true to trigger and abort (and a stack trace) on receipt "
37  "of an error from the X window system. This can make it easier "
38  "to discover where these errors are generated."));
39 
40 ConfigVariableInt x_wheel_up_button
41 ("x-wheel-up-button", 4,
42  PRC_DESC("This is the mouse button index of the wheel_up event: which "
43  "mouse button number does the system report when the mouse wheel "
44  "is rolled one notch up?"));
45 
46 ConfigVariableInt x_wheel_down_button
47 ("x-wheel-down-button", 5,
48  PRC_DESC("This is the mouse button index of the wheel_down event: which "
49  "mouse button number does the system report when the mouse wheel "
50  "is rolled one notch down?"));
51 
52 ConfigVariableInt x_wheel_left_button
53 ("x-wheel-left-button", 6,
54  PRC_DESC("This is the mouse button index of the wheel_left event: which "
55  "mouse button number does the system report when one scrolls "
56  "to the left?"));
57 
58 ConfigVariableInt x_wheel_right_button
59 ("x-wheel-right-button", 7,
60  PRC_DESC("This is the mouse button index of the wheel_right event: which "
61  "mouse button number does the system report when one scrolls "
62  "to the right?"));
63 
64 ConfigVariableString x_wm_class_name
65 ("x-wm-class-name", "",
66  PRC_DESC("Specify the value to use for the res_name field of the window's "
67  "WM_CLASS property. Has no effect when x-wm-class is not set."));
68 
69 ConfigVariableString x_wm_class
70 ("x-wm-class", "",
71  PRC_DESC("Specify the value to use for the res_class field of the window's "
72  "WM_CLASS property."));
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: init_libx11display
76 // Description: Initializes the library. This must be called at
77 // least once before any of the functions or classes in
78 // this library can be used. Normally it will be
79 // called by the static initializers and need not be
80 // called explicitly, but special cases exist.
81 ////////////////////////////////////////////////////////////////////
82 void
83 init_libx11display() {
84  static bool initialized = false;
85  if (initialized) {
86  return;
87  }
88  initialized = true;
89 
90  x11GraphicsPipe::init_type();
91  x11GraphicsWindow::init_type();
92 }
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a string type.
This is a convenience class to specialize ConfigVariable as an integer type.