pango-tabs.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #ifndef __PANGO_TABS_H__
  22. #define __PANGO_TABS_H__
  23. #include <pango/pango-types.h>
  24. G_BEGIN_DECLS
  25. typedef struct _PangoTabArray PangoTabArray;
  26. /**
  27. * PangoTabAlign:
  28. * @PANGO_TAB_LEFT: the text appears to the right of the tab stop position
  29. * @PANGO_TAB_RIGHT: the text appears to the left of the tab stop position
  30. * until the available space is filled. Since: 1.50
  31. * @PANGO_TAB_CENTER: the text is centered at the tab stop position
  32. * until the available space is filled. Since: 1.50
  33. * @PANGO_TAB_DECIMAL: text before the first occurrence of the decimal point
  34. * character appears to the left of the tab stop position (until the available
  35. * space is filled), the rest to the right. Since: 1.50
  36. *
  37. * `PangoTabAlign` specifies where the text appears relative to the tab stop
  38. * position.
  39. */
  40. typedef enum
  41. {
  42. PANGO_TAB_LEFT,
  43. PANGO_TAB_RIGHT,
  44. PANGO_TAB_CENTER,
  45. PANGO_TAB_DECIMAL
  46. } PangoTabAlign;
  47. #define PANGO_TYPE_TAB_ARRAY (pango_tab_array_get_type ())
  48. PANGO_AVAILABLE_IN_ALL
  49. PangoTabArray *pango_tab_array_new (gint initial_size,
  50. gboolean positions_in_pixels);
  51. PANGO_AVAILABLE_IN_ALL
  52. PangoTabArray *pango_tab_array_new_with_positions (gint size,
  53. gboolean positions_in_pixels,
  54. PangoTabAlign first_alignment,
  55. gint first_position,
  56. ...);
  57. PANGO_AVAILABLE_IN_ALL
  58. GType pango_tab_array_get_type (void) G_GNUC_CONST;
  59. PANGO_AVAILABLE_IN_ALL
  60. PangoTabArray *pango_tab_array_copy (PangoTabArray *src);
  61. PANGO_AVAILABLE_IN_ALL
  62. void pango_tab_array_free (PangoTabArray *tab_array);
  63. PANGO_AVAILABLE_IN_ALL
  64. gint pango_tab_array_get_size (PangoTabArray *tab_array);
  65. PANGO_AVAILABLE_IN_ALL
  66. void pango_tab_array_resize (PangoTabArray *tab_array,
  67. gint new_size);
  68. PANGO_AVAILABLE_IN_ALL
  69. void pango_tab_array_set_tab (PangoTabArray *tab_array,
  70. gint tab_index,
  71. PangoTabAlign alignment,
  72. gint location);
  73. PANGO_AVAILABLE_IN_ALL
  74. void pango_tab_array_get_tab (PangoTabArray *tab_array,
  75. gint tab_index,
  76. PangoTabAlign *alignment,
  77. gint *location);
  78. PANGO_AVAILABLE_IN_ALL
  79. void pango_tab_array_get_tabs (PangoTabArray *tab_array,
  80. PangoTabAlign **alignments,
  81. gint **locations);
  82. PANGO_AVAILABLE_IN_ALL
  83. gboolean pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array);
  84. PANGO_AVAILABLE_IN_1_50
  85. void pango_tab_array_set_positions_in_pixels (PangoTabArray *tab_array,
  86. gboolean positions_in_pixels);
  87. PANGO_AVAILABLE_IN_1_50
  88. char * pango_tab_array_to_string (PangoTabArray *tab_array);
  89. PANGO_AVAILABLE_IN_1_50
  90. PangoTabArray * pango_tab_array_from_string (const char *text);
  91. PANGO_AVAILABLE_IN_1_50
  92. void pango_tab_array_set_decimal_point (PangoTabArray *tab_array,
  93. int tab_index,
  94. gunichar decimal_point);
  95. PANGO_AVAILABLE_IN_1_50
  96. gunichar pango_tab_array_get_decimal_point (PangoTabArray *tab_array,
  97. int tab_index);
  98. PANGO_AVAILABLE_IN_1_50
  99. void pango_tab_array_sort (PangoTabArray *tab_array);
  100. G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoTabArray, pango_tab_array_free)
  101. G_END_DECLS
  102. #endif /* __PANGO_TABS_H__ */