GuiPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef _GZ_GUI_PLUGIN_HH_
18 #define _GZ_GUI_PLUGIN_HH_
19 
20 #include "gazebo/gui/qt.h"
21 #include "gazebo/common/Plugin.hh"
22 
23 namespace gazebo
24 {
26  class GZ_GUI_VISIBLE GUIPlugin : public QWidget, public PluginT<GUIPlugin>
27  {
28  public: GUIPlugin() : QWidget(NULL)
29  {this->type = GUI_PLUGIN;}
30 
39  public: virtual void Load(sdf::ElementPtr /*_sdf*/) {}
40  };
41 
46 #define GZ_REGISTER_GUI_PLUGIN(classname) \
47  extern "C" GZ_GUI_VISIBLE gazebo::GUIPlugin *RegisterPlugin(); \
48  GZ_GUI_VISIBLE \
49  gazebo::GUIPlugin *RegisterPlugin() \
50  {\
51  return new classname();\
52  }
53 }
54 
55 #endif
virtual void Load(sdf::ElementPtr)
Load function.
Definition: GuiPlugin.hh:39
#define GZ_GUI_VISIBLE
Definition: system.hh:284
A plugin loaded within the gzclient on startup.
Definition: GuiPlugin.hh:26
GUIPlugin()
Definition: GuiPlugin.hh:28
#define NULL
Definition: CommonTypes.hh:31
A class which all plugins must inherit from.
Definition: Plugin.hh:83
A GUI plugin.
Definition: Plugin.hh:76