Skip to content

Commit

Permalink
Consolidate namespaces: whitespace changes
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Oct 30, 2023
1 parent ccdef74 commit b939f2e
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 422 deletions.
65 changes: 32 additions & 33 deletions src/Application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,50 +38,49 @@

namespace gz::gui
{
class ApplicationPrivate
{
/// \brief QML engine
public: QQmlApplicationEngine *engine{nullptr};

/// \brief Pointer to main window
public: MainWindow *mainWin{nullptr};
class ApplicationPrivate
{
/// \brief QML engine
public: QQmlApplicationEngine *engine{nullptr};

/// \brief Vector of pointers to dialogs
public: std::vector<Dialog *> dialogs;
/// \brief Pointer to main window
public: MainWindow *mainWin{nullptr};

/// \brief Queue of plugins which should be added to the window
public: std::queue<std::shared_ptr<Plugin>> pluginsToAdd;
/// \brief Vector of pointers to dialogs
public: std::vector<Dialog *> dialogs;

/// \brief Vector of pointers to plugins already added, we hang on to
/// these until it is ok to unload the plugin's shared library.
public: std::vector<std::shared_ptr<Plugin>> pluginsAdded;
/// \brief Queue of plugins which should be added to the window
public: std::queue<std::shared_ptr<Plugin>> pluginsToAdd;

/// \brief Deprecated environment variable which holds paths to look for
/// plugins
public: std::string pluginPathEnvDeprecated = "IGN_GUI_PLUGIN_PATH";
/// \brief Vector of pointers to plugins already added, we hang on to
/// these until it is ok to unload the plugin's shared library.
public: std::vector<std::shared_ptr<Plugin>> pluginsAdded;

/// \brief Environment variable which holds paths to look for plugins
public: std::string pluginPathEnv = "GZ_GUI_PLUGIN_PATH";
/// \brief Deprecated environment variable which holds paths to look for
/// plugins
public: std::string pluginPathEnvDeprecated = "IGN_GUI_PLUGIN_PATH";

/// \brief Vector of paths to look for plugins
public: std::vector<std::string> pluginPaths;
/// \brief Environment variable which holds paths to look for plugins
public: std::string pluginPathEnv = "GZ_GUI_PLUGIN_PATH";

/// \brief Holds a configuration which may be applied to mainWin once it
/// is created by calling applyConfig(). It's no longer needed and
/// should not be used after that.
public: WindowConfig windowConfig;
/// \brief Vector of paths to look for plugins
public: std::vector<std::string> pluginPaths;

/// \brief The path containing the default configuration file.
public: std::string defaultConfigPath;
/// \brief Holds a configuration which may be applied to mainWin once it
/// is created by calling applyConfig(). It's no longer needed and
/// should not be used after that.
public: WindowConfig windowConfig;

public: common::SignalHandler signalHandler;
/// \brief The path containing the default configuration file.
public: std::string defaultConfigPath;

/// \brief QT message handler that pipes qt messages into our console
/// system.
public: static void MessageHandler(QtMsgType _type,
const QMessageLogContext &_context, const QString &_msg);
};
public: common::SignalHandler signalHandler;

/// \brief QT message handler that pipes qt messages into our console
/// system.
public: static void MessageHandler(QtMsgType _type,
const QMessageLogContext &_context, const QString &_msg);
};

/////////////////////////////////////////////////
Application::Application(int &_argc, char **_argv, const WindowType _type)
Expand Down
10 changes: 5 additions & 5 deletions src/Dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

namespace gz::gui
{
class DialogPrivate
{
/// \brief Pointer to quick window
public: QQuickWindow *quickWindow{nullptr};
};
class DialogPrivate
{
/// \brief Pointer to quick window
public: QQuickWindow *quickWindow{nullptr};
};

/////////////////////////////////////////////////
Dialog::Dialog()
Expand Down
64 changes: 32 additions & 32 deletions src/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,51 @@

namespace gz::gui
{
class MainWindowPrivate
{
/// \brief Number of plugins on the window
public: int pluginCount{0};
class MainWindowPrivate
{
/// \brief Number of plugins on the window
public: int pluginCount{0};

/// \brief Pointer to quick window
public: QQuickWindow *quickWindow{nullptr};
/// \brief Pointer to quick window
public: QQuickWindow *quickWindow{nullptr};

/// \brief Configuration for this window.
public: WindowConfig windowConfig;
/// \brief Configuration for this window.
public: WindowConfig windowConfig;

/// \brief Counts the times the window has been painted
public: unsigned int paintCount{0};
/// \brief Counts the times the window has been painted
public: unsigned int paintCount{0};

/// \brief Minimum number of paint events to consider the window to be
/// fully initialized.
public: const unsigned int paintCountMin{20};
/// \brief Minimum number of paint events to consider the window to be
/// fully initialized.
public: const unsigned int paintCountMin{20};

/// \brief The action executed when GUI is closed without prompt.
public: ExitAction defaultExitAction{ExitAction::CLOSE_GUI};
/// \brief The action executed when GUI is closed without prompt.
public: ExitAction defaultExitAction{ExitAction::CLOSE_GUI};

/// \brief Show the confirmation dialog on exit
public: bool showDialogOnExit{false};
/// \brief Show the confirmation dialog on exit
public: bool showDialogOnExit{false};

/// \brief Text of the prompt in the confirmation dialog on exit
public: QString dialogOnExitText;
/// \brief Text of the prompt in the confirmation dialog on exit
public: QString dialogOnExitText;

/// \brief Show "shutdown" button in exit dialog
public: bool exitDialogShowShutdown{false};
/// \brief Show "shutdown" button in exit dialog
public: bool exitDialogShowShutdown{false};

/// \brief Show "Close GUI" button in exit dialog
public: bool exitDialogShowCloseGui{true};
/// \brief Show "Close GUI" button in exit dialog
public: bool exitDialogShowCloseGui{true};

/// \brief Text of "shutdown" button in exit dialog
public: QString exitDialogShutdownText;
/// \brief Text of "shutdown" button in exit dialog
public: QString exitDialogShutdownText;

/// \brief Text of "Close GUI" button in exit dialog
public: QString exitDialogCloseGuiText;
/// \brief Text of "Close GUI" button in exit dialog
public: QString exitDialogCloseGuiText;

/// \brief Service to send server control requests
public: std::string controlService{"/server_control"};
/// \brief Service to send server control requests
public: std::string controlService{"/server_control"};

/// \brief Communication node
public: gz::transport::Node node;
};
/// \brief Communication node
public: gz::transport::Node node;
};

/// \brief Strip last component from a path.
/// \return Original path without its last component.
Expand Down
1 change: 0 additions & 1 deletion src/PlottingInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class PlotDataPrivate
public: std::set<int> charts;
};


class TopicPrivate
{
/// \brief Check the plotable types and get data from reflection
Expand Down
26 changes: 13 additions & 13 deletions src/plugins/image_display/ImageDisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@

namespace gz::gui::plugins
{
class ImageDisplayPrivate
{
/// \brief List of topics publishing image messages.
public: QStringList topicList;
class ImageDisplayPrivate
{
/// \brief List of topics publishing image messages.
public: QStringList topicList;

/// \brief Holds data to set as the next image
public: msgs::Image imageMsg;
/// \brief Holds data to set as the next image
public: msgs::Image imageMsg;

/// \brief Node for communication.
public: transport::Node node;
/// \brief Node for communication.
public: transport::Node node;

/// \brief Mutex for accessing image data
public: std::recursive_mutex imageMutex;
/// \brief Mutex for accessing image data
public: std::recursive_mutex imageMutex;

/// \brief To provide images for QML.
public: ImageProvider *provider{nullptr};
};
/// \brief To provide images for QML.
public: ImageProvider *provider{nullptr};
};

/////////////////////////////////////////////////
ImageDisplay::ImageDisplay()
Expand Down
34 changes: 17 additions & 17 deletions src/plugins/key_publisher/KeyPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@

namespace gz::gui
{
class KeyPublisherPrivate
{
/// \brief Node for communication
public: gz::transport::Node node;
class KeyPublisherPrivate
{
/// \brief Node for communication
public: gz::transport::Node node;

/// \brief Publisher
public: gz::transport::Node::Publisher pub;
/// \brief Publisher
public: gz::transport::Node::Publisher pub;

/// \brief Topic
public: std::string topic = "keyboard/keypress";
/// \brief Topic
public: std::string topic = "keyboard/keypress";

/// \brief Publish keyboard strokes
/// \param[in] key_press Pointer to the keyevent
public: void KeyPub(QKeyEvent *_keyPress)
{
gz::msgs::Int32 Msg;
Msg.set_data(_keyPress->key());
pub.Publish(Msg);
}
};
/// \brief Publish keyboard strokes
/// \param[in] key_press Pointer to the keyevent
public: void KeyPub(QKeyEvent *_keyPress)
{
gz::msgs::Int32 Msg;
Msg.set_data(_keyPress->key());
pub.Publish(Msg);
}
};

/////////////////////////////////////////////////
KeyPublisher::KeyPublisher(): Plugin(), dataPtr(new KeyPublisherPrivate)
Expand Down
22 changes: 11 additions & 11 deletions src/plugins/navsat_map/NavSatMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@

namespace gz::gui::plugins
{
class NavSatMapPrivate
{
/// \brief List of topics publishing navSat messages.
public: QStringList topicList;
class NavSatMapPrivate
{
/// \brief List of topics publishing navSat messages.
public: QStringList topicList;

/// \brief Holds data to set as the next navSat
public: msgs::NavSat navSatMsg;
/// \brief Holds data to set as the next navSat
public: msgs::NavSat navSatMsg;

/// \brief Node for communication.
public: transport::Node node;
/// \brief Node for communication.
public: transport::Node node;

/// \brief Mutex for accessing navSat data
public: std::recursive_mutex navSatMutex;
};
/// \brief Mutex for accessing navSat data
public: std::recursive_mutex navSatMutex;
};

/////////////////////////////////////////////////
NavSatMap::NavSatMap()
Expand Down
34 changes: 17 additions & 17 deletions src/plugins/publisher/Publisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@

namespace gz::gui::plugins
{
class PublisherPrivate
{
/// \brief Message type
public: QString msgType = "gz.msgs.StringMsg";
class PublisherPrivate
{
/// \brief Message type
public: QString msgType = "gz.msgs.StringMsg";

/// \brief Message contents
public: QString msgData = "data: \"Hello\"";
/// \brief Message contents
public: QString msgData = "data: \"Hello\"";

/// \brief Topic
public: QString topic = "/echo";
/// \brief Topic
public: QString topic = "/echo";

/// \brief Frequency
public: double frequency = 1.0;
/// \brief Frequency
public: double frequency = 1.0;

/// \brief Timer to keep publishing
public: QTimer *timer;
/// \brief Timer to keep publishing
public: QTimer *timer;

/// \brief Node for communication
public: gz::transport::Node node;
/// \brief Node for communication
public: gz::transport::Node node;

/// \brief Publisher
public: gz::transport::Node::Publisher pub;
};
/// \brief Publisher
public: gz::transport::Node::Publisher pub;
};

/////////////////////////////////////////////////
Publisher::Publisher()
Expand Down
30 changes: 15 additions & 15 deletions src/plugins/screenshot/Screenshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@

namespace gz::gui::plugins
{
class ScreenshotPrivate
{
/// \brief Node for communication
public: gz::transport::Node node;
class ScreenshotPrivate
{
/// \brief Node for communication
public: gz::transport::Node node;

/// \brief Screenshot service name
public: std::string screenshotService;
/// \brief Screenshot service name
public: std::string screenshotService;

/// \brief Directory to save screenshots
public: std::string directory;
/// \brief Directory to save screenshots
public: std::string directory;

/// \brief Whether a screenshot has been requested but not processed yet.
public: bool dirty{false};
/// \brief Whether a screenshot has been requested but not processed yet.
public: bool dirty{false};

/// \brief Pointer to the user camera.
public: gz::rendering::CameraPtr userCamera{nullptr};
/// \brief Pointer to the user camera.
public: gz::rendering::CameraPtr userCamera{nullptr};

/// \brief Saved screenshot filepath
public: QString savedScreenshotPath = "";
};
/// \brief Saved screenshot filepath
public: QString savedScreenshotPath = "";
};

/////////////////////////////////////////////////
Screenshot::Screenshot()
Expand Down
Loading

0 comments on commit b939f2e

Please sign in to comment.