GnuCash  5.6-150-g038405b370+
gnc-cell-view.h
1 /*************************************************************************
2  * The following code implements a text view in a custom GtkCellRenderer.
3  *
4  * Copyright (C) 2020 Robert Fewell
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *************************************************************************/
21 
22 #ifndef __GNC_CELL_VIEW_H__
23 #define __GNC_CELL_VIEW_H__
24 
25 #include <pango/pango.h>
26 #include <gtk/gtk.h>
27 
28 #define GNC_TYPE_CELL_VIEW (gnc_cell_view_get_type ())
29 #define GNC_CELL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_CELL_VIEW, GncCellView))
30 #define GNC_CELL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_CELL_VIEW, GncCellViewClass))
31 #define GNC_IS_CELL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_CELL_VIEW))
32 #define GNC_IS_CELL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GNC_TYPE_CELL_VIEW))
33 #define GNC_CELL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_CELL_VIEW, GncCellViewClass))
34 
35 typedef struct _GncCellView GncCellView;
36 typedef struct _GncCellViewClass GncCellViewClass;
37 
39 {
40  GtkEventBox parent;
41 
42  GtkWidget *text_view;
43  GtkTextBuffer *buffer;
44 
45  gulong focus_out_id;
46  gulong populate_popup_id;
47  guint tooltip_id;
48  gboolean in_popup_menu;
49  gboolean editing_canceled;
50 };
51 
53 {
54  GtkEventBoxClass parent_class;
55 };
56 
57 GType gnc_cell_view_get_type (void) G_GNUC_CONST;
58 
59 GtkWidget *gnc_cell_view_new (void);
60 
61 void gnc_cell_view_set_text (GncCellView *cv, const gchar *text);
62 
63 gchar *gnc_cell_view_get_text (GncCellView *cv);
64 
65 #endif /* __GNC_CELL_VIEW_H__ */