Commit 6b61461a authored by Lars Hamann's avatar Lars Hamann

adapted clist pixmap clipping

        * gtk/gtkctree.c (draw_row): adapted clist pixmap clipping

        * gtk/gtknotebook.h (struct _GtkNotebookClass):
        * gtk/gtknotebook.c (gtk_real_notebook_switch_page):
        added missing argument (according to Joseph Coleman's bug report)

        * gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
        function to fix notebook focus handling
parent 344572dc
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
Wed Jun 10 22:23:27 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): adapted clist pixmap clipping
* gtk/gtknotebook.h (struct _GtkNotebookClass):
* gtk/gtknotebook.c (gtk_real_notebook_switch_page):
added missing argument (according to Joseph Coleman's bug report)
* gtk/gtknotebook.c (gtk_notebook_set_focus_child): new class
function to fix notebook focus handling
Wed Jun 10 12:57:03 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkcc.c glib/ghash.c glib/glib.h glib/gstring.c
......
......@@ -970,6 +970,7 @@ draw_row (GtkCList *clist,
gint i, offset = 0, width, height, pixmap_width = 0, string_width = 0;
gint xsrc, ysrc, xdest = 0, ydest;
gboolean need_redraw = TRUE;
gboolean draw_pixmap = FALSE;
g_return_if_fail (clist != NULL);
......@@ -1418,29 +1419,10 @@ draw_row (GtkCList *clist,
if (pixmap_width && xdest + pixmap_width >= rect->x &&
xdest <= rect->x + rect->width)
{
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->mask)
{
gdk_gc_set_clip_mask
(fg_gc, GTK_CELL_PIXTEXT (clist_row->cell[i])->mask);
gdk_gc_set_clip_origin (fg_gc, xdest, ydest);
}
gdk_draw_pixmap (clist->clist_window, fg_gc,
GTK_CELL_PIXTEXT
(clist_row->cell[i])->pixmap, xsrc, ysrc,
xdest, ydest, pixmap_width, height);
if (xdest + pixmap_width >
clip_rectangle.x + clip_rectangle.width)
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
rect->x + rect->width, ydest + 1,
xdest + pixmap_width -
(rect->x + rect->width), height - 1);
}
draw_pixmap = TRUE;
xdest += (GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing +
pixmap_width);
break;
case GTK_JUSTIFY_RIGHT:
offset_x = 0;
......@@ -1566,29 +1548,62 @@ draw_row (GtkCList *clist,
+ clist_row->cell[i].horizontal);
if (pixmap_width && xdest + pixmap_width >= rect->x &&
xdest <= rect->x + rect->width && xdest >= clip_rectangle.x)
xdest <= rect->x + rect->width)
draw_pixmap = TRUE;
break;
default :
break;
}
if (draw_pixmap)
{
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->mask)
{
gdk_gc_set_clip_mask
(fg_gc, GTK_CELL_PIXTEXT (clist_row->cell[i])->mask);
gdk_gc_set_clip_origin (fg_gc, xdest, ydest);
gdk_draw_pixmap (clist->clist_window, fg_gc,
GTK_CELL_PIXTEXT
(clist_row->cell[i])->pixmap,
xsrc, ysrc, xdest, ydest,
pixmap_width, height);
}
xdest -= (GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing +
string_width);
break;
default :
break;
if (xdest < clip_rectangle.x)
{
xsrc = clip_rectangle.x - xdest;
pixmap_width -= xsrc;
xdest = clip_rectangle.x;
}
if (xdest + pixmap_width >
clip_rectangle.x + clip_rectangle.width)
pixmap_width =
(clip_rectangle.x + clip_rectangle.width) - xdest;
if (ydest < clip_rectangle.y)
{
ysrc = clip_rectangle.y - ydest;
height -= ysrc;
ydest = clip_rectangle.y;
}
if (ydest + height > clip_rectangle.y + clip_rectangle.height)
height = (clip_rectangle.y + clip_rectangle.height) - ydest;
gdk_draw_pixmap (clist->clist_window, fg_gc,
GTK_CELL_PIXTEXT
(clist_row->cell[i])->pixmap,
xsrc, ysrc, xdest, ydest,
pixmap_width, height);
}
if (string_width)
{
gint delta;
if (clist->column[i].justification == GTK_JUSTIFY_RIGHT)
xdest -= (GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing +
string_width);
else
xdest += (GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing +
pixmap_width);
delta = CELL_SPACING - (rect->y - clip_rectangle.y);
if (delta > 0)
{
......@@ -1641,6 +1656,29 @@ draw_row (GtkCList *clist,
(clist_row->cell[i])->mask);
gdk_gc_set_clip_origin (fg_gc, xdest, ydest);
}
if (xdest < clip_rectangle.x)
{
xsrc = clip_rectangle.x - xdest;
pixmap_width -= xsrc;
xdest = clip_rectangle.x;
}
if (xdest + pixmap_width >
clip_rectangle.x + clip_rectangle.width)
pixmap_width = (clip_rectangle.x + clip_rectangle.width) -
xdest;
if (ydest < clip_rectangle.y)
{
ysrc = clip_rectangle.y - ydest;
height -= ysrc;
ydest = clip_rectangle.y;
}
if (ydest + height > clip_rectangle.y + clip_rectangle.height)
height = (clip_rectangle.y + clip_rectangle.height) - ydest;
gdk_draw_pixmap (clist->clist_window, fg_gc,
GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap,
xsrc, ysrc, xdest, ydest, pixmap_width, height);
......@@ -1666,7 +1704,29 @@ draw_row (GtkCList *clist,
(clist_row->cell[i])->mask);
gdk_gc_set_clip_origin (fg_gc, xdest, ydest);
}
if (xdest < clip_rectangle.x)
{
xsrc = clip_rectangle.x - xdest;
pixmap_width -= xsrc;
xdest = clip_rectangle.x;
}
if (xdest + pixmap_width >
clip_rectangle.x + clip_rectangle.width)
pixmap_width = (clip_rectangle.x + clip_rectangle.width)
- xdest;
if (ydest < clip_rectangle.y)
{
ysrc = clip_rectangle.y - ydest;
height -= ysrc;
ydest = clip_rectangle.y;
}
if (ydest + height > clip_rectangle.y + clip_rectangle.height)
height = (clip_rectangle.y + clip_rectangle.height) - ydest;
gdk_draw_pixmap (clist->clist_window, fg_gc,
GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
xsrc, ysrc, xdest, ydest, pixmap_width, height);
......
This diff is collapsed.
......@@ -62,6 +62,7 @@ struct _GtkNotebook
guint click_child : 2;
guint button : 2;
guint need_timer : 1;
guint child_has_focus : 1;
};
struct _GtkNotebookClass
......@@ -69,7 +70,8 @@ struct _GtkNotebookClass
GtkContainerClass parent_class;
void (* switch_page) (GtkNotebook *notebook,
GtkNotebookPage *page);
GtkNotebookPage *page,
gint page_num);
};
struct _GtkNotebookPage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment