[dia] text: const correctness
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] text: const correctness
- Date: Wed, 3 Oct 2012 20:03:52 +0000 (UTC)
commit 7a61f29fc5a4c202321c3aae6c1300c47956621c
Author: Hans Breuer <hans breuer org>
Date: Tue Oct 2 21:11:42 2012 +0200
text: const correctness
lib/text.c | 10 +++++-----
lib/text.h | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/lib/text.c b/lib/text.c
index 1f04a63..00f5d2c 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -70,7 +70,7 @@ struct TextObjectChange {
/* *** Encapsulation functions for transferring to text_line *** */
gchar *
-text_get_line(Text *text, int line)
+text_get_line(const Text *text, int line)
{
return text_line_get_string(text->lines[line]);
}
@@ -130,7 +130,7 @@ text_insert_line(Text *text, int line_no)
* @returns The width in cm of the indicated line.
*/
real
-text_get_line_width(Text *text, int line_no)
+text_get_line_width(const Text *text, int line_no)
{
return text_line_get_width(text->lines[line_no]);
}
@@ -141,7 +141,7 @@ text_get_line_width(Text *text, int line_no)
* @returns The number of UTF-8 characters of the indicated line.
*/
int
-text_get_line_strlen(Text *text, int line_no)
+text_get_line_strlen(const Text *text, int line_no)
{
return g_utf8_strlen(text_line_get_string(text->lines[line_no]), -1);
}
@@ -475,7 +475,7 @@ text_calc_boundingbox(Text *text, Rectangle *box)
}
char *
-text_get_string_copy(Text *text)
+text_get_string_copy(const Text *text)
{
int num,i;
char *str;
@@ -1038,7 +1038,7 @@ text_key_event(Focus *focus,
return return_val;
}
-int text_is_empty(Text *text)
+int text_is_empty(const Text *text)
{
int i;
for (i = 0; i < text->numlines; i++) {
diff --git a/lib/text.h b/lib/text.h
index 0368a8d..c9386be 100644
--- a/lib/text.h
+++ b/lib/text.h
@@ -73,8 +73,8 @@ Text *new_text(const char *string, DiaFont *font, real height,
Text *new_text_default(Point *pos, Color *color, Alignment align);
void text_destroy(Text *text);
Text *text_copy(Text *text);
-gchar *text_get_line(Text *text, int line);
-char *text_get_string_copy(Text *text);
+gchar *text_get_line(const Text *text, int line);
+char *text_get_string_copy(const Text *text);
void text_set_string(Text *text, const char *string);
void text_set_height(Text *text, real height);
void text_set_font(Text *text, DiaFont *font);
@@ -88,13 +88,13 @@ void text_set_cursor(Text *text, Point *clicked_point,
DiaRenderer *interactive_renderer);
void text_set_cursor_at_end( Text* text );
void text_grab_focus(Text *text, DiaObject *object);
-int text_is_empty(Text *text);
+int text_is_empty(const Text *text);
int text_delete_all(Text *text, ObjectChange **change, DiaObject *obj);
void text_get_attributes(Text *text, TextAttributes *attr);
void text_set_attributes(Text *text, TextAttributes *attr);
-real text_get_line_width(Text *text, int line_no);
-int text_get_line_strlen(Text *text, int line_no);
+real text_get_line_width(const Text *text, int line_no);
+int text_get_line_strlen(const Text *text, int line_no);
real text_get_max_width(Text *text);
real text_get_ascent(Text *text);
real text_get_descent(Text *text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]