1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Merge branch 'master' of projects.qi-hardware.com:gmenu2x into install_locations

Conflicts:
	data/platform/nanonote/sections/terminals/ash
	src/gmenu2x.cpp
	src/surface.cpp
This commit is contained in:
Ayla
2011-06-02 12:16:26 +02:00
38 changed files with 509 additions and 654 deletions

View File

@@ -24,12 +24,14 @@
#include "debug.h"
#include "gmenu2x.h"
#include <iostream>
using std::endl;
using std::string;
SurfaceCollection::SurfaceCollection(bool defaultAlpha, const string &skin) {
this->defaultAlpha = defaultAlpha;
setSkin(skin);
SurfaceCollection::SurfaceCollection()
: skin("default")
{
}
SurfaceCollection::~SurfaceCollection() {}
@@ -83,7 +85,7 @@ string SurfaceCollection::getSkinFilePath(const string &skin, const string &file
void SurfaceCollection::debug() {
SurfaceHash::iterator end = surfaces.end();
for(SurfaceHash::iterator curr = surfaces.begin(); curr != end; curr++){
DEBUG("key: %i\n", curr->first);
DEBUG("key: %s\n", curr->first.c_str());
}
}
@@ -97,7 +99,7 @@ Surface *SurfaceCollection::add(Surface *s, const string &path) {
return s;
}
Surface *SurfaceCollection::add(const string &path, bool alpha) {
Surface *SurfaceCollection::add(const string &path) {
DEBUG("Adding surface: '%s'\n", path.c_str());
if (exists(path)) del(path);
@@ -109,12 +111,12 @@ Surface *SurfaceCollection::add(const string &path, bool alpha) {
return NULL;
} else if (!fileExists(filePath)) return NULL;
Surface *s = new Surface(filePath,alpha);
Surface *s = new Surface(filePath);
surfaces[path] = s;
return s;
}
Surface *SurfaceCollection::addSkinRes(const string &path, bool alpha) {
Surface *SurfaceCollection::addSkinRes(const string &path) {
DEBUG("Adding skin surface: '%s'\n", path.c_str());
if (path.empty()) return NULL;
@@ -123,7 +125,7 @@ Surface *SurfaceCollection::addSkinRes(const string &path, bool alpha) {
string skinpath = getSkinFilePath(path);
if (skinpath.empty())
return NULL;
Surface *s = new Surface(skinpath,alpha);
Surface *s = new Surface(skinpath);
if (s != NULL)
surfaces[path] = s;
return s;
@@ -154,7 +156,7 @@ void SurfaceCollection::move(const string &from, const string &to) {
Surface *SurfaceCollection::operator[](const string &key) {
SurfaceHash::iterator i = surfaces.find(key);
if (i == surfaces.end())
return add(key, defaultAlpha);
return add(key);
else
return i->second;
}
@@ -164,7 +166,7 @@ Surface *SurfaceCollection::skinRes(const string &key) {
SurfaceHash::iterator i = surfaces.find(key);
if (i == surfaces.end())
return addSkinRes(key, defaultAlpha);
return addSkinRes(key);
else
return i->second;
}