theme: Remove unused memory management functions

This commit is contained in:
Jasper St. Pierre 2015-02-11 17:49:21 -08:00
parent 3142220443
commit 644ab0e270
2 changed files with 5 additions and 39 deletions

View File

@ -53,8 +53,6 @@ typedef struct _MetaFrameGeometry MetaFrameGeometry;
**/
struct _MetaFrameLayout
{
int refcount;
/** Border/padding of the entire frame */
GtkBorder frame_border;
/** Border/padding of the titlebar region */
@ -229,9 +227,7 @@ struct _MetaTheme
};
MetaFrameLayout* meta_frame_layout_new (void);
MetaFrameLayout* meta_frame_layout_copy (const MetaFrameLayout *src);
void meta_frame_layout_ref (MetaFrameLayout *layout);
void meta_frame_layout_unref (MetaFrameLayout *layout);
void meta_frame_layout_free (MetaFrameLayout *layout);
void meta_frame_layout_get_borders (const MetaFrameLayout *layout,
int text_height,
MetaFrameFlags flags,

View File

@ -45,8 +45,6 @@ meta_frame_layout_new (void)
layout = g_new0 (MetaFrameLayout, 1);
layout->refcount = 1;
/* Spacing as hardcoded in GTK+:
* https://git.gnome.org/browse/gtk+/tree/gtk/gtkheaderbar.c?h=gtk-3-14#n53
*/
@ -58,41 +56,13 @@ meta_frame_layout_new (void)
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
meta_frame_layout_ref (MetaFrameLayout *layout)
meta_frame_layout_free (MetaFrameLayout *layout)
{
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);
g_free (layout);
}
DEBUG_FILL_STRUCT (layout);
g_free (layout);
}
void
@ -928,7 +898,7 @@ meta_theme_free (MetaTheme *theme)
for (i = 0; i < META_FRAME_TYPE_LAST; i++)
if (theme->layouts[i])
meta_frame_layout_unref (theme->layouts[i]);
meta_frame_layout_free (theme->layouts[i]);
DEBUG_FILL_STRUCT (theme);
g_free (theme);