// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- /* * Copyright (C) 2012 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Authored by: Jason Smith */ #ifndef UNITYWINDOWVIEW_H #define UNITYWINDOWVIEW_H #include "unity-shared/BackgroundEffectHelper.h" #include "Introspectable.h" #include "UnityWindowStyle.h" #include #include #include #include #include namespace unity { namespace ui { class UnityWindowView : public debug::Introspectable, public nux::View { NUX_DECLARE_OBJECT_TYPE(UnityWindowView, nux::View) public: nux::Property background_color; nux::Property style; UnityWindowView(NUX_FILE_LINE_PROTO); virtual ~UnityWindowView(); void SetupBackground(bool enabled = true); protected: void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw); virtual void PreDraw(nux::GraphicsEngine& GfxContext, bool force_draw) {}; virtual void DrawOverlay(nux::GraphicsEngine& GfxContext, bool force_draw, nux::Geometry clip) = 0; virtual void PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw) {}; virtual nux::Geometry GetBackgroundGeometry() = 0; // Introspectable methods std::string GetName() const; void AddProperties(GVariantBuilder* builder); private: void DrawBackground(nux::GraphicsEngine& GfxContext, nux::Geometry const& geo); BackgroundEffectHelper bg_helper_; nux::ObjectPtr bg_texture_; }; } } #endif