Adding HiDPI support (WIP)

This commit is contained in:
Hombre
2018-10-25 20:22:33 +02:00
parent c34bd31765
commit 4eb8a8f70c
1213 changed files with 875 additions and 379 deletions

View File

@@ -2,6 +2,7 @@
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
* Copyright (c) 2018 Jean-Christophe FRISCH <natureh.510@gmail.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,26 +17,40 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _RTIMAGE_
#define _RTIMAGE_
#pragma once
#include <gtkmm/image.h>
class Options;
#include "rtscalable.h"
/**
* @brief A derived class of Gtk::Image in order to handle theme-related icon sets.
*/
class RTImage : public Gtk::Image
class RTImage : public Gtk::Image, public RTScalable
{
static double dpiBack; // used to keep track of master dpi change
static int scaleBack; // used to keep track of master scale change
//bool on_configure_event(GdkEventConfigure* configure_event);
protected:
Cairo::RefPtr<Cairo::ImageSurface> surface;
public:
RTImage ();
RTImage (RTImage &other);
RTImage (Glib::RefPtr<Gdk::Pixbuf> &pixbuf);
RTImage (Glib::RefPtr<RTImage> &other);
RTImage (const Glib::ustring& fileName, const Glib::ustring& rtlFileName = Glib::ustring());
void setImage (const Glib::ustring& fileName, const Glib::ustring& rtlFileName = Glib::ustring());
void changeImage (const Glib::ustring& imageName);
static void init();
static void updateImages ();
static void setDPInScale (const double newDPI, const int newScale);
static void setScale (const int newScale);
static Glib::RefPtr<Gdk::Pixbuf> createFromFile (const Glib::ustring& fileName);
static Cairo::RefPtr<Cairo::ImageSurface> createFromPng (const Glib::ustring& fileName);
static Cairo::RefPtr<Cairo::ImageSurface> createFromFile (const Glib::ustring& fileName);
void from(RTImage* other);
void from(Glib::RefPtr<RTImage> other);
};
#endif