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#ifndef DT_WIDGETS_DRAWINGAREA_H
24#define DT_WIDGETS_DRAWINGAREA_H
25
26#include <glib-object.h>
27#include <gtk/gtk.h>
28
29G_BEGIN_DECLS
30
31#define DTGTK_TYPE_DRAWING_AREA (dtgtk_drawing_area_get_type())
32#define DTGTK_DRAWING_AREA(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingArea))
34#define DTGTK_IS_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DTGTK_TYPE_DRAWING_AREA))
35#define DTGTK_DRAWING_AREA_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST((klass), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingAreaClass))
37#define DTGTK_IS_DRAWING_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DTGTK_TYPE_DRAWING_AREA))
38#define DTGTK_DRAWING_AREA_GET_CLASS(obj) \
39 (G_TYPE_INSTANCE_GET_CLASS((obj), DTGTK_TYPE_DRAWING_AREA, GtkDarktableDrawingAreaClass))
40
42{
43 GtkDrawingArea area;
44
45 /*
46 * drawing area aspect ratio.
47 * width = as much as possible
48 * height = width * aspect
49 *
50 * e.g. 1 => square
51 * 0.5 => height is 2 times smaller than width
52 * 2 => height is 2 times bigger than width
53 */
54 double aspect;
56
61
63
66
67G_END_DECLS
68
69#endif // DT_WIDGETS_DRAWINGAREA_H
70
71// clang-format off
72// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
73// vim: shiftwidth=2 expandtab tabstop=2 cindent
74// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
75// clang-format on
76
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
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
GtkDrawingAreaClass parent_class
Definition drawingarea.h:59