/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* mazen-ng
* Copyright (C) Jacob Zimmermann 2009 <jacob@jzimm.net>
*
* mazen-ng is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mazen-ng 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 <http://www.gnu.org/licenses/>.
*/
#pragma implementation
#include "util.h"
#include "config.h"
#include <glibmm.h>
using namespace std;
using namespace Glib;
// On Windows, always look for resources in the current directory
#ifdef G_OS_WIN32
#define RSC_USE_LOCAL_DIR
#endif // G_OS_WIN32
#ifdef RSC_USE_LOCAL_DIR
static const string top_dir = build_filename ("share", "mazen");
#else
static const string top_dir = DATA_DIR;
#endif // RSC_USE_LOCAL_DIR
namespace Resources {
string get_ui_path () {
return build_filename (top_dir, "mazen.ui");
}
string get_logo_path () {
return build_filename (top_dir, "mazen.png");
}
string get_svg_path (const string& svgfile) {
return build_filename (top_dir, svgfile);
}
};
void set_line_width (Cairo::RefPtr<Cairo::Context> cr, double width) {
double dummy = 0;
cr->device_to_user_distance (width, dummy);
cr->set_line_width (width);
}