mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 08:24:09 +00:00
theme: Remove unused memory management functions
This commit is contained in:
parent
3142220443
commit
644ab0e270
@ -53,8 +53,6 @@ typedef struct _MetaFrameGeometry MetaFrameGeometry;
|
|||||||
**/
|
**/
|
||||||
struct _MetaFrameLayout
|
struct _MetaFrameLayout
|
||||||
{
|
{
|
||||||
int refcount;
|
|
||||||
|
|
||||||
/** Border/padding of the entire frame */
|
/** Border/padding of the entire frame */
|
||||||
GtkBorder frame_border;
|
GtkBorder frame_border;
|
||||||
/** Border/padding of the titlebar region */
|
/** Border/padding of the titlebar region */
|
||||||
@ -229,9 +227,7 @@ struct _MetaTheme
|
|||||||
};
|
};
|
||||||
|
|
||||||
MetaFrameLayout* meta_frame_layout_new (void);
|
MetaFrameLayout* meta_frame_layout_new (void);
|
||||||
MetaFrameLayout* meta_frame_layout_copy (const MetaFrameLayout *src);
|
void meta_frame_layout_free (MetaFrameLayout *layout);
|
||||||
void meta_frame_layout_ref (MetaFrameLayout *layout);
|
|
||||||
void meta_frame_layout_unref (MetaFrameLayout *layout);
|
|
||||||
void meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
void meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||||
int text_height,
|
int text_height,
|
||||||
MetaFrameFlags flags,
|
MetaFrameFlags flags,
|
||||||
|
@ -45,8 +45,6 @@ meta_frame_layout_new (void)
|
|||||||
|
|
||||||
layout = g_new0 (MetaFrameLayout, 1);
|
layout = g_new0 (MetaFrameLayout, 1);
|
||||||
|
|
||||||
layout->refcount = 1;
|
|
||||||
|
|
||||||
/* Spacing as hardcoded in GTK+:
|
/* Spacing as hardcoded in GTK+:
|
||||||
* https://git.gnome.org/browse/gtk+/tree/gtk/gtkheaderbar.c?h=gtk-3-14#n53
|
* https://git.gnome.org/browse/gtk+/tree/gtk/gtkheaderbar.c?h=gtk-3-14#n53
|
||||||
*/
|
*/
|
||||||
@ -58,42 +56,14 @@ meta_frame_layout_new (void)
|
|||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaFrameLayout*
|
|
||||||
meta_frame_layout_copy (const MetaFrameLayout *src)
|
|
||||||
{
|
|
||||||
MetaFrameLayout *layout;
|
|
||||||
|
|
||||||
layout = g_new0 (MetaFrameLayout, 1);
|
|
||||||
|
|
||||||
*layout = *src;
|
|
||||||
|
|
||||||
layout->refcount = 1;
|
|
||||||
|
|
||||||
return layout;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_frame_layout_ref (MetaFrameLayout *layout)
|
meta_frame_layout_free (MetaFrameLayout *layout)
|
||||||
{
|
{
|
||||||
g_return_if_fail (layout != NULL);
|
g_return_if_fail (layout != NULL);
|
||||||
|
|
||||||
layout->refcount += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
meta_frame_layout_unref (MetaFrameLayout *layout)
|
|
||||||
{
|
|
||||||
g_return_if_fail (layout != NULL);
|
|
||||||
g_return_if_fail (layout->refcount > 0);
|
|
||||||
|
|
||||||
layout->refcount -= 1;
|
|
||||||
|
|
||||||
if (layout->refcount == 0)
|
|
||||||
{
|
|
||||||
DEBUG_FILL_STRUCT (layout);
|
DEBUG_FILL_STRUCT (layout);
|
||||||
g_free (layout);
|
g_free (layout);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||||
@ -928,7 +898,7 @@ meta_theme_free (MetaTheme *theme)
|
|||||||
|
|
||||||
for (i = 0; i < META_FRAME_TYPE_LAST; i++)
|
for (i = 0; i < META_FRAME_TYPE_LAST; i++)
|
||||||
if (theme->layouts[i])
|
if (theme->layouts[i])
|
||||||
meta_frame_layout_unref (theme->layouts[i]);
|
meta_frame_layout_free (theme->layouts[i]);
|
||||||
|
|
||||||
DEBUG_FILL_STRUCT (theme);
|
DEBUG_FILL_STRUCT (theme);
|
||||||
g_free (theme);
|
g_free (theme);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user