Commit 244996ff authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

fix indentation

2000-09-29  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation

        * gtk/gtktextview.c: Implement drag thresholding; change functions
	that set border window size to have nicer name
	(gtk_text_view_mark_set_handler):  Fix this to have the
	right signature.

	* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes

	* gtk/testtext.c: Update with API changes, put line numbers on
	both sides.

	* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
	with this

	* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
	pixbuf; delete a big block of #if 0 Tk code

	* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
	insert_pixmap with insert_pixbuf
parent 0415b69e
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
2000-09-29 Havoc Pennington <hp@redhat.com>
* gtk/gtktexttag.c (gtk_text_tag_set_priority): fix indentation
* gtk/gtktextview.c: Implement drag thresholding; change functions
that set border window size to have nicer name
(gtk_text_view_mark_set_handler): Fix this to have the
right signature.
* gtk/testtextbuffer.c (fill_buffer): Update with pixbuf changes
* gtk/testtext.c: Update with API changes, put line numbers on
both sides.
* gtk/gtktextiter.c (gtk_text_iter_get_pixbuf): Replace get_pixmap
with this
* gtk/gtktextchild.h, gtk/gtktextchild.c: replace all pixmap with
pixbuf; delete a big block of #if 0 Tk code
* gtk/gtktextbuffer.c (gtk_text_buffer_insert_pixbuf): Replace
insert_pixmap with insert_pixbuf
2000-09-29 Martin Baulig <baulig@suse.de>
* Makefile.am (pkgconfigdir): Set this to `$(libexecdir)/pkgconfig';
......
......@@ -1043,9 +1043,8 @@ gtk_text_btree_insert (GtkTextIter *iter,
}
void
gtk_text_btree_insert_pixmap (GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask)
gtk_text_btree_insert_pixbuf (GtkTextIter *iter,
GdkPixbuf *pixbuf)
{
GtkTextLineSegment *seg;
GtkTextIter start;
......@@ -1058,7 +1057,7 @@ gtk_text_btree_insert_pixmap (GtkTextIter *iter,
tree = gtk_text_iter_get_btree(iter);
start_byte_offset = gtk_text_iter_get_line_index(iter);
seg = gtk_text_pixmap_segment_new (pixmap, mask);
seg = gtk_text_pixbuf_segment_new (pixbuf);
prevPtr = gtk_text_line_segment_split(iter);
if (prevPtr == NULL)
......@@ -2037,7 +2036,7 @@ copy_segment(GString *string,
/* printf(" :%s\n", string->str); */
}
else if (seg->type == &gtk_text_pixmap_type)
else if (seg->type == &gtk_text_pixbuf_type)
{
gboolean copy = TRUE;
......@@ -3401,7 +3400,7 @@ gtk_text_line_byte_to_char (GtkTextLine *line,
gint
gtk_text_line_char_to_byte (GtkTextLine *line,
gint char_offset)
gint char_offset)
{
g_warning("FIXME not implemented");
}
......
......@@ -31,9 +31,8 @@ void gtk_text_btree_delete (GtkTextIter *start,
void gtk_text_btree_insert (GtkTextIter *iter,
const gchar *text,
gint len);
void gtk_text_btree_insert_pixmap (GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gtk_text_btree_insert_pixbuf (GtkTextIter *iter,
GdkPixbuf *pixbuf);
......
......@@ -787,22 +787,21 @@ gtk_text_buffer_get_slice (GtkTextBuffer *buffer,
*/
void
gtk_text_buffer_insert_pixmap (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask)
gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixbuf *pixbuf)
{
g_return_if_fail(GTK_IS_TEXT_BUFFER(buffer));
g_return_if_fail(iter != NULL);
g_return_if_fail(pixmap != NULL);
gtk_text_btree_insert_pixmap(iter, pixmap, mask);
g_return_if_fail (GTK_IS_TEXT_BUFFER(buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
gtk_text_btree_insert_pixbuf (iter, pixbuf);
/* FIXME pixmap-specific signal like insert_text */
/* FIXME pixbuf-specific signal like insert_text */
gtk_signal_emit(GTK_OBJECT(buffer), signals[CHANGED]);
gtk_signal_emit (GTK_OBJECT(buffer), signals[CHANGED]);
gtk_text_buffer_set_modified(buffer, TRUE);
gtk_text_buffer_set_modified (buffer, TRUE);
}
/*
......@@ -977,6 +976,22 @@ gtk_text_buffer_get_mark (GtkTextBuffer *buffer,
return mark;
}
GtkTextMark*
gtk_text_buffer_get_insert (GtkTextBuffer *buffer)
{
g_return_val_if_fail(GTK_IS_TEXT_BUFFER(buffer), NULL);
return gtk_text_buffer_get_mark (buffer, "insert");
}
GtkTextMark*
gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer)
{
g_return_val_if_fail(GTK_IS_TEXT_BUFFER(buffer), NULL);
return gtk_text_buffer_get_mark (buffer, "selection_bound");
}
/**
* gtk_text_buffer_place_cursor:
* @buffer: a #GtkTextBuffer
......
......@@ -133,11 +133,10 @@ gchar *gtk_text_buffer_get_slice (GtkTextBuffer *buffer,
const GtkTextIter *end,
gboolean include_hidden_chars);
/* Insert a pixmap */
void gtk_text_buffer_insert_pixmap (GtkTextBuffer *buffer,
/* Insert a pixbuf */
void gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask);
GdkPixbuf *pixbuf);
/* Mark manipulation */
GtkTextMark *gtk_text_buffer_create_mark (GtkTextBuffer *buffer,
......@@ -149,9 +148,12 @@ void gtk_text_buffer_move_mark (GtkTextBuffer *buffer,
const GtkTextIter *where);
void gtk_text_buffer_delete_mark (GtkTextBuffer *buffer,
GtkTextMark *mark);
GtkTextMark *gtk_text_buffer_get_mark (GtkTextBuffer *buffer,
GtkTextMark* gtk_text_buffer_get_mark (GtkTextBuffer *buffer,
const gchar *name);
GtkTextMark* gtk_text_buffer_get_insert (GtkTextBuffer *buffer);
GtkTextMark* gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer);
/* efficiently move insert and selection_bound to same location */
void gtk_text_buffer_place_cursor (GtkTextBuffer *buffer,
......
This diff is collapsed.
......@@ -7,14 +7,13 @@
extern "C" {
#endif /* __cplusplus */
typedef struct _GtkTextPixmap GtkTextPixmap;
typedef struct _GtkTextPixbuf GtkTextPixbuf;
struct _GtkTextPixmap {
GdkPixmap *pixmap;
GdkBitmap *mask;
struct _GtkTextPixbuf {
GdkPixbuf *pixbuf;
};
GtkTextLineSegment *gtk_text_pixmap_segment_new(GdkPixmap *pixmap, GdkBitmap *mask);
GtkTextLineSegment *gtk_text_pixbuf_segment_new(GdkPixbuf *pixbuf);
#ifdef __cplusplus
......
......@@ -159,7 +159,7 @@ static void
render_layout_line (GdkDrawable *drawable,
GtkTextRenderState *render_state,
PangoLayoutLine *line,
GSList **pixmap_pointer,
GSList **pixbuf_pointer,
int x,
int y,
gboolean selected)
......@@ -246,37 +246,67 @@ render_layout_line (GdkDrawable *drawable,
x_off += logical_rect.width;
}
else /* Pixmap segment */
else /* Pixbuf segment */
{
GtkTextPixmap *pixmap = (*pixmap_pointer)->data;
GtkTextPixbuf *pixbuf = (*pixbuf_pointer)->data;
gint width, height;
GdkRectangle pixmap_rect, draw_rect;
*pixmap_pointer = (*pixmap_pointer)->next;
gdk_drawable_get_size (pixmap->pixmap, &width, &height);
pixmap_rect.x = x + x_off / PANGO_SCALE;
pixmap_rect.y = y - height;
pixmap_rect.width = width;
pixmap_rect.height = height;
gdk_rectangle_intersect (&pixmap_rect, &render_state->clip_rect, &draw_rect);
if (pixmap->mask)
{
gdk_gc_set_clip_mask (render_state->fg_gc, pixmap->mask);
gdk_gc_set_clip_origin (render_state->fg_gc,
pixmap_rect.x, pixmap_rect.y);
}
gdk_draw_drawable (drawable, render_state->fg_gc, pixmap->pixmap,
draw_rect.x - pixmap_rect.x, draw_rect.y - pixmap_rect.y,
draw_rect.x, draw_rect.y, draw_rect.width, draw_rect.height);
if (pixmap->mask)
gdk_gc_set_clip_rectangle (render_state->fg_gc, &render_state->clip_rect);
GdkRectangle pixbuf_rect, draw_rect;
GdkBitmap *mask = NULL;
*pixbuf_pointer = (*pixbuf_pointer)->next;
width = gdk_pixbuf_get_width (pixbuf->pixbuf);
height = gdk_pixbuf_get_height (pixbuf->pixbuf);
pixbuf_rect.x = x + x_off / PANGO_SCALE;
pixbuf_rect.y = y - height;
pixbuf_rect.width = width;
pixbuf_rect.height = height;
if (gdk_rectangle_intersect (&pixbuf_rect, &render_state->clip_rect,
&draw_rect))
{
if (gdk_pixbuf_get_has_alpha (pixbuf->pixbuf))
{
mask = gdk_pixmap_new (drawable,
gdk_pixbuf_get_width (pixbuf->pixbuf),
gdk_pixbuf_get_height (pixbuf->pixbuf),
1);
gdk_pixbuf_render_threshold_alpha (pixbuf->pixbuf, mask,
0, 0, 0, 0,
gdk_pixbuf_get_width (pixbuf->pixbuf),
gdk_pixbuf_get_height (pixbuf->pixbuf),
128);
}
if (mask)
{
gdk_gc_set_clip_mask (render_state->fg_gc, mask);
gdk_gc_set_clip_origin (render_state->fg_gc,
pixbuf_rect.x, pixbuf_rect.y);
}
gdk_pixbuf_render_to_drawable (pixbuf->pixbuf,
drawable,
render_state->fg_gc,
draw_rect.x - pixbuf_rect.x,
draw_rect.y - pixbuf_rect.y,
draw_rect.x, draw_rect.y,
draw_rect.width,
draw_rect.height,
GDK_RGB_DITHER_NORMAL,
0, 0);
if (mask)
{
gdk_gc_set_clip_rectangle (render_state->fg_gc,
&render_state->clip_rect);
g_object_unref (G_OBJECT (mask));
}
}
x_off += width * PANGO_SCALE;
}
}
......@@ -292,7 +322,7 @@ render_para (GdkDrawable *drawable,
int selection_end_index)
{
PangoRectangle logical_rect;
GSList *pixmap_pointer = line_display->pixmaps;
GSList *pixbuf_pointer = line_display->pixbufs;
GSList *tmp_list;
PangoAlignment align;
PangoLayout *layout = line_display->layout;
......@@ -375,15 +405,15 @@ render_para (GdkDrawable *drawable,
TRUE,
x + line_display->left_margin, selection_y,
total_width / PANGO_SCALE, selection_height);
render_layout_line (drawable, render_state, line, &pixmap_pointer,
render_layout_line (drawable, render_state, line, &pixbuf_pointer,
x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
TRUE);
}
else
{
GSList *pixmap_pointer_tmp = pixmap_pointer;
GSList *pixbuf_pointer_tmp = pixbuf_pointer;
render_layout_line (drawable, render_state, line, &pixmap_pointer,
render_layout_line (drawable, render_state, line, &pixbuf_pointer,
x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
FALSE);
......@@ -405,7 +435,7 @@ render_para (GdkDrawable *drawable,
logical_rect.width / PANGO_SCALE,
selection_height);
render_layout_line (drawable, render_state, line, &pixmap_pointer_tmp,
render_layout_line (drawable, render_state, line, &pixbuf_pointer_tmp,
x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
TRUE);
......
......@@ -794,34 +794,21 @@ gtk_text_iter_get_visible_text (const GtkTextIter *start,
}
/**
* gtk_text_iter_get_pixmap:
* gtk_text_iter_get_pixbuf:
* @iter: an iterator
* @pixmap: return location for the pixmap
* @mask: return location for the mask
*
* If the location pointed to by @iter contains a pixmap, the pixmap
* is placed in @pixmap, the mask is placed in @mask, and
* gtk_text_iter_get_pixmap() returns TRUE. If @iter points at
* something else, FALSE will be returned and @pixmap/@mask will
* remain unchanged. The pixmap and mask do not have their reference
* count incremented. If the pixmap has no mask, NULL is returned for
* the mask.
*
* Return value: whether the iterator pointed at a pixmap
*
* If the location pointed to by @iter contains a pixbuf, the pixbuf
* is returned (with no new reference count added). Otherwise,
* NULL is returned.
*
* Return value: the pixbuf at @iter
**/
gboolean
gtk_text_iter_get_pixmap (const GtkTextIter *iter,
GdkPixmap** pixmap,
GdkBitmap** mask)
GdkPixbuf*
gtk_text_iter_get_pixbuf (const GtkTextIter *iter)
{
GtkTextRealIter *real;
g_return_val_if_fail(iter != NULL, FALSE);
g_return_val_if_fail(pixmap != NULL, FALSE);
g_return_val_if_fail(mask != NULL, FALSE);
*pixmap = NULL;
*mask = NULL;
real = gtk_text_iter_make_real(iter);
......@@ -830,17 +817,10 @@ gtk_text_iter_get_pixmap (const GtkTextIter *iter,
check_invariants(iter);
if (real->segment->type != &gtk_text_pixmap_type)
if (real->segment->type != &gtk_text_pixbuf_type)
return FALSE;
else
{
if (pixmap)
*pixmap = real->segment->body.pixmap.pixmap;
if (mask)
*mask = real->segment->body.pixmap.pixmap;
return TRUE;
}
return real->segment->body.pixbuf.pixbuf;
}
/**
......
......@@ -72,12 +72,8 @@ gchar *gtk_text_iter_get_visible_slice (const GtkTextIter *start,
gchar *gtk_text_iter_get_visible_text (const GtkTextIter *start,
const GtkTextIter *end);
/* Returns TRUE if the iterator pointed at a pixmap */
gboolean gtk_text_iter_get_pixmap (const GtkTextIter *iter,
GdkPixmap **pixmap,
GdkBitmap **mask);
GSList *gtk_text_iter_get_marks (const GtkTextIter *iter);
GdkPixbuf* gtk_text_iter_get_pixbuf (const GtkTextIter *iter);
GSList * gtk_text_iter_get_marks (const GtkTextIter *iter);
/* Return list of tags toggled at this point (toggled_on determines
whether the list is of on-toggles or off-toggles) */
......
......@@ -1170,7 +1170,7 @@ add_text_attrs (GtkTextLayout *layout,
}
static void
add_pixmap_attrs (GtkTextLayout *layout,
add_pixbuf_attrs (GtkTextLayout *layout,
GtkTextLineDisplay *display,
GtkTextAttributes *style,
GtkTextLineSegment *seg,
......@@ -1179,10 +1179,12 @@ add_pixmap_attrs (GtkTextLayout *layout,
{
PangoAttribute *attr;
PangoRectangle logical_rect;
GtkTextPixmap *pixmap = &seg->body.pixmap;
GtkTextPixbuf *pixbuf = &seg->body.pixbuf;
gint width, height;
gdk_drawable_get_size (pixmap->pixmap, &width, &height);
width = gdk_pixbuf_get_width (pixbuf->pixbuf);
height = gdk_pixbuf_get_height (pixbuf->pixbuf);
logical_rect.x = 0;
logical_rect.y = -height * PANGO_SCALE;
logical_rect.width = width * PANGO_SCALE;
......@@ -1193,7 +1195,7 @@ add_pixmap_attrs (GtkTextLayout *layout,
attr->end_index = start + seg->byte_count;
pango_attr_list_insert (attrs, attr);
display->pixmaps = g_slist_append (display->pixmaps, pixmap);
display->pixbufs = g_slist_append (display->pixbufs, pixbuf);
}
static void
......@@ -1305,7 +1307,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
{
/* Displayable segments */
if (seg->type == &gtk_text_char_type ||
seg->type == &gtk_text_pixmap_type)
seg->type == &gtk_text_pixbuf_type)
{
gtk_text_btree_get_iter_at_line (_gtk_text_buffer_get_btree (layout->buffer),
&iter, line,
......@@ -1313,7 +1315,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
style = get_style (layout, &iter);
/* We have to delay setting the paragraph values until we
* hit the first pixmap or text segment because toggles at
* hit the first pixbuf or text segment because toggles at
* the beginning of the paragraph should affect the
* paragraph-global values
*/
......@@ -1367,7 +1369,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
}
else
{
add_pixmap_attrs (layout, display, style, seg, attrs, byte_offset);
add_pixbuf_attrs (layout, display, style, seg, attrs, byte_offset);
memcpy (text + byte_offset, gtk_text_unknown_char_utf8, seg->byte_count);
byte_offset += seg->byte_count;
}
......@@ -1461,7 +1463,7 @@ gtk_text_layout_free_line_display (GtkTextLayout *layout,
{
g_slist_foreach (display->cursors, (GFunc)g_free, NULL);
g_slist_free (display->cursors);
g_slist_free (display->pixmaps);
g_slist_free (display->pixbufs);
}
g_free (display);
......
......@@ -132,7 +132,7 @@ struct _GtkTextLineDisplay
{
PangoLayout *layout;
GSList *cursors;
GSList *pixmaps;
GSList *pixbufs;
GtkTextDirection direction;
......@@ -146,7 +146,7 @@ struct _GtkTextLineDisplay
gint bottom_margin;
gboolean size_only;
GtkTextLine *line;
GtkTextLine *line;
};
extern PangoAttrType gtk_text_attr_appearance_type;
......
......@@ -25,14 +25,14 @@ gtk_text_mark_is_visible(GtkTextMark *mark)
return seg->body.mark.visible;
}
char *
const char *
gtk_text_mark_get_name (GtkTextMark *mark)
{
GtkTextLineSegment *seg;
seg = (GtkTextLineSegment*)mark;
return g_strdup (seg->body.mark.name);
return seg->body.mark.name;
}
......
......@@ -9,17 +9,15 @@ extern "C" {
typedef struct _GtkTextMark GtkTextMark;
void gtk_text_mark_set_visible (GtkTextMark *mark,
gboolean setting);
void gtk_text_mark_set_visible (GtkTextMark *mark,
gboolean setting);
gboolean gtk_text_mark_is_visible (GtkTextMark *mark);
/* FIXME gconst */
const char * gtk_text_mark_get_name (GtkTextMark *mark);
GtkTextMark *gtk_text_mark_ref (GtkTextMark *mark);
void gtk_text_mark_unref (GtkTextMark *mark);
gboolean gtk_text_mark_deleted (GtkTextMark *mark);
gboolean gtk_text_mark_is_visible (GtkTextMark *mark);
/* Temporarily commented out until memory management behavior is figured out */
/* char * gtk_text_mark_get_name (GtkTextMark *mark); */
GtkTextMark *gtk_text_mark_ref (GtkTextMark *mark);
void gtk_text_mark_unref (GtkTextMark *mark);
gboolean gtk_text_mark_deleted (GtkTextMark *mark);
#ifdef __cplusplus
}
......
......@@ -102,7 +102,7 @@ struct _GtkTextLineSegment {
* hold as many characters as needed.*/
GtkTextToggleBody toggle; /* Information about tag toggle. */
GtkTextMarkBody mark; /* Information about mark. */
GtkTextPixmap pixmap; /* Child pixmap */
GtkTextPixbuf pixbuf; /* Child pixbuf */
#if 0
GtkTextChild child; /* child widget */
#endif
......
......@@ -945,43 +945,47 @@ delta_priority_foreach(GtkTextTag *tag, gpointer user_data)
gint
gtk_text_tag_get_priority (GtkTextTag *tag)
{
g_return_val_if_fail(GTK_IS_TEXT_TAG(tag), 0);
g_return_val_if_fail (GTK_IS_TEXT_TAG(tag), 0);
return tag->priority;
}
void
gtk_text_tag_set_priority(GtkTextTag *tag,
gint priority)
gtk_text_tag_set_priority (GtkTextTag *tag,
gint priority)
{
DeltaData dd;
g_return_if_fail(GTK_IS_TEXT_TAG(tag));
g_return_if_fail(tag->table != NULL);
g_return_if_fail(priority >= 0);
g_return_if_fail(priority < gtk_text_tag_table_size(tag->table));
g_return_if_fail (GTK_IS_TEXT_TAG (tag));
g_return_if_fail (tag->table != NULL);
g_return_if_fail (priority >= 0);
g_return_if_fail (priority < gtk_text_tag_table_size (tag->table));
if (priority == tag->priority)
return;
if (priority < tag->priority) {
dd.low = priority;
dd.high = tag->priority - 1;
dd.delta = 1;