/usr/include/ibus-1.0/ibustext.h is in libibus-1.0-dev 1.4.1-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* vim:set et sts=4: */
/* IBus - The Input Bus
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
* Copyright (C) 2008-2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
#error "Only <ibus.h> can be included directly"
#endif
/**
* SECTION: ibustext
* @short_description: Text with decorating information.
* @see_also: #IBusAttribute
*
* An IBusText is the main text object in IBus.
* The text is decorated according to associated IBusAttribute,
* e.g. the foreground/background color, underline, and
* applied scope.
*/
#ifndef __IBUS_TEXT_H_
#define __IBUS_TEXT_H_
#include "ibusserializable.h"
#include "ibusattrlist.h"
/*
* Type macros.
*/
/* define IBusText macros */
#define IBUS_TYPE_TEXT \
(ibus_text_get_type ())
#define IBUS_TEXT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_TEXT, IBusText))
#define IBUS_TEXT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_TEXT, IBusTextClass))
#define IBUS_IS_TEXT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_TEXT))
#define IBUS_IS_TEXT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_TEXT))
#define IBUS_TEXT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_TEXT, IBusTextClass))
G_BEGIN_DECLS
typedef struct _IBusText IBusText;
typedef struct _IBusTextClass IBusTextClass;
/**
* IBusText:
* @is_static: Whether @text is static, i.e., no need and will not be freed. Only TRUE if IBusText is newed from ibus_text_new_from_static_string().
* @text: The string content of IBusText in UTF-8.
* @attrs: Associated IBusAttributes.
*
* A text object in IBus.
*/
struct _IBusText {
IBusSerializable parent;
/* members */
/*< public >*/
gboolean is_static;
gchar *text;
IBusAttrList *attrs;
};
struct _IBusTextClass {
IBusSerializableClass parent;
};
GType ibus_text_get_type (void);
/**
* ibus_text_new_from_string:
* @str: An text string to be set.
* @returns: A newly allocated IBusText.
*
* New an IBusText from a string.
*
* @str will be duplicated in IBusText, so feel free to free @str after this function.
*/
IBusText *ibus_text_new_from_string (const gchar *str);
/**
* ibus_text_new_from_ucs4:
* @str: An text string to be set.
* @returns: A newly allocated IBusText.
*
* New an IBusText from an UCS-4 encoded string.
*
* @str will be duplicated in IBusText, so feel free to free @str after this function.
*/
IBusText *ibus_text_new_from_ucs4 (const gunichar *str);
/**
* ibus_text_new_from_static_string: (skip)
* @str: An text string to be set.
* @returns: A newly allocated IBusText.
*
* New an IBusText from a static string.
*
* Since @str is a static string which won't be freed.
* This function will NOT duplicate @str.
*/
IBusText *ibus_text_new_from_static_string (const gchar *str);
/**
* ibus_text_new_from_printf:
* @fmt: printf format string.
* @...: arguments for @fmt.
* @returns: A newly allocated IBusText.
*
* New an IBusText from a printf expression.
*
* The result of printf expression is stored in the new IBusText instance.
*/
IBusText *ibus_text_new_from_printf (const gchar *fmt,
...) G_GNUC_PRINTF (1, 2);
/**
* ibus_text_new_from_unichar:
* @c: A single UCS4-encoded character.
* @returns: A newly allocated IBusText.
*
* New an IBusText from a single UCS4-encoded character.
*/
IBusText *ibus_text_new_from_unichar (gunichar c);
/**
* ibus_text_append_attribute:
* @text: an IBusText
* @type: IBusAttributeType for @text.
* @value: Value for the type.
* @start_index: The starting index, inclusive.
* @end_index: The ending index, exclusive.
*
* Append an IBusAttribute for IBusText.
*/
void ibus_text_append_attribute (IBusText *text,
guint type,
guint value,
guint start_index,
gint end_index);
/**
* ibus_text_get_length:
* @text: An IBusText.
* @returns: Number of character in @text, not counted by bytes.
*
* Return number of characters in an IBusText.
* This function is based on g_utf8_strlen(), so unlike strlen(),
* it does not count by bytes but characters instead.
*/
guint ibus_text_get_length (IBusText *text);
/**
* ibus_text_get_is_static: (skip)
* @text: An IBusText.
* @returns: the is_static in @text.
*
* Return the is_static in an IBusText.
*/
gboolean ibus_text_get_is_static (IBusText *text);
/**
* ibus_text_get_text:
* @text: An IBusText.
* @returns: the text in @text.
*
* Return the text in an IBusText. Should not be freed.
*/
const gchar * ibus_text_get_text (IBusText *text);
/**
* ibus_text_get_attributes:
* @text: An IBusText.
* @returns: (transfer none): the attrs in @text.
*
* Return the attributes in an IBusText. Should not be freed.
*/
IBusAttrList * ibus_text_get_attributes (IBusText *text);
/**
* ibus_text_set_attributes:
* @text: An IBusText.
* @attrs: An IBusAttrList
*/
void ibus_text_set_attributes (IBusText *text,
IBusAttrList *attrs);
G_END_DECLS
#endif
|