File: gwyappinternal.h

package info (click to toggle)
gwyddion 2.47-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 38,180 kB
  • ctags: 37,276
  • sloc: ansic: 317,531; sh: 5,122; xml: 3,583; python: 3,067; makefile: 2,694; cpp: 2,550; pascal: 418; perl: 154; ruby: 130; sed: 17
file content (237 lines) | stat: -rw-r--r-- 8,042 bytes parent folder | download
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/*
 *  @(#) $Id: gwyappinternal.h 18922 2016-09-05 10:10:23Z yeti-dn $
 *  Copyright (C) 2004-2016 David Necas (Yeti), Petr Klapetek.
 *  E-mail: yeti@gwyddion.net, klapetek@gwyddion.net.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 */

/*< private_header >*/

#ifndef __GWY_APP_INTERNAL_H__
#define __GWY_APP_INTERNAL_H__

#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <libprocess/spectra.h>
#include <libprocess/brick.h>
#include <libgwydgets/gwydatawindow.h>
#include <libgwydgets/gwy3dwindow.h>
#include <libgwydgets/gwygraphwindow.h>
#include <libgwydgets/gwysensitivitygroup.h>

#include <app/gwyappfilechooser.h>
#include <app/data-browser.h>

G_BEGIN_DECLS

/* The GtkTargetEntry for tree model drags.
 * FIXME: Is it Gtk+ private or what? */
#define GTK_TREE_MODEL_ROW \
    { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_APP, 0 }

/* The container prefix all graph reside in.  This is a bit silly but it does
 * not worth to break file compatibility with 1.x. */
#define GRAPH_PREFIX "/0/graph/graph"

/* Thiese are sane and should remain so. */
#define SPECTRA_PREFIX "/sps"
#define BRICK_PREFIX "/brick"
#define SURFACE_PREFIX "/surface"

enum {
    THUMB_SIZE = 60,
    TMS_NORMAL_THUMB_SIZE = 128,
    GWY_NPAGES = GWY_PAGE_XYZS + 1,
};

/* Data types interesting keys can correspond to */
typedef enum {
    KEY_IS_NONE = 0,
    KEY_IS_FILENAME,
    KEY_IS_DATA,
    KEY_IS_DATA_VISIBLE,
    KEY_IS_CHANNEL_META,
    KEY_IS_CHANNEL_LOG,
    KEY_IS_TITLE,
    KEY_IS_SELECT,
    KEY_IS_RANGE_TYPE,
    KEY_IS_RANGE,
    KEY_IS_PALETTE,
    KEY_IS_REAL_SQUARE,
    KEY_IS_DATA_VIEW_SCALE,
    KEY_IS_MASK,
    KEY_IS_MASK_COLOR,
    KEY_IS_SHOW,
    KEY_IS_3D_SETUP,
    KEY_IS_3D_PALETTE,
    KEY_IS_3D_MATERIAL,
    KEY_IS_3D_LABEL,
    KEY_IS_3D_VIEW_SCALE,
    KEY_IS_3D_VIEW_SIZE,
    KEY_IS_CALDATA,
    KEY_IS_GRAPH,
    KEY_IS_GRAPH_VISIBLE,
    KEY_IS_GRAPH_LASTID,
    KEY_IS_GRAPH_VIEW_SCALE,
    KEY_IS_GRAPH_VIEW_SIZE,
    KEY_IS_SPECTRA,
    KEY_IS_SPECTRA_VISIBLE,
    KEY_IS_SPS_REF,
    KEY_IS_BRICK,
    KEY_IS_BRICK_VISIBLE,
    KEY_IS_BRICK_TITLE,
    KEY_IS_BRICK_PREVIEW,
    KEY_IS_BRICK_PREVIEW_PALETTE,
    KEY_IS_BRICK_META,
    KEY_IS_BRICK_LOG,
    KEY_IS_BRICK_VIEW_SCALE,
    KEY_IS_SURFACE,
    KEY_IS_SURFACE_VISIBLE,
    KEY_IS_SURFACE_TITLE,
    KEY_IS_SURFACE_PREVIEW,
    KEY_IS_SURFACE_PREVIEW_PALETTE,
    KEY_IS_SURFACE_META,
    KEY_IS_SURFACE_LOG,
    KEY_IS_SURFACE_VIEW_SCALE,
    KEY_IS_SURFACE_VIEW_SIZE,
} GwyAppKeyType;

typedef struct {
    GLogLevelFlags log_level;
    GQuark log_domain;
    gchar *message;
} GwyAppLogMessage;

/* XXX: Bad name.  Cannot fix it because according to the rules it is now
 * public API. */
void     gwy_app_main_window_set              (GtkWidget *window);

G_GNUC_INTERNAL
gint     _gwy_app_get_n_recent_files          (void);

G_GNUC_INTERNAL
void     _gwy_app_data_window_setup           (GwyDataWindow *data_window);
G_GNUC_INTERNAL
void     _gwy_app_3d_window_setup             (Gwy3DWindow *window3d);
G_GNUC_INTERNAL
gboolean _gwy_app_3d_view_init_setup          (GwyContainer *container,
                                               const gchar *setup_prefix);
G_GNUC_INTERNAL
void     _gwy_app_graph_window_setup          (GwyGraphWindow *graph_window,
                                               GwyContainer *container,
                                               GQuark prefix);
G_GNUC_INTERNAL
void     _gwy_app_brick_window_setup          (GwyDataWindow *data_window);

G_GNUC_INTERNAL
void     _gwy_app_surface_window_setup        (GwyDataWindow *data_window);

G_GNUC_INTERNAL
void     _gwy_app_data_view_set_current       (GwyDataView *data_view);
G_GNUC_INTERNAL
void     _gwy_app_spectra_set_current         (GwySpectra *spectra);

G_GNUC_INTERNAL
GwySensitivityGroup* _gwy_app_sensitivity_get_group(void);

G_GNUC_INTERNAL
GdkPixbuf* _gwy_app_recent_file_try_thumbnail  (const gchar *filename_sys);
G_GNUC_INTERNAL
void       _gwy_app_recent_file_write_thumbnail(const gchar *filename_sys,
                                                GwyContainer *data,
                                                GwyAppPage pageno,
                                                gint id,
                                                GdkPixbuf *pixbuf);

G_GNUC_INTERNAL
gint       _gwy_app_analyse_data_key           (const gchar *strkey,
                                                GwyAppKeyType *type,
                                                guint *len);

G_GNUC_INTERNAL
void              _gwy_app_log_start_message_capture    (void);
G_GNUC_INTERNAL
void              _gwy_app_log_discard_captured_messages(void);
G_GNUC_INTERNAL
GwyAppLogMessage* _gwy_app_log_get_captured_messages    (guint *nmesg);
G_GNUC_INTERNAL
void              _gwy_app_data_browser_add_messages    (GwyContainer *data);
G_GNUC_INTERNAL
GtkTextBuffer*    _gwy_app_log_create_textbuf           (void);
G_GNUC_INTERNAL
void              _gwy_app_log_add_message_to_textbuf   (GtkTextBuffer *textbuf,
                                                         const gchar *message,
                                                         GLogLevelFlags log_level);

/* data-browser-aux functions */
G_GNUC_INTERNAL
void _gwy_app_data_merge_gather(gpointer key,
                                gpointer value,
                                gpointer user_data);
G_GNUC_INTERNAL
void _gwy_app_data_merge_copy_1(gpointer key,
                                gpointer value,
                                gpointer user_data);
G_GNUC_INTERNAL
void _gwy_app_data_merge_copy_2(gpointer key,
                                gpointer value,
                                gpointer user_data);
G_GNUC_INTERNAL
gint* _gwy_app_find_ids_unmanaged(GwyContainer *data,
                                  GwyAppKeyType keytype,
                                  GType gtype);
G_GNUC_INTERNAL
GwyDataField* _gwy_app_create_brick_preview_field  (GwyBrick *brick);
G_GNUC_INTERNAL
void _gwy_app_update_data_range_type(GwyDataView *data_view,
                                     gint id);
G_GNUC_INTERNAL
void _gwy_app_sync_mask(GwyContainer *data,
                        GQuark quark,
                        GwyDataView *data_view);
G_GNUC_INTERNAL
void _gwy_app_sync_show(GwyContainer *data,
                        GQuark quark,
                        GwyDataView *data_view);
G_GNUC_INTERNAL
void _gwy_app_update_channel_sens(void);
G_GNUC_INTERNAL
void _gwy_app_update_graph_sens  (void);
G_GNUC_INTERNAL
void _gwy_app_update_brick_sens  (void);
G_GNUC_INTERNAL
void _gwy_app_update_surface_sens(void);
G_GNUC_INTERNAL
void _gwy_app_update_3d_window_title(Gwy3DWindow *window3d,
                                     gint id);
G_GNUC_INTERNAL
void _gwy_app_update_brick_info(GwyContainer *data,
                                gint id,
                                GwyDataView *data_view);
G_GNUC_INTERNAL
void _gwy_app_update_surface_info(GwyContainer *data,
                                  gint id,
                                  GwyDataView *data_view);
G_GNUC_INTERNAL
gchar* _gwy_app_figure_out_channel_title(GwyContainer *data,
                                         gint channel);

G_END_DECLS

#endif /* __GWY_APP_INTERNAL_H__ */

/* vim: set cin et ts=4 sw=4 cino=>1s,e0,n0,f0,{0,}0,^0,\:1s,=0,g1s,h0,t0,+1s,c3,(0,u0 : */