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

/**/
/*  Copyright (C) 2018 Faissal Bensefia*/
/**/
/*  This file is part of Plank.*/
/**/
/*  Plank 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 3 of the License, or*/
/*  (at your option) any later version.*/
/**/
/*  Plank 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, see <http://www.gnu.org/licenses/>.*/
/**/

#include <plank.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DOCKY_TYPE_BATTERY_DOCKLET (docky_battery_docklet_get_type ())
#define DOCKY_BATTERY_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DOCKY_TYPE_BATTERY_DOCKLET, DockyBatteryDocklet))
#define DOCKY_BATTERY_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DOCKY_TYPE_BATTERY_DOCKLET, DockyBatteryDockletClass))
#define DOCKY_IS_BATTERY_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DOCKY_TYPE_BATTERY_DOCKLET))
#define DOCKY_IS_BATTERY_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DOCKY_TYPE_BATTERY_DOCKLET))
#define DOCKY_BATTERY_DOCKLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DOCKY_TYPE_BATTERY_DOCKLET, DockyBatteryDockletClass))

typedef struct _DockyBatteryDocklet DockyBatteryDocklet;
typedef struct _DockyBatteryDockletClass DockyBatteryDockletClass;
typedef struct _DockyBatteryDockletPrivate DockyBatteryDockletPrivate;
enum  {
	DOCKY_BATTERY_DOCKLET_0_PROPERTY,
	DOCKY_BATTERY_DOCKLET_NUM_PROPERTIES
};
static GParamSpec* docky_battery_docklet_properties[DOCKY_BATTERY_DOCKLET_NUM_PROPERTIES];

#define DOCKY_TYPE_BATTERY_DOCK_ITEM (docky_battery_dock_item_get_type ())
#define DOCKY_BATTERY_DOCK_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DOCKY_TYPE_BATTERY_DOCK_ITEM, DockyBatteryDockItem))
#define DOCKY_BATTERY_DOCK_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DOCKY_TYPE_BATTERY_DOCK_ITEM, DockyBatteryDockItemClass))
#define DOCKY_IS_BATTERY_DOCK_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DOCKY_TYPE_BATTERY_DOCK_ITEM))
#define DOCKY_IS_BATTERY_DOCK_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DOCKY_TYPE_BATTERY_DOCK_ITEM))
#define DOCKY_BATTERY_DOCK_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DOCKY_TYPE_BATTERY_DOCK_ITEM, DockyBatteryDockItemClass))

typedef struct _DockyBatteryDockItem DockyBatteryDockItem;
typedef struct _DockyBatteryDockItemClass DockyBatteryDockItemClass;

struct _DockyBatteryDocklet {
	GObject parent_instance;
	DockyBatteryDockletPrivate * priv;
};

struct _DockyBatteryDockletClass {
	GObjectClass parent_class;
};

static gpointer docky_battery_docklet_parent_class = NULL;
static PlankDockletIface * docky_battery_docklet_plank_docklet_parent_iface = NULL;

VALA_EXTERN void docklet_init (PlankDockletManager* manager);
VALA_EXTERN GType docky_battery_docklet_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DockyBatteryDocklet, g_object_unref)
static const gchar* docky_battery_docklet_real_get_id (PlankDocklet* base);
static const gchar* docky_battery_docklet_real_get_name (PlankDocklet* base);
static const gchar* docky_battery_docklet_real_get_description (PlankDocklet* base);
static const gchar* docky_battery_docklet_real_get_icon (PlankDocklet* base);
static gboolean docky_battery_docklet_real_is_supported (PlankDocklet* base);
static PlankDockElement* docky_battery_docklet_real_make_element (PlankDocklet* base,
                                                           const gchar* launcher,
                                                           GFile* file);
VALA_EXTERN DockyBatteryDockItem* docky_battery_dock_item_new_with_dockitem_file (GFile* file);
VALA_EXTERN DockyBatteryDockItem* docky_battery_dock_item_construct_with_dockitem_file (GType object_type,
                                                                            GFile* file);
VALA_EXTERN GType docky_battery_dock_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DockyBatteryDockItem, g_object_unref)
VALA_EXTERN DockyBatteryDocklet* docky_battery_docklet_new (void);
VALA_EXTERN DockyBatteryDocklet* docky_battery_docklet_construct (GType object_type);
static GType docky_battery_docklet_get_type_once (void);

void
docklet_init (PlankDockletManager* manager)
{
	g_return_if_fail (manager != NULL);
	plank_docklet_manager_register_docklet (manager, DOCKY_TYPE_BATTERY_DOCKLET);
}

static const gchar*
docky_battery_docklet_real_get_id (PlankDocklet* base)
{
	DockyBatteryDocklet * self;
	const gchar* result;
	self = (DockyBatteryDocklet*) base;
	result = "battery";
	return result;
}

static const gchar*
docky_battery_docklet_real_get_name (PlankDocklet* base)
{
	DockyBatteryDocklet * self;
	const gchar* result;
	self = (DockyBatteryDocklet*) base;
	result = _ ("Battery");
	return result;
}

static const gchar*
docky_battery_docklet_real_get_description (PlankDocklet* base)
{
	DockyBatteryDocklet * self;
	const gchar* result;
	self = (DockyBatteryDocklet*) base;
	result = _ ("Displays battery information");
	return result;
}

static const gchar*
docky_battery_docklet_real_get_icon (PlankDocklet* base)
{
	DockyBatteryDocklet * self;
	const gchar* result;
	self = (DockyBatteryDocklet*) base;
	result = "battery";
	return result;
}

static gboolean
docky_battery_docklet_real_is_supported (PlankDocklet* base)
{
	DockyBatteryDocklet * self;
	gboolean result;
	self = (DockyBatteryDocklet*) base;
	result = TRUE;
	return result;
}

static PlankDockElement*
docky_battery_docklet_real_make_element (PlankDocklet* base,
                                         const gchar* launcher,
                                         GFile* file)
{
	DockyBatteryDocklet * self;
	DockyBatteryDockItem* _tmp0_;
	PlankDockElement* result;
	self = (DockyBatteryDocklet*) base;
	g_return_val_if_fail (launcher != NULL, NULL);
	g_return_val_if_fail (file != NULL, NULL);
	_tmp0_ = docky_battery_dock_item_new_with_dockitem_file (file);
	result = (PlankDockElement*) _tmp0_;
	return result;
}

DockyBatteryDocklet*
docky_battery_docklet_construct (GType object_type)
{
	DockyBatteryDocklet * self = NULL;
	self = (DockyBatteryDocklet*) g_object_new (object_type, NULL);
	return self;
}

DockyBatteryDocklet*
docky_battery_docklet_new (void)
{
	return docky_battery_docklet_construct (DOCKY_TYPE_BATTERY_DOCKLET);
}

static void
docky_battery_docklet_class_init (DockyBatteryDockletClass * klass,
                                  gpointer klass_data)
{
	docky_battery_docklet_parent_class = g_type_class_peek_parent (klass);
}

static void
docky_battery_docklet_plank_docklet_interface_init (PlankDockletIface * iface,
                                                    gpointer iface_data)
{
	docky_battery_docklet_plank_docklet_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = (const gchar* (*) (PlankDocklet*)) docky_battery_docklet_real_get_id;
	iface->get_name = (const gchar* (*) (PlankDocklet*)) docky_battery_docklet_real_get_name;
	iface->get_description = (const gchar* (*) (PlankDocklet*)) docky_battery_docklet_real_get_description;
	iface->get_icon = (const gchar* (*) (PlankDocklet*)) docky_battery_docklet_real_get_icon;
	iface->is_supported = (gboolean (*) (PlankDocklet*)) docky_battery_docklet_real_is_supported;
	iface->make_element = (PlankDockElement* (*) (PlankDocklet*, const gchar*, GFile*)) docky_battery_docklet_real_make_element;
}

static void
docky_battery_docklet_instance_init (DockyBatteryDocklet * self,
                                     gpointer klass)
{
}

static GType
docky_battery_docklet_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DockyBatteryDockletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) docky_battery_docklet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DockyBatteryDocklet), 0, (GInstanceInitFunc) docky_battery_docklet_instance_init, NULL };
	static const GInterfaceInfo plank_docklet_info = { (GInterfaceInitFunc) docky_battery_docklet_plank_docklet_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType docky_battery_docklet_type_id;
	docky_battery_docklet_type_id = g_type_register_static (G_TYPE_OBJECT, "DockyBatteryDocklet", &g_define_type_info, 0);
	g_type_add_interface_static (docky_battery_docklet_type_id, PLANK_TYPE_DOCKLET, &plank_docklet_info);
	return docky_battery_docklet_type_id;
}

GType
docky_battery_docklet_get_type (void)
{
	static volatile gsize docky_battery_docklet_type_id__once = 0;
	if (g_once_init_enter (&docky_battery_docklet_type_id__once)) {
		GType docky_battery_docklet_type_id;
		docky_battery_docklet_type_id = docky_battery_docklet_get_type_once ();
		g_once_init_leave (&docky_battery_docklet_type_id__once, docky_battery_docklet_type_id);
	}
	return docky_battery_docklet_type_id__once;
}

