Back to index

unity  6.0.0
UnityWindowStyle.cpp
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2012 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Jason Smith <jason.smith@canonical.com>
00018  */
00019 
00020 #include "UnityWindowStyle.h"
00021 #include "config.h"
00022 
00023 namespace unity {
00024 namespace ui {
00025 
00026 UnityWindowStyle::UnityWindowStyle()
00027 {
00028   background_top_.Adopt(nux::CreateTexture2DFromFile(PKGDATADIR"/switcher_top.png", -1, true));
00029   background_left_.Adopt(nux::CreateTexture2DFromFile(PKGDATADIR"/switcher_left.png", -1, true));
00030   background_corner_.Adopt(nux::CreateTexture2DFromFile(PKGDATADIR"/switcher_corner.png", -1, true));
00031 }
00032 
00033 UnityWindowStyle::~UnityWindowStyle()
00034 {
00035   // nothing to do
00036 }
00037 
00038 int UnityWindowStyle::GetBorderSize() const
00039 {
00040   return 30; // as measured from textures
00041 }
00042 
00043 int UnityWindowStyle::GetInternalOffset() const
00044 {
00045   return 20;
00046 }
00047 
00048 nux::BaseTexture* UnityWindowStyle::GetBackgroundTop() const
00049 {
00050   return background_top_.GetPointer();
00051 }
00052 
00053 nux::BaseTexture* UnityWindowStyle::GetBackgroundLeft() const
00054 {
00055   return background_left_.GetPointer();
00056 }
00057 
00058 nux::BaseTexture* UnityWindowStyle::GetBackgroundCorner() const
00059 {
00060   return background_corner_.GetPointer();
00061 }
00062 
00063 
00064 }
00065 }