Panda3D
 All Classes Functions Variables Enumerations
rocketRegion.I
1 // Filename: rocketRegion.I
2 // Created by: rdb (01Dec11)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: RocketRegion::make
18 // Access: Published, Static
19 // Description: Creates a libRocket context with the given name
20 // (must be unique) for the given window. Returns
21 // a new DisplayRegion where the libRocket context
22 // will render to.
23 // This variant of make() creates a region that
24 // fills the entire window.
25 ////////////////////////////////////////////////////////////////////
27 make(const string &context_name, GraphicsOutput *window) {
28  return make(context_name, window, LVecBase4(0.0f, 1.0f, 0.0f, 1.0f));
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: RocketRegion::make
33 // Access: Published, Static
34 // Description: Creates a libRocket context with the given name
35 // (must be unique) for the given window. Returns
36 // a new DisplayRegion where the libRocket context
37 // will render to.
38 ////////////////////////////////////////////////////////////////////
40 make(const string &context_name, GraphicsOutput *window,
41  const LVecBase4 &dimensions) {
42 
43  return new RocketRegion(window, dimensions, context_name);
44 }
45 
46 #ifndef CPPPARSER
47 ////////////////////////////////////////////////////////////////////
48 // Function: RocketRegion::get_context
49 // Access: Published
50 // Description: Returns a pointer to the Rocket context associated
51 // with this region. Does not increase the reference
52 // count, so if you want to preserve it for longer
53 // than this region exists, be sure to call
54 // AddReference() and RemoveReference() yourself.
55 ////////////////////////////////////////////////////////////////////
56 Rocket::Core::Context* RocketRegion::
57 get_context() const {
58  return _context;
59 }
60 #endif
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: RocketRegion::set_input_handler
64 // Access: Published
65 // Description: Sets the RocketInputHandler object from which to
66 // gather the keyboard and mouse inputs to pass to
67 // the libRocket context before rendering.
68 // You may use one input handler to provide inputs to
69 // any number of RocketRegion objects.
70 ////////////////////////////////////////////////////////////////////
71 INLINE void RocketRegion::
73  _input_handler = handler;
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: RocketRegion::get_input_handler
78 // Access: Published
79 // Description: Returns the RocketInputHandler object previously
80 // passed to set_input_handler.
81 ////////////////////////////////////////////////////////////////////
84  return _input_handler;
85 }
Represents a region in a window or buffer where the libRocket UI will be rendered to...
Definition: rocketRegion.h:30
This is a base class for the various different classes that represent the result of a frame of render...
void set_input_handler(RocketInputHandler *handler)
Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the ...
Definition: rocketRegion.I:72
DataNode that listens for keyboard and mouse events and passes them to libRocket. ...
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
Rocket::Core::Context * get_context() const
Returns a pointer to the Rocket context associated with this region.
Definition: rocketRegion.I:57
static RocketRegion * make(const string &context_name, GraphicsOutput *window)
Creates a libRocket context with the given name (must be unique) for the given window.
Definition: rocketRegion.I:27
RocketInputHandler * get_input_handler() const
Returns the RocketInputHandler object previously passed to set_input_handler.
Definition: rocketRegion.I:83