new function gdk_window_at_pointer() to retrive the current GdkWindow the
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org> * gdk/gdk.h: * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive the current GdkWindow the pointer is on if there is any. * gtk/gtktable.c (gtk_table_init): preallocate a table with one row and one column, so we don't construction logic at all. changed a few (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to unsigned int wraps. * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code portion, added an additional check for parent != widget. * more GtkType and macro fixups.
This commit is contained in:
parent
7bb4d7d961
commit
7d0331a679
16
ChangeLog
16
ChangeLog
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -1,3 +1,19 @@
|
||||
Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gdk/gdk.h:
|
||||
* gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
|
||||
the current GdkWindow the pointer is on if there is any.
|
||||
|
||||
* gtk/gtktable.c (gtk_table_init): preallocate a table with one row
|
||||
and one column, so we don't construction logic at all. changed a few
|
||||
(x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
|
||||
unsigned int wraps.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
|
||||
portion, added an additional check for parent != widget.
|
||||
|
||||
* more GtkType and macro fixups.
|
||||
|
||||
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
|
||||
|
@ -131,6 +131,8 @@ void gdk_window_destroy (GdkWindow *window);
|
||||
GdkWindow* gdk_window_ref (GdkWindow *window);
|
||||
void gdk_window_unref (GdkWindow *window);
|
||||
|
||||
GdkWindow* gdk_window_at_pointer (gint *win_x,
|
||||
gint *win_y);
|
||||
void gdk_window_show (GdkWindow *window);
|
||||
void gdk_window_hide (GdkWindow *window);
|
||||
void gdk_window_withdraw (GdkWindow *window);
|
||||
|
@ -61,15 +61,19 @@ int event_mask_table[20] =
|
||||
|
||||
/* internal function created for and used by gdk_window_xid_at_coords */
|
||||
Window
|
||||
gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
GList *excludes, gboolean excl_child)
|
||||
gdk_window_xid_at (Window base,
|
||||
gint bx,
|
||||
gint by,
|
||||
gint x,
|
||||
gint y,
|
||||
GList *excludes,
|
||||
gboolean excl_child)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindowPrivate *private;
|
||||
Display *disp;
|
||||
Window *list = NULL;
|
||||
Window child = 0, parent_win = 0, root_win = 0;
|
||||
|
||||
int i;
|
||||
unsigned int ww, wh, wb, wd, num;
|
||||
int wx, wy;
|
||||
@ -79,11 +83,18 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
disp = private->xdisplay;
|
||||
if (!XGetGeometry (disp, base, &root_win, &wx, &wy, &ww, &wh, &wb, &wd))
|
||||
return 0;
|
||||
wx+=bx;wy+=by;
|
||||
if (!((x>=wx)&&(y>=wy)&&(x<(int)(wx+ww))&&(y<(int)(wy+wh))))
|
||||
wx += bx;
|
||||
wy += by;
|
||||
|
||||
if (!((x >= wx) &&
|
||||
(y >= wy) &&
|
||||
(x < (int) (wx + ww)) &&
|
||||
(y < (int) (wy + wh))))
|
||||
return 0;
|
||||
|
||||
if (!XQueryTree (disp, base, &root_win, &parent_win, &list, &num))
|
||||
return base;
|
||||
|
||||
if (list)
|
||||
{
|
||||
for (i = num - 1; ; i--)
|
||||
@ -96,7 +107,8 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
return child;
|
||||
}
|
||||
}
|
||||
if (!i) break;
|
||||
if (!i)
|
||||
break;
|
||||
}
|
||||
XFree (list);
|
||||
}
|
||||
@ -117,7 +129,10 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
* those X,Y co-ordinates.
|
||||
*/
|
||||
Window
|
||||
gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
|
||||
gdk_window_xid_at_coords (gint x,
|
||||
gint y,
|
||||
GList *excludes,
|
||||
gboolean excl_child)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindowPrivate *private;
|
||||
@ -131,10 +146,14 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
|
||||
private = (GdkWindowPrivate*) window;
|
||||
disp = private->xdisplay;
|
||||
root = private->xwindow;
|
||||
XGrabServer(disp);
|
||||
num = g_list_length (excludes);
|
||||
|
||||
XGrabServer (disp);
|
||||
if (!XQueryTree (disp, root, &root_win, &parent_win, &list, &num))
|
||||
{
|
||||
XUngrabServer(disp);
|
||||
return root;
|
||||
}
|
||||
if (list)
|
||||
{
|
||||
i = num - 1;
|
||||
@ -1326,6 +1345,46 @@ gdk_window_get_pointer (GdkWindow *window,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_at_pointer (gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
GdkWindow *window;
|
||||
Window root;
|
||||
Window xwindow;
|
||||
Window xwindow_last = 0;
|
||||
int rootx = -1, rooty = -1;
|
||||
int winx, winy;
|
||||
unsigned int xmask;
|
||||
|
||||
private = &gdk_root_parent;
|
||||
|
||||
xwindow = private->xwindow;
|
||||
|
||||
XGrabServer (private->xdisplay);
|
||||
while (xwindow)
|
||||
{
|
||||
xwindow_last = xwindow;
|
||||
XQueryPointer (private->xdisplay,
|
||||
xwindow,
|
||||
&root, &xwindow,
|
||||
&rootx, &rooty,
|
||||
&winx, &winy,
|
||||
&xmask);
|
||||
}
|
||||
XUngrabServer (private->xdisplay);
|
||||
|
||||
window = gdk_window_lookup (xwindow_last);
|
||||
|
||||
if (win_x)
|
||||
*win_x = window ? winx : -1;
|
||||
if (win_y)
|
||||
*win_y = window ? winy : -1;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_get_parent (GdkWindow *window)
|
||||
{
|
||||
|
@ -61,15 +61,19 @@ int event_mask_table[20] =
|
||||
|
||||
/* internal function created for and used by gdk_window_xid_at_coords */
|
||||
Window
|
||||
gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
GList *excludes, gboolean excl_child)
|
||||
gdk_window_xid_at (Window base,
|
||||
gint bx,
|
||||
gint by,
|
||||
gint x,
|
||||
gint y,
|
||||
GList *excludes,
|
||||
gboolean excl_child)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindowPrivate *private;
|
||||
Display *disp;
|
||||
Window *list = NULL;
|
||||
Window child = 0, parent_win = 0, root_win = 0;
|
||||
|
||||
int i;
|
||||
unsigned int ww, wh, wb, wd, num;
|
||||
int wx, wy;
|
||||
@ -79,11 +83,18 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
disp = private->xdisplay;
|
||||
if (!XGetGeometry (disp, base, &root_win, &wx, &wy, &ww, &wh, &wb, &wd))
|
||||
return 0;
|
||||
wx+=bx;wy+=by;
|
||||
if (!((x>=wx)&&(y>=wy)&&(x<(int)(wx+ww))&&(y<(int)(wy+wh))))
|
||||
wx += bx;
|
||||
wy += by;
|
||||
|
||||
if (!((x >= wx) &&
|
||||
(y >= wy) &&
|
||||
(x < (int) (wx + ww)) &&
|
||||
(y < (int) (wy + wh))))
|
||||
return 0;
|
||||
|
||||
if (!XQueryTree (disp, base, &root_win, &parent_win, &list, &num))
|
||||
return base;
|
||||
|
||||
if (list)
|
||||
{
|
||||
for (i = num - 1; ; i--)
|
||||
@ -96,7 +107,8 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
return child;
|
||||
}
|
||||
}
|
||||
if (!i) break;
|
||||
if (!i)
|
||||
break;
|
||||
}
|
||||
XFree (list);
|
||||
}
|
||||
@ -117,7 +129,10 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
|
||||
* those X,Y co-ordinates.
|
||||
*/
|
||||
Window
|
||||
gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
|
||||
gdk_window_xid_at_coords (gint x,
|
||||
gint y,
|
||||
GList *excludes,
|
||||
gboolean excl_child)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindowPrivate *private;
|
||||
@ -131,10 +146,14 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
|
||||
private = (GdkWindowPrivate*) window;
|
||||
disp = private->xdisplay;
|
||||
root = private->xwindow;
|
||||
XGrabServer(disp);
|
||||
num = g_list_length (excludes);
|
||||
|
||||
XGrabServer (disp);
|
||||
if (!XQueryTree (disp, root, &root_win, &parent_win, &list, &num))
|
||||
{
|
||||
XUngrabServer(disp);
|
||||
return root;
|
||||
}
|
||||
if (list)
|
||||
{
|
||||
i = num - 1;
|
||||
@ -1326,6 +1345,46 @@ gdk_window_get_pointer (GdkWindow *window,
|
||||
return return_val;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_at_pointer (gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
GdkWindow *window;
|
||||
Window root;
|
||||
Window xwindow;
|
||||
Window xwindow_last = 0;
|
||||
int rootx = -1, rooty = -1;
|
||||
int winx, winy;
|
||||
unsigned int xmask;
|
||||
|
||||
private = &gdk_root_parent;
|
||||
|
||||
xwindow = private->xwindow;
|
||||
|
||||
XGrabServer (private->xdisplay);
|
||||
while (xwindow)
|
||||
{
|
||||
xwindow_last = xwindow;
|
||||
XQueryPointer (private->xdisplay,
|
||||
xwindow,
|
||||
&root, &xwindow,
|
||||
&rootx, &rooty,
|
||||
&winx, &winy,
|
||||
&xmask);
|
||||
}
|
||||
XUngrabServer (private->xdisplay);
|
||||
|
||||
window = gdk_window_lookup (xwindow_last);
|
||||
|
||||
if (win_x)
|
||||
*win_x = window ? winx : -1;
|
||||
if (win_y)
|
||||
*win_y = window ? winy : -1;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
GdkWindow*
|
||||
gdk_window_get_parent (GdkWindow *window)
|
||||
{
|
||||
|
@ -68,10 +68,10 @@ static GtkType gtk_box_child_type (GtkContainer *container);
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_box_get_type (void)
|
||||
{
|
||||
static guint box_type = 0;
|
||||
static GtkType box_type = 0;
|
||||
|
||||
if (!box_type)
|
||||
{
|
||||
@ -86,7 +86,7 @@ gtk_box_get_type (void)
|
||||
(GtkArgGetFunc) gtk_box_get_arg,
|
||||
};
|
||||
|
||||
box_type = gtk_type_unique (gtk_container_get_type (), &box_info);
|
||||
box_type = gtk_type_unique (GTK_TYPE_CONTAINER, &box_info);
|
||||
}
|
||||
|
||||
return box_type;
|
||||
@ -103,7 +103,7 @@ gtk_box_class_init (GtkBoxClass *class)
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
container_class = (GtkContainerClass*) class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_container_get_type ());
|
||||
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
||||
|
||||
gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SPACING);
|
||||
gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
|
||||
|
11
gtk/gtkbox.h
11
gtk/gtkbox.h
@ -26,12 +26,15 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_BOX(obj) GTK_CHECK_CAST (obj, gtk_box_get_type (), GtkBox)
|
||||
#define GTK_BOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_box_get_type (), GtkBoxClass)
|
||||
#define GTK_IS_BOX(obj) GTK_CHECK_TYPE (obj, gtk_box_get_type ())
|
||||
#define GTK_TYPE_BOX (gtk_box_get_type ())
|
||||
#define GTK_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_BOX, GtkBox))
|
||||
#define GTK_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX, GtkBoxClass))
|
||||
#define GTK_IS_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_BOX))
|
||||
#define GTK_IS_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX))
|
||||
|
||||
|
||||
typedef struct _GtkBox GtkBox;
|
||||
@ -62,7 +65,7 @@ struct _GtkBoxChild
|
||||
};
|
||||
|
||||
|
||||
guint gtk_box_get_type (void);
|
||||
GtkType gtk_box_get_type (void);
|
||||
void gtk_box_pack_start (GtkBox *box,
|
||||
GtkWidget *child,
|
||||
gboolean expand,
|
||||
|
@ -27,10 +27,10 @@ static void gtk_hbox_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_hbox_get_type (void)
|
||||
{
|
||||
static guint hbox_type = 0;
|
||||
static GtkType hbox_type = 0;
|
||||
|
||||
if (!hbox_type)
|
||||
{
|
||||
@ -45,7 +45,7 @@ gtk_hbox_get_type (void)
|
||||
(GtkArgGetFunc) NULL,
|
||||
};
|
||||
|
||||
hbox_type = gtk_type_unique (gtk_box_get_type (), &hbox_info);
|
||||
hbox_type = gtk_type_unique (GTK_TYPE_BOX, &hbox_info);
|
||||
}
|
||||
|
||||
return hbox_type;
|
||||
|
@ -26,12 +26,15 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_HBOX(obj) GTK_CHECK_CAST (obj, gtk_hbox_get_type (), GtkHBox)
|
||||
#define GTK_HBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_hbox_get_type (), GtkHBoxClass)
|
||||
#define GTK_IS_HBOX(obj) GTK_CHECK_TYPE (obj, gtk_hbox_get_type ())
|
||||
#define GTK_TYPE_HBOX (gtk_hbox_get_type ())
|
||||
#define GTK_HBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HBOX, GtkHBox))
|
||||
#define GTK_HBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBOX, GtkHBoxClass))
|
||||
#define GTK_IS_HBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HBOX))
|
||||
#define GTK_IS_HBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBOX))
|
||||
|
||||
|
||||
typedef struct _GtkHBox GtkHBox;
|
||||
@ -48,7 +51,7 @@ struct _GtkHBoxClass
|
||||
};
|
||||
|
||||
|
||||
guint gtk_hbox_get_type (void);
|
||||
GtkType gtk_hbox_get_type (void);
|
||||
GtkWidget* gtk_hbox_new (gint homogeneous,
|
||||
gint spacing);
|
||||
|
||||
|
@ -39,10 +39,10 @@ static void gtk_misc_get_arg (GtkMisc *misc,
|
||||
guint arg_id);
|
||||
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_misc_get_type (void)
|
||||
{
|
||||
static guint misc_type = 0;
|
||||
static GtkType misc_type = 0;
|
||||
|
||||
if (!misc_type)
|
||||
{
|
||||
@ -57,7 +57,7 @@ gtk_misc_get_type (void)
|
||||
(GtkArgGetFunc) gtk_misc_get_arg,
|
||||
};
|
||||
|
||||
misc_type = gtk_type_unique (gtk_widget_get_type (), &misc_info);
|
||||
misc_type = gtk_type_unique (GTK_TYPE_WIDGET, &misc_info);
|
||||
}
|
||||
|
||||
return misc_type;
|
||||
|
@ -26,12 +26,15 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_MISC(obj) GTK_CHECK_CAST (obj, gtk_misc_get_type (), GtkMisc)
|
||||
#define GTK_MISC_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_misc_get_type (), GtkMiscClass)
|
||||
#define GTK_IS_MISC(obj) GTK_CHECK_TYPE (obj, gtk_misc_get_type ())
|
||||
#define GTK_TYPE_MISC (gtk_misc_get_type ())
|
||||
#define GTK_MISC(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
|
||||
#define GTK_MISC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MISC, GtkMiscClass))
|
||||
#define GTK_IS_MISC(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MISC))
|
||||
#define GTK_IS_MISC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MISC))
|
||||
|
||||
|
||||
typedef struct _GtkMisc GtkMisc;
|
||||
@ -54,7 +57,7 @@ struct _GtkMiscClass
|
||||
};
|
||||
|
||||
|
||||
guint gtk_misc_get_type (void);
|
||||
GtkType gtk_misc_get_type (void);
|
||||
void gtk_misc_set_alignment (GtkMisc *misc,
|
||||
gfloat xalign,
|
||||
gfloat yalign);
|
||||
@ -68,4 +71,4 @@ void gtk_misc_set_padding (GtkMisc *misc,
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __GTK_LABEL_H__ */
|
||||
#endif /* __GTK_MISC_H__ */
|
||||
|
@ -28,10 +28,10 @@ static void gtk_pixmap_finalize (GtkObject *object);
|
||||
|
||||
static GtkWidgetClass *parent_class;
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_pixmap_get_type (void)
|
||||
{
|
||||
static guint pixmap_type = 0;
|
||||
static GtkType pixmap_type = 0;
|
||||
|
||||
if (!pixmap_type)
|
||||
{
|
||||
@ -46,7 +46,7 @@ gtk_pixmap_get_type (void)
|
||||
(GtkArgGetFunc) NULL,
|
||||
};
|
||||
|
||||
pixmap_type = gtk_type_unique (gtk_misc_get_type (), &pixmap_info);
|
||||
pixmap_type = gtk_type_unique (GTK_TYPE_MISC, &pixmap_info);
|
||||
}
|
||||
|
||||
return pixmap_type;
|
||||
|
@ -26,12 +26,15 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_PIXMAP(obj) GTK_CHECK_CAST (obj, gtk_pixmap_get_type (), GtkPixmap)
|
||||
#define GTK_PIXMAP_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pixmap_get_type (), GtkPixmapClass)
|
||||
#define GTK_IS_PIXMAP(obj) GTK_CHECK_TYPE (obj, gtk_pixmap_get_type ())
|
||||
#define GTK_TYPE_PIXMAP (gtk_pixmap_get_type ())
|
||||
#define GTK_PIXMAP(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PIXMAP, GtkPixmap))
|
||||
#define GTK_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIXMAP, GtkPixmapClass))
|
||||
#define GTK_IS_PIXMAP(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIXMAP))
|
||||
#define GTK_IS_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIXMAP))
|
||||
|
||||
|
||||
typedef struct _GtkPixmap GtkPixmap;
|
||||
@ -51,7 +54,7 @@ struct _GtkPixmapClass
|
||||
};
|
||||
|
||||
|
||||
guint gtk_pixmap_get_type (void);
|
||||
GtkType gtk_pixmap_get_type (void);
|
||||
GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap,
|
||||
GdkBitmap *mask);
|
||||
void gtk_pixmap_set (GtkPixmap *pixmap,
|
||||
|
@ -367,6 +367,8 @@ gtk_table_init (GtkTable *table)
|
||||
table->column_spacing = 0;
|
||||
table->row_spacing = 0;
|
||||
table->homogeneous = FALSE;
|
||||
|
||||
gtk_table_resize (table, 1, 1);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
@ -544,8 +546,7 @@ gtk_table_set_row_spacing (GtkTable *table,
|
||||
{
|
||||
g_return_if_fail (table != NULL);
|
||||
g_return_if_fail (GTK_IS_TABLE (table));
|
||||
/* g_return_if_fail ((row >= 0) && (row < (table->nrows - 1))); */
|
||||
g_return_if_fail (row < table->nrows - 1);
|
||||
g_return_if_fail (row + 1 < table->nrows);
|
||||
|
||||
if (table->rows[row].spacing != spacing)
|
||||
{
|
||||
@ -563,8 +564,7 @@ gtk_table_set_col_spacing (GtkTable *table,
|
||||
{
|
||||
g_return_if_fail (table != NULL);
|
||||
g_return_if_fail (GTK_IS_TABLE (table));
|
||||
/* g_return_if_fail ((column >= 0) && (column < (table->ncols - 1))); */
|
||||
g_return_if_fail (column < table->ncols - 1);
|
||||
g_return_if_fail (column + 1 < table->ncols);
|
||||
|
||||
if (table->cols[column].spacing != spacing)
|
||||
{
|
||||
@ -585,7 +585,7 @@ gtk_table_set_row_spacings (GtkTable *table,
|
||||
g_return_if_fail (GTK_IS_TABLE (table));
|
||||
|
||||
table->row_spacing = spacing;
|
||||
for (row = 0; row < table->nrows - 1; row++)
|
||||
for (row = 0; row + 1 < table->nrows; row++)
|
||||
table->rows[row].spacing = spacing;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (table))
|
||||
@ -602,7 +602,7 @@ gtk_table_set_col_spacings (GtkTable *table,
|
||||
g_return_if_fail (GTK_IS_TABLE (table));
|
||||
|
||||
table->column_spacing = spacing;
|
||||
for (col = 0; col < table->ncols - 1; col++)
|
||||
for (col = 0; col + 1 < table->ncols; col++)
|
||||
table->cols[col].spacing = spacing;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (table))
|
||||
@ -777,12 +777,12 @@ gtk_table_size_request (GtkWidget *widget,
|
||||
|
||||
for (col = 0; col < table->ncols; col++)
|
||||
requisition->width += table->cols[col].requisition;
|
||||
for (col = 0; col < table->ncols - 1; col++)
|
||||
for (col = 0; col + 1 < table->ncols; col++)
|
||||
requisition->width += table->cols[col].spacing;
|
||||
|
||||
for (row = 0; row < table->nrows; row++)
|
||||
requisition->height += table->rows[row].requisition;
|
||||
for (row = 0; row < table->nrows - 1; row++)
|
||||
for (row = 0; row + 1 < table->nrows; row++)
|
||||
requisition->height += table->rows[row].spacing;
|
||||
|
||||
requisition->width += GTK_CONTAINER (table)->border_width * 2;
|
||||
@ -1244,7 +1244,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
|
||||
{
|
||||
width = real_width;
|
||||
|
||||
for (col = 0; col < table->ncols - 1; col++)
|
||||
for (col = 0; col + 1 < table->ncols; col++)
|
||||
width -= table->cols[col].spacing;
|
||||
|
||||
for (col = 0; col < table->ncols; col++)
|
||||
@ -1269,7 +1269,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
|
||||
if (table->cols[col].shrink)
|
||||
nshrink += 1;
|
||||
}
|
||||
for (col = 0; col < table->ncols - 1; col++)
|
||||
for (col = 0; col + 1 < table->ncols; col++)
|
||||
width += table->cols[col].spacing;
|
||||
|
||||
/* Check to see if we were allocated more width than we requested.
|
||||
@ -1321,7 +1321,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
|
||||
{
|
||||
height = real_height;
|
||||
|
||||
for (row = 0; row < table->nrows - 1; row++)
|
||||
for (row = 0; row + 1 < table->nrows; row++)
|
||||
height -= table->rows[row].spacing;
|
||||
|
||||
|
||||
@ -1347,7 +1347,7 @@ gtk_table_size_allocate_pass1 (GtkTable *table)
|
||||
if (table->rows[row].shrink)
|
||||
nshrink += 1;
|
||||
}
|
||||
for (row = 0; row < table->nrows - 1; row++)
|
||||
for (row = 0; row + 1 < table->nrows; row++)
|
||||
height += table->rows[row].spacing;
|
||||
|
||||
/* Check to see if we were allocated more height than we requested.
|
||||
|
@ -27,10 +27,10 @@ static void gtk_vbox_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_vbox_get_type (void)
|
||||
{
|
||||
static guint vbox_type = 0;
|
||||
static GtkType vbox_type = 0;
|
||||
|
||||
if (!vbox_type)
|
||||
{
|
||||
@ -45,7 +45,7 @@ gtk_vbox_get_type (void)
|
||||
(GtkArgGetFunc) NULL,
|
||||
};
|
||||
|
||||
vbox_type = gtk_type_unique (gtk_box_get_type (), &vbox_info);
|
||||
vbox_type = gtk_type_unique (GTK_TYPE_BOX, &vbox_info);
|
||||
}
|
||||
|
||||
return vbox_type;
|
||||
|
@ -26,12 +26,15 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#pragma }
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_VBOX(obj) GTK_CHECK_CAST (obj, gtk_vbox_get_type (), GtkVBox)
|
||||
#define GTK_VBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_vbox_get_type (), GtkVBoxClass)
|
||||
#define GTK_IS_VBOX(obj) GTK_CHECK_TYPE (obj, gtk_vbox_get_type ())
|
||||
#define GTK_TYPE_VBOX (gtk_vbox_get_type ())
|
||||
#define GTK_VBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VBOX, GtkVBox))
|
||||
#define GTK_VBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VBOX, GtkVBoxClass))
|
||||
#define GTK_IS_VBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VBOX))
|
||||
#define GTK_IS_VBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VBOX))
|
||||
|
||||
|
||||
typedef struct _GtkVBox GtkVBox;
|
||||
@ -48,7 +51,7 @@ struct _GtkVBoxClass
|
||||
};
|
||||
|
||||
|
||||
guint gtk_vbox_get_type (void);
|
||||
GtkType gtk_vbox_get_type (void);
|
||||
GtkWidget* gtk_vbox_new (gint homogeneous,
|
||||
gint spacing);
|
||||
|
||||
|
@ -2532,6 +2532,7 @@ gtk_widget_set_parent (GtkWidget *widget,
|
||||
g_return_if_fail (widget->parent == NULL);
|
||||
g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget));
|
||||
g_return_if_fail (parent != NULL);
|
||||
g_return_if_fail (widget != parent);
|
||||
|
||||
/* keep this function in sync with gtk_menu_attach_to_widget()
|
||||
*/
|
||||
@ -2549,9 +2550,6 @@ gtk_widget_set_parent (GtkWidget *widget,
|
||||
|
||||
gtk_widget_propagate_state (widget, &data);
|
||||
|
||||
while (parent->parent != NULL)
|
||||
parent = parent->parent;
|
||||
|
||||
gtk_widget_set_style_recurse (widget, NULL);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (widget), widget_signals[PARENT_SET], NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user