Make list handling code easier to read. (#63820, Tilman Sauerbeck)

2007-04-27  Matthias Clasen  <mclasen@redhat.com>

        * gdk/x11/gdkgeometry-x11.c: Make list handling code
        easier to read.  (#63820, Tilman Sauerbeck)



svn path=/trunk/; revision=17662
This commit is contained in:
Matthias Clasen
2007-04-27 23:23:52 +00:00
committed by Matthias Clasen
parent 2824f4597d
commit 197f292161
2 changed files with 24 additions and 59 deletions

View File

@ -1,3 +1,8 @@
2007-04-27 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkgeometry-x11.c: Make list handling code
easier to read. (#63820, Tilman Sauerbeck)
2007-04-27 Matthias Clasen <mclasen@redhat.com> 2007-04-27 Matthias Clasen <mclasen@redhat.com>
* gtkassistant.c: * gtkassistant.c:

View File

@ -225,7 +225,7 @@ gdk_window_copy_area_scroll (GdkWindow *window,
gint dy) gint dy)
{ {
GdkWindowObject *obj = GDK_WINDOW_OBJECT (window); GdkWindowObject *obj = GDK_WINDOW_OBJECT (window);
GList *tmp_list; GList *l;
if (dest_rect->width > 0 && dest_rect->height > 0) if (dest_rect->width > 0 && dest_rect->height > 0)
{ {
@ -244,15 +244,12 @@ gdk_window_copy_area_scroll (GdkWindow *window,
dest_rect->x, dest_rect->y); dest_rect->x, dest_rect->y);
} }
tmp_list = obj->children; for (l = obj->children; l; l = l->next)
while (tmp_list)
{ {
GdkWindow *child = GDK_WINDOW (tmp_list->data); GdkWindow *child = GDK_WINDOW (l->data);
GdkWindowObject *child_obj = GDK_WINDOW_OBJECT (child); GdkWindowObject *child_obj = GDK_WINDOW_OBJECT (child);
gdk_window_move (child, child_obj->x + dx, child_obj->y + dy); gdk_window_move (child, child_obj->x + dx, child_obj->y + dy);
tmp_list = tmp_list->next;
} }
} }
@ -315,7 +312,7 @@ gdk_window_guffaw_scroll (GdkWindow *window,
GdkRectangle new_position; GdkRectangle new_position;
GdkXPositionInfo new_info; GdkXPositionInfo new_info;
GdkWindowParentPos parent_pos; GdkWindowParentPos parent_pos;
GList *tmp_list; GList *l;
gdk_window_compute_parent_pos (impl, &parent_pos); gdk_window_compute_parent_pos (impl, &parent_pos);
gdk_window_compute_position (impl, &parent_pos, &new_info); gdk_window_compute_position (impl, &parent_pos, &new_info);
@ -340,14 +337,15 @@ gdk_window_guffaw_scroll (GdkWindow *window,
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
new_position.x, new_position.y, new_position.width, new_position.height); new_position.x, new_position.y, new_position.width, new_position.height);
tmp_list = obj->children; for (l = obj->children; l; l = l->next)
while (tmp_list)
{ {
GDK_WINDOW_OBJECT(tmp_list->data)->x -= d_xoffset; GdkWindow *child = GDK_WINDOW (l->data);
GDK_WINDOW_OBJECT(tmp_list->data)->y -= d_yoffset; GdkWindowObject *child_obj = GDK_WINDOW_OBJECT (child);
gdk_window_premove (tmp_list->data, &parent_pos); child_obj->x -= d_xoffset;
tmp_list = tmp_list->next; child_obj->y -= d_yoffset;
gdk_window_premove (child, &parent_pos);
} }
XMoveWindow (GDK_WINDOW_XDISPLAY (window), XMoveWindow (GDK_WINDOW_XDISPLAY (window),
@ -367,12 +365,7 @@ gdk_window_guffaw_scroll (GdkWindow *window,
impl->position_info = new_info; impl->position_info = new_info;
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_postmove, &parent_pos);
while (tmp_list)
{
gdk_window_postmove (tmp_list->data, &parent_pos);
tmp_list = tmp_list->next;
}
} }
/** /**
@ -594,7 +587,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
GdkWindowObject *obj; GdkWindowObject *obj;
GdkXPositionInfo new_info; GdkXPositionInfo new_info;
GdkWindowParentPos parent_pos; GdkWindowParentPos parent_pos;
GList *tmp_list;
gint d_xoffset, d_yoffset; gint d_xoffset, d_yoffset;
gint dx, dy; gint dx, dy;
@ -658,12 +650,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
new_position.x, new_position.y, new_position.width, new_position.height); new_position.x, new_position.y, new_position.width, new_position.height);
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_premove, &parent_pos);
while (tmp_list)
{
gdk_window_premove (tmp_list->data, &parent_pos);
tmp_list = tmp_list->next;
}
XMoveWindow (GDK_WINDOW_XDISPLAY (window), XMoveWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
@ -683,12 +670,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
impl->position_info = new_info; impl->position_info = new_info;
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_postmove, &parent_pos);
while (tmp_list)
{
gdk_window_postmove (tmp_list->data, &parent_pos);
tmp_list = tmp_list->next;
}
} }
else else
{ {
@ -698,12 +680,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (impl->position_info.mapped && !new_info.mapped) if (impl->position_info.mapped && !new_info.mapped)
XUnmapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); XUnmapWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_premove, &parent_pos);
while (tmp_list)
{
gdk_window_premove (tmp_list->data, &parent_pos);
tmp_list = tmp_list->next;
}
if (is_resize) if (is_resize)
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window), XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
@ -714,12 +691,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
new_info.x, new_info.y); new_info.x, new_info.y);
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_postmove, &parent_pos);
while (tmp_list)
{
gdk_window_postmove (tmp_list->data, &parent_pos);
tmp_list = tmp_list->next;
}
reset_backgrounds (window); reset_backgrounds (window);
@ -899,7 +871,6 @@ gdk_window_premove (GdkWindow *window,
GdkWindowImplX11 *impl; GdkWindowImplX11 *impl;
GdkWindowObject *obj; GdkWindowObject *obj;
GdkXPositionInfo new_info; GdkXPositionInfo new_info;
GList *tmp_list;
gint d_xoffset, d_yoffset; gint d_xoffset, d_yoffset;
GdkWindowParentPos this_pos; GdkWindowParentPos this_pos;
@ -937,12 +908,7 @@ gdk_window_premove (GdkWindow *window,
new_position.x, new_position.y, new_position.width, new_position.height); new_position.x, new_position.y, new_position.width, new_position.height);
} }
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_premove, &this_pos);
while (tmp_list)
{
gdk_window_premove (tmp_list->data, &this_pos);
tmp_list = tmp_list->next;
}
} }
static void static void
@ -952,7 +918,6 @@ gdk_window_postmove (GdkWindow *window,
GdkWindowImplX11 *impl; GdkWindowImplX11 *impl;
GdkWindowObject *obj; GdkWindowObject *obj;
GdkXPositionInfo new_info; GdkXPositionInfo new_info;
GList *tmp_list;
gint d_xoffset, d_yoffset; gint d_xoffset, d_yoffset;
GdkWindowParentPos this_pos; GdkWindowParentPos this_pos;
@ -987,12 +952,7 @@ gdk_window_postmove (GdkWindow *window,
impl->position_info = new_info; impl->position_info = new_info;
tmp_list = obj->children; g_list_foreach (obj->children, (GFunc) gdk_window_postmove, &this_pos);
while (tmp_list)
{
gdk_window_postmove (tmp_list->data, &this_pos);
tmp_list = tmp_list->next;
}
} }
static Bool static Bool