2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-08 18:45:14 +00:00

Get scale factor from GTK on Linux

This commit is contained in:
Ilya Fedin
2021-01-23 04:22:40 +04:00
committed by John Preston
parent 89ccc95023
commit 3967052375
4 changed files with 50 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ extern "C" {
#endif // !LINK_TO_GTK
// To be able to compile with gtk-2.0 headers as well
#define GdkMonitor GdkScreen
typedef struct _GtkAppChooser GtkAppChooser;
namespace Platform {
@@ -147,6 +148,9 @@ inline bool g_type_cit_helper(Object *instance, GType iface_type) {
inline gint (*gtk_dialog_run)(GtkDialog *dialog) = nullptr;
inline GdkAtom (*gdk_atom_intern)(const gchar *atom_name, gboolean only_if_exists) = nullptr;
inline GdkDisplay* (*gdk_display_get_default)(void) = nullptr;
inline GdkMonitor* (*gdk_display_get_primary_monitor)(GdkDisplay *display) = nullptr;
inline int (*gdk_monitor_get_scale_factor)(GdkMonitor *monitor) = nullptr;
inline GdkPixbuf* (*gdk_pixbuf_new_from_file_at_size)(const gchar *filename, int width, int height, GError **error) = nullptr;
inline gboolean (*gdk_pixbuf_get_has_alpha)(const GdkPixbuf *pixbuf) = nullptr;
inline guchar* (*gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf) = nullptr;