1 /* 2 A widget to display and manipulate tabular data 3 Copyright (C) 2016, 2020 John Darrington 4 5 This program 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 This program 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 this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef _SSW_SHEET_AXIS_H 20 #define _SSW_SHEET_AXIS_H 21 22 #include <gtk/gtk.h> 23 24 typedef struct 25 { 26 gint position; 27 gint size; 28 } SswGeometry; 29 30 struct _SswSheetAxis 31 { 32 GtkContainer parent_instance; 33 34 gint last_cell; 35 gint first_cell; 36 GPtrArray *cell_limits; 37 }; 38 39 struct _SswSheetAxisClass 40 { 41 GtkContainerClass parent_class; 42 }; 43 44 #define SSW_TYPE_SHEET_AXIS ssw_sheet_axis_get_type () 45 46 G_DECLARE_FINAL_TYPE (SswSheetAxis, ssw_sheet_axis, SSW, SHEET_AXIS, GtkContainer) 47 48 GtkWidget * ssw_sheet_axis_new (GtkOrientation orientation); 49 50 void ssw_sheet_axis_set_model (SswSheetAxis *box, GListModel *model); 51 52 GListModel *ssw_sheet_axis_get_model (SswSheetAxis *box); 53 54 gint ssw_sheet_axis_find_cell (SswSheetAxis *axis, gdouble pos, gint *offset, gint *size); 55 56 gint ssw_sheet_axis_find_boundary (SswSheetAxis *axis, gint pos, gint *offset, gint *size); 57 58 void ssw_sheet_axis_override_size (SswSheetAxis *axis, gint pos, gint size); 59 60 gint ssw_sheet_axis_get_size (SswSheetAxis *axis); 61 gint ssw_sheet_axis_get_extent (SswSheetAxis *axis); 62 63 gint ssw_sheet_axis_get_visible_size (SswSheetAxis *axis); 64 65 void ssw_sheet_axis_jump_start (SswSheetAxis *axis, gint whereto); 66 void ssw_sheet_axis_jump_end (SswSheetAxis *axis, gint whereto); 67 void ssw_sheet_axis_jump_center (SswSheetAxis *axis, gint whereto); 68 69 gint ssw_sheet_axis_get_last (SswSheetAxis *axis); 70 gint ssw_sheet_axis_get_first (SswSheetAxis *axis); 71 72 73 void ssw_sheet_axis_info (SswSheetAxis *axis); 74 75 gboolean ssw_sheet_axis_rtl (SswSheetAxis *axis); 76 77 78 #endif 79