2
* Copyright © 2004 Noah Levitt
3
* Copyright © 2007 Christian Persch
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License as published by the
7
* Free Software Foundation; either version 2 of the License, or (at your
8
* option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public License along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 59 Temple Place, Suite 330, Boston, MA 02110-1301 USA
22
#define I_(string) g_intern_static_string (string)
24
/* The last unicode character we support */
25
#define UNICHAR_MAX (0x0010FFFFUL)
27
G_GNUC_INTERNAL void _gucharmap_intl_ensure_initialized (void);
29
G_GNUC_INTERNAL gboolean _gucharmap_unicode_has_nameslist_entry (gunichar uc);
32
struct _GucharmapChaptersModelPrivate {
33
GucharmapCodepointList *book_list;
36
struct _GucharmapChartablePrivate {
37
/* scrollable implementation */
38
GtkAdjustment *vadjustment;
39
gulong vadjustment_changed_handler_id;
42
PangoFontDescription *font_desc;
46
int bare_minimal_column_width; /* depends only on font_desc */
47
int bare_minimal_row_height; /* depends only on font_desc */
48
int minimal_column_width; /* depends on font_desc and size allocation */
49
int minimal_row_height; /* depends on font_desc and size allocation */
50
int n_padded_columns; /* columns 0..n-1 will be 1px wider than minimal_column_width */
51
int n_padded_rows; /* rows 0..n-1 will be 1px taller than minimal_row_height */
54
int page_size; /* rows * cols */
56
int page_first_cell; /* the cell index of the top left corner */
57
int active_cell; /* the active cell index */
58
int old_page_first_cell;
63
PangoLayout *pango_layout;
66
GtkWidget *zoom_window;
67
GtkWidget *zoom_image;
69
/* for dragging (#114534) */
70
gdouble click_x, click_y;
72
GtkTargetList *target_list;
74
GucharmapCodepointList *codepoint_list;
75
int last_cell; /* from gucharmap_codepoint_list_get_last_index */
76
gboolean codepoint_list_changed;
79
guint snap_pow2_enabled : 1;
80
guint zoom_mode_enabled : 1;
83
gint _gucharmap_chartable_cell_column (GucharmapChartable *chartable,
85
gint _gucharmap_chartable_column_width (GucharmapChartable *chartable,
87
gint _gucharmap_chartable_x_offset (GucharmapChartable *chartable,
89
gint _gucharmap_chartable_row_height (GucharmapChartable *chartable,
91
gint _gucharmap_chartable_y_offset (GucharmapChartable *chartable,
93
void _gucharmap_chartable_redraw (GucharmapChartable *chartable,