Commit ea19f7c3 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

popuplayout: Add shadow width

Add shadow width to the GdkPopupLayout struct. This
information is needed by the compositor to make correct
positioning decisions about popups.
parent 0222d389
......@@ -75,6 +75,10 @@
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-4-2" role="4.2">
<title>Index of new symbols in 4.2</title>
<xi:include href="xml/api-index-4.2.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-deprecated" role="deprecated">
<title>Index of deprecated symbols</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
......
......@@ -627,6 +627,8 @@ gdk_popup_layout_set_anchor_hints
gdk_popup_layout_get_anchor_hints
gdk_popup_layout_set_offset
gdk_popup_layout_get_offset
gdk_popup_layout_set_shadow_width
gdk_popup_layout_get_shadow_width
<SUBSECTION Standard>
GDK_TYPE_POPUP_LAYOUT
gdk_popup_layout_get_type
......
......@@ -74,6 +74,10 @@ struct _GdkPopupLayout
GdkAnchorHints anchor_hints;
int dx;
int dy;
int shadow_left;
int shadow_right;
int shadow_top;
int shadow_bottom;
};
G_DEFINE_BOXED_TYPE (GdkPopupLayout, gdk_popup_layout,
......@@ -165,6 +169,10 @@ gdk_popup_layout_copy (GdkPopupLayout *layout)
new_layout->anchor_hints = layout->anchor_hints;
new_layout->dx = layout->dx;
new_layout->dy = layout->dy;
new_layout->shadow_left = layout->shadow_left;
new_layout->shadow_right = layout->shadow_right;
new_layout->shadow_top = layout->shadow_top;
new_layout->shadow_bottom = layout->shadow_bottom;
return new_layout;
}
......@@ -191,7 +199,11 @@ gdk_popup_layout_equal (GdkPopupLayout *layout,
layout->surface_anchor == other->surface_anchor &&
layout->anchor_hints == other->anchor_hints &&
layout->dx == other->dx &&
layout->dy == other->dy);
layout->dy == other->dy &&
layout->shadow_left == other->shadow_left &&
layout->shadow_right == other->shadow_right &&
layout->shadow_top == other->shadow_top &&
layout->shadow_bottom == other->shadow_bottom);
}
/**
......@@ -346,3 +358,59 @@ gdk_popup_layout_get_offset (GdkPopupLayout *layout,
if (dy)
*dy = layout->dy;
}
/**
* gdk_popup_layout_set_shadow_width:
* @layout: a #GdkPopupLayout
* @left: width of the left part of the shadow
* @right: width of the right part of the shadow
* @top: height of the top part of the shadow
* @bottom: height of the bottom part of the shadow
*
* The shadow width corresponds to the part of the computed surface size
* that would consist of the shadow margin surrounding the window, would
* there be any.
*
* Since: 4.2
*/
void
gdk_popup_layout_set_shadow_width (GdkPopupLayout *layout,
int left,
int right,
int top,
int bottom)
{
layout->shadow_left = left;
layout->shadow_right = right;
layout->shadow_top = top;
layout->shadow_bottom = bottom;
}
/**
* gdk_popup_layout_get_shadow_width:
* @layout: a #GdkPopupLayout
* @left: (out): return location for the left shadow width
* @right: (out): return location for the right shadow width
* @top: (out): return location for the top shadow width
* @bottom: (out): return location for the bottom shadow width
*
* Obtains the shadow widths of this layout.
*
* Since: 4.2
*/
void
gdk_popup_layout_get_shadow_width (GdkPopupLayout *layout,
int *left,
int *right,
int *top,
int *bottom)
{
if (left)
*left = layout->shadow_left;
if (right)
*right = layout->shadow_right;
if (top)
*top = layout->shadow_top;
if (bottom)
*bottom = layout->shadow_bottom;
}
......@@ -137,6 +137,20 @@ void gdk_popup_layout_get_offset (GdkPopupLayout
int *dx,
int *dy);
GDK_AVAILABLE_IN_4_2
void gdk_popup_layout_set_shadow_width (GdkPopupLayout *layout,
int left,
int right,
int top,
int bottom);
GDK_AVAILABLE_IN_4_2
void gdk_popup_layout_get_shadow_width (GdkPopupLayout *layout,
int *left,
int *right,
int *top,
int *bottom);
G_END_DECLS
#endif /* __GDK_POPUP_LAYOUT_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment