ShellOS.h#

Parent directory (OS)

Contains the declaration of the ShellOS class. Most of the functionality is platform-specific, and as such is delegated to platform-specific ShellOS.cpp files. Do not access or use directly.

Includes#

  • PVRShell/Shell.h

  • PVRShell/ShellData.h

  • memory

Included By#

Namespaces#

Classes#

Source Code#

#pragma once
#include "PVRShell/ShellData.h"
#include "PVRShell/Shell.h"
#include <memory>
namespace pvr {
namespace platform {
// Forward declaration of internal implementation.
class InternalOS;

class ShellOS
{
public:
    struct Capabilities
    {
        Capability resizable;
        Capability movable;
    };

    ShellData _shellData;

    ShellOS(OSApplication instance, OSDATA osdata);

    virtual ~ShellOS();

    bool init(DisplayAttributes& data);

    bool initializeWindow(DisplayAttributes& data);

    bool isInitialized();

    void releaseWindow();

    OSApplication getApplication() const;

    OSConnection getConnection() const;

    OSDisplay getDisplay() const;

    OSWindow getWindow() const;

    const std::string& getDefaultReadPath() const;

    const std::vector<std::string>& getReadPaths() const;

    void addReadPath(const std::string& readPath) { _readPaths.emplace_back(readPath); }

    void clearReadPaths() { _readPaths.clear(); }

    const std::string& getWritePath() const;

    void setWritePath(const std::string& writePath) { _writePath = writePath; }

    const std::string& getApplicationName() const;

    void setApplicationName(const std::string& applicationName);

    bool handleOSEvents();

    static const Capabilities& getCapabilities() { return _capabilities; }

    bool popUpMessage(const char* const title, const char* const message, ...) const;

    Shell* getShell() { return _shell.get(); }

    void updatePointingDeviceLocation();

protected:
    std::unique_ptr<Shell> _shell;
    std::string _appName;
    std::vector<std::string> _readPaths;
    std::string _writePath;

private:
    OSApplication _instance;
    std::unique_ptr<InternalOS> _OSImplementation;
    static const Capabilities _capabilities;
};
inline const std::string& ShellOS::getApplicationName() const { return _appName; }
inline void ShellOS::setApplicationName(const std::string& applicationName) { _appName = applicationName; }
inline const std::string& ShellOS::getDefaultReadPath() const { return _readPaths[0]; }
inline const std::vector<std::string>& ShellOS::getReadPaths() const { return _readPaths; }
inline const std::string& ShellOS::getWritePath() const { return _writePath; }
} // namespace platform
} // namespace pvr