summaryrefslogtreecommitdiff
path: root/atspi/atspi-text.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-12-06 20:44:48 -0600
committerFederico Mena Quintero <federico@gnome.org>2022-12-06 20:50:13 -0600
commitb10fcf21b1ef49dd3d6297ac657434ece3b23578 (patch)
treed560f8449f3ae75fea343887dcb6d5f4df7b434c /atspi/atspi-text.c
parentbf4d71a38b970699f63ce7b701e9bf4c9d31f717 (diff)
downloadat-spi2-core-b10fcf21b1ef49dd3d6297ac657434ece3b23578.tar.gz
Reformat all the *.[ch] files with clang-format
I ran this on each directory with C files: clang-format -i *.[ch] "-i" is the in-place option. I also adjusted the order of #includes for some files which failed to build after that: Clang-format reorders blocks of #include directives alphabetically, but they can be grouped and separated by blank lines. If there is a blank line between blocks, like #include "zork.h" #include "bar.h" #include "foo.h" then it will not put zork.h after the other two. The last two header files will be sorted alphabetically. We can adjust the formatting of chunks of code by hand with comments like these: /* clang-format off */ this code { is, formatted, by, hand; } /* clang-format on */ See https://clang.llvm.org/docs/ClangFormat.html for the general manual and https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the style options and the comments described above.
Diffstat (limited to 'atspi/atspi-text.c')
-rw-r--r--atspi/atspi-text.c172
1 files changed, 85 insertions, 87 deletions
diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c
index f85d3f3e..8ef77490 100644
--- a/atspi/atspi-text.c
+++ b/atspi/atspi-text.c
@@ -76,8 +76,7 @@ atspi_text_range_free (AtspiTextRange *range)
g_free (range);
}
-G_DEFINE_BOXED_TYPE (AtspiTextRange, atspi_text_range, atspi_text_range_copy,
- atspi_text_range_free)
+G_DEFINE_BOXED_TYPE (AtspiTextRange, atspi_text_range, atspi_text_range_copy, atspi_text_range_free)
/**
* atspi_text_get_character_count:
@@ -115,9 +114,9 @@ atspi_text_get_character_count (AtspiText *obj, GError **error)
**/
gchar *
atspi_text_get_text (AtspiText *obj,
- gint start_offset,
- gint end_offset,
- GError **error)
+ gint start_offset,
+ gint end_offset,
+ GError **error)
{
gchar *retval = NULL;
dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
@@ -174,10 +173,10 @@ atspi_text_get_caret_offset (AtspiText *obj, GError **error)
**/
GHashTable *
atspi_text_get_attributes (AtspiText *obj,
- gint offset,
- gint *start_offset,
- gint *end_offset,
- GError **error)
+ gint offset,
+ gint *start_offset,
+ gint *end_offset,
+ GError **error)
{
return atspi_text_get_text_attributes (obj, offset, start_offset, end_offset, error);
}
@@ -202,10 +201,10 @@ atspi_text_get_attributes (AtspiText *obj,
**/
GHashTable *
atspi_text_get_text_attributes (AtspiText *obj,
- gint offset,
- gint *start_offset,
- gint *end_offset,
- GError **error)
+ gint offset,
+ gint *start_offset,
+ gint *end_offset,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_int32_t d_start_offset, d_end_offset;
@@ -214,7 +213,7 @@ atspi_text_get_text_attributes (AtspiText *obj,
GHashTable *ret = NULL;
if (obj == NULL)
- return NULL;
+ return NULL;
reply = _atspi_dbus_call_partial (obj, atspi_interface_text, "GetAttributes", error, "i", d_offset);
_ATSPI_DBUS_CHECK_SIG (reply, "a{ss}ii", error, ret)
@@ -242,7 +241,7 @@ atspi_text_get_text_attributes (AtspiText *obj,
* search is based.
* @include_defaults: a #bool that, when set as #FALSE, indicates the call
* should only return those attributes which are explicitly set on the current
- * attribute run, omitting any attributes which are inherited from the
+ * attribute run, omitting any attributes which are inherited from the
* default values.
* @start_offset: (out): a #gint pointer indicating the start of the desired text
* range.
@@ -257,11 +256,11 @@ atspi_text_get_text_attributes (AtspiText *obj,
**/
GHashTable *
atspi_text_get_attribute_run (AtspiText *obj,
- gint offset,
- gboolean include_defaults,
- gint *start_offset,
- gint *end_offset,
- GError **error)
+ gint offset,
+ gboolean include_defaults,
+ gint *start_offset,
+ gint *end_offset,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_int32_t d_start_offset, d_end_offset;
@@ -270,7 +269,7 @@ atspi_text_get_attribute_run (AtspiText *obj,
GHashTable *ret = NULL;
if (obj == NULL)
- return NULL;
+ return NULL;
reply = _atspi_dbus_call_partial (obj, atspi_interface_text,
"GetAttributeRun", error, "ib", d_offset,
@@ -338,7 +337,7 @@ atspi_text_get_text_attribute_value (AtspiText *obj,
g_return_val_if_fail (obj != NULL, NULL);
- _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, (const gchar *)attribute_value, &retval);
+ _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, (const gchar *) attribute_value, &retval);
if (!retval)
retval = g_strdup ("");
@@ -351,7 +350,7 @@ atspi_text_get_text_attribute_value (AtspiText *obj,
* @obj: a pointer to the #AtspiText object to query.
*
* Gets the default attributes applied to an #AtspiText
- * object. The text attributes correspond to CSS attributes
+ * object. The text attributes correspond to CSS attributes
* where possible. The combination of this attribute set and
* the attributes reported by #atspi_text_get_attributes
* describes the entire set of text attributes over a range.
@@ -365,13 +364,12 @@ atspi_text_get_default_attributes (AtspiText *obj, GError **error)
{
DBusMessage *reply;
- g_return_val_if_fail (obj != NULL, NULL);
+ g_return_val_if_fail (obj != NULL, NULL);
reply = _atspi_dbus_call_partial (obj, atspi_interface_text, "GetDefaultAttributes", error, "");
return _atspi_dbus_return_hash_from_message (reply);
}
-
/**
* atspi_text_set_caret_offset:
* @obj: a pointer to the #AtspiText object on which to operate.
@@ -383,8 +381,8 @@ atspi_text_get_default_attributes (AtspiText *obj, GError **error)
**/
gboolean
atspi_text_set_caret_offset (AtspiText *obj,
- gint new_offset,
- GError **error)
+ gint new_offset,
+ GError **error)
{
dbus_int32_t d_new_offset = new_offset;
dbus_bool_t retval = FALSE;
@@ -413,9 +411,9 @@ atspi_text_set_caret_offset (AtspiText *obj,
**/
AtspiTextRange *
atspi_text_get_text_before_offset (AtspiText *obj,
- gint offset,
- AtspiTextBoundaryType type,
- GError **error)
+ gint offset,
+ AtspiTextBoundaryType type,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_uint32_t d_type = type;
@@ -527,9 +525,9 @@ atspi_text_get_string_at_offset (AtspiText *obj,
**/
AtspiTextRange *
atspi_text_get_text_at_offset (AtspiText *obj,
- gint offset,
- AtspiTextBoundaryType type,
- GError **error)
+ gint offset,
+ AtspiTextBoundaryType type,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_uint32_t d_type = type;
@@ -570,9 +568,9 @@ atspi_text_get_text_at_offset (AtspiText *obj,
**/
AtspiTextRange *
atspi_text_get_text_after_offset (AtspiText *obj,
- gint offset,
- AtspiTextBoundaryType type,
- GError **error)
+ gint offset,
+ AtspiTextBoundaryType type,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_uint32_t d_type = type;
@@ -610,8 +608,8 @@ atspi_text_get_text_after_offset (AtspiText *obj,
**/
guint
atspi_text_get_character_at_offset (AtspiText *obj,
- gint offset,
- GError **error)
+ gint offset,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_int32_t retval = -1;
@@ -641,9 +639,9 @@ atspi_text_get_character_at_offset (AtspiText *obj,
**/
AtspiRect *
atspi_text_get_character_extents (AtspiText *obj,
- gint offset,
- AtspiCoordType type,
- GError **error)
+ gint offset,
+ AtspiCoordType type,
+ GError **error)
{
dbus_int32_t d_offset = offset;
dbus_uint32_t d_type = type;
@@ -680,10 +678,10 @@ atspi_text_get_character_extents (AtspiText *obj,
**/
gint
atspi_text_get_offset_at_point (AtspiText *obj,
- gint x,
- gint y,
- AtspiCoordType type,
- GError **error)
+ gint x,
+ gint y,
+ AtspiCoordType type,
+ GError **error)
{
dbus_int32_t d_x = x, d_y = y;
dbus_uint32_t d_type = type;
@@ -716,10 +714,10 @@ atspi_text_get_offset_at_point (AtspiText *obj,
**/
AtspiRect *
atspi_text_get_range_extents (AtspiText *obj,
- gint start_offset,
- gint end_offset,
- AtspiCoordType type,
- GError **error)
+ gint start_offset,
+ gint end_offset,
+ AtspiCoordType type,
+ GError **error)
{
dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
dbus_uint32_t d_type = type;
@@ -762,14 +760,14 @@ atspi_text_get_range_extents (AtspiText *obj,
**/
GArray *
atspi_text_get_bounded_ranges (AtspiText *obj,
- gint x,
- gint y,
- gint width,
- gint height,
- AtspiCoordType type,
- AtspiTextClipType clipTypeX,
- AtspiTextClipType clipTypeY,
- GError **error)
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ AtspiCoordType type,
+ AtspiTextClipType clipTypeX,
+ AtspiTextClipType clipTypeY,
+ GError **error)
{
dbus_int32_t d_x = x, d_y = y, d_width = width, d_height = height;
dbus_uint32_t d_type = type;
@@ -816,8 +814,8 @@ atspi_text_get_n_selections (AtspiText *obj, GError **error)
**/
AtspiRange *
atspi_text_get_selection (AtspiText *obj,
- gint selection_num,
- GError **error)
+ gint selection_num,
+ GError **error)
{
dbus_int32_t d_selection_num = selection_num;
dbus_int32_t d_start_offset, d_end_offset;
@@ -847,8 +845,9 @@ atspi_text_get_selection (AtspiText *obj,
**/
gboolean
atspi_text_add_selection (AtspiText *obj,
- gint start_offset, gint end_offset,
- GError **error)
+ gint start_offset,
+ gint end_offset,
+ GError **error)
{
dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
dbus_bool_t retval = FALSE;
@@ -869,8 +868,8 @@ atspi_text_add_selection (AtspiText *obj,
**/
gboolean
atspi_text_remove_selection (AtspiText *obj,
- gint selection_num,
- GError **error)
+ gint selection_num,
+ GError **error)
{
dbus_int32_t d_selection_num = selection_num;
dbus_bool_t retval = FALSE;
@@ -896,10 +895,10 @@ atspi_text_remove_selection (AtspiText *obj,
**/
gboolean
atspi_text_set_selection (AtspiText *obj,
- gint selection_num,
- gint start_offset,
- gint end_offset,
- GError **error)
+ gint selection_num,
+ gint start_offset,
+ gint end_offset,
+ GError **error)
{
dbus_int32_t d_selection_num = selection_num, d_start_offset = start_offset, d_end_offset = end_offset;
dbus_bool_t retval = FALSE;
@@ -926,10 +925,10 @@ atspi_text_set_selection (AtspiText *obj,
**/
gboolean
atspi_text_scroll_substring_to (AtspiText *obj,
- gint start_offset,
- gint end_offset,
- AtspiScrollType type,
- GError **error)
+ gint start_offset,
+ gint end_offset,
+ AtspiScrollType type,
+ GError **error)
{
dbus_bool_t retval = FALSE;
@@ -959,12 +958,12 @@ atspi_text_scroll_substring_to (AtspiText *obj,
**/
gboolean
atspi_text_scroll_substring_to_point (AtspiText *obj,
- gint start_offset,
- gint end_offset,
- AtspiCoordType coords,
- gint x,
- gint y,
- GError **error)
+ gint start_offset,
+ gint end_offset,
+ AtspiCoordType coords,
+ gint x,
+ gint y,
+ GError **error)
{
dbus_bool_t retval = FALSE;
@@ -987,16 +986,15 @@ atspi_text_get_type (void)
{
static GType type = 0;
- if (!type) {
- static const GTypeInfo tinfo =
+ if (!type)
{
- sizeof (AtspiText),
- (GBaseInitFunc) atspi_text_base_init,
- (GBaseFinalizeFunc) NULL,
- };
-
- type = g_type_register_static (G_TYPE_INTERFACE, "AtspiText", &tinfo, 0);
-
- }
+ static const GTypeInfo tinfo = {
+ sizeof (AtspiText),
+ (GBaseInitFunc) atspi_text_base_init,
+ (GBaseFinalizeFunc) NULL,
+ };
+
+ type = g_type_register_static (G_TYPE_INTERFACE, "AtspiText", &tinfo, 0);
+ }
return type;
}