<commit_before>/**
 *  For conditions of distribution and use, see copyright notice in license.txt
 *
 *  @file   UiSceneService.h
 *  @brief  Light-weight UI service. Implements UiServiceInterface and provides 
 *          means of embedding Qt widgets to the same scene/canvas as the 3D in-world
 *          view. Uses only one UI scene for everything.
 */

#ifndef incl_UiServiceModule_UiService_h
#define incl_UiServiceModule_UiService_h

#include "UiServiceInterface.h"

class QGraphicsView;
class QRectF;

/// Light-weight UI service. Implements UiServiceInterface and provides means of  embedding Qt
/// widgets to the same scene/canvas as the 3D in-world view. Uses only one UI scene for everything.
class UiService : public UiServiceInterface
{
    Q_OBJECT

public:
    /// Constuctor.
    /** @param view The main graphics view.
    */
    explicit UiService(QGraphicsView *view);

    /// Destructor.
    ~UiService();

public slots:
    /// UiServiceInterface override.
    /** @note If you want to add full screen widget that is resized automatically to fit the screen
        when scene rectangle changes, remember to set Qt::FullScreen window state for the widget.
    */
    UiProxyWidget *AddWidgetToScene(QWidget *widget, Qt::WindowFlags flags = Qt::Dialog);

    /// UiServiceInterface override.
    bool AddWidgetToScene(UiProxyWidget *widget);

    /// UiServiceInterface override.
    void AddWidgetToMenu(QWidget *widget, const QString &name, const QString &menu, const QString &icon);

    /// UiServiceInterface override.
    void AddWidgetToMenu(UiProxyWidget *widget, const QString &name, const QString &menu, const QString &icon);

    /// UiServiceInterface override.
    void AddWidgetToMenu(QWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromScene(QWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromScene(QGraphicsProxyWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromMenu(QWidget *widget);<commit_msg>Added AddWidgetToSceneRaw() that works for scripts.<commit_after>/**
 *  For conditions of distribution and use, see copyright notice in license.txt
 *
 *  @file   UiSceneService.h
 *  @brief  Light-weight UI service. Implements UiServiceInterface and provides 
 *          means of embedding Qt widgets to the same scene/canvas as the 3D in-world
 *          view. Uses only one UI scene for everything.
 */

#ifndef incl_UiServiceModule_UiService_h
#define incl_UiServiceModule_UiService_h

#include "UiServiceInterface.h"

class QGraphicsView;
class QRectF;

/// Light-weight UI service. Implements UiServiceInterface and provides means of  embedding Qt
/// widgets to the same scene/canvas as the 3D in-world view. Uses only one UI scene for everything.
class UiService : public UiServiceInterface
{
    Q_OBJECT

public:
    /// Constuctor.
    /** @param view The main graphics view.
    */
    explicit UiService(QGraphicsView *view);

    /// Destructor.
    ~UiService();

public slots:
    /// UiServiceInterface override.
    /** @note If you want to add full screen widget that is resized automatically to fit the screen
        when scene rectangle changes, remember to set Qt::FullScreen window state for the widget.
    */
    UiProxyWidget *AddWidgetToScene(QWidget *widget, Qt::WindowFlags flags = Qt::Dialog);

    UiProxyWidget *AddWidgetToSceneRaw(QWidget *widget, int flags = (int)Qt::Dialog) { return AddWidgetToScene(widget, (Qt::WindowFlags)flags); }

    /// UiServiceInterface override.
    bool AddWidgetToScene(UiProxyWidget *widget);

    /// UiServiceInterface override.
    void AddWidgetToMenu(QWidget *widget, const QString &name, const QString &menu, const QString &icon);

    /// UiServiceInterface override.
    void AddWidgetToMenu(UiProxyWidget *widget, const QString &name, const QString &menu, const QString &icon);

    /// UiServiceInterface override.
    void AddWidgetToMenu(QWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromScene(QWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromScene(QGraphicsProxyWidget *widget);

    /// UiServiceInterface override.
    void RemoveWidgetFromMenu(QWidget *widget);
{'fraction_non_alphanumeric': 0.0833530106257379, 'fraction_numerical': 0.0009445100354191264, 'mean_word_length': 3.6754966887417218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2104082', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1139, 'n_words': 397}