Towards GSEAL-clean build on win32
Use accessors instead of direct member access in a few places. Bug 625655.
This commit is contained in:
committed by
Matthias Clasen
parent
93fa95e79f
commit
4047d0526d
@ -265,13 +265,15 @@ static void
|
|||||||
gtk_win32_embed_widget_map (GtkWidget *widget)
|
gtk_win32_embed_widget_map (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GtkBin *bin = GTK_BIN (widget);
|
GtkBin *bin = GTK_BIN (widget);
|
||||||
|
GtkWidget *child;
|
||||||
|
|
||||||
gtk_widget_set_mapped (widget, TRUE);
|
gtk_widget_set_mapped (widget, TRUE);
|
||||||
|
|
||||||
if (bin->child &&
|
child = gtk_bin_get_child (bin);
|
||||||
gtk_widget_get_visible (bin->child) &&
|
if (child &&
|
||||||
!gtk_widget_get_mapped (bin->child))
|
gtk_widget_get_visible (child) &&
|
||||||
gtk_widget_map (bin->child);
|
!gtk_widget_get_mapped (child))
|
||||||
|
gtk_widget_map (child);
|
||||||
|
|
||||||
gdk_window_show (widget->window);
|
gdk_window_show (widget->window);
|
||||||
}
|
}
|
||||||
@ -288,6 +290,7 @@ gtk_win32_embed_widget_size_allocate (GtkWidget *widget,
|
|||||||
GtkAllocation *allocation)
|
GtkAllocation *allocation)
|
||||||
{
|
{
|
||||||
GtkBin *bin = GTK_BIN (widget);
|
GtkBin *bin = GTK_BIN (widget);
|
||||||
|
GtkWidget *child;
|
||||||
|
|
||||||
widget->allocation = *allocation;
|
widget->allocation = *allocation;
|
||||||
|
|
||||||
@ -296,17 +299,19 @@ gtk_win32_embed_widget_size_allocate (GtkWidget *widget,
|
|||||||
allocation->x, allocation->y,
|
allocation->x, allocation->y,
|
||||||
allocation->width, allocation->height);
|
allocation->width, allocation->height);
|
||||||
|
|
||||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
child = gtk_bin_get_child (bin);
|
||||||
|
if (child && gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
GtkAllocation child_allocation;
|
GtkAllocation child_allocation;
|
||||||
|
|
||||||
child_allocation.x = child_allocation.y = GTK_CONTAINER (widget)->border_width;
|
child_allocation.x = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
|
child_allocation.y = child_allocation.x;
|
||||||
child_allocation.width =
|
child_allocation.width =
|
||||||
MAX (1, (gint)allocation->width - child_allocation.x * 2);
|
MAX (1, (gint)allocation->width - child_allocation.x * 2);
|
||||||
child_allocation.height =
|
child_allocation.height =
|
||||||
MAX (1, (gint)allocation->height - child_allocation.y * 2);
|
MAX (1, (gint)allocation->height - child_allocation.y * 2);
|
||||||
|
|
||||||
gtk_widget_size_allocate (bin->child, &child_allocation);
|
gtk_widget_size_allocate (child, &child_allocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,8 +329,9 @@ gtk_win32_embed_widget_focus (GtkWidget *widget,
|
|||||||
GtkWin32EmbedWidget *embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
GtkWin32EmbedWidget *embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
||||||
GtkWindow *window = GTK_WINDOW (widget);
|
GtkWindow *window = GTK_WINDOW (widget);
|
||||||
GtkContainer *container = GTK_CONTAINER (widget);
|
GtkContainer *container = GTK_CONTAINER (widget);
|
||||||
GtkWidget *old_focus_child = container->focus_child;
|
GtkWidget *old_focus_child = gtk_container_get_focus_child (container);
|
||||||
GtkWidget *parent;
|
GtkWidget *parent;
|
||||||
|
GtkWidget *child;
|
||||||
|
|
||||||
/* We override GtkWindow's behavior, since we don't want wrapping here.
|
/* We override GtkWindow's behavior, since we don't want wrapping here.
|
||||||
*/
|
*/
|
||||||
@ -350,11 +356,12 @@ gtk_win32_embed_widget_focus (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Try to focus the first widget in the window */
|
/* Try to focus the first widget in the window */
|
||||||
if (bin->child && gtk_widget_child_focus (bin->child, direction))
|
child = gtk_bin_get_child (bin);
|
||||||
|
if (child && gtk_widget_child_focus (child, direction))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GTK_CONTAINER (window)->focus_child)
|
if (!gtk_container_get_focus_child (GTK_CONTAINER (window)))
|
||||||
{
|
{
|
||||||
int backwards = FALSE;
|
int backwards = FALSE;
|
||||||
|
|
||||||
|
|||||||
@ -1056,7 +1056,7 @@ map_gtk_progress_bar_to_xp (GtkProgressBar *progress_bar, gboolean trough)
|
|||||||
{
|
{
|
||||||
XpThemeElement ret;
|
XpThemeElement ret;
|
||||||
|
|
||||||
switch (progress_bar->orientation)
|
switch (gtk_progress_bar_get_orientation (progress_bar))
|
||||||
{
|
{
|
||||||
case GTK_PROGRESS_LEFT_TO_RIGHT:
|
case GTK_PROGRESS_LEFT_TO_RIGHT:
|
||||||
case GTK_PROGRESS_RIGHT_TO_LEFT:
|
case GTK_PROGRESS_RIGHT_TO_LEFT:
|
||||||
|
|||||||
Reference in New Issue
Block a user