diff --git a/ChangeLog b/ChangeLog index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8a64745d4e..bed341a8f3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,56 @@ +2001-03-07 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_set_decorated): new function, turns + off decorations for a window. + + * demos/gtk-demo/button_box.c (create_bbox): adapt to button box + changes + + * gtk/gtklabel.c (gtk_label_get_layout_offsets): new function + to get location of PangoLayout inside the label, closes #51198 + + * gtk/testgtk.c (create_bbox): fix up button box usage + + * gtk/testcalendar.c (create_calendar): fix up button box usage + + * gtk/gtkfilesel.c (gtk_file_selection_init): fixup buttonbox usage + + * gtk/gtkdialog.c (gtk_dialog_init): fixup buttonbox usage + + * gtk/gtkhbbox.h: deprecations + + * gtk/gtkvbbox.h: deprecations + + * gtk/gtkbox.c (gtk_box_get_spacing): new function, used to + emulate deprecated gtk_button_box_get_spacing + + * gtk/gtkbbox.h: deprecate some useless functions, remove entirely + the "set global default" functions + (struct _GtkButtonBox): remove "spacing" field, use the one from + GtkBox base class + + * gtk/gtkbbox.c (_gtk_button_box_child_requisition): rename with uscore + + * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): If we fail to + render the icon, return the missing image icon. + + * gtk/gtkimage.c (gtk_image_set_from_file): fall back to missing + image icon if the load fails. + + * gtk/gtkstock.h (GTK_STOCK_MISSING_IMAGE): Add stock icon for use + when no image is found; should be the Netscape "missing image" + icon eventually but for now is a random image + + * gtk/gtkwindow.c (gtk_window_set_role): new function, sets the + role for the session manager + + * gtk/testgtk.c (dnd_drop): remove use of GTK_WINDOW_DIALOG + + * gtk/gtkcompat.h (GTK_WINDOW_DIALOG): compat #define + GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL + + * gtk/gtkenums.h (enum GtkWindowType): remove GTK_WINDOW_DIALOG + Wed Mar 7 13:24:57 2001 Tim Janik * gtk/*.c: marshaller fixes. diff --git a/demos/gtk-demo/button_box.c b/demos/gtk-demo/button_box.c index 6291375d2e..3cbdb09058 100644 --- a/demos/gtk-demo/button_box.c +++ b/demos/gtk-demo/button_box.c @@ -9,8 +9,6 @@ static GtkWidget * create_bbox (gint horizontal, char* title, gint spacing, - gint child_w, - gint child_h, gint layout) { GtkWidget *frame; @@ -28,8 +26,7 @@ create_bbox (gint horizontal, gtk_container_add (GTK_CONTAINER (frame), bbox); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), spacing); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h); + gtk_box_set_spacing (GTK_BOX (bbox), spacing); button = gtk_button_new_with_label ("OK"); gtk_container_add (GTK_CONTAINER (bbox), button); @@ -75,19 +72,19 @@ do_button_box (void) gtk_container_add (GTK_CONTAINER (frame_horz), vbox); gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Spread", 40, 85, 20, GTK_BUTTONBOX_SPREAD), + create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Edge", 40, 85, 20, GTK_BUTTONBOX_EDGE), + create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "Start", 40, 85, 20, GTK_BUTTONBOX_START), + create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), - create_bbox (TRUE, "End", 40, 85, 20, GTK_BUTTONBOX_END), + create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END), TRUE, TRUE, 5); frame_vert = gtk_frame_new ("Vertical Button Boxes"); @@ -98,19 +95,19 @@ do_button_box (void) gtk_container_add (GTK_CONTAINER (frame_vert), hbox); gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Spread", 30, 85, 20, GTK_BUTTONBOX_SPREAD), + create_bbox (FALSE, "Spread", 30, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Edge", 30, 85, 20, GTK_BUTTONBOX_EDGE), + create_bbox (FALSE, "Edge", 30, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "Start", 30, 85, 20, GTK_BUTTONBOX_START), + create_bbox (FALSE, "Start", 30, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), - create_bbox (FALSE, "End", 30, 85, 20, GTK_BUTTONBOX_END), + create_bbox (FALSE, "End", 30, GTK_BUTTONBOX_END), TRUE, TRUE, 5); } diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf.hierarchy b/docs/reference/gdk-pixbuf/gdk-pixbuf.hierarchy index e69de29bb2..7346c3efc4 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf.hierarchy +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf.hierarchy @@ -0,0 +1,2 @@ +GObject + GdkPixbufLoader diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf.signals b/docs/reference/gdk-pixbuf/gdk-pixbuf.signals index b3db0835ec..252ed60d48 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf.signals +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf.signals @@ -1,3 +1,15 @@ + +GdkPixbufLoader::animation-done +void +GdkPixbufLoader *gdkpixbufloader + + + +GdkPixbufLoader::area-prepared +void +GdkPixbufLoader *gdkpixbufloader + + GdkPixbufLoader::area-updated void @@ -9,7 +21,7 @@ gint arg4 -GdkPixbufLoader::area-prepared +GdkPixbufLoader::closed void GdkPixbufLoader *gdkpixbufloader @@ -18,18 +30,6 @@ GdkPixbufLoader *gdkpixbufloader GdkPixbufLoader::frame-done void GdkPixbufLoader *gdkpixbufloader -gpointer arg1 - - - -GdkPixbufLoader::animation-done -void -GdkPixbufLoader *gdkpixbufloader - - - -GdkPixbufLoader::closed -void -GdkPixbufLoader *gdkpixbufloader +GdkPixbufFrame arg1 diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml index afa985da26..b2f07bd0ef 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml @@ -132,6 +132,28 @@ Application-driven progressive image loading. @Returns: + + + This signal is emitted when an animation is done loading. + + +@gdkpixbufloader: the object which received the signal. + +@loader: Loader which emitted the signal. + + + + This signal is emitted when the pixbuf loader has been fed the + initial amount of data that is required to figure out the size and + format of the image that it will create. After this signal is + emitted, applications can call gdk_pixbuf_loader_get_pixbuf() to + fetch the partially-loaded pixbuf. + + +@gdkpixbufloader: the object which received the signal. + +@loader: Loader which emitted the signal. + This signal is emitted when a significant area of the image being @@ -153,40 +175,6 @@ Application-driven progressive image loading. @width: Width of updated area. @height: Height of updated area. - - - This signal is emitted when the pixbuf loader has been fed the - initial amount of data that is required to figure out the size and - format of the image that it will create. After this signal is - emitted, applications can call gdk_pixbuf_loader_get_pixbuf() to - fetch the partially-loaded pixbuf. - - -@gdkpixbufloader: the object which received the signal. - -@loader: Loader which emitted the signal. - - - - This signal is emitted when a frame is done loading. It will be - emitted for each frame in an animation data stream. - - -@gdkpixbufloader: the object which received the signal. -@arg1: - -@loader: Loader which emitted the signal. -@frame: Frame which just completed loading. - - - - This signal is emitted when an animation is done loading. - - -@gdkpixbufloader: the object which received the signal. - -@loader: Loader which emitted the signal. - This signal is emitted when gdk_pixbuf_loader_close() is called. @@ -206,3 +194,15 @@ sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "") End: --> + + + This signal is emitted when a frame is done loading. It will be + emitted for each frame in an animation data stream. + + +@gdkpixbufloader: the object which received the signal. +@arg1: + +@loader: Loader which emitted the signal. +@frame: Frame which just completed loading. + diff --git a/docs/reference/gtk/tmpl/gtk-unused.sgml b/docs/reference/gtk/tmpl/gtk-unused.sgml index 8d8f64b286..84e9b4c678 100644 --- a/docs/reference/gtk/tmpl/gtk-unused.sgml +++ b/docs/reference/gtk/tmpl/gtk-unused.sgml @@ -571,6 +571,14 @@ produce superscript and subscript. + + + + + +@widget: the object which received the signal. +@message: + @@ -593,6 +601,53 @@ produce superscript and subscript. @widget: the object which received the signal. + + +This is an internally used function and should never be called from an +application. + + +@widget: +@nvis_children: +@width: +@height: + + + +The internal padding of a button is the amount of space between the outside +of the button and the widget it contains. This function gets the default +amount of horizontal and vertical padding, placing the results in @ipad_x +and @ipad_y, respectively. + + +@ipad_x: the default horizontal internal button padding. +@ipad_y: the default vertical internal button padding. + + + +Retrieves the default minimum width and height for all button boxes, and +places the values in @min_width and @min_height, respectively. + + +@min_width: the default minimum width of a child widget. +@min_height: the default minimum height of a child widget. + + + +Sets the default number of pixels that pad each button in every button box. + + +@ipad_x: new default horizontal padding. +@ipad_y: new default vertical padding. + + + +Sets the default size of child buttons. + + +@min_width: minimum default width for child buttons. +@min_height: minimum default height for child buttons. + Initializes a previously allocated #GtkCList widget for use. This should not @@ -954,6 +1009,12 @@ This function is labeled private. @object: the object whose signal handlers should be destroyed. + + + + + + Find out the recursion depth of emissions for a particular type diff --git a/docs/reference/gtk/tmpl/gtkbbox.sgml b/docs/reference/gtk/tmpl/gtkbbox.sgml index a73be12568..07185209dd 100644 --- a/docs/reference/gtk/tmpl/gtkbbox.sgml +++ b/docs/reference/gtk/tmpl/gtkbbox.sgml @@ -70,53 +70,14 @@ Used internally only. - - -Retrieves the default minimum width and height for all button boxes, and -places the values in @min_width and @min_height, respectively. - - -@min_width: the default minimum width of a child widget. -@min_height: the default minimum height of a child widget. - - - - -The internal padding of a button is the amount of space between the outside -of the button and the widget it contains. This function gets the default -amount of horizontal and vertical padding, placing the results in @ipad_x -and @ipad_y, respectively. - - -@ipad_x: the default horizontal internal button padding. -@ipad_y: the default vertical internal button padding. - - - - -Sets the default size of child buttons. - - -@min_width: minimum default width for child buttons. -@min_height: minimum default height for child buttons. - - - - -Sets the default number of pixels that pad each button in every button box. - - -@ipad_x: new default horizontal padding. -@ipad_y: new default vertical padding. - - - + Retrieves how much space a button box is placing between each child button. -@widget: a #GtkButtonBox. @Returns: the current spacing applied to the buttons in @widget. + +@widget: a #GtkButtonBox. @@ -149,11 +110,12 @@ Gets the default number of pixels that pad the buttons in a given button box. @ipad_y: the vertical padding used by buttons in @widget. - + Sets the amount of spacing between buttons in a given button box. + @widget: a #GtkButtonBox. @spacing: the number of pixels of spacing. @@ -188,15 +150,3 @@ box. @ipad_y: the vertical padding that should be used by each button in @widget. - - -This is an internally used function and should never be called from an -application. - - -@widget: -@nvis_children: -@width: -@height: - - diff --git a/docs/reference/gtk/tmpl/gtkenums.sgml b/docs/reference/gtk/tmpl/gtkenums.sgml index 00419b966b..ab9c7500b1 100644 --- a/docs/reference/gtk/tmpl/gtkenums.sgml +++ b/docs/reference/gtk/tmpl/gtkenums.sgml @@ -373,7 +373,6 @@ window managers. @GTK_WINDOW_TOPLEVEL: A window for a typical application. -@GTK_WINDOW_DIALOG: A window for transient messages and dialogs. @GTK_WINDOW_POPUP: A window for popups. diff --git a/docs/reference/gtk/tmpl/gtksignal.sgml b/docs/reference/gtk/tmpl/gtksignal.sgml index 8e7a420846..c3696cb03c 100644 --- a/docs/reference/gtk/tmpl/gtksignal.sgml +++ b/docs/reference/gtk/tmpl/gtksignal.sgml @@ -244,13 +244,6 @@ to the signal. @GTK_RUN_ACTION: @GTK_RUN_NO_HOOKS: - - - - - - - Create a new signal type. (This is usually done in the @@ -308,7 +301,7 @@ you don't want a return value. the callbacks. - + Given the name of the signal and the type of object it connects to, get the signal's identifying integer. Emitting the signal @@ -318,12 +311,13 @@ by number is somewhat faster than using the name each time. It also tries the ancestors of the given type. +@Returns: the signal's identifying number, or 0 if no signal was found. + @name: the signal's name, e.g. clicked. @object_type: the type that the signal operates on, e.g. #GTK_TYPE_BUTTON. -@Returns: the signal's identifying number, or 0 if no signal was found. - + Given the signal's identifier, find its name. @@ -331,8 +325,9 @@ Given the signal's identifier, find its name. Two different signals may have the same name, if they have differing types. -@signal_id: the signal's identifying number. @Returns: the signal name, or NULL if the signal number was invalid. + +@signal_id: the signal's identifying number. @@ -400,7 +395,7 @@ an array of GtkArgs instead of using C's varargs mechanism. followed by one which is a pointer to the return type. - + This function aborts a signal's current emission. @@ -414,11 +409,11 @@ It will print a warning if used on a signal which isn't being emitted. -@object: the object whose signal handlers you wish to stop. -@signal_id: the signal identifier, as returned by gtk_signal_lookup(). - @i: @s: + +@object: the object whose signal handlers you wish to stop. +@signal_id: the signal identifier, as returned by gtk_signal_lookup(). @@ -434,7 +429,7 @@ except it will lookup the signal id for you. @name: the name of the signal you wish to stop. - + Attach a function pointer and user data to a signal for a particular object. @@ -473,38 +468,38 @@ static void attach_print_signal(GtkButton* button, gint to_print) +@o: +@s: +@f: +@d: +@Returns: the connection id. + @object: the object associated with the signal, e.g. if a button is getting pressed, this is that button. @name: name of the signal. @func: function pointer to attach to the signal. @func_data: value to pass as to your function (through the marshaller). -@Returns: the connection id. - -@o: -@s: -@f: -@d: - + Attach a function pointer and user data to a signal so that this handler will be called after the other handlers. -@object: the object associated with the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@func_data: value to pass as to your function (through the marshaller). -@Returns: the unique identifier for this attachment: the connection id. - @o: @s: @f: @d: +@Returns: the unique identifier for this attachment: the connection id. + +@object: the object associated with the signal. +@name: name of the signal. +@func: function pointer to attach to the signal. +@func_data: value to pass as to your function (through the marshaller). - + This function is for registering a callback that will call another object's callback. That is, @@ -525,21 +520,21 @@ gtk_signal_connect_object(button, "clicked", gtk_widget_show, window); +@o: +@s: +@f: +@d: +@Returns: the connection id. + @object: the object which emits the signal. @name: the name of the signal. @func: the function to callback. @slot_object: the object to pass as the first parameter to func. (Though it pretends to take an object, you can really pass any gpointer as the #slot_object .) -@Returns: the connection id. - -@o: -@s: -@f: -@d: - + Attach a signal hook to a signal, passing in an alternate object as the first parameter, and guaranteeing @@ -547,16 +542,16 @@ that the default handler and all normal handlers are called first. -@object: the object associated with the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@slot_object: the object to pass as the first parameter to #func. -@Returns: the connection id. - @o: @s: @f: @d: +@Returns: the connection id. + +@object: the object associated with the signal. +@name: name of the signal. +@func: function pointer to attach to the signal. +@slot_object: the object to pass as the first parameter to #func. @@ -645,95 +640,98 @@ should signal the removal of this signal. @name: name of the signal. - + Destroy a user-defined handler connection. + @object: the object which the handler pertains to. @handler_id: the connection id. - + Destroy all connections for a particular object, with the given function-pointer and user-data. -@object: the object which emits the signal. -@func: the function pointer to search for. -@data: the user data to search for. - @o: @f: @d: + +@object: the object which emits the signal. +@func: the function pointer to search for. +@data: the user data to search for. - + Destroy all connections for a particular object, with the given user-data. -@object: the object which emits the signal. -@data: the user data to search for. - @o: @d: + +@object: the object which emits the signal. +@data: the user data to search for. - + Prevent an user-defined handler from being invoked. All other signal processing will go on as normal, but this particular handler will ignore it. + @object: the object which emits the signal to block. @handler_id: the connection id. - + Prevent a user-defined handler from being invoked, by reference to the user-defined handler's function pointer and user data. (It may result in multiple hooks being blocked, if you've called connect multiple times.) -@object: the object which emits the signal to block. -@func: the function pointer of the handler to block. -@data: the user data of the handler to block. - @o: @f: @d: + +@object: the object which emits the signal to block. +@func: the function pointer of the handler to block. +@data: the user data of the handler to block. - + Prevent all user-defined handlers with a certain user data from being invoked. -@object: the object which emits the signal we want to block. -@data: the user data of the handlers to block. - @o: @d: + +@object: the object which emits the signal we want to block. +@data: the user data of the handlers to block. - + Undo a block, by connection id. Note that undoing a block doesn't necessarily make the hook callable, because if you block a hook twice, you must unblock it twice. + @object: the object which emits the signal we want to unblock. @handler_id: the emission handler identifier, as returned by gtk_signal_connect(), etc. - + Undo a block, by function pointer and data. Note that undoing a block doesn't @@ -741,29 +739,29 @@ necessarily make the hook callable, because if you block a hook twice, you must unblock it twice. -@object: the object which emits the signal we want to unblock. -@func: the function pointer to search for. -@data: the user data to search for. - @o: @f: @d: + +@object: the object which emits the signal we want to unblock. +@func: the function pointer to search for. +@data: the user data to search for. - + Undo block(s), to all signals for a particular object with a particular user-data pointer -@object: the object which emits the signal we want to unblock. -@data: the user data to search for. - @o: @d: + +@object: the object which emits the signal we want to unblock. +@data: the user data to search for. - + Returns a connection id corresponding to a given signal id and object. @@ -774,64 +772,64 @@ may opt to not emit the signal if no one is attached anyway, thus saving the cost of building the arguments. +@i: +@s: +@b: +@Returns: the connection id, if a connection was found. 0 otherwise. + @object: the object to search for the desired user-defined handler. @signal_id: the number of the signal to search for. @may_be_blocked: whether it is acceptable to return a blocked handler. -@Returns: the connection id, if a connection was found. 0 otherwise. - -@i: -@s: -@b: - + Returns a connection id corresponding to a given signal id, object, function pointer and user data. +@o: +@s: +@b: +@f: +@d: +@Returns: the connection id, if a handler was found. 0 otherwise. + @object: the object to search for the desired handler. @signal_id: the number of the signal to search for. @may_be_blocked: whether it is acceptable to return a blocked handler. @func: the function pointer to search for. @data: the user data to search for. -@Returns: the connection id, if a handler was found. 0 otherwise. - -@o: -@s: -@b: -@f: -@d: - + Add an emission hook for a type of signal, for any object. -@signal_id: the type of signal to hook for. -@hook_func: the function to invoke to handle the emission hook. -@data: the user data passed in to hook_func. -@Returns: the id (that you may pass as a parameter -to gtk_signal_remove_emission_hook()). - @i: @h: @d: +@Returns: the id (that you may pass as a parameter +to gtk_signal_remove_emission_hook()). + +@signal_id: the type of signal to hook for. +@hook_func: the function to invoke to handle the emission hook. +@data: the user data passed in to hook_func. - + Delete an emission hook. (see gtk_signal_add_emission_hook()) -@signal_id: the id of the signal type. -@hook_id: the id of the emission handler, returned by add_emission_hook(). - @i: @h: + +@signal_id: the id of the signal type. +@hook_id: the id of the emission handler, returned by add_emission_hook(). diff --git a/docs/reference/gtk/tmpl/gtktypeutils.sgml b/docs/reference/gtk/tmpl/gtktypeutils.sgml index 6295e2dfa1..16a7e543fe 100644 --- a/docs/reference/gtk/tmpl/gtktypeutils.sgml +++ b/docs/reference/gtk/tmpl/gtktypeutils.sgml @@ -560,30 +560,33 @@ Create a new, unique type. @type_info: must not be null, and @type_info->type_name must also not be null. - + -@type: a GtkType @Returns: a pointer to the name of a type, or NULL if it has none. + +@type: a GtkType - + Get the internal representation of a type given its name. -@name: the name of a gtk type @Returns: a GtkType + +@name: the name of a gtk type - + -@type: a GtkType @Returns: the GtkType of the parent + +@type: a GtkType @@ -608,15 +611,16 @@ has all the proper initializers called. @Returns: gpointer to a GtkTypeObject - + Look in the type hierarchy to see if @type has @is_a_type among its ancestors. Do so with a simple lookup, not a loop. +@Returns: + @type: GtkType @is_a_type: GtkType -@Returns: diff --git a/docs/reference/gtk/tmpl/gtkwidget.sgml b/docs/reference/gtk/tmpl/gtkwidget.sgml index b0fb70150f..d86f82e167 100644 --- a/docs/reference/gtk/tmpl/gtkwidget.sgml +++ b/docs/reference/gtk/tmpl/gtkwidget.sgml @@ -1295,14 +1295,6 @@ GtkWidget @event: @Returns: - - - - - -@widget: the object which received the signal. -@message: - diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 4bbf206812..4946596121 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -616,6 +616,10 @@ gdk_drawable_get_image (GdkDrawable *drawable, g_return_val_if_fail (x >= 0, NULL); g_return_val_if_fail (y >= 0, NULL); + /* FIXME? Note race condition since we get the size then + * get the image, and the size may have changed. + */ + if (width < 0 || height < 0) gdk_drawable_get_size (drawable, width < 0 ? &width : NULL, diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 5ee3b86d00..45fe3d3453 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -68,12 +68,16 @@ gtk_button_box_class_init (GtkButtonBoxClass *class) GtkWidgetClass *widget_class; widget_class = (GtkWidgetClass*) class; + + /* FIXME we need to override the "spacing" property on GtkBox once + * libgobject allows that. + */ } static void gtk_button_box_init (GtkButtonBox *button_box) { - button_box->spacing = GTK_BUTTONBOX_DEFAULT; + GTK_BOX (button_box)->spacing = 0; button_box->child_min_width = GTK_BUTTONBOX_DEFAULT; button_box->child_min_height = GTK_BUTTONBOX_DEFAULT; button_box->child_ipad_x = GTK_BUTTONBOX_DEFAULT; @@ -81,43 +85,8 @@ gtk_button_box_init (GtkButtonBox *button_box) button_box->layout_style = GTK_BUTTONBOX_DEFAULT_STYLE; } - -/* set default values for child size and child internal padding */ -/* default spacing is in defined in subclasses */ - -void gtk_button_box_set_child_size_default (gint width, gint height) -{ - default_child_min_width = width; - default_child_min_height = height; -} - -void gtk_button_box_set_child_ipadding_default (gint ipad_x, gint ipad_y) -{ - default_child_ipad_x = ipad_x; - default_child_ipad_y = ipad_y; -} - -/* get default values for child size and child internal padding */ - -void gtk_button_box_get_child_size_default (gint *width, gint *height) -{ - *width = default_child_min_width; - *height = default_child_min_height; -} - -void gtk_button_box_get_child_ipadding_default (gint *ipad_x, gint *ipad_y) -{ - *ipad_x = default_child_ipad_x; - *ipad_y = default_child_ipad_y; -} - /* set per widget values for spacing, child size and child internal padding */ -void gtk_button_box_set_spacing (GtkButtonBox *widget, gint spacing) -{ - widget->spacing = spacing; -} - void gtk_button_box_set_child_size (GtkButtonBox *widget, gint width, gint height) { widget->child_min_width = width; @@ -143,11 +112,6 @@ void gtk_button_box_set_layout (GtkButtonBox *widget, /* get per widget values for spacing, child size and child internal padding */ -gint gtk_button_box_get_spacing (GtkButtonBox *widget) -{ - return widget->spacing; -} - void gtk_button_box_get_child_size (GtkButtonBox *widget, gint *width, gint *height) { @@ -173,10 +137,10 @@ GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget) to match minimum size and internal padding. Returns the size each single child should have. */ void -gtk_button_box_child_requisition (GtkWidget *widget, - int *nvis_children, - int *width, - int *height) +_gtk_button_box_child_requisition (GtkWidget *widget, + int *nvis_children, + int *width, + int *height) { GtkButtonBox *bbox; GtkBoxChild *child; @@ -202,8 +166,10 @@ gtk_button_box_child_requisition (GtkWidget *widget, bbox = GTK_BUTTON_BOX (widget); - gtk_button_box_get_child_size_default (&width_default, &height_default); - gtk_button_box_get_child_ipadding_default (&ipad_x_default, &ipad_y_default); + width_default = default_child_min_width; + height_default = default_child_min_height; + ipad_x_default = default_child_ipad_x; + ipad_y_default = default_child_ipad_y; child_min_width = bbox->child_min_width != GTK_BUTTONBOX_DEFAULT ? bbox->child_min_width : width_default; diff --git a/gtk/gtkbbox.h b/gtk/gtkbbox.h index ac2fd9f6a5..5ac286e799 100644 --- a/gtk/gtkbbox.h +++ b/gtk/gtkbbox.h @@ -51,7 +51,6 @@ typedef struct _GtkButtonBoxClass GtkButtonBoxClass; struct _GtkButtonBox { GtkBox box; - gint spacing; gint child_min_width; gint child_min_height; gint child_ipad_x; @@ -67,31 +66,27 @@ struct _GtkButtonBoxClass GtkType gtk_button_box_get_type (void) G_GNUC_CONST; -void gtk_button_box_get_child_size_default (gint *min_width, gint *min_height); -void gtk_button_box_get_child_ipadding_default (gint *ipad_x, gint *ipad_y); +GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget); +void gtk_button_box_set_layout (GtkButtonBox *widget, + GtkButtonBoxStyle layout_style); -void gtk_button_box_set_child_size_default (gint min_width, gint min_height); -void gtk_button_box_set_child_ipadding_default (gint ipad_x, gint ipad_y); +#ifndef GTK_DISABLE_DEPRECATED +#define gtk_button_box_set_spacing gtk_box_set_spacing +#define gtk_button_box_get_spacing gtk_box_get_spacing -gint gtk_button_box_get_spacing (GtkButtonBox *widget); -GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget); -void gtk_button_box_get_child_size (GtkButtonBox *widget, - gint *min_width, gint *min_height); -void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y); - -void gtk_button_box_set_spacing (GtkButtonBox *widget, gint spacing); -void gtk_button_box_set_layout (GtkButtonBox *widget, - GtkButtonBoxStyle layout_style); void gtk_button_box_set_child_size (GtkButtonBox *widget, gint min_width, gint min_height); void gtk_button_box_set_child_ipadding (GtkButtonBox *widget, gint ipad_x, gint ipad_y); - +void gtk_button_box_get_child_size (GtkButtonBox *widget, + gint *min_width, gint *min_height); +void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y); +#endif /* Internal method - do not use. */ -void gtk_button_box_child_requisition (GtkWidget *widget, - int *nvis_children, - int *width, - int *height); +void _gtk_button_box_child_requisition (GtkWidget *widget, + int *nvis_children, + int *width, + int *height); #ifdef __cplusplus } diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 96fad211c0..e61d7a8a81 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -438,6 +438,22 @@ gtk_box_set_spacing (GtkBox *box, } } +/** + * gtk_box_get_spacing: + * @box: a #GtkBox + * + * Gets the value set by gtk_box_set_spacing(). + * + * Return value: spacing between children + **/ +gint +gtk_box_get_spacing (GtkBox *box) +{ + g_return_if_fail (GTK_IS_BOX (box)); + + return box->spacing; +} + void gtk_box_reorder_child (GtkBox *box, GtkWidget *child, diff --git a/gtk/gtkbox.h b/gtk/gtkbox.h index f079fb8fde..b6de573f5b 100644 --- a/gtk/gtkbox.h +++ b/gtk/gtkbox.h @@ -92,6 +92,7 @@ void gtk_box_set_homogeneous (GtkBox *box, gboolean homogeneous); void gtk_box_set_spacing (GtkBox *box, gint spacing); +gint gtk_box_get_spacing (GtkBox *box); void gtk_box_reorder_child (GtkBox *box, GtkWidget *child, gint position); diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 1742f56780..ea47558750 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -129,7 +129,7 @@ gtk_dialog_init (GtkDialog *dialog) gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog->action_area), 5); + gtk_box_set_spacing (GTK_BOX (dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index bb75cd24eb..b489b0744d 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -356,7 +356,6 @@ typedef enum typedef enum { GTK_WINDOW_TOPLEVEL, - GTK_WINDOW_DIALOG, GTK_WINDOW_POPUP } GtkWindowType; diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 538f799636..05aea054d1 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -499,7 +499,7 @@ gtk_file_selection_init (GtkFileSelection *filesel) /* The horizontal box containing create, rename etc. buttons */ filesel->button_area = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (filesel->button_area), 0); + gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0); gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, FALSE, FALSE, 0); gtk_widget_show (filesel->button_area); diff --git a/gtk/gtkhbbox.c b/gtk/gtkhbbox.c index e2bbdcf329..af95fe73ef 100644 --- a/gtk/gtkhbbox.c +++ b/gtk/gtkhbbox.c @@ -144,15 +144,14 @@ gtk_hbutton_box_size_request (GtkWidget *widget, box = GTK_BOX (widget); bbox = GTK_BUTTON_BOX (widget); - spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT - ? bbox->spacing : default_spacing; + spacing = box->spacing; layout = bbox->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE ? bbox->layout_style : default_layout_style; - gtk_button_box_child_requisition (widget, - &nvis_children, - &child_width, - &child_height); + _gtk_button_box_child_requisition (widget, + &nvis_children, + &child_width, + &child_height); if (nvis_children == 0) { @@ -190,6 +189,7 @@ static void gtk_hbutton_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { + GtkBox *base_box; GtkButtonBox *box; GtkHButtonBox *hbox; GtkBoxChild *child; @@ -210,16 +210,16 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget, g_return_if_fail (GTK_IS_HBUTTON_BOX (widget)); g_return_if_fail (allocation != NULL); + base_box = GTK_BOX (widget); box = GTK_BUTTON_BOX (widget); hbox = GTK_HBUTTON_BOX (widget); - spacing = box->spacing != GTK_BUTTONBOX_DEFAULT - ? box->spacing : default_spacing; + spacing = base_box->spacing; layout = box->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE ? box->layout_style : default_layout_style; - gtk_button_box_child_requisition (widget, - &nvis_children, - &child_width, - &child_height); + _gtk_button_box_child_requisition (widget, + &nvis_children, + &child_width, + &child_height); widget->allocation = *allocation; width = allocation->width - GTK_CONTAINER (box)->border_width*2; switch (layout) diff --git a/gtk/gtkhbbox.h b/gtk/gtkhbbox.h index c918b79266..41e62e26fd 100644 --- a/gtk/gtkhbbox.h +++ b/gtk/gtkhbbox.h @@ -63,12 +63,13 @@ GtkWidget* gtk_hbutton_box_new (void); /* buttons can be added by gtk_container_add() */ +#ifndef GTK_DISABLE_DEPRECATED gint gtk_hbutton_box_get_spacing_default (void); GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void); void gtk_hbutton_box_set_spacing_default (gint spacing); void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout); - +#endif #ifdef __cplusplus } diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index 07b5d5038c..4217869f8a 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -33,6 +33,9 @@ #include #include +/* FIXME use a better icon for this */ +#define MISSING_IMAGE_INLINE dialog_error + static gpointer parent_class = NULL; static void gtk_icon_factory_init (GtkIconFactory *icon_factory); @@ -384,6 +387,8 @@ get_default_icons (GtkIconFactory *factory) add_unsized (factory, stock_new, GTK_STOCK_NEW); add_unsized (factory, stock_open, GTK_STOCK_OPEN); add_unsized (factory, stock_save, GTK_STOCK_SAVE); + + add_unsized (factory, MISSING_IMAGE_INLINE, GTK_STOCK_MISSING_IMAGE); } /* Sizes */ @@ -878,6 +883,20 @@ find_and_prep_icon_source (GtkIconSet *icon_set, return source; } +static GdkPixbuf* +get_fallback_image (void) +{ + /* This icon can be used for any direction/state/size */ + static GdkPixbuf *pixbuf = NULL; + + if (pixbuf == NULL) + pixbuf = gdk_pixbuf_new_from_inline (MISSING_IMAGE_INLINE, FALSE, -1, NULL); + else + g_object_ref (G_OBJECT (pixbuf)); + + return pixbuf; +} + /** * gtk_icon_set_render_icon: * @icon_set: a #GtkIconSet @@ -908,17 +927,11 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set, GdkPixbuf *icon; GtkIconSource *source; - /* FIXME conceivably, everywhere this function - * returns NULL, we should return some default - * dummy icon like a question mark or the image icon - * from netscape - */ - g_return_val_if_fail (icon_set != NULL, NULL); g_return_val_if_fail (GTK_IS_STYLE (style), NULL); if (icon_set->sources == NULL) - return NULL; + return get_fallback_image (); icon = find_in_cache (icon_set, style, direction, state, size); @@ -933,7 +946,7 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set, source = find_and_prep_icon_source (icon_set, direction, state, size); if (source == NULL) - return NULL; + return get_fallback_image (); g_assert (source->pixbuf != NULL); @@ -948,7 +961,7 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set, if (icon == NULL) { g_warning ("Theme engine failed to render icon"); - return NULL; + return get_fallback_image (); } add_to_cache (icon_set, style, direction, state, size, icon); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index d82effbb77..a28109419d 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -27,6 +27,7 @@ #include "gtkcontainer.h" #include "gtkimage.h" #include "gtkiconfactory.h" +#include "gtkstock.h" static void gtk_image_class_init (GtkImageClass *klass); static void gtk_image_init (GtkImage *image); @@ -388,7 +389,12 @@ gtk_image_set_from_file (GtkImage *image, pixbuf = gdk_pixbuf_new_from_file (filename, NULL); if (pixbuf == NULL) - return; + { + gtk_image_set_from_stock (image, + GTK_STOCK_MISSING_IMAGE, + GTK_ICON_SIZE_BUTTON); + return; + } gtk_image_set_from_pixbuf (image, pixbuf); diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 738f263427..fad59e5709 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -332,6 +332,7 @@ gtk_label_get_property (GObject *object, case PROP_ACCEL_KEYVAL: g_value_set_uint (value, label->accel_keyval); break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1673,3 +1674,27 @@ gtk_label_select_region (GtkLabel *label, } } +/** + * gtk_label_get_layout_offsets: + * @label: a #GtkLabel + * @x: location to store X offset of layout, or %NULL + * @y: location to store Y offset of layout, or %NULL + * + * Returns the coordinates where the label will draw the #PangoLayout + * representing the text in the label; useful to convert mouse events + * into coordinates inside the #PangoLayout, e.g. to take some action + * if some part of the label is clicked. Of course you will need to + * create a #GtkEventBox to receive the events, and pack the label + * inside it, since labels are a #GTK_NO_WINDOW widget. + * + **/ +void +gtk_label_get_layout_offsets (GtkLabel *label, + gint *x, + gint *y) +{ + g_return_if_fail (GTK_IS_LABEL (label)); + + get_layout_location (label, x, y); +} + diff --git a/gtk/gtklabel.h b/gtk/gtklabel.h index 7a8caa4165..d9bca17405 100644 --- a/gtk/gtklabel.h +++ b/gtk/gtklabel.h @@ -112,6 +112,10 @@ void gtk_label_select_region (GtkLabel *label, gint start_offset, gint end_offset); +void gtk_label_get_layout_offsets (GtkLabel *label, + gint *x, + gint *y); + #ifndef GTK_DISABLE_COMPAT_H # define gtk_label_set gtk_label_set_text #endif /* GTK_DISABLE_COMPAT_H */ diff --git a/gtk/gtkstock.h b/gtk/gtkstock.h index d40cb95602..a613446168 100644 --- a/gtk/gtkstock.h +++ b/gtk/gtkstock.h @@ -62,6 +62,8 @@ void gtk_stock_item_free (GtkStockItem *item); /* Stock IDs */ +#define GTK_STOCK_MISSING_IMAGE "gtk-missing-image" + #define GTK_STOCK_DIALOG_INFO "gtk-dialog-info" #define GTK_STOCK_DIALOG_WARNING "gtk-dialog-warning" #define GTK_STOCK_DIALOG_ERROR "gtk-dialog-error" diff --git a/gtk/gtkvbbox.c b/gtk/gtkvbbox.c index b199d1d448..d427d2917a 100644 --- a/gtk/gtkvbbox.c +++ b/gtk/gtkvbbox.c @@ -146,15 +146,14 @@ gtk_vbutton_box_size_request (GtkWidget *widget, box = GTK_BOX (widget); bbox = GTK_BUTTON_BOX (widget); - spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT - ? bbox->spacing : default_spacing; + spacing = box->spacing; layout = bbox->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE ? bbox->layout_style : default_layout_style; - gtk_button_box_child_requisition (widget, - &nvis_children, - &child_width, - &child_height); + _gtk_button_box_child_requisition (widget, + &nvis_children, + &child_width, + &child_height); if (nvis_children == 0) { @@ -193,6 +192,7 @@ static void gtk_vbutton_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { + GtkBox *base_box; GtkButtonBox *box; GtkVButtonBox *hbox; GtkBoxChild *child; @@ -213,16 +213,16 @@ gtk_vbutton_box_size_allocate (GtkWidget *widget, g_return_if_fail (GTK_IS_VBUTTON_BOX (widget)); g_return_if_fail (allocation != NULL); + base_box = GTK_BOX (widget); box = GTK_BUTTON_BOX (widget); hbox = GTK_VBUTTON_BOX (widget); - spacing = box->spacing != GTK_BUTTONBOX_DEFAULT - ? box->spacing : default_spacing; + spacing = base_box->spacing; layout = box->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE ? box->layout_style : default_layout_style; - gtk_button_box_child_requisition (widget, - &nvis_children, - &child_width, - &child_height); + _gtk_button_box_child_requisition (widget, + &nvis_children, + &child_width, + &child_height); widget->allocation = *allocation; height = allocation->height - GTK_CONTAINER (box)->border_width*2; switch (layout) diff --git a/gtk/gtkvbbox.h b/gtk/gtkvbbox.h index f4b3fbdc8f..b5dac7dd8f 100644 --- a/gtk/gtkvbbox.h +++ b/gtk/gtkvbbox.h @@ -63,11 +63,13 @@ GtkWidget *gtk_vbutton_box_new (void); /* buttons can be added by gtk_container_add() */ +#ifndef GTK_DISABLE_DEPRECATED gint gtk_vbutton_box_get_spacing_default (void); void gtk_vbutton_box_set_spacing_default (gint spacing); GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void); void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout); +#endif #ifdef __cplusplus diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 710a5e32ad..494c091fc8 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -315,7 +315,8 @@ gtk_window_init (GtkWindow *window) window->frame_top = 0; window->frame_bottom = 0; window->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL; - + window->decorated = TRUE; + gtk_widget_ref (GTK_WIDGET (window)); gtk_object_sink (GTK_OBJECT (window)); window->has_user_ref_count = TRUE; @@ -442,9 +443,13 @@ gtk_window_get_arg (GtkObject *object, * contain other widgets. Nearly always, the type of the window should * be #GTK_WINDOW_TOPLEVEL. If you're implementing something like a * popup menu from scratch (which is a bad idea, just use #GtkMenu), - * you might use #GTK_WINDOW_TOPLEVEL. #GTK_WINDOW_DIALOG is not - * useful; dialogs should be of type #GTK_WINDOW_TOPLEVEL. (Probably - * you want to use the #GtkDialog widget for dialogs anyway). + * you might use #GTK_WINDOW_POPUP. #GTK_WINDOW_POPUP is not for + * dialogs, though in some other toolkits dialogs are called "popups." + * In GTK+, #GTK_WINDOW_POPUP means a pop-up menu or pop-up tooltip. + * Popup windows are not controlled by the window manager. + * + * If you simply want an undecorated window (no window borders), use + * gtk_window_set_decorated(), don't use #GTK_WINDOW_POPUP. * * Return value: a new #GtkWindow. **/ @@ -500,13 +505,14 @@ gtk_window_set_title (GtkWindow *window, * @wmclass_name: window name hint * @wmclass_class: window class hint * - * This function sets the X Window System "class" and "name" hints for a window. - * According to the ICCCM, you should always set these to the same value for - * all windows in an application, and GTK sets them to that value by default, - * so calling this function is sort of pointless. However, you may want to - * call gtk_window_set_role() on each window in your application, for the - * benefit of the session manager. Setting the role allows the window manager - * to restore window positions when loading a saved session. + * Don't use this function. It sets the X Window System "class" and + * "name" hints for a window. According to the ICCCM, you should + * always set these to the same value for all windows in an + * application, and GTK sets them to that value by default, so calling + * this function is sort of pointless. However, you may want to call + * gtk_window_set_role() on each window in your application, for the + * benefit of the session manager. Setting the role allows the window + * manager to restore window positions when loading a saved session. * **/ void @@ -524,7 +530,39 @@ gtk_window_set_wmclass (GtkWindow *window, window->wmclass_class = g_strdup (wmclass_class); if (GTK_WIDGET_REALIZED (window)) - g_warning ("shouldn't set wmclass after window is realized!\n"); + g_warning ("gtk_window_set_wmclass: shouldn't set wmclass after window is realized!\n"); +} + +/** + * gtk_window_set_role: + * @window: a #GtkWindow + * @role: unique identifier for the window to be used when restoring a session + * + * In combination with the window title, the window role allows a + * window manager to identify "the same" window when an application is + * restarted. So for example you might set the "toolbox" role on your + * app's toolbox window, so that when the user restarts their session, + * the window manager can put the toolbox back in the same place. + * + * If a window already has a unique title, you don't need to set the + * role, since the WM can use the title to identify the window when + * restoring the session. + * + **/ +void +gtk_window_set_role (GtkWindow *window, + const gchar *role) +{ + g_return_if_fail (GTK_IS_WINDOW (window)); + + if (role == window->wm_role) + return; + + g_free (window->wm_role); + window->wm_role = g_strdup (role); + + if (GTK_WIDGET_REALIZED (window)) + g_warning ("gtk_window_set_role(): shouldn't set role after window is realized!\n"); } /** @@ -927,7 +965,7 @@ gtk_window_unset_transient_for (GtkWindow *window) * e.g. keep the dialog on top of the main window, or center the * dialog over the main window. gtk_dialog_new_with_buttons() and * other convenience functions in GTK+ will sometimes call - * gtk_window_set_transient_for() on yoru behalf. + * gtk_window_set_transient_for() on your behalf. * **/ void @@ -1111,6 +1149,40 @@ gtk_window_set_geometry_hints (GtkWindow *window, gtk_widget_queue_resize (GTK_WIDGET (window)); } +/** + * gtk_window_set_decorated: + * @window: a #GtkWindow + * @setting: %TRUE to decorate the window + * + * By default, windows are decorated with a title bar, resize + * controls, etc. Some window managers allow GTK+ to disable these + * decorations, creating a borderless window. If you set the decorated + * property to %FALSE using this function, GTK+ will do its best to + * convince the window manager not to decorate the window. + * + **/ +void +gtk_window_set_decorated (GtkWindow *window, + gboolean setting) +{ + g_return_if_fail (GTK_IS_WINDOW (window)); + + setting = setting != FALSE; + + if (setting == window->decorated) + return; + + if (GTK_WIDGET (window)->window) + { + if (window->decorated) + gdk_window_set_decorations (GTK_WIDGET (window)->window, + GDK_DECOR_ALL); + else + gdk_window_set_decorations (GTK_WIDGET (window)->window, + 0); + } +} + /** * gtk_window_set_default_size: * @window: a #GtkWindow @@ -1128,6 +1200,11 @@ gtk_window_set_geometry_hints (GtkWindow *window, * * For more control over a window's initial size and how resizing works, * investigate gtk_window_set_geometry_hints(). + * + * A useful feature: if you set the "geometry widget" via + * gtk_window_set_geometry_hints(), the default size specified by + * gtk_window_set_default_size() will be the default size of that + * widget, not of the entire window. * **/ void @@ -1376,12 +1453,12 @@ gtk_window_realize (GtkWidget *widget) case GTK_WINDOW_TOPLEVEL: attributes.window_type = GDK_WINDOW_TOPLEVEL; break; - case GTK_WINDOW_DIALOG: - attributes.window_type = GDK_WINDOW_DIALOG; - break; case GTK_WINDOW_POPUP: attributes.window_type = GDK_WINDOW_TEMP; break; + default: + g_warning (G_STRLOC": Unknown window type %d!", window->type); + break; } attributes.title = window->title; @@ -1454,6 +1531,12 @@ gtk_window_realize (GtkWidget *widget) gdk_window_set_transient_for (widget->window, GTK_WIDGET (window->transient_parent)->window); + if (window->wm_role) + gdk_window_set_role (widget->window, window->wm_role); + + if (!window->decorated) + gdk_window_set_decorations (widget->window, 0); + gdk_window_set_type_hint (widget->window, window->type_hint); /* transient_for must be set to allow the modal hint */ diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 92d97a3e4b..d0c7ece481 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -57,6 +57,7 @@ struct _GtkWindow gchar *title; gchar *wmclass_name; gchar *wmclass_class; + gchar *wm_role; GtkWindowType type; GdkWindow *frame; @@ -90,8 +91,10 @@ struct _GtkWindow guint stick_initially : 1; guint maximize_initially : 1; + guint decorated : 1; + GdkWindowTypeHint type_hint : 2; - + guint frame_left; guint frame_top; guint frame_right; @@ -116,6 +119,8 @@ void gtk_window_set_title (GtkWindow *window, void gtk_window_set_wmclass (GtkWindow *window, const gchar *wmclass_name, const gchar *wmclass_class); +void gtk_window_set_role (GtkWindow *window, + const gchar *role); void gtk_window_set_policy (GtkWindow *window, gint allow_shrink, gint allow_grow, @@ -139,6 +144,11 @@ void gtk_window_set_geometry_hints (GtkWindow *window, GtkWidget *geometry_widget, GdkGeometry *geometry, GdkWindowHints geom_mask); +void gtk_window_set_decorations_hint (GtkWindow *window, + GdkWMDecoration decorations); +void gtk_window_set_functions_hint (GtkWindow *window, + GdkWMFunction functions); + /* The following differs from gtk_widget_set_usize, in that * gtk_widget_set_usize() overrides the requisition, so sets a minimum * size, while this only sets the size requested from the WM. diff --git a/gtk/testcalendar.c b/gtk/testcalendar.c index 0eaa0c9602..d870890c80 100644 --- a/gtk/testcalendar.c +++ b/gtk/testcalendar.c @@ -296,7 +296,7 @@ void create_calendar() hbbox = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD); gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD); - gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5); + gtk_box_set_spacing(GTK_BOX(hbbox), 5); /* Calendar widget */ frame = gtk_frame_new("Calendar"); diff --git a/gtk/testgtk.c b/gtk/testgtk.c index 8b06fe0b38..c4cada989a 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -508,7 +508,7 @@ create_bbox (gint horizontal, gtk_container_add (GTK_CONTAINER (frame), bbox); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), spacing); + gtk_box_set_spacing (GTK_BOX (bbox), spacing); gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h); button = gtk_button_new_with_label ("OK"); @@ -7228,7 +7228,7 @@ dnd_drop (GtkWidget *button, GdkEvent *event) if (window) return; - window = gtk_window_new(GTK_WINDOW_DIALOG); + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER(window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", @@ -7606,6 +7606,8 @@ create_shapes (void) with_region = shape_create_icon ("3DRings.xpm", 460, 270, 25,25, GTK_WINDOW_TOPLEVEL); + gtk_window_set_decorated (GTK_WINDOW (with_region), FALSE); + gtk_signal_connect (GTK_OBJECT (with_region), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &with_region); diff --git a/tests/testcalendar.c b/tests/testcalendar.c index 0eaa0c9602..d870890c80 100644 --- a/tests/testcalendar.c +++ b/tests/testcalendar.c @@ -296,7 +296,7 @@ void create_calendar() hbbox = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD); gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD); - gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5); + gtk_box_set_spacing(GTK_BOX(hbbox), 5); /* Calendar widget */ frame = gtk_frame_new("Calendar"); diff --git a/tests/testgtk.c b/tests/testgtk.c index 8b06fe0b38..c4cada989a 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -508,7 +508,7 @@ create_bbox (gint horizontal, gtk_container_add (GTK_CONTAINER (frame), bbox); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), spacing); + gtk_box_set_spacing (GTK_BOX (bbox), spacing); gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h); button = gtk_button_new_with_label ("OK"); @@ -7228,7 +7228,7 @@ dnd_drop (GtkWidget *button, GdkEvent *event) if (window) return; - window = gtk_window_new(GTK_WINDOW_DIALOG); + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER(window), 10); gtk_signal_connect (GTK_OBJECT (window), "destroy", @@ -7606,6 +7606,8 @@ create_shapes (void) with_region = shape_create_icon ("3DRings.xpm", 460, 270, 25,25, GTK_WINDOW_TOPLEVEL); + gtk_window_set_decorated (GTK_WINDOW (with_region), FALSE); + gtk_signal_connect (GTK_OBJECT (with_region), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &with_region);