From 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 10:29:19 -0400 Subject: Prefer GLib basic types over C types. --- widgets/text/a11y/gal-a11y-e-text.c | 68 +++++++-------- widgets/text/e-reflow-model.c | 24 +++--- widgets/text/e-reflow-model.h | 44 +++++----- widgets/text/e-reflow.c | 120 +++++++++++++-------------- widgets/text/e-reflow.h | 18 ++-- widgets/text/e-text-model.c | 14 ++-- widgets/text/e-text-model.h | 2 +- widgets/text/e-text.c | 160 ++++++++++++++++++------------------ widgets/text/e-text.h | 28 +++---- 9 files changed, 239 insertions(+), 239 deletions(-) (limited to 'widgets/text') diff --git a/widgets/text/a11y/gal-a11y-e-text.c b/widgets/text/a11y/gal-a11y-e-text.c index 98484949ff..6717f687b0 100644 --- a/widgets/text/a11y/gal-a11y-e-text.c +++ b/widgets/text/a11y/gal-a11y-e-text.c @@ -39,11 +39,11 @@ static AtkComponentIface *component_parent_iface; static GType parent_type; static gint priv_offset; static GQuark quark_accessible_object = 0; -#define GET_PRIVATE(object) ((GalA11yETextPrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETextPrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETextPrivate { - int dummy; + gint dummy; }; static void @@ -66,8 +66,8 @@ et_get_extents (AtkComponent *component, EText *item = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component))); double real_width; double real_height; - int fake_width; - int fake_height; + gint fake_width; + gint fake_height; if (component_parent_iface && component_parent_iface->get_extents) @@ -94,7 +94,7 @@ et_get_full_text (AtkText *text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); ETextModel *model; - const char *full_text; + const gchar *full_text; g_object_get (etext, "model", &model, NULL); @@ -105,7 +105,7 @@ et_get_full_text (AtkText *text) static void et_set_full_text (AtkEditableText *text, - const char *full_text) + const gchar *full_text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); ETextModel *model; @@ -121,7 +121,7 @@ et_get_text (AtkText *text, gint end_offset) { gint start, end, real_start, real_end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); @@ -149,12 +149,12 @@ is_a_seperator (gunichar c) } static gint -find_word_start (const char *text, +find_word_start (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current, previous; gint len; @@ -175,12 +175,12 @@ find_word_start (const char *text, } static gint -find_word_end (const char *text, +find_word_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current, previous; gint len; @@ -201,14 +201,14 @@ find_word_end (const char *text, } static gint -find_sentence_start (const char *text, +find_sentence_start (const gchar *text, gint begin_offset, gint step) { gint offset, last_word_end, len; - char *at_offset; + gchar *at_offset; gunichar ch; - int i; + gint i; offset = find_word_start (text, begin_offset, step); len = g_utf8_strlen (text, -1); @@ -231,12 +231,12 @@ find_sentence_start (const char *text, } static gint -find_sentence_end (const char *text, +find_sentence_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar previous; gint len; @@ -255,12 +255,12 @@ find_sentence_end (const char *text, } static gint -find_line_start (const char *text, +find_line_start (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar previous; gint len; @@ -279,12 +279,12 @@ find_line_start (const char *text, } static gint -find_line_end (const char *text, +find_line_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current; gint len; @@ -310,7 +310,7 @@ et_get_text_after_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -363,7 +363,7 @@ et_get_text_at_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -412,15 +412,15 @@ static gunichar et_get_character_at_offset (AtkText *text, gint offset) { - const char *full_text = et_get_full_text (text); - char *at_offset; + const gchar *full_text = et_get_full_text (text); + gchar *at_offset; at_offset = g_utf8_offset_to_pointer (full_text, offset); return g_utf8_get_char_validated (at_offset, -1); } -static gchar* +static gchar * et_get_text_before_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, @@ -428,7 +428,7 @@ et_get_text_before_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -478,7 +478,7 @@ et_get_caret_offset (AtkText *text) { GObject *obj; EText *etext; - int offset; + gint offset; g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); @@ -588,7 +588,7 @@ et_get_character_extents (AtkText *text, static gint et_get_character_count (AtkText *text) { - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); return g_utf8_strlen (full_text, -1); } @@ -606,8 +606,8 @@ et_get_offset_at_point (AtkText *text, gint x_widget, y_widget, x_window, y_window; GdkWindow *window; GtkWidget *widget; - int index; - int trailing; + gint index; + gint trailing; g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); @@ -670,7 +670,7 @@ et_get_n_selections (AtkText *text) } -static gchar* +static gchar * et_get_selection (AtkText *text, gint selection_num, gint *start_offset, @@ -679,7 +679,7 @@ et_get_selection (AtkText *text, gint start, end, real_start, real_end, len; EText *etext; if (selection_num == 0) { - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); @@ -842,9 +842,9 @@ et_insert_text (AtkEditableText *text, gint *position) { /* Utf8 unimplemented */ - char *result; + gchar *result; - const char *full_text = et_get_full_text (ATK_TEXT (text)); + const gchar *full_text = et_get_full_text (ATK_TEXT (text)); if (full_text == NULL) return; diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index d24b915e6e..2bf5e4990d 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -50,7 +50,7 @@ static guint e_reflow_model_signals [LAST_SIGNAL] = { 0, }; * @width: The new value for the width of each item. */ void -e_reflow_model_set_width (EReflowModel *e_reflow_model, int width) +e_reflow_model_set_width (EReflowModel *e_reflow_model, gint width) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -64,7 +64,7 @@ e_reflow_model_set_width (EReflowModel *e_reflow_model, int width) * * Returns: the number of items in the reflow model. */ -int +gint e_reflow_model_count (EReflowModel *e_reflow_model) { g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -81,8 +81,8 @@ e_reflow_model_count (EReflowModel *e_reflow_model) * * Returns: the height of the nth item. */ -int -e_reflow_model_height (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent) +gint +e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, 0); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0); @@ -101,7 +101,7 @@ e_reflow_model_height (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *pa * Returns: the new GnomeCanvasItem. */ GnomeCanvasItem * -e_reflow_model_incarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent) +e_reflow_model_incarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, NULL); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL); @@ -119,8 +119,8 @@ e_reflow_model_incarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup * * Returns: strcmp like semantics for the comparison value. */ -int -e_reflow_model_compare (EReflowModel *e_reflow_model, int n1, int n2) +gint +e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2) { #if 0 g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -139,7 +139,7 @@ e_reflow_model_compare (EReflowModel *e_reflow_model, int n1, int n2) * Update item to represent the nth piece of data. */ void -e_reflow_model_reincarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasItem *item) +e_reflow_model_reincarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasItem *item) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -219,7 +219,7 @@ e_reflow_model_init (EReflowModel *e_reflow_model) static void print_tabs (void) { - int i; + gint i; for (i = 0; i < depth; i++) g_print("\t"); } @@ -284,7 +284,7 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) * Use this function to notify any views of the reflow model that a number of items have been inserted. **/ void -e_reflow_model_items_inserted (EReflowModel *e_reflow_model, int position, int count) +e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint count) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -308,7 +308,7 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, int position, int c **/ void e_reflow_model_item_removed (EReflowModel *e_reflow_model, - int n) + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -335,7 +335,7 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, * object */ void -e_reflow_model_item_changed (EReflowModel *e_reflow_model, int n) +e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); diff --git a/widgets/text/e-reflow-model.h b/widgets/text/e-reflow-model.h index c772621d07..d606edf8cd 100644 --- a/widgets/text/e-reflow-model.h +++ b/widgets/text/e-reflow-model.h @@ -48,13 +48,13 @@ typedef struct { /* * Virtual methods */ - void (*set_width) (EReflowModel *etm, int width); + void (*set_width) (EReflowModel *etm, gint width); - int (*count) (EReflowModel *etm); - int (*height) (EReflowModel *etm, int n, GnomeCanvasGroup *parent); - GnomeCanvasItem *(*incarnate) (EReflowModel *etm, int n, GnomeCanvasGroup *parent); - int (*compare) (EReflowModel *etm, int n1, int n2); - void (*reincarnate) (EReflowModel *etm, int n, GnomeCanvasItem *item); + gint (*count) (EReflowModel *etm); + gint (*height) (EReflowModel *etm, gint n, GnomeCanvasGroup *parent); + GnomeCanvasItem *(*incarnate) (EReflowModel *etm, gint n, GnomeCanvasGroup *parent); + gint (*compare) (EReflowModel *etm, gint n1, gint n2); + void (*reincarnate) (EReflowModel *etm, gint n, GnomeCanvasItem *item); /* * Signals @@ -68,28 +68,28 @@ typedef struct { */ void (*model_changed) (EReflowModel *etm); void (*comparison_changed) (EReflowModel *etm); - void (*model_items_inserted) (EReflowModel *etm, int position, int count); - void (*model_item_removed) (EReflowModel *etm, int position); - void (*model_item_changed) (EReflowModel *etm, int n); + void (*model_items_inserted) (EReflowModel *etm, gint position, gint count); + void (*model_item_removed) (EReflowModel *etm, gint position); + void (*model_item_changed) (EReflowModel *etm, gint n); } EReflowModelClass; GType e_reflow_model_get_type (void); /**/ void e_reflow_model_set_width (EReflowModel *e_reflow_model, - int width); -int e_reflow_model_count (EReflowModel *e_reflow_model); -int e_reflow_model_height (EReflowModel *e_reflow_model, - int n, + gint width); +gint e_reflow_model_count (EReflowModel *e_reflow_model); +gint e_reflow_model_height (EReflowModel *e_reflow_model, + gint n, GnomeCanvasGroup *parent); GnomeCanvasItem *e_reflow_model_incarnate (EReflowModel *e_reflow_model, - int n, + gint n, GnomeCanvasGroup *parent); -int e_reflow_model_compare (EReflowModel *e_reflow_model, - int n1, - int n2); +gint e_reflow_model_compare (EReflowModel *e_reflow_model, + gint n1, + gint n2); void e_reflow_model_reincarnate (EReflowModel *e_reflow_model, - int n, + gint n, GnomeCanvasItem *item); /* @@ -98,12 +98,12 @@ void e_reflow_model_reincarnate (EReflowModel *e_reflow_mode void e_reflow_model_changed (EReflowModel *e_reflow_model); void e_reflow_model_comparison_changed (EReflowModel *e_reflow_model); void e_reflow_model_items_inserted (EReflowModel *e_reflow_model, - int position, - int count); + gint position, + gint count); void e_reflow_model_item_removed (EReflowModel *e_reflow_model, - int n); + gint n); void e_reflow_model_item_changed (EReflowModel *e_reflow_model, - int n); + gint n); #ifdef __cplusplus } diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 95f3f89bab..e9f7adc2cf 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -41,10 +41,10 @@ static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event); static void e_reflow_realize (GnomeCanvasItem *item); static void e_reflow_unrealize (GnomeCanvasItem *item); static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height); + gint x, gint y, gint width, gint height); static void e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags); -static double e_reflow_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, GnomeCanvasItem **actual_item); -static void e_reflow_reflow (GnomeCanvasItem *item, int flags); +static double e_reflow_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item); +static void e_reflow_reflow (GnomeCanvasItem *item, gint flags); static void set_empty(EReflow *reflow); static void e_reflow_resize_children (GnomeCanvasItem *item); @@ -75,7 +75,7 @@ enum { static guint signals [LAST_SIGNAL] = {0, }; static gint -er_compare (int i1, int i2, gpointer user_data) +er_compare (gint i1, gint i2, gpointer user_data) { EReflow *reflow = user_data; return e_reflow_model_compare (reflow->model, i1, i2); @@ -92,7 +92,7 @@ e_reflow_pick_line (EReflow *reflow, double x) static int er_find_item (EReflow *reflow, GnomeCanvasItem *item) { - int i; + gint i; for (i = 0; i < reflow->count; i++) { if (reflow->items[i] == item) return i; @@ -104,8 +104,8 @@ static void e_reflow_resize_children (GnomeCanvasItem *item) { EReflow *reflow; - int i; - int count; + gint i; + gint count; reflow = E_REFLOW (item); @@ -119,7 +119,7 @@ e_reflow_resize_children (GnomeCanvasItem *item) } static inline void -e_reflow_update_selection_row (EReflow *reflow, int row) +e_reflow_update_selection_row (EReflow *reflow, gint row) { if (reflow->items[row]) { g_object_set(reflow->items[row], @@ -137,8 +137,8 @@ e_reflow_update_selection_row (EReflow *reflow, int row) static void e_reflow_update_selection (EReflow *reflow) { - int i; - int count; + gint i; + gint count; count = reflow->count; for (i = 0; i < count; i++) { @@ -153,7 +153,7 @@ selection_changed (ESelectionModel *selection, EReflow *reflow) } static void -selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow) +selection_row_changed (ESelectionModel *selection, gint row, EReflow *reflow) { e_reflow_update_selection_row (reflow, row); } @@ -161,7 +161,7 @@ selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow) static gboolean do_adjustment (gpointer user_data) { - int row; + gint row; GtkAdjustment *adj ; gfloat value, min_value, max_value; EReflow *reflow = user_data; @@ -195,10 +195,10 @@ do_adjustment (gpointer user_data) } static void -cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow) +cursor_changed (ESelectionModel *selection, gint row, gint col, EReflow *reflow) { - int count = reflow->count; - int old_cursor = reflow->cursor_row; + gint count = reflow->count; + gint old_cursor = reflow->cursor_row; if (old_cursor < count && old_cursor >= 0) { if (reflow->items[old_cursor]) { @@ -233,12 +233,12 @@ cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow) static void incarnate (EReflow *reflow) { - int column_width; - int first_column; - int last_column; - int first_cell; - int last_cell; - int i; + gint column_width; + gint first_column; + gint last_column; + gint first_cell; + gint last_cell; + gint i; GtkAdjustment *adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas)); column_width = reflow->column_width; @@ -261,7 +261,7 @@ incarnate (EReflow *reflow) last_cell = reflow->count; for (i = first_cell; i < last_cell; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (reflow->items[unsorted] == NULL) { if (reflow->model) { reflow->items[unsorted] = e_reflow_model_incarnate (reflow->model, unsorted, GNOME_CANVAS_GROUP (reflow)); @@ -295,10 +295,10 @@ static void reflow_columns (EReflow *reflow) { GSList *list; - int count; - int start; - int i; - int column_count, column_start; + gint count; + gint start; + gint i; + gint column_count, column_start; double running_height; if (reflow->reflow_from_column <= 1) { @@ -321,7 +321,7 @@ reflow_columns (EReflow *reflow) count = reflow->count - start; for (i = start; i < count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (i != 0 && running_height + reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH > reflow->height) { list = g_slist_prepend (list, GINT_TO_POINTER(i)); column_count ++; @@ -350,7 +350,7 @@ reflow_columns (EReflow *reflow) } static void -item_changed (EReflowModel *model, int i, EReflow *reflow) +item_changed (EReflowModel *model, gint i, EReflow *reflow) { if (i < 0 || i >= reflow->count) return; @@ -365,17 +365,17 @@ item_changed (EReflowModel *model, int i, EReflow *reflow) } static void -item_removed (EReflowModel *model, int i, EReflow *reflow) +item_removed (EReflowModel *model, gint i, EReflow *reflow) { - int c; - int sorted; + gint c; + gint sorted; if (i < 0 || i >= reflow->count) return; sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); for (c = reflow->column_count - 1; c >= 0; c--) { - int start_of_column = reflow->columns[c]; + gint start_of_column = reflow->columns[c]; if (start_of_column <= sorted) { if (reflow->reflow_from_column == -1 @@ -407,9 +407,9 @@ item_removed (EReflowModel *model, int i, EReflow *reflow) } static void -items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) +items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) { - int i, oldcount; + gint i, oldcount; if (position < 0 || position > reflow->count) return; @@ -438,11 +438,11 @@ items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) e_sorter_array_set_count (reflow->sorter, reflow->count); for (i = position; i < position + count; i ++) { - int sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); - int c; + gint sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); + gint c; for (c = reflow->column_count - 1; c >= 0; c--) { - int start_of_column = reflow->columns[c]; + gint start_of_column = reflow->columns[c]; if (start_of_column <= sorted) { if (reflow->reflow_from_column == -1 @@ -462,9 +462,9 @@ items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) static void model_changed (EReflowModel *model, EReflow *reflow) { - int i; - int count; - int oldcount; + gint i; + gint count; + gint oldcount; count = reflow->count; oldcount = count; @@ -829,8 +829,8 @@ e_reflow_realize (GnomeCanvasItem *item) { EReflow *reflow; GtkAdjustment *adjustment; - int count; - int i; + gint count; + gint i; reflow = E_REFLOW (item); @@ -897,7 +897,7 @@ static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) { EReflow *reflow; - int return_val = FALSE; + gint return_val = FALSE; reflow = E_REFLOW (item); @@ -910,11 +910,11 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) if (event->key.keyval == GDK_Tab || event->key.keyval == GDK_KP_Tab || event->key.keyval == GDK_ISO_Left_Tab) { - int i; - int count; + gint i; + gint count; count = reflow->count; for (i = 0; i < count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); GnomeCanvasItem *item = reflow->items[unsorted]; EFocus has_focus; if (item) { @@ -1104,12 +1104,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height) + gint x, gint y, gint width, gint height) { - int x_rect, y_rect, width_rect, height_rect; + gint x_rect, y_rect, width_rect, height_rect; gdouble running_width; EReflow *reflow = E_REFLOW(item); - int i; + gint i; double column_width; if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw) @@ -1144,7 +1144,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } if (reflow->column_drag) { - int start_line = e_reflow_pick_line(reflow, + gint start_line = e_reflow_pick_line(reflow, gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value); i = x - start_line * (column_width + E_REFLOW_FULL_GUTTER); running_width = start_line * (column_width + E_REFLOW_FULL_GUTTER); @@ -1216,11 +1216,11 @@ e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gin gnome_canvas_request_redraw(item->canvas, x0, y0, x1, y1); reflow->need_height_update = FALSE; } else if (reflow->need_column_resize) { - int x_rect, y_rect, width_rect, height_rect; - int start_line = e_reflow_pick_line(reflow, + gint x_rect, y_rect, width_rect, height_rect; + gint start_line = e_reflow_pick_line(reflow, gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value); gdouble running_width; - int i; + gint i; double column_width; if ( reflow->previous_temp_column_width != -1 ) { @@ -1262,7 +1262,7 @@ e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gin static double e_reflow_point (GnomeCanvasItem *item, - double x, double y, int cx, int cy, + double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { double distance = 1; @@ -1292,14 +1292,14 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow( GnomeCanvasItem *item, int flags ) +e_reflow_reflow( GnomeCanvasItem *item, gint flags ) { EReflow *reflow = E_REFLOW(item); gdouble old_width; gdouble running_width; gdouble running_height; - int next_column; - int i; + gint next_column; + gint i; if (! (GTK_OBJECT_FLAGS (reflow) & GNOME_CANVAS_ITEM_REALIZED)) return; @@ -1316,7 +1316,7 @@ e_reflow_reflow( GnomeCanvasItem *item, int flags ) next_column = 1; for (i = 0; i < reflow->count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (next_column < reflow->column_count && i == reflow->columns[next_column]) { running_height = E_REFLOW_BORDER_WIDTH; running_width += reflow->column_width + E_REFLOW_FULL_GUTTER; @@ -1340,8 +1340,8 @@ e_reflow_reflow( GnomeCanvasItem *item, int flags ) static int e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) { - int row; - int return_val = TRUE; + gint row; + gint return_val = TRUE; switch (event->type) { case GDK_BUTTON_PRESS: switch (event->button.button) { diff --git a/widgets/text/e-reflow.h b/widgets/text/e-reflow.h index 3ea840d358..89ceb032b1 100644 --- a/widgets/text/e-reflow.h +++ b/widgets/text/e-reflow.h @@ -79,12 +79,12 @@ struct _EReflow guint adjustment_value_changed_id; guint set_scroll_adjustments_id; - int *heights; + gint *heights; GnomeCanvasItem **items; - int count; - int allocated_count; + gint count; + gint allocated_count; - int *columns; + gint *columns; gint column_count; /* Number of columnns */ GnomeCanvasItem *empty_text; @@ -96,8 +96,8 @@ struct _EReflow double column_width; - int incarnate_idle_id; - int do_adjustment_idle_id; + gint incarnate_idle_id; + gint do_adjustment_idle_id; /* These are all for when the column is being dragged. */ gdouble start_x; @@ -105,9 +105,9 @@ struct _EReflow double temp_column_width; double previous_temp_column_width; - int cursor_row; + gint cursor_row; - int reflow_from_column; + gint reflow_from_column; guint column_drag : 1; @@ -127,7 +127,7 @@ struct _EReflowClass { GnomeCanvasGroupClass parent_class; - int (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); + gint (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); void (*column_width_changed) (EReflow *reflow, double width); }; diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index c7462e21a6..1bc2090caa 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -222,10 +222,10 @@ static void e_text_model_real_insert_length (ETextModel *model, gint position, const gchar *text, gint length) { EReposInsertShift repos; - int model_len = e_text_model_real_get_text_length (model); - char *offs; - const char *p; - int byte_length, l; + gint model_len = e_text_model_real_get_text_length (model); + gchar *offs; + const gchar *p; + gint byte_length, l; if (position > model_len) return; @@ -255,9 +255,9 @@ static void e_text_model_real_delete (ETextModel *model, gint position, gint length) { EReposDeleteShift repos; - int byte_position, byte_length; - char *offs, *p; - int l; + gint byte_position, byte_length; + gchar *offs, *p; + gint l; offs = g_utf8_offset_to_pointer (model->priv->text->str, position); byte_position = offs - model->priv->text->str; diff --git a/widgets/text/e-text-model.h b/widgets/text/e-text-model.h index 69c6f0c68e..f16c061610 100644 --- a/widgets/text/e-text-model.h +++ b/widgets/text/e-text-model.h @@ -60,7 +60,7 @@ struct _ETextModelClass { gint (* validate_pos) (ETextModel *model, gint pos); - const char *(* get_text) (ETextModel *model); + const gchar *(* get_text) (ETextModel *model); gint (* get_text_len) (ETextModel *model); void (* set_text) (ETextModel *model, const gchar *text); void (* insert) (ETextModel *model, gint position, const gchar *text); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index b30cf05b0c..d9f599f8a7 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -122,11 +122,11 @@ static void calc_height (EText *text); static gboolean show_pango_rectangle (EText *text, PangoRectangle rect); -static void e_text_do_popup (EText *text, GdkEventButton *button, int position); +static void e_text_do_popup (EText *text, GdkEventButton *button, gint position); static void e_text_update_primary_selection (EText *text); static void e_text_paste (EText *text, GdkAtom selection); -static void e_text_insert(EText *text, const char *string); +static void e_text_insert(EText *text, const gchar *string); static void reset_layout_attrs (EText *text); @@ -139,7 +139,7 @@ static void e_text_editable_do_insert_text (GtkEditable *editable, static void e_text_editable_do_delete_text (GtkEditable *editable, gint start_pos, gint end_pos); -static gchar* e_text_editable_get_chars (GtkEditable *editable, +static gchar * e_text_editable_get_chars (GtkEditable *editable, gint start_pos, gint end_pos); static void e_text_editable_set_selection_bounds (GtkEditable *editable, @@ -341,7 +341,7 @@ static void reset_layout_attrs (EText *text) { PangoAttrList *attrs = NULL; - int object_count; + gint object_count; if (text->layout == NULL) return; @@ -349,13 +349,13 @@ reset_layout_attrs (EText *text) object_count = e_text_model_object_count (text->model); if (text->bold || text->strikeout || object_count > 0) { - int length = 0; - int i; + gint length = 0; + gint i; attrs = pango_attr_list_new (); for (i = 0; i < object_count; i++) { - int start_pos, end_pos; + gint start_pos, end_pos; PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE); e_text_model_get_nth_object_bounds (text->model, i, &start_pos, &end_pos); @@ -442,7 +442,7 @@ reset_layout (EText *text) if (!text->button_down) { PangoRectangle strong_pos, weak_pos; - char *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); pango_layout_get_cursor_pos (text->layout, offs - text->text, &strong_pos, &weak_pos); @@ -597,10 +597,10 @@ static void calc_height (EText *text) { GnomeCanvasItem *item; - int old_height; - int old_width; - int width = 0; - int height = 0; + gint old_height; + gint old_width; + gint width = 0; + gint height = 0; item = GNOME_CANVAS_ITEM (text); @@ -623,7 +623,7 @@ static void calc_ellipsis (EText *text) { /* FIXME: a pango layout per calc_ellipsis sucks */ - int width; + gint width; PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), text->ellipsis ? text->ellipsis : "..."); pango_layout_get_size (layout, &width, NULL); @@ -651,7 +651,7 @@ set_text_gc_foreground (EText *text) /* Sets the stipple pattern for the text */ static void -set_stipple (EText *text, GdkBitmap *stipple, int reconfigure) +set_stipple (EText *text, GdkBitmap *stipple, gint reconfigure) { if (text->stipple && !reconfigure) g_object_unref (text->stipple); @@ -1167,7 +1167,7 @@ e_text_get_property (GObject *object, /* Update handler for the text item */ static void -e_text_reflow (GnomeCanvasItem *item, int flags) +e_text_reflow (GnomeCanvasItem *item, gint flags) { EText *text; @@ -1196,7 +1196,7 @@ e_text_reflow (GnomeCanvasItem *item, int flags) /* Update handler for the text item */ static void -e_text_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +e_text_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { EText *text; double x1, y1, x2, y2; @@ -1293,10 +1293,10 @@ _get_tep(EText *text) } static void -draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRectangle rect) +draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, gint x1, gint y1, PangoRectangle rect) { - int width = rect.width / PANGO_SCALE; - int height = rect.height / PANGO_SCALE; + gint width = rect.width / PANGO_SCALE; + gint height = rect.height / PANGO_SCALE; if (width <= 0) width = 1; if (height <= 0) @@ -1308,16 +1308,16 @@ draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRec static gboolean show_pango_rectangle (EText *text, PangoRectangle rect) { - int x1 = rect.x / PANGO_SCALE; - int x2 = (rect.x + rect.width) / PANGO_SCALE; + gint x1 = rect.x / PANGO_SCALE; + gint x2 = (rect.x + rect.width) / PANGO_SCALE; - int y1 = rect.y / PANGO_SCALE; - int y2 = (rect.y + rect.height) / PANGO_SCALE; + gint y1 = rect.y / PANGO_SCALE; + gint y2 = (rect.y + rect.height) / PANGO_SCALE; - int new_xofs_edit = text->xofs_edit; - int new_yofs_edit = text->yofs_edit; + gint new_xofs_edit = text->xofs_edit; + gint new_yofs_edit = text->yofs_edit; - int clip_width, clip_height; + gint clip_width, clip_height; clip_width = text->clip_width; if (clip_width >= 0 && text->draw_borders) { @@ -1372,11 +1372,11 @@ show_pango_rectangle (EText *text, PangoRectangle rect) /* Draw handler for the text item */ static void e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height) + gint x, gint y, gint width, gint height) { EText *text; GdkRectangle rect, *clip_rect; - int xpos, ypos; + gint xpos, ypos; GdkGC *main_gc; GnomeCanvas *canvas; GtkWidget *widget; @@ -1422,8 +1422,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, } } if (text->draw_button) { - int xoff = item->x1 - x; - int yoff = item->y1 - y; + gint xoff = item->x1 - x; + gint yoff = item->y1 - y; widget = GTK_WIDGET (item->canvas); @@ -1442,8 +1442,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (widget) { GtkButton *button = GTK_BUTTON (widget); GtkShadowType shadow_type; - int thisx, thisy, thisheight, thiswidth; - int default_spacing; + gint thisx, thisy, thisheight, thiswidth; + gint default_spacing; GdkRectangle area; area.x = 0; area.y = 0; @@ -1562,7 +1562,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GdkRegion *clip_region = gdk_region_new (); GdkGC *selection_gc; GdkGC *text_gc; - int start_index, end_index; + gint start_index, end_index; start_index = MIN (text->selection_start, text->selection_end); end_index = MAX (text->selection_start, text->selection_end); @@ -1587,8 +1587,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, PangoLayoutLine *line = pango_layout_iter_get_line (iter); gint n_ranges, i; gint *ranges; - int y0, y1; - int s, e; + gint y0, y1; + gint s, e; if (start_index < line->start_index + line->length && end_index > line->start_index) { @@ -1644,7 +1644,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, } else { if (text->show_cursor) { PangoRectangle strong_pos, weak_pos; - char *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); pango_layout_get_cursor_pos (text->layout, offs - text->text + text->preedit_len, &strong_pos, &weak_pos); draw_pango_rectangle (drawable, main_gc, xpos, ypos, strong_pos); @@ -1666,7 +1666,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, /* Point handler for the text item */ static double e_text_point (GnomeCanvasItem *item, double x, double y, - int cx, int cy, GnomeCanvasItem **actual_item) + gint cx, gint cy, GnomeCanvasItem **actual_item) { EText *text; double clip_width; @@ -1783,8 +1783,8 @@ e_text_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double static gint get_position_from_xy (EText *text, gint x, gint y) { - int index; - int trailing; + gint index; + gint trailing; if (text->draw_borders) { x -= BORDER_INDENT; @@ -1829,8 +1829,8 @@ _blink_scroll_timeout (gpointer data) scroll = TRUE; } if (scroll && text->button_down && text->clip) { - int old_xofs_edit = text->xofs_edit; - int old_yofs_edit = text->yofs_edit; + gint old_xofs_edit = text->xofs_edit; + gint old_yofs_edit = text->yofs_edit; if (text->clip_cwidth >= 0 && text->lastx - text->clip_cx > text->clip_cwidth && @@ -1946,13 +1946,13 @@ _do_tooltip (gpointer data) /* FIXME: need to sort out tooltip stuff. */ EText *text = E_TEXT (data); GtkWidget *canvas; - int i; - int max_width; + gint i; + gint max_width; gboolean cut_off; double i2c[6]; ArtPoint origin = {0, 0}; ArtPoint pixel_origin; - int canvas_x, canvas_y; + gint canvas_x, canvas_y; GnomeCanvasItem *tooltip_text; double tooltip_width; double tooltip_height; @@ -2525,7 +2525,7 @@ e_text_copy_clipboard (EText *text) void e_text_delete_selection(EText *text) { - int sel_start, sel_end; + gint sel_start, sel_end; sel_start = MIN(text->selection_start, text->selection_end); sel_end = MAX(text->selection_start, text->selection_end); @@ -2573,7 +2573,7 @@ primary_get_cb (GtkClipboard *clipboard, gpointer data) { EText *text = E_TEXT (data); - int sel_start, sel_end; + gint sel_start, sel_end; sel_start = MIN(text->selection_start, text->selection_end); sel_end = MAX(text->selection_start, text->selection_end); @@ -2655,7 +2655,7 @@ e_text_paste (EText *text, GdkAtom selection) typedef struct { EText *text; GdkEventButton *button; - int position; + gint position; } PopupClosure; static void @@ -2688,7 +2688,7 @@ popup_targets_received (GtkClipboard *clipboard, PopupClosure *closure = user_data; EText *text = closure->text; GdkEventButton *button = closure->button; - int position = closure->position; + gint position = closure->position; GtkWidget *popup_menu = gtk_menu_new (); GtkWidget *menuitem, *submenu; @@ -2767,7 +2767,7 @@ popup_targets_received (GtkClipboard *clipboard, } static void -e_text_do_popup (EText *text, GdkEventButton *button, int position) +e_text_do_popup (EText *text, GdkEventButton *button, gint position) { PopupClosure *closure = g_new (PopupClosure, 1); @@ -2799,10 +2799,10 @@ e_text_reset_im_context (EText *text) /* fixme: */ static int -next_word (EText *text, int start) +next_word (EText *text, gint start) { - char *p = g_utf8_offset_to_pointer (text->text, start); - int length; + gchar *p = g_utf8_offset_to_pointer (text->text, start); + gint length; length = g_utf8_strlen (text->text, -1); @@ -2828,15 +2828,15 @@ next_word (EText *text, int start) } static int -find_offset_into_line (EText *text, int offset_into_text, char **start_of_line) +find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line) { - char *p; + gchar *p; p = g_utf8_offset_to_pointer (text->text, offset_into_text); if (p == text->text) { if (start_of_line) - *start_of_line = (char*)text->text; + *start_of_line = (gchar *)text->text; return 0; } else { @@ -2852,7 +2852,7 @@ find_offset_into_line (EText *text, int offset_into_text, char **start_of_line) } if (start_of_line) - *start_of_line = (char*)text->text; + *start_of_line = (gchar *)text->text; return offset_into_text; } } @@ -2866,7 +2866,7 @@ _get_updated_position (EText *text, gboolean direction) { PangoLogAttr *log_attrs = NULL; gint n_attrs; - char *p = NULL; + gchar *p = NULL; gint new_pos = 0; gint length = 0; @@ -2889,7 +2889,7 @@ _get_updated_position (EText *text, gboolean direction) /* get layout's PangoLogAttr to facilitate moving when moving across grapheme cluster as in indic langs */ pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs); - /* Fetch the current char index in the line & keep moving + /* Fetch the current gchar index in the line & keep moving forward until we can display cursor */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); @@ -2930,9 +2930,9 @@ _get_updated_position (EText *text, gboolean direction) static int _get_position(EText *text, ETextEventProcessorCommand *command) { - int length, obj_num; + gint length, obj_num; gunichar unival; - char *p = NULL; + gchar *p = NULL; gint new_pos = 0; switch (command->position) { @@ -3020,7 +3020,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) case E_TEP_BACKWARD_WORD: new_pos = 0; if (text->selection_end >= 1) { - int pos = text->selection_end; + gint pos = text->selection_end; p = g_utf8_find_prev_char (text->text, g_utf8_offset_to_pointer (text->text, text->selection_end)); pos --; @@ -3046,7 +3046,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) break; case E_TEP_FORWARD_LINE: { - int offset_into_line; + gint offset_into_line; offset_into_line = find_offset_into_line (text, text->selection_end, NULL); if (offset_into_line == -1) @@ -3077,7 +3077,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) break; } case E_TEP_BACKWARD_LINE: { - int offset_into_line = find_offset_into_line (text, text->selection_end, &p); + gint offset_into_line = find_offset_into_line (text, text->selection_end, &p); if (offset_into_line == -1) return text->selection_end; @@ -3196,22 +3196,22 @@ _get_position(EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert(EText *text, const char *string) +e_text_insert(EText *text, const gchar *string) { - int len = strlen (string); + gint len = strlen (string); if (len > 0) { - int utf8len = 0; + gint utf8len = 0; if (!text->allow_newlines) { - const char *i; - char *new_string = g_malloc (len + 1); - char *j = new_string; + const gchar *i; + gchar *new_string = g_malloc (len + 1); + gchar *j = new_string; for (i = string; *i; i = g_utf8_next_char(i)) { if (*i != '\n') { gunichar c; - int charlen; + gint charlen; c = g_utf8_get_char (i); charlen = g_unichar_to_utf8 (c, j); @@ -3231,16 +3231,16 @@ e_text_insert(EText *text, const char *string) } static void -capitalize (EText *text, int start, int end, ETextEventProcessorCaps type) +capitalize (EText *text, gint start, gint end, ETextEventProcessorCaps type) { gboolean first = TRUE; - const char *p = g_utf8_offset_to_pointer (text->text, start); - const char *text_end = g_utf8_offset_to_pointer (text->text, end); - int utf8len = text_end - p; + const gchar *p = g_utf8_offset_to_pointer (text->text, start); + const gchar *text_end = g_utf8_offset_to_pointer (text->text, end); + gint utf8len = text_end - p; if (utf8len > 0) { - char *new_text = g_new0 (char, utf8len * 6); - char *output = new_text; + gchar *new_text = g_new0 (char, utf8len * 6); + gchar *output = new_text; while (p && *p && p < text_end) { gunichar unival = g_utf8_get_char (p); @@ -3374,8 +3374,8 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp if (text->selection_start == text->selection_end) { capitalize (text, text->selection_start, next_word (text, text->selection_start), command->value); } else { - int selection_start = MIN (text->selection_start, text->selection_end); - int selection_end = MAX (text->selection_start, text->selection_end); + gint selection_start = MIN (text->selection_start, text->selection_end); + gint selection_end = MAX (text->selection_start, text->selection_end); capitalize (text, selection_start, selection_end, command->value); } break; @@ -3397,7 +3397,7 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp we don't we can scrap the loop and just use pango_layout_index_to_pos */ PangoLayoutLine *cur_line = NULL; - int selection_index; + gint selection_index; PangoLayoutIter *iter = pango_layout_get_iter (text->layout); /* check if we are using selection_start or selection_end for moving? */ @@ -3418,7 +3418,7 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp } while (pango_layout_iter_next_line (iter)); if (cur_line) { - int xpos, ypos; + gint xpos, ypos; double clip_width, clip_height; /* gboolean trailing = FALSE; */ PangoRectangle pango_pos; diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h index ebe5817285..f9b838aae3 100644 --- a/widgets/text/e-text.h +++ b/widgets/text/e-text.h @@ -85,7 +85,7 @@ G_BEGIN_DECLS * ellipsis string RW The characters to use as ellipsis. NULL = "...". * line_wrap boolean RW Line wrap when not editing. * break_characters string RW List of characters to optionally break on. - * max_lines int RW Number of lines possible when doing line wrap. + * max_lines gint RW Number of lines possible when doing line wrap. * draw_borders boolean RW Whether to draw borders. * draw_background boolean RW Whether to draw the background. * draw_button boolean RW This makes EText handle being the child of a button properly and highlighting as it should. @@ -112,7 +112,7 @@ struct _EText { gint preedit_len; /* preedit length to display */ gint preedit_pos; /* preedit cursor position */ PangoLayout *layout; - int num_lines; /* Number of lines of text */ + gint num_lines; /* Number of lines of text */ gchar *revert; /* Text to revert to */ @@ -128,26 +128,26 @@ struct _EText { GdkBitmap *stipple; /* Stipple for text */ GdkGC *gc; /* GC for drawing text */ - int cx, cy; /* Top-left canvas coordinates for text */ - int text_cx, text_cy; /* Top-left canvas coordinates for text */ - int clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */ - int clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */ - int max_width; /* Maximum width of text lines */ - int width; /* Rendered text width in pixels */ - int height; /* Rendered text height in pixels */ + gint cx, cy; /* Top-left canvas coordinates for text */ + gint text_cx, text_cy; /* Top-left canvas coordinates for text */ + gint clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */ + gint clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */ + gint max_width; /* Maximum width of text lines */ + gint width; /* Rendered text width in pixels */ + gint height; /* Rendered text height in pixels */ guint32 rgba; /* RGBA color for text */ double affine[6]; /* The item -> canvas affine */ - char *ellipsis; /* The ellipsis characters. NULL = "...". */ + gchar *ellipsis; /* The ellipsis characters. NULL = "...". */ double ellipsis_width; /* The width of the ellipsis. */ - int xofs_edit; /* Offset because of editing */ - int yofs_edit; /* Offset because of editing */ + gint xofs_edit; /* Offset because of editing */ + gint yofs_edit; /* Offset because of editing */ /* This needs to be reworked a bit once we get line wrapping. */ - int selection_start; /* Start of selection IN BYTES */ - int selection_end; /* End of selection IN BYTES */ + gint selection_start; /* Start of selection IN BYTES */ + gint selection_end; /* End of selection IN BYTES */ gboolean select_by_word; /* Current selection is by word */ /* This section is for drag scrolling and blinking cursor. */ -- cgit