| 1 | /* Pango |
| 2 | * pango-tabs.h: Tab-related stuff |
| 3 | * |
| 4 | * Copyright (C) 2000 Red Hat Software |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library 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 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; 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 __PANGO_TABS_H__ |
| 23 | #define __PANGO_TABS_H__ |
| 24 | |
| 25 | #include <pango/pango-types.h> |
| 26 | |
| 27 | G_BEGIN_DECLS |
| 28 | |
| 29 | typedef struct _PangoTabArray PangoTabArray; |
| 30 | |
| 31 | /** |
| 32 | * PangoTabAlign: |
| 33 | * @PANGO_TAB_LEFT: the text appears to the right of the tab stop position |
| 34 | * @PANGO_TAB_RIGHT: the text appears to the left of the tab stop position |
| 35 | * until the available space is filled. Since: 1.50 |
| 36 | * @PANGO_TAB_CENTER: the text is centered at the tab stop position |
| 37 | * until the available space is filled. Since: 1.50 |
| 38 | * @PANGO_TAB_DECIMAL: text before the first occurrence of the decimal point |
| 39 | * character appears to the left of the tab stop position (until the available |
| 40 | * space is filled), the rest to the right. Since: 1.50 |
| 41 | * |
| 42 | * `PangoTabAlign` specifies where the text appears relative to the tab stop |
| 43 | * position. |
| 44 | */ |
| 45 | typedef enum |
| 46 | { |
| 47 | PANGO_TAB_LEFT, |
| 48 | PANGO_TAB_RIGHT, |
| 49 | PANGO_TAB_CENTER, |
| 50 | PANGO_TAB_DECIMAL |
| 51 | } PangoTabAlign; |
| 52 | |
| 53 | #define PANGO_TYPE_TAB_ARRAY (pango_tab_array_get_type ()) |
| 54 | |
| 55 | PANGO_AVAILABLE_IN_ALL |
| 56 | PangoTabArray *pango_tab_array_new (gint initial_size, |
| 57 | gboolean positions_in_pixels); |
| 58 | PANGO_AVAILABLE_IN_ALL |
| 59 | PangoTabArray *pango_tab_array_new_with_positions (gint size, |
| 60 | gboolean positions_in_pixels, |
| 61 | PangoTabAlign first_alignment, |
| 62 | gint first_position, |
| 63 | ...); |
| 64 | PANGO_AVAILABLE_IN_ALL |
| 65 | GType pango_tab_array_get_type (void) G_GNUC_CONST; |
| 66 | PANGO_AVAILABLE_IN_ALL |
| 67 | PangoTabArray *pango_tab_array_copy (PangoTabArray *src); |
| 68 | PANGO_AVAILABLE_IN_ALL |
| 69 | void pango_tab_array_free (PangoTabArray *tab_array); |
| 70 | PANGO_AVAILABLE_IN_ALL |
| 71 | gint pango_tab_array_get_size (PangoTabArray *tab_array); |
| 72 | PANGO_AVAILABLE_IN_ALL |
| 73 | void pango_tab_array_resize (PangoTabArray *tab_array, |
| 74 | gint new_size); |
| 75 | PANGO_AVAILABLE_IN_ALL |
| 76 | void pango_tab_array_set_tab (PangoTabArray *tab_array, |
| 77 | gint tab_index, |
| 78 | PangoTabAlign alignment, |
| 79 | gint location); |
| 80 | PANGO_AVAILABLE_IN_ALL |
| 81 | void pango_tab_array_get_tab (PangoTabArray *tab_array, |
| 82 | gint tab_index, |
| 83 | PangoTabAlign *alignment, |
| 84 | gint *location); |
| 85 | PANGO_AVAILABLE_IN_ALL |
| 86 | void pango_tab_array_get_tabs (PangoTabArray *tab_array, |
| 87 | PangoTabAlign **alignments, |
| 88 | gint **locations); |
| 89 | |
| 90 | PANGO_AVAILABLE_IN_ALL |
| 91 | gboolean pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array); |
| 92 | |
| 93 | PANGO_AVAILABLE_IN_1_50 |
| 94 | void pango_tab_array_set_positions_in_pixels (PangoTabArray *tab_array, |
| 95 | gboolean positions_in_pixels); |
| 96 | |
| 97 | PANGO_AVAILABLE_IN_1_50 |
| 98 | char * pango_tab_array_to_string (PangoTabArray *tab_array); |
| 99 | PANGO_AVAILABLE_IN_1_50 |
| 100 | PangoTabArray * pango_tab_array_from_string (const char *text); |
| 101 | |
| 102 | PANGO_AVAILABLE_IN_1_50 |
| 103 | void pango_tab_array_set_decimal_point (PangoTabArray *tab_array, |
| 104 | int tab_index, |
| 105 | gunichar decimal_point); |
| 106 | PANGO_AVAILABLE_IN_1_50 |
| 107 | gunichar pango_tab_array_get_decimal_point (PangoTabArray *tab_array, |
| 108 | int tab_index); |
| 109 | |
| 110 | PANGO_AVAILABLE_IN_1_50 |
| 111 | void pango_tab_array_sort (PangoTabArray *tab_array); |
| 112 | |
| 113 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoTabArray, pango_tab_array_free) |
| 114 | |
| 115 | G_END_DECLS |
| 116 | |
| 117 | #endif /* __PANGO_TABS_H__ */ |
| 118 | |