summaryrefslogtreecommitdiff
path: root/gtk/gtkinscription.h
blob: 164d05991ababd0424d4ab8335b4a60179557d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 * Copyright © 2022 Benjamin Otte
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Benjamin Otte <otte@gnome.org>
 */

#ifndef __GTK_INSCRIPTION_H__
#define __GTK_INSCRIPTION_H__

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkwidget.h>

G_BEGIN_DECLS

#define GTK_TYPE_INSCRIPTION         (gtk_inscription_get_type ())

/**
 * GtkInscriptionOverflow:
 * @GTK_INSCRIPTION_OVERFLOW_CLIP: Clip the remaining text
 * @GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START: Omit characters at the start of the text
 * @GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE: Omit characters at the middle of the text
 * @GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END: Omit characters at the end of the text
 *
 * The different methods to handle text in #GtkInscription when it doesn't
 * fit the available space.
 *
 * Since: 4.8
 */
typedef enum {
  GTK_INSCRIPTION_OVERFLOW_CLIP,
  GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START,
  GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE,
  GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END
} GtkInscriptionOverflow;

GDK_AVAILABLE_IN_4_8
G_DECLARE_FINAL_TYPE (GtkInscription, gtk_inscription, GTK, INSCRIPTION, GtkWidget)

GDK_AVAILABLE_IN_4_8
GtkWidget *             gtk_inscription_new                     (const char             *text);

GDK_AVAILABLE_IN_4_8
const char *            gtk_inscription_get_text                (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_text                (GtkInscription         *self,
                                                                 const char             *text);
GDK_AVAILABLE_IN_4_8
PangoAttrList *         gtk_inscription_get_attributes          (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_attributes          (GtkInscription         *self,
                                                                 PangoAttrList          *attrs);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_markup              (GtkInscription         *self,
                                                                 const char             *markup);
GDK_AVAILABLE_IN_4_8
GtkInscriptionOverflow  gtk_inscription_get_text_overflow       (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_text_overflow       (GtkInscription         *self,
                                                                 GtkInscriptionOverflow  overflow);
GDK_AVAILABLE_IN_4_8
PangoWrapMode           gtk_inscription_get_wrap_mode           (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_wrap_mode           (GtkInscription         *self,
                                                                 PangoWrapMode           wrap_mode);

GDK_AVAILABLE_IN_4_8
guint                   gtk_inscription_get_min_chars           (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_min_chars           (GtkInscription         *self,
                                                                 guint                   min_chars);
GDK_AVAILABLE_IN_4_8
guint                   gtk_inscription_get_nat_chars           (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_nat_chars           (GtkInscription         *self,
                                                                 guint                   nat_chars);
GDK_AVAILABLE_IN_4_8
guint                   gtk_inscription_get_min_lines           (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_min_lines           (GtkInscription         *self,
                                                                 guint                   min_lines);
GDK_AVAILABLE_IN_4_8
guint                   gtk_inscription_get_nat_lines           (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_nat_lines           (GtkInscription         *self,
                                                                 guint                   nat_lines);

GDK_AVAILABLE_IN_4_8
float                   gtk_inscription_get_xalign              (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_xalign              (GtkInscription         *self,
                                                                 float                   xalign);
GDK_AVAILABLE_IN_4_8
float                   gtk_inscription_get_yalign              (GtkInscription         *self);
GDK_AVAILABLE_IN_4_8
void                    gtk_inscription_set_yalign              (GtkInscription         *self,
                                                                 float                   yalign);

G_END_DECLS

#endif  /* __GTK_INSCRIPTION_H__ */