if (focus)
{
g_return_if_fail (GTK_IS_WIDGET (focus));
- g_return_if_fail (GTK_WIDGET_CAN_FOCUS (focus));
+ g_return_if_fail (gtk_widget_get_can_focus (focus));
}
if (focus)
g_return_if_fail (GTK_IS_WINDOW (window));
if ((window->focus_widget != focus) ||
- (focus && !GTK_WIDGET_HAS_FOCUS (focus)))
+ (focus && !gtk_widget_has_focus (focus)))
g_signal_emit (window, window_signals[SET_FOCUS], 0, focus);
}
g_return_if_fail (GTK_IS_WINDOW (window));
if (default_widget)
- g_return_if_fail (GTK_WIDGET_CAN_DEFAULT (default_widget));
+ g_return_if_fail (gtk_widget_get_can_default (default_widget));
if (window->default_widget != default_widget)
{
old_default_widget = window->default_widget;
if (window->focus_widget != window->default_widget ||
- !GTK_WIDGET_RECEIVES_DEFAULT (window->default_widget))
+ !gtk_widget_get_receives_default (window->default_widget))
GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
gtk_widget_queue_draw (window->default_widget);
}
if (window->default_widget)
{
if (window->focus_widget == NULL ||
- !GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget))
+ !gtk_widget_get_receives_default (window->focus_widget))
GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
gtk_widget_queue_draw (window->default_widget);
}
{
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- if (window->focus_widget && GTK_WIDGET_IS_SENSITIVE (window->focus_widget))
+ if (window->focus_widget && gtk_widget_is_sensitive (window->focus_widget))
return gtk_widget_activate (window->focus_widget);
return FALSE;
* Retrieves the current focused widget within the window.
* Note that this is the widget that would have the focus
* if the toplevel window focused; if the toplevel window
- * is not focused then <literal>GTK_WIDGET_HAS_FOCUS (widget)</literal> will
+ * is not focused then <literal>gtk_widget_has_focus (widget)</literal> will
* not be %TRUE for the widget.
*
* Return value: (transfer none): the currently focused widget, or %NULL if there is none.
*
* Activates the default widget for the window, unless the current
* focused widget has been configured to receive the default action
- * (see #GTK_RECEIVES_DEFAULT in #GtkWidgetFlags), in which case the
+ * (see gtk_widget_set_receives_default()), in which case the
* focused widget is activated.
*
* Return value: %TRUE if a widget got activated.
{
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- if (window->default_widget && GTK_WIDGET_IS_SENSITIVE (window->default_widget) &&
- (!window->focus_widget || !GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget)))
+ if (window->default_widget && gtk_widget_is_sensitive (window->default_widget) &&
+ (!window->focus_widget || !gtk_widget_get_receives_default (window->focus_widget)))
return gtk_widget_activate (window->default_widget);
- else if (window->focus_widget && GTK_WIDGET_IS_SENSITIVE (window->focus_widget))
+ else if (window->focus_widget && gtk_widget_is_sensitive (window->focus_widget))
return gtk_widget_activate (window->focus_widget);
return FALSE;
gtk_window_set_modal (GtkWindow *window,
gboolean modal)
{
+ GtkWidget *widget;
+
g_return_if_fail (GTK_IS_WINDOW (window));
modal = modal != FALSE;
return;
window->modal = modal;
+ widget = GTK_WIDGET (window);
/* adjust desired modality state */
if (GTK_WIDGET_REALIZED (window))
{
- GtkWidget *widget = GTK_WIDGET (window);
-
if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
else
gdk_window_set_modal_hint (widget->window, FALSE);
}
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
if (window->modal)
- gtk_grab_add (GTK_WIDGET (window));
+ gtk_grab_add (widget);
else
- gtk_grab_remove (GTK_WIDGET (window));
+ gtk_grab_remove (widget);
}
g_object_notify (G_OBJECT (window), "modal");
*
* Since: 2.6
*/
-G_CONST_RETURN gchar *
+const gchar *
gtk_window_get_icon_name (GtkWindow *window)
{
GtkWindowIconInfo *info;
* gtk_window_set_icon_from_file:
* @window: a #GtkWindow
* @filename: location of icon file
- * @err: location to store error, or %NULL.
+ * @err: (allow-none): location to store error, or %NULL.
*
* Sets the icon for @window.
* Warns on failure if @err is %NULL.
/**
* gtk_window_set_default_icon_from_file:
* @filename: location of icon file
- * @err: location to store error, or %NULL.
+ * @err: (allow-none): location to store error, or %NULL.
*
* Sets an icon to be used as fallback for windows that haven't
* had gtk_window_set_icon_list() called on them from a file
/**
* gtk_window_get_default_size:
* @window: a #GtkWindow
- * @width: location to store the default width, or %NULL
- * @height: location to store the default height, or %NULL
+ * @width: (allow-none): location to store the default width, or %NULL
+ * @height: (allow-none): location to store the default height, or %NULL
*
* Gets the default size of the window. A value of -1 for the width or
* height indicates that a default size has not been explicitly set
/**
* gtk_window_get_size:
* @window: a #GtkWindow
- * @width: (out): return location for width, or %NULL
- * @height: (out): return location for height, or %NULL
+ * @width: (allow-none): (out): return location for width, or %NULL
+ * @height: (allow-none): (out): return location for height, or %NULL
*
* Obtains the current size of @window. If @window is not onscreen,
* it returns the size GTK+ will suggest to the <link
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if (window->bin.child &&
- GTK_WIDGET_VISIBLE (window->bin.child) &&
+ gtk_widget_get_visible (window->bin.child) &&
!GTK_WIDGET_MAPPED (window->bin.child))
gtk_widget_map (window->bin.child);
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
window = GTK_WINDOW (widget);
widget->allocation = *allocation;
- if (window->bin.child && GTK_WIDGET_VISIBLE (window->bin.child))
+ if (window->bin.child && gtk_widget_get_visible (window->bin.child))
{
child_allocation.x = GTK_CONTAINER (window)->border_width;
child_allocation.y = GTK_CONTAINER (window)->border_width;
{
GtkWidget *parent;
- if (GTK_WIDGET_IS_SENSITIVE (focus))
+ if (gtk_widget_is_sensitive (focus))
handled = gtk_widget_event (focus, (GdkEvent*) event);
parent = focus->parent;
* the window is visible before actually handling the
* event
*/
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
_gtk_window_set_has_toplevel_focus (window, TRUE);
_gtk_window_set_is_active (window, TRUE);
static void
gtk_window_check_resize (GtkContainer *container)
{
- GtkWindow *window = GTK_WINDOW (container);
-
- if (GTK_WIDGET_VISIBLE (container))
- gtk_window_move_resize (window);
+ if (gtk_widget_get_visible (GTK_WIDGET (container)))
+ gtk_window_move_resize (GTK_WINDOW (container));
}
static gboolean
{
g_object_ref (old_focus);
g_object_freeze_notify (G_OBJECT (old_focus));
- old_focus_had_default = GTK_WIDGET_HAS_DEFAULT (old_focus);
+ old_focus_had_default = gtk_widget_has_default (old_focus);
}
if (focus)
{
g_object_ref (focus);
g_object_freeze_notify (G_OBJECT (focus));
- focus_had_default = GTK_WIDGET_HAS_DEFAULT (focus);
+ focus_had_default = gtk_widget_has_default (focus);
}
if (window->default_widget)
- had_default = GTK_WIDGET_HAS_DEFAULT (window->default_widget);
+ had_default = gtk_widget_has_default (window->default_widget);
if (window->focus_widget)
{
- if (GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget) &&
+ if (gtk_widget_get_receives_default (window->focus_widget) &&
(window->focus_widget != window->default_widget))
{
GTK_WIDGET_UNSET_FLAGS (window->focus_widget, GTK_HAS_DEFAULT);
{
window->focus_widget = focus;
- if (GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget) &&
+ if (gtk_widget_get_receives_default (window->focus_widget) &&
(window->focus_widget != window->default_widget))
{
- if (GTK_WIDGET_CAN_DEFAULT (window->focus_widget))
+ if (gtk_widget_get_can_default (window->focus_widget))
GTK_WIDGET_SET_FLAGS (window->focus_widget, GTK_HAS_DEFAULT);
if (window->default_widget)
* is harmless.
*/
if (window->default_widget &&
- (had_default != GTK_WIDGET_HAS_DEFAULT (window->default_widget)))
+ (had_default != gtk_widget_has_default (window->default_widget)))
gtk_widget_queue_draw (window->default_widget);
if (old_focus)
{
- if (old_focus_had_default != GTK_WIDGET_HAS_DEFAULT (old_focus))
+ if (old_focus_had_default != gtk_widget_has_default (old_focus))
gtk_widget_queue_draw (old_focus);
g_object_thaw_notify (G_OBJECT (old_focus));
}
if (focus)
{
- if (focus_had_default != GTK_WIDGET_HAS_DEFAULT (focus))
+ if (focus_had_default != gtk_widget_has_default (focus))
gtk_widget_queue_draw (focus);
g_object_thaw_notify (G_OBJECT (focus));
gtk_window_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- if (!GTK_WIDGET_APP_PAINTABLE (widget))
+ if (!gtk_widget_get_app_paintable (widget))
gtk_window_paint (widget, &event->area);
if (GTK_WIDGET_CLASS (gtk_window_parent_class)->expose_event)
widget = GTK_WIDGET (window);
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
g_assert (widget->window != NULL);
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
/**
* gtk_window_get_frame_dimensions:
* @window: a #GtkWindow
- * @left: location to store the width of the frame at the left, or %NULL
- * @top: location to store the height of the frame at the top, or %NULL
- * @right: location to store the width of the frame at the returns, or %NULL
- * @bottom: location to store the height of the frame at the bottom, or %NULL
+ * @left: (allow-none): location to store the width of the frame at the left, or %NULL
+ * @top: (allow-none): location to store the height of the frame at the top, or %NULL
+ * @right: (allow-none): location to store the width of the frame at the returns, or %NULL
+ * @bottom: (allow-none): location to store the height of the frame at the bottom, or %NULL
*
* (Note: this is a special-purpose function intended for the
* framebuffer port; see gtk_window_set_has_frame(). It will not
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
/**
* gtk_window_get_group:
- * @window: a #GtkWindow, or %NULL
+ * @window: (allow-none): a #GtkWindow, or %NULL
*
* Returns the group for @window or the default group, if
* @window is %NULL or if @window does not have an explicit
{
if (window->focus_widget &&
window->focus_widget != widget &&
- !GTK_WIDGET_HAS_FOCUS (window->focus_widget))
+ !gtk_widget_has_focus (window->focus_widget))
do_focus_change (window->focus_widget, TRUE);
}
else
{
if (window->focus_widget &&
window->focus_widget != widget &&
- GTK_WIDGET_HAS_FOCUS (window->focus_widget))
+ gtk_widget_has_focus (window->focus_widget))
do_focus_change (window->focus_widget, FALSE);
}
}
return window->type;
}
+/* gtk_window_get_mnemonics_visible:
+ * @window: a #GtkWindow
+ *
+ * Gets the value of the #GtkWindow:mnemonics-visible property.
+ *
+ * Returns: %TRUE if mnemonics are supposed to be visible
+ * in this window.
+ *
+ * Since: 2.20
+ */
gboolean
gtk_window_get_mnemonics_visible (GtkWindow *window)
{
return priv->mnemonics_visible;
}
+/**
+ * gtk_window_set_mnemonics_visible:
+ * @window: a #GtkWindow
+ * @setting: the new value
+ *
+ * Sets the #GtkWindow:mnemonics-visible property.
+ *
+ * Since: 2.20
+ */
void
gtk_window_set_mnemonics_visible (GtkWindow *window,
gboolean setting)