+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
+2001-03-07 Havoc Pennington <hp@redhat.com>
+
+ * 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 <timj@gtk.org>
* gtk/*.c: marshaller fixes.
create_bbox (gint horizontal,
char* title,
gint spacing,
- gint child_w,
- gint child_h,
gint layout)
{
GtkWidget *frame;
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);
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");
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);
}
+GObject
+ GdkPixbufLoader
<SIGNAL>
-<NAME>GdkPixbufLoader::area-updated</NAME>
+<NAME>GdkPixbufLoader::animation-done</NAME>
<RETURNS>void</RETURNS>
GdkPixbufLoader *gdkpixbufloader
-gint arg1
-gint arg2
-gint arg3
-gint arg4
</SIGNAL>
<SIGNAL>
</SIGNAL>
<SIGNAL>
-<NAME>GdkPixbufLoader::frame-done</NAME>
+<NAME>GdkPixbufLoader::area-updated</NAME>
<RETURNS>void</RETURNS>
GdkPixbufLoader *gdkpixbufloader
-gpointer arg1
+gint arg1
+gint arg2
+gint arg3
+gint arg4
</SIGNAL>
<SIGNAL>
-<NAME>GdkPixbufLoader::animation-done</NAME>
+<NAME>GdkPixbufLoader::closed</NAME>
<RETURNS>void</RETURNS>
GdkPixbufLoader *gdkpixbufloader
</SIGNAL>
<SIGNAL>
-<NAME>GdkPixbufLoader::closed</NAME>
+<NAME>GdkPixbufLoader::frame-done</NAME>
<RETURNS>void</RETURNS>
GdkPixbufLoader *gdkpixbufloader
+GdkPixbufFrame arg1
</SIGNAL>
@Returns:
-<!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
+<!-- ##### SIGNAL GdkPixbufLoader::animation-done ##### -->
<para>
- This signal is emitted when a significant area of the image being
- loaded has been updated. Normally it means that a complete
- scanline has been read in, but it could be a different area as
- well. Applications can use this signal to know when to repaint
- areas of an image that is being loaded.
+ This signal is emitted when an animation is done loading.
</para>
@gdkpixbufloader: the object which received the signal.
-@arg1:
-@arg2:
-@arg3:
-@arg4:
<!-- # Unused Parameters # -->
@loader: Loader which emitted the signal.
-@x: X offset of upper-left corner of the updated area.
-@y: Y offset of upper-left corner of the updated area.
-@width: Width of updated area.
-@height: Height of updated area.
<!-- ##### SIGNAL GdkPixbufLoader::area-prepared ##### -->
<para>
<!-- # Unused Parameters # -->
@loader: Loader which emitted the signal.
-<!-- ##### SIGNAL GdkPixbufLoader::frame-done ##### -->
+<!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
<para>
- This signal is emitted when a frame is done loading. It will be
- emitted for each frame in an animation data stream.
+ This signal is emitted when a significant area of the image being
+ loaded has been updated. Normally it means that a complete
+ scanline has been read in, but it could be a different area as
+ well. Applications can use this signal to know when to repaint
+ areas of an image that is being loaded.
</para>
@gdkpixbufloader: the object which received the signal.
@arg1:
+@arg2:
+@arg3:
+@arg4:
<!-- # Unused Parameters # -->
@loader: Loader which emitted the signal.
-@frame: Frame which just completed loading.
-
-<!-- ##### SIGNAL GdkPixbufLoader::animation-done ##### -->
- <para>
- This signal is emitted when an animation is done loading.
- </para>
-
-@gdkpixbufloader: the object which received the signal.
-<!-- # Unused Parameters # -->
-@loader: Loader which emitted the signal.
+@x: X offset of upper-left corner of the updated area.
+@y: Y offset of upper-left corner of the updated area.
+@width: Width of updated area.
+@height: Height of updated area.
<!-- ##### SIGNAL GdkPixbufLoader::closed ##### -->
<para>
End:
-->
+<!-- ##### SIGNAL GdkPixbufLoader::frame-done ##### -->
+ <para>
+ This signal is emitted when a frame is done loading. It will be
+ emitted for each frame in an animation data stream.
+ </para>
+
+@gdkpixbufloader: the object which received the signal.
+@arg1:
+<!-- # Unused Parameters # -->
+@loader: Loader which emitted the signal.
+@frame: Frame which just completed loading.
+
</para>
+<!-- ##### SIGNAL GtkWidget::debug-msg ##### -->
+<para>
+
+</para>
+
+@widget: the object which received the signal.
+@message:
+
<!-- ##### SIGNAL GtkWidget::draw ##### -->
<para>
@widget: the object which received the signal.
+<!-- ##### FUNCTION gtk_button_box_child_requisition ##### -->
+<para>\r
+This is an internally used function and should never be called from an\r
+application.\r
+</para>
+
+@widget:
+@nvis_children:
+@width:
+@height:
+
+<!-- ##### FUNCTION gtk_button_box_get_child_ipadding_default ##### -->
+<para>\r
+The internal padding of a button is the amount of space between the outside\r
+of the button and the widget it contains. This function gets the default\r
+amount of horizontal and vertical padding, placing the results in @ipad_x\r
+and @ipad_y, respectively.\r
+</para>
+
+@ipad_x: the default horizontal internal button padding.
+@ipad_y: the default vertical internal button padding.
+
+<!-- ##### FUNCTION gtk_button_box_get_child_size_default ##### -->
+<para>\r
+Retrieves the default minimum width and height for all button boxes, and\r
+places the values in @min_width and @min_height, respectively.\r
+</para>
+
+@min_width: the default minimum width of a child widget.
+@min_height: the default minimum height of a child widget.
+
+<!-- ##### FUNCTION gtk_button_box_set_child_ipadding_default ##### -->
+<para>\r
+Sets the default number of pixels that pad each button in every button box.\r
+</para>
+
+@ipad_x: new default horizontal padding.
+@ipad_y: new default vertical padding.
+
+<!-- ##### FUNCTION gtk_button_box_set_child_size_default ##### -->
+<para>\r
+Sets the default size of child buttons.\r
+</para>
+
+@min_width: minimum default width for child buttons.
+@min_height: minimum default height for child buttons.
+
<!-- ##### FUNCTION gtk_clist_construct ##### -->
<para>
Initializes a previously allocated #GtkCList widget for use. This should not
@object: the object whose signal handlers should be destroyed.
+<!-- ##### FUNCTION gtk_signal_init ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION gtk_signal_n_emissions ##### -->
<para>
Find out the recursion depth of emissions for a particular type
-<!-- ##### FUNCTION gtk_button_box_get_child_size_default ##### -->
-<para>\r
-Retrieves the default minimum width and height for all button boxes, and\r
-places the values in @min_width and @min_height, respectively.\r
-</para>
-
-@min_width: the default minimum width of a child widget.
-@min_height: the default minimum height of a child widget.
-
-
-<!-- ##### FUNCTION gtk_button_box_get_child_ipadding_default ##### -->
-<para>\r
-The internal padding of a button is the amount of space between the outside\r
-of the button and the widget it contains. This function gets the default\r
-amount of horizontal and vertical padding, placing the results in @ipad_x\r
-and @ipad_y, respectively.\r
-</para>
-
-@ipad_x: the default horizontal internal button padding.
-@ipad_y: the default vertical internal button padding.
-
-
-<!-- ##### FUNCTION gtk_button_box_set_child_size_default ##### -->
-<para>\r
-Sets the default size of child buttons.\r
-</para>
-
-@min_width: minimum default width for child buttons.
-@min_height: minimum default height for child buttons.
-
-
-<!-- ##### FUNCTION gtk_button_box_set_child_ipadding_default ##### -->
-<para>\r
-Sets the default number of pixels that pad each button in every button box.\r
-</para>
-
-@ipad_x: new default horizontal padding.
-@ipad_y: new default vertical padding.
-
-
-<!-- ##### FUNCTION gtk_button_box_get_spacing ##### -->
+<!-- ##### MACRO gtk_button_box_get_spacing ##### -->
<para>\r
Retrieves how much space a button box is placing between each child button.\r
</para>
-@widget: a #GtkButtonBox.
@Returns: the current spacing applied to the buttons in @widget.
+<!-- # Unused Parameters # -->
+@widget: a #GtkButtonBox.
<!-- ##### FUNCTION gtk_button_box_get_layout ##### -->
@ipad_y: the vertical padding used by buttons in @widget.
-<!-- ##### FUNCTION gtk_button_box_set_spacing ##### -->
+<!-- ##### MACRO gtk_button_box_set_spacing ##### -->
<para>\r
Sets the amount of spacing between buttons in a given button box.\r
</para>
+<!-- # Unused Parameters # -->
@widget: a #GtkButtonBox.
@spacing: the number of pixels of spacing.
@ipad_y: the vertical padding that should be used by each button in @widget.
-<!-- ##### FUNCTION gtk_button_box_child_requisition ##### -->
-<para>\r
-This is an internally used function and should never be called from an\r
-application.\r
-</para>
-
-@widget:
-@nvis_children:
-@width:
-@height:
-
-
</para>
@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.
<!-- ##### ENUM GtkSortType ##### -->
@GTK_RUN_ACTION:
@GTK_RUN_NO_HOOKS:
-<!-- ##### FUNCTION gtk_signal_init ##### -->
-<para>
-
-</para>
-
-
-
<!-- ##### FUNCTION gtk_signal_new ##### -->
<para>
Create a new signal type. (This is usually done in the
the callbacks.
-<!-- ##### FUNCTION gtk_signal_lookup ##### -->
+<!-- ##### MACRO gtk_signal_lookup ##### -->
<para>
Given the name of the signal and the type of object it connects
to, get the signal's identifying integer. Emitting the signal
It also tries the ancestors of the given type.
</para>
+@Returns: the signal's identifying number, or 0 if no signal was found.
+<!-- # Unused Parameters # -->
@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.
-<!-- ##### FUNCTION gtk_signal_name ##### -->
+<!-- ##### MACRO gtk_signal_name ##### -->
<para>
Given the signal's identifier, find its name.
</para>
Two different signals may have the same name, if they have differing types.
</para>
-@signal_id: the signal's identifying number.
@Returns: the signal name, or NULL if the signal number was invalid.
+<!-- # Unused Parameters # -->
+@signal_id: the signal's identifying number.
<!-- ##### FUNCTION gtk_signal_emit ##### -->
followed by one which is a pointer to the return type.
-<!-- ##### FUNCTION gtk_signal_emit_stop ##### -->
+<!-- ##### MACRO gtk_signal_emit_stop ##### -->
<para>
This function aborts a signal's current emission.
</para>
isn't being emitted.
</para>
-@object: the object whose signal handlers you wish to stop.
-@signal_id: the signal identifier, as returned by gtk_signal_lookup().
-<!-- # Unused Parameters # -->
@i:
@s:
+<!-- # Unused Parameters # -->
+@object: the object whose signal handlers you wish to stop.
+@signal_id: the signal identifier, as returned by gtk_signal_lookup().
<!-- ##### FUNCTION gtk_signal_emit_stop_by_name ##### -->
@name: the name of the signal you wish to stop.
-<!-- ##### FUNCTION gtk_signal_connect ##### -->
+<!-- ##### MACRO gtk_signal_connect ##### -->
<para>
Attach a function pointer and user data to a signal for
a particular object.
</programlisting>
</informalexample>
+@o:
+@s:
+@f:
+@d:
+@Returns: the connection id.
+<!-- # Unused Parameters # -->
@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.
-<!-- # Unused Parameters # -->
-@o:
-@s:
-@f:
-@d:
-<!-- ##### FUNCTION gtk_signal_connect_after ##### -->
+<!-- ##### MACRO gtk_signal_connect_after ##### -->
<para>
Attach a function pointer and user data to a signal
so that this handler will be called after the other handlers.
</para>
-@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.
-<!-- # Unused Parameters # -->
@o:
@s:
@f:
@d:
+@Returns: the unique identifier for this attachment: the connection id.
+<!-- # Unused Parameters # -->
+@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).
-<!-- ##### FUNCTION gtk_signal_connect_object ##### -->
+<!-- ##### MACRO gtk_signal_connect_object ##### -->
<para>
This function is for registering a callback that will
call another object's callback. That is,
</programlisting>
</informalexample>
+@o:
+@s:
+@f:
+@d:
+@Returns: the connection id.
+<!-- # Unused Parameters # -->
@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.
-<!-- # Unused Parameters # -->
-@o:
-@s:
-@f:
-@d:
-<!-- ##### FUNCTION gtk_signal_connect_object_after ##### -->
+<!-- ##### MACRO gtk_signal_connect_object_after ##### -->
<para>
Attach a signal hook to a signal, passing in an alternate
object as the first parameter, and guaranteeing
handlers are called first.
</para>
-@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.
-<!-- # Unused Parameters # -->
@o:
@s:
@f:
@d:
+@Returns: the connection id.
+<!-- # Unused Parameters # -->
+@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.
<!-- ##### FUNCTION gtk_signal_connect_full ##### -->
@name: name of the signal.
-<!-- ##### FUNCTION gtk_signal_disconnect ##### -->
+<!-- ##### MACRO gtk_signal_disconnect ##### -->
<para>
Destroy a user-defined handler connection.
</para>
+<!-- # Unused Parameters # -->
@object: the object which the handler pertains to.
@handler_id: the connection id.
-<!-- ##### FUNCTION gtk_signal_disconnect_by_func ##### -->
+<!-- ##### MACRO gtk_signal_disconnect_by_func ##### -->
<para>
Destroy all connections for a particular object, with
the given function-pointer and user-data.
</para>
-@object: the object which emits the signal.
-@func: the function pointer to search for.
-@data: the user data to search for.
-<!-- # Unused Parameters # -->
@o:
@f:
@d:
+<!-- # Unused Parameters # -->
+@object: the object which emits the signal.
+@func: the function pointer to search for.
+@data: the user data to search for.
-<!-- ##### FUNCTION gtk_signal_disconnect_by_data ##### -->
+<!-- ##### MACRO gtk_signal_disconnect_by_data ##### -->
<para>
Destroy all connections for a particular object, with
the given user-data.
</para>
-@object: the object which emits the signal.
-@data: the user data to search for.
-<!-- # Unused Parameters # -->
@o:
@d:
+<!-- # Unused Parameters # -->
+@object: the object which emits the signal.
+@data: the user data to search for.
-<!-- ##### FUNCTION gtk_signal_handler_block ##### -->
+<!-- ##### MACRO gtk_signal_handler_block ##### -->
<para>
Prevent an user-defined handler from being invoked. All other
signal processing will go on as normal, but this particular
handler will ignore it.
</para>
+<!-- # Unused Parameters # -->
@object: the object which emits the signal to block.
@handler_id: the connection id.
-<!-- ##### FUNCTION gtk_signal_handler_block_by_func ##### -->
+<!-- ##### MACRO gtk_signal_handler_block_by_func ##### -->
<para>
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.)
</para>
-@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.
-<!-- # Unused Parameters # -->
@o:
@f:
@d:
+<!-- # Unused Parameters # -->
+@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.
-<!-- ##### FUNCTION gtk_signal_handler_block_by_data ##### -->
+<!-- ##### MACRO gtk_signal_handler_block_by_data ##### -->
<para>
Prevent all user-defined handlers with a certain user data from being invoked.
</para>
-@object: the object which emits the signal we want to block.
-@data: the user data of the handlers to block.
-<!-- # Unused Parameters # -->
@o:
@d:
+<!-- # Unused Parameters # -->
+@object: the object which emits the signal we want to block.
+@data: the user data of the handlers to block.
-<!-- ##### FUNCTION gtk_signal_handler_unblock ##### -->
+<!-- ##### MACRO gtk_signal_handler_unblock ##### -->
<para>
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.
</para>
+<!-- # Unused Parameters # -->
@object: the object which emits the signal we want to unblock.
@handler_id: the emission handler identifier, as returned by
gtk_signal_connect(), etc.
-<!-- ##### FUNCTION gtk_signal_handler_unblock_by_func ##### -->
+<!-- ##### MACRO gtk_signal_handler_unblock_by_func ##### -->
<para>
Undo a block, by function pointer and data.
Note that undoing a block doesn't
hook twice, you must unblock it twice.
</para>
-@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.
-<!-- # Unused Parameters # -->
@o:
@f:
@d:
+<!-- # Unused Parameters # -->
+@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.
-<!-- ##### FUNCTION gtk_signal_handler_unblock_by_data ##### -->
+<!-- ##### MACRO gtk_signal_handler_unblock_by_data ##### -->
<para>
Undo block(s), to all signals for a particular object
with a particular user-data pointer
</para>
-@object: the object which emits the signal we want to unblock.
-@data: the user data to search for.
-<!-- # Unused Parameters # -->
@o:
@d:
+<!-- # Unused Parameters # -->
+@object: the object which emits the signal we want to unblock.
+@data: the user data to search for.
-<!-- ##### FUNCTION gtk_signal_handler_pending ##### -->
+<!-- ##### MACRO gtk_signal_handler_pending ##### -->
<para>
Returns a connection id corresponding to a given signal id and object.
</para>
thus saving the cost of building the arguments.
</para>
+@i:
+@s:
+@b:
+@Returns: the connection id, if a connection was found. 0 otherwise.
+<!-- # Unused Parameters # -->
@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.
-<!-- # Unused Parameters # -->
-@i:
-@s:
-@b:
-<!-- ##### FUNCTION gtk_signal_handler_pending_by_func ##### -->
+<!-- ##### MACRO gtk_signal_handler_pending_by_func ##### -->
<para>
Returns a connection id corresponding to a given signal id, object, function
pointer and user data.
</para>
+@o:
+@s:
+@b:
+@f:
+@d:
+@Returns: the connection id, if a handler was found. 0 otherwise.
+<!-- # Unused Parameters # -->
@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.
-<!-- # Unused Parameters # -->
-@o:
-@s:
-@b:
-@f:
-@d:
-<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
+<!-- ##### MACRO gtk_signal_add_emission_hook ##### -->
<para>
Add an emission hook for a type of signal, for any object.
</para>
-@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()).
-<!-- # Unused Parameters # -->
@i:
@h:
@d:
+@Returns: the id (that you may pass as a parameter
+to gtk_signal_remove_emission_hook()).
+<!-- # Unused Parameters # -->
+@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.
-<!-- ##### FUNCTION gtk_signal_remove_emission_hook ##### -->
+<!-- ##### MACRO gtk_signal_remove_emission_hook ##### -->
<para>
Delete an emission hook. (see gtk_signal_add_emission_hook())
</para>
-@signal_id: the id of the signal type.
-@hook_id: the id of the emission handler, returned by add_emission_hook().
-<!-- # Unused Parameters # -->
@i:
@h:
+<!-- # Unused Parameters # -->
+@signal_id: the id of the signal type.
+@hook_id: the id of the emission handler, returned by add_emission_hook().
<!-- ##### MACRO gtk_signal_default_marshaller ##### -->
@type_info: must not be null, and @type_info->type_name must also not be null.
-<!-- ##### FUNCTION gtk_type_name ##### -->
+<!-- ##### MACRO gtk_type_name ##### -->
<para>
</para>
-@type: a GtkType
@Returns: a pointer to the name of a type, or NULL if it has none.
+<!-- # Unused Parameters # -->
+@type: a GtkType
-<!-- ##### FUNCTION gtk_type_from_name ##### -->
+<!-- ##### MACRO gtk_type_from_name ##### -->
<para>
Get the internal representation of a type given its name.
</para>
-@name: the name of a gtk type
@Returns: a GtkType
+<!-- # Unused Parameters # -->
+@name: the name of a gtk type
-<!-- ##### FUNCTION gtk_type_parent ##### -->
+<!-- ##### MACRO gtk_type_parent ##### -->
<para>
</para>
-@type: a GtkType
@Returns: the GtkType of the parent
+<!-- # Unused Parameters # -->
+@type: a GtkType
<!-- ##### FUNCTION gtk_type_class ##### -->
@Returns: gpointer to a GtkTypeObject
-<!-- ##### FUNCTION gtk_type_is_a ##### -->
+<!-- ##### MACRO gtk_type_is_a ##### -->
<para>
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.
</para>
+@Returns:
+<!-- # Unused Parameters # -->
@type: GtkType
@is_a_type: GtkType
-@Returns:
<!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
@event:
@Returns:
-<!-- ##### SIGNAL GtkWidget::debug-msg ##### -->
-<para>
-
-</para>
-
-@widget: the object which received the signal.
-@message:
-
<!-- ##### SIGNAL GtkWidget::delete-event ##### -->
<para>
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,
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;
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;
/* 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)
{
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;
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;
struct _GtkButtonBox
{
GtkBox box;
- gint spacing;
gint child_min_width;
gint child_min_height;
gint child_ipad_x;
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
}
}
}
+/**
+ * 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,
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);
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,
typedef enum
{
GTK_WINDOW_TOPLEVEL,
- GTK_WINDOW_DIALOG,
GTK_WINDOW_POPUP
} GtkWindowType;
/* 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);
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)
{
gtk_hbutton_box_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
+ GtkBox *base_box;
GtkButtonBox *box;
GtkHButtonBox *hbox;
GtkBoxChild *child;
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)
/* 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
}
#include <ctype.h>
#include <string.h>
+/* 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);
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 */
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
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);
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);
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);
#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);
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);
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;
}
}
+/**
+ * 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);
+}
+
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 */
/* 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"
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)
{
gtk_vbutton_box_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
+ GtkBox *base_box;
GtkButtonBox *box;
GtkVButtonBox *hbox;
GtkBoxChild *child;
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)
/* 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
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;
* 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.
**/
* @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
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");
}
/**
* 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
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
*
* 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
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;
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 */
gchar *title;
gchar *wmclass_name;
gchar *wmclass_class;
+ gchar *wm_role;
GtkWindowType type;
GdkWindow *frame;
guint stick_initially : 1;
guint maximize_initially : 1;
+ guint decorated : 1;
+
GdkWindowTypeHint type_hint : 2;
-
+
guint frame_left;
guint frame_top;
guint frame_right;
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,
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.
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");
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");
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",
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);
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");
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");
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",
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);