Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
drawingarea.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2014-2015 Roman Lebedev.
4 Copyright (C) 2016 johannes hanika.
5 Copyright (C) 2016 Tobias Ellinghaus.
6 Copyright (C) 2020 Pascal Obry.
7 Copyright (C) 2022 Martin Baƙinka.
8
9 darktable is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 darktable is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with darktable. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#pragma once
24
25#include <glib-object.h>
26#include <gtk/gtk.h>
27
28G_BEGIN_DECLS
29
30#define DTGTK_TYPE_DRAWING_AREA (dtgtk_drawing_area_get_type())
31#define DTGTK_DRAWING_AREA(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST((obj), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingArea))
33#define DTGTK_IS_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DTGTK_TYPE_DRAWING_AREA))
34#define DTGTK_DRAWING_AREA_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingAreaClass))
36#define DTGTK_IS_DRAWING_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DTGTK_TYPE_DRAWING_AREA))
37#define DTGTK_DRAWING_AREA_GET_CLASS(obj) \
38 (G_TYPE_INSTANCE_GET_CLASS((obj), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingAreaClass))
39
41{
42 GtkDrawingArea area;
43
44 /*
45 * drawing area aspect ratio.
46 * width = as much as possible
47 * height = width * aspect
48 *
49 * e.g. 1 => square
50 * 0.5 => height is 2 times smaller than width
51 * 2 => height is 2 times bigger than width
52 */
53 double aspect;
55
60
62
65
66G_END_DECLS
67
68// clang-format off
69// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
70// vim: shiftwidth=2 expandtab tabstop=2 cindent
71// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
72// clang-format on
73
void dtgtk_drawing_area_set_aspect_ratio(GtkWidget *w, double aspect)
Definition drawingarea.c:63
struct _GtkDarktableDrawingAreaClass GtkDarktableDrawingAreaClass
GtkWidget * dtgtk_drawing_area_new_with_aspect_ratio(double aspect)
Definition drawingarea.c:54
GType dtgtk_drawing_area_get_type(void)
struct _GtkDarktableDrawingArea GtkDarktableDrawingArea
struct _GtkWidget GtkWidget
Definition splash.h:29
Definition drawingarea.h:57
GtkDrawingAreaClass parent_class
Definition drawingarea.h:58
Definition drawingarea.h:41
double aspect
Definition drawingarea.h:53
GtkDrawingArea area
Definition drawingarea.h:42