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