Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gtk
Commits
16920395
Commit
16920395
authored
Mar 31, 2018
by
Benjamin Otte
Browse files
widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
parent
fc6de135
Changes
78
Hide whitespace changes
Inline
Side-by-side
demos/gtk-demo/application.c
View file @
16920395
...
...
@@ -457,13 +457,12 @@ demo_application_window_constructed (GObject *object)
static
void
demo_application_window_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
DemoApplicationWindow
*
window
=
(
DemoApplicationWindow
*
)
widget
;
GTK_WIDGET_CLASS
(
demo_application_window_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
,
out_clip
);
baseline
);
if
(
!
window
->
maximized
&&
!
window
->
fullscreen
)
gtk_window_get_size
(
GTK_WINDOW
(
window
),
&
window
->
width
,
&
window
->
height
);
...
...
demos/gtk-demo/gtkfishbowl.c
View file @
16920395
...
...
@@ -127,8 +127,7 @@ gtk_fishbowl_measure (GtkWidget *widget,
static
void
gtk_fishbowl_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkFishbowl
*
fishbowl
=
GTK_FISHBOWL
(
widget
);
GtkFishbowlPrivate
*
priv
=
gtk_fishbowl_get_instance_private
(
fishbowl
);
...
...
@@ -139,8 +138,6 @@ gtk_fishbowl_size_allocate (GtkWidget *widget,
for
(
children
=
priv
->
children
;
children
;
children
=
children
->
next
)
{
GtkAllocation
child_clip
;
child
=
children
->
data
;
if
(
!
gtk_widget_get_visible
(
child
->
widget
))
...
...
@@ -152,7 +149,7 @@ gtk_fishbowl_size_allocate (GtkWidget *widget,
child_allocation
.
width
=
child_requisition
.
width
;
child_allocation
.
height
=
child_requisition
.
height
;
gtk_widget_size_allocate
(
child
->
widget
,
&
child_allocation
,
-
1
,
&
child_clip
);
gtk_widget_size_allocate
(
child
->
widget
,
&
child_allocation
,
-
1
);
}
}
...
...
demos/gtk-demo/popover.c
View file @
16920395
...
...
@@ -58,8 +58,7 @@ static void
entry_size_allocate_cb
(
GtkEntry
*
entry
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
,
gpointer
user_data
)
gpointer
user_data
)
{
GtkEntryIconPosition
popover_pos
;
GtkPopover
*
popover
=
user_data
;
...
...
examples/drawing.c
View file @
16920395
...
...
@@ -21,7 +21,6 @@ static void
size_allocate_cb
(
GtkWidget
*
widget
,
GtkAllocation
*
alloc
,
int
baseline
,
GdkRectangle
*
clip
,
gpointer
data
)
{
if
(
surface
)
...
...
gtk/gtkaccellabel.c
View file @
16920395
...
...
@@ -164,13 +164,12 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_WIDGET)
static
void
gtk_accel_label_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkAccelLabel
*
al
=
GTK_ACCEL_LABEL
(
widget
);
GtkAccelLabelPrivate
*
priv
=
gtk_accel_label_get_instance_private
(
al
);
gtk_widget_size_allocate
(
priv
->
box
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
box
,
allocation
,
baseline
);
}
static
void
...
...
gtk/gtkactionbar.c
View file @
16920395
...
...
@@ -271,11 +271,10 @@ gtk_action_bar_snapshot (GtkWidget *widget,
static
void
gtk_action_bar_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkActionBarPrivate
*
priv
=
gtk_action_bar_get_instance_private
(
GTK_ACTION_BAR
(
widget
));
gtk_widget_size_allocate
(
priv
->
revealer
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
revealer
,
allocation
,
baseline
);
}
static
void
...
...
gtk/gtkappchooserwidget.c
View file @
16920395
...
...
@@ -938,15 +938,14 @@ gtk_app_chooser_widget_snapshot (GtkWidget *widget,
static
void
gtk_app_chooser_widget_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkAppChooserWidget
*
self
=
GTK_APP_CHOOSER_WIDGET
(
widget
);
GtkAppChooserWidgetPrivate
*
priv
=
gtk_app_chooser_widget_get_instance_private
(
self
);
GTK_WIDGET_CLASS
(
gtk_app_chooser_widget_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
,
out_clip
);
GTK_WIDGET_CLASS
(
gtk_app_chooser_widget_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
);
gtk_widget_size_allocate
(
priv
->
overlay
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
overlay
,
allocation
,
baseline
);
}
static
void
...
...
gtk/gtkapplicationwindow.c
View file @
16920395
...
...
@@ -593,8 +593,7 @@ gtk_application_window_measure (GtkWidget *widget,
static
void
gtk_application_window_real_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkApplicationWindow
*
window
=
GTK_APPLICATION_WINDOW
(
widget
);
...
...
@@ -613,19 +612,18 @@ gtk_application_window_real_size_allocate (GtkWidget *widget,
&
menubar_height
,
NULL
,
NULL
,
NULL
);
menubar_allocation
.
height
=
menubar_height
;
gtk_widget_size_allocate
(
window
->
priv
->
menubar
,
&
menubar_allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
window
->
priv
->
menubar
,
&
menubar_allocation
,
baseline
);
child_allocation
.
y
+=
menubar_height
;
child_allocation
.
height
-=
menubar_height
;
child
=
gtk_bin_get_child
(
GTK_BIN
(
window
));
if
(
child
!=
NULL
&&
gtk_widget_get_visible
(
child
))
gtk_widget_size_allocate
(
child
,
&
child_allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
child
,
&
child_allocation
,
baseline
);
}
else
GTK_WIDGET_CLASS
(
gtk_application_window_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
,
out_clip
);
baseline
);
}
static
void
...
...
gtk/gtkbbox.c
View file @
16920395
...
...
@@ -99,8 +99,7 @@ static void gtk_button_box_measure (GtkWidget *widget,
int
*
natural_baseline
);
static
void
gtk_button_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
);
int
baseline
);
static
void
gtk_button_box_remove
(
GtkContainer
*
container
,
GtkWidget
*
widget
);
static
void
gtk_button_box_set_child_property
(
GtkContainer
*
container
,
...
...
@@ -745,8 +744,7 @@ gtk_button_box_measure (GtkWidget *widget,
static
void
gtk_button_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkButtonBox
*
bbox
=
GTK_BUTTON_BOX
(
widget
);
GtkButtonBoxPrivate
*
priv
=
bbox
->
priv
;
...
...
@@ -774,14 +772,12 @@ gtk_button_box_size_allocate (GtkWidget *widget,
gint
baseline_height
;
gint
child_baseline
;
gint
i
;
GdkRectangle
child_clip
;
if
(
priv
->
layout_style
==
GTK_BUTTONBOX_EXPAND
)
{
GTK_WIDGET_CLASS
(
gtk_button_box_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
,
out_clip
);
baseline
);
return
;
}
...
...
@@ -1035,8 +1031,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
}
}
gtk_widget_size_allocate
(
child
,
&
child_allocation
,
child_baseline
,
&
child_clip
);
gdk_rectangle_union
(
out_clip
,
&
child_clip
,
out_clip
);
gtk_widget_size_allocate
(
child
,
&
child_allocation
,
child_baseline
);
i
++
;
}
}
...
...
gtk/gtkbin.c
View file @
16920395
...
...
@@ -66,14 +66,13 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
static
void
gtk_bin_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkBin
*
bin
=
GTK_BIN
(
widget
);
GtkBinPrivate
*
priv
=
gtk_bin_get_instance_private
(
bin
);
if
(
priv
->
child
&&
gtk_widget_get_visible
(
priv
->
child
))
gtk_widget_size_allocate
(
priv
->
child
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
child
,
allocation
,
baseline
);
}
static
void
...
...
gtk/gtkbox.c
View file @
16920395
...
...
@@ -143,8 +143,7 @@ struct _GtkBoxChild
static
void
gtk_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
);
int
baseline
);
static
void
gtk_box_direction_changed
(
GtkWidget
*
widget
,
GtkTextDirection
previous_direction
);
...
...
@@ -371,8 +370,7 @@ get_spacing (GtkBox *box)
static
void
gtk_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GdkRectangle
*
out_clip
)
int
baseline
)
{
GtkBox
*
box
=
GTK_BOX
(
widget
);
GtkBoxPrivate
*
priv
=
gtk_box_get_instance_private
(
box
);
...
...
@@ -398,7 +396,6 @@ gtk_box_size_allocate (GtkWidget *widget,
gint
x
=
0
,
y
=
0
,
i
;
gint
child_size
;
gint
spacing
;
GdkRectangle
clip
;
count_expand_children
(
box
,
&
nvis_children
,
&
nexpand_children
);
...
...
@@ -660,8 +657,7 @@ gtk_box_size_allocate (GtkWidget *widget,
child_allocation
.
y
-=
child_size
;
}
}
gtk_widget_size_allocate
(
child
->
widget
,
&
child_allocation
,
baseline
,
&
clip
);
gdk_rectangle_union
(
&
clip
,
out_clip
,
out_clip
);
gtk_widget_size_allocate
(
child
->
widget
,
&
child_allocation
,
baseline
);
i
++
;
}
...
...
gtk/gtkcalendar.c
View file @
16920395
...
...
@@ -273,8 +273,7 @@ static void gtk_calendar_measure (GtkWidget *widget,
int
*
natural_baseline
);
static
void
gtk_calendar_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
);
int
baseline
);
static
void
gtk_calendar_snapshot
(
GtkWidget
*
widget
,
GtkSnapshot
*
snapshot
);
static
void
gtk_calendar_button_press
(
GtkGestureMultiPress
*
gesture
,
...
...
@@ -1854,8 +1853,7 @@ gtk_calendar_measure (GtkWidget *widget,
static
void
gtk_calendar_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkCalendar
*
calendar
=
GTK_CALENDAR
(
widget
);
GtkCalendarPrivate
*
priv
=
calendar
->
priv
;
...
...
gtk/gtkcellview.c
View file @
16920395
...
...
@@ -67,8 +67,7 @@ static void gtk_cell_view_finalize (GObject *obj
static
void
gtk_cell_view_dispose
(
GObject
*
object
);
static
void
gtk_cell_view_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
);
int
baseline
);
static
void
gtk_cell_view_snapshot
(
GtkWidget
*
widget
,
GtkSnapshot
*
snapshot
);
static
void
gtk_cell_view_set_value
(
GtkCellView
*
cell_view
,
...
...
@@ -461,8 +460,7 @@ gtk_cell_view_dispose (GObject *object)
static
void
gtk_cell_view_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkCellView
*
cellview
;
GtkCellViewPrivate
*
priv
;
...
...
gtk/gtkcenterbox.c
View file @
16920395
...
...
@@ -384,12 +384,10 @@ gtk_center_box_measure (GtkWidget *widget,
static
void
gtk_center_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkCenterBox
*
self
=
GTK_CENTER_BOX
(
widget
);
GtkAllocation
child_allocation
;
GtkAllocation
child_clip
;
GtkWidget
*
child
[
3
];
int
child_size
[
3
];
int
child_pos
[
3
];
...
...
@@ -529,8 +527,7 @@ gtk_center_box_size_allocate (GtkWidget *widget,
child_allocation
.
height
=
child_size
[
i
];
}
gtk_widget_size_allocate
(
child
[
i
],
&
child_allocation
,
allocation
->
y
+
baseline
,
&
child_clip
);
gdk_rectangle_union
(
out_clip
,
&
child_clip
,
out_clip
);
gtk_widget_size_allocate
(
child
[
i
],
&
child_allocation
,
allocation
->
y
+
baseline
);
}
}
...
...
gtk/gtkcheckbutton.c
View file @
16920395
...
...
@@ -78,8 +78,7 @@
static
void
gtk_check_button_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
);
int
baseline
);
typedef
struct
{
GtkWidget
*
indicator_widget
;
...
...
@@ -442,12 +441,10 @@ gtk_check_button_new_with_mnemonic (const gchar *label)
static
void
gtk_check_button_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkCheckButtonPrivate
*
priv
=
gtk_check_button_get_instance_private
(
GTK_CHECK_BUTTON
(
widget
));
GtkAllocation
child_alloc
=
{
0
};
GdkRectangle
child_clip
;
GtkWidget
*
child
;
gboolean
is_rtl
=
_gtk_widget_get_direction
(
widget
)
==
GTK_TEXT_DIR_RTL
;
int
x
=
0
;
...
...
@@ -471,8 +468,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
child_alloc
.
x
=
allocation
->
x
;
}
gtk_widget_size_allocate
(
priv
->
indicator_widget
,
&
child_alloc
,
baseline
,
&
child_clip
);
gdk_rectangle_union
(
out_clip
,
&
child_clip
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
indicator_widget
,
&
child_alloc
,
baseline
);
}
child
=
gtk_bin_get_child
(
GTK_BIN
(
widget
));
...
...
@@ -483,8 +479,7 @@ gtk_check_button_size_allocate (GtkWidget *widget,
child_alloc
.
width
=
allocation
->
width
-
child_alloc
.
width
;
/* Indicator width */
child_alloc
.
height
=
allocation
->
height
;
gtk_widget_size_allocate
(
child
,
&
child_alloc
,
baseline
,
&
child_clip
);
gdk_rectangle_union
(
out_clip
,
&
child_clip
,
out_clip
);
gtk_widget_size_allocate
(
child
,
&
child_alloc
,
baseline
);
}
}
...
...
gtk/gtkcheckmenuitem.c
View file @
16920395
...
...
@@ -106,10 +106,8 @@ G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_IT
static
void
gtk_check_menu_item_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkAllocation
child_clip
;
GtkAllocation
indicator_alloc
;
GtkCheckMenuItem
*
check_menu_item
=
GTK_CHECK_MENU_ITEM
(
widget
);
GtkCheckMenuItemPrivate
*
priv
=
check_menu_item
->
priv
;
...
...
@@ -117,8 +115,7 @@ gtk_check_menu_item_size_allocate (GtkWidget *widget,
GTK_WIDGET_CLASS
(
gtk_check_menu_item_parent_class
)
->
size_allocate
(
widget
,
allocation
,
baseline
,
out_clip
);
baseline
);
gtk_widget_measure
(
priv
->
indicator_widget
,
GTK_ORIENTATION_HORIZONTAL
,
...
...
@@ -142,9 +139,7 @@ gtk_check_menu_item_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate
(
priv
->
indicator_widget
,
&
indicator_alloc
,
baseline
,
&
child_clip
);
gdk_rectangle_union
(
out_clip
,
&
child_clip
,
out_clip
);
baseline
);
}
static
void
...
...
gtk/gtkcolorbutton.c
View file @
16920395
...
...
@@ -169,13 +169,12 @@ gtk_color_button_snapshot (GtkWidget *widget,
static
void
gtk_color_button_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkColorButton
*
button
=
GTK_COLOR_BUTTON
(
widget
);
GtkColorButtonPrivate
*
priv
=
gtk_color_button_get_instance_private
(
button
);
gtk_widget_size_allocate
(
priv
->
button
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
button
,
allocation
,
baseline
);
}
static
void
...
...
gtk/gtkcolorplane.c
View file @
16920395
...
...
@@ -175,8 +175,7 @@ create_texture (GtkColorPlane *plane)
static
void
plane_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkColorPlane
*
plane
=
GTK_COLOR_PLANE
(
widget
);
...
...
gtk/gtkcolorswatch.c
View file @
16920395
...
...
@@ -368,11 +368,10 @@ tap_action (GtkGestureMultiPress *gesture,
static
void
swatch_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkColorSwatch
*
swatch
=
GTK_COLOR_SWATCH
(
widget
);
gtk_widget_size_allocate
(
swatch
->
priv
->
overlay_widget
,
allocation
,
-
1
,
out_clip
);
gtk_widget_size_allocate
(
swatch
->
priv
->
overlay_widget
,
allocation
,
-
1
);
}
static
void
...
...
gtk/gtkcombobox.c
View file @
16920395
...
...
@@ -363,13 +363,12 @@ gtk_combo_box_measure (GtkWidget *widget,
static
void
gtk_combo_box_size_allocate
(
GtkWidget
*
widget
,
const
GtkAllocation
*
allocation
,
int
baseline
,
GtkAllocation
*
out_clip
)
int
baseline
)
{
GtkComboBox
*
combo_box
=
GTK_COMBO_BOX
(
widget
);
GtkComboBoxPrivate
*
priv
=
combo_box
->
priv
;
gtk_widget_size_allocate
(
priv
->
box
,
allocation
,
baseline
,
out_clip
);
gtk_widget_size_allocate
(
priv
->
box
,
allocation
,
baseline
);
if
(
gtk_widget_get_visible
(
priv
->
popup_widget
))
{
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment