/* theme.c generated by valac 0.19.0, the Vala compiler
 * generated from theme.vala, do not modify */

/*
 *  Notes - panel plugin for Xfce Desktop Environment
 *  Copyright (c) 2006-2013  Mike Massonnet <mmassonnet@xfce.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <theme-gtkrc.h>
#include <gtk/gtk.h>


#define XNP_TYPE_THEME (xnp_theme_get_type ())
#define XNP_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XNP_TYPE_THEME, XnpTheme))
#define XNP_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XNP_TYPE_THEME, XnpThemeClass))
#define XNP_IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XNP_TYPE_THEME))
#define XNP_IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XNP_TYPE_THEME))
#define XNP_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XNP_TYPE_THEME, XnpThemeClass))

typedef struct _XnpTheme XnpTheme;
typedef struct _XnpThemeClass XnpThemeClass;
typedef struct _XnpThemePrivate XnpThemePrivate;

struct _XnpTheme {
	GObject parent_instance;
	XnpThemePrivate * priv;
};

struct _XnpThemeClass {
	GObjectClass parent_class;
};


static gpointer xnp_theme_parent_class = NULL;

GType xnp_theme_get_type (void) G_GNUC_CONST;
enum  {
	XNP_THEME_DUMMY_PROPERTY
};
void xnp_theme_set_background_color (const gchar* color);
XnpTheme* xnp_theme_new (void);
XnpTheme* xnp_theme_construct (GType object_type);


void xnp_theme_set_background_color (const gchar* color) {
	GdkColor gdkcolor = {0};
	const gchar* _tmp0_;
	GdkColor _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	GdkColor _tmp4_;
	g_return_if_fail (color != NULL);
	_tmp0_ = color;
	_tmp2_ = gdk_color_parse (_tmp0_, &_tmp1_);
	gdkcolor = _tmp1_;
	if (!_tmp2_) {
		const gchar* _tmp3_;
		_tmp3_ = color;
		g_warning ("theme.vala:27: Cannot parse background color %s", _tmp3_);
		return;
	}
	_tmp4_ = gdkcolor;
	update_gtkrc (&_tmp4_);
	gtk_rc_reparse_all ();
}


XnpTheme* xnp_theme_construct (GType object_type) {
	XnpTheme * self = NULL;
	self = (XnpTheme*) g_object_new (object_type, NULL);
	return self;
}


XnpTheme* xnp_theme_new (void) {
	return xnp_theme_construct (XNP_TYPE_THEME);
}


static void xnp_theme_class_init (XnpThemeClass * klass) {
	xnp_theme_parent_class = g_type_class_peek_parent (klass);
}


static void xnp_theme_instance_init (XnpTheme * self) {
}


GType xnp_theme_get_type (void) {
	static volatile gsize xnp_theme_type_id__volatile = 0;
	if (g_once_init_enter (&xnp_theme_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (XnpThemeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xnp_theme_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XnpTheme), 0, (GInstanceInitFunc) xnp_theme_instance_init, NULL };
		GType xnp_theme_type_id;
		xnp_theme_type_id = g_type_register_static (G_TYPE_OBJECT, "XnpTheme", &g_define_type_info, 0);
		g_once_init_leave (&xnp_theme_type_id__volatile, xnp_theme_type_id);
	}
	return xnp_theme_type_id__volatile;
}



