/* diversity-equipment.h - DiversityEquipment * * Copyright 2008 OpenMoko, Inc. * Authored by Chia-I Wu * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _DIVERSITY_EQUIPMENT_H_ #define _DIVERSITY_EQUIPMENT_H_ #define G_DISABLE_CAST_CHECKS #include #include G_BEGIN_DECLS #define DIVERSITY_TYPE_EQUIPMENT (diversity_equipment_get_type()) #define DIVERSITY_EQUIPMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DIVERSITY_TYPE_EQUIPMENT, DiversityEquipment)) #define DIVERSITY_EQUIPMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DIVERSITY_TYPE_EQUIPMENT, DiversityEquipmentClass)) #define DIVERSITY_IS_EQUIPMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DIVERSITY_TYPE_EQUIPMENT)) #define DIVERSITY_IS_EQUIPMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DIVERSITY_TYPE_EQUIPMENT)) #define DIVERSITY_EQUIPMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DIVERSITY_TYPE_EQUIPMENT, DiversityEquipmentClass)) typedef struct _DiversityEquipment DiversityEquipment; typedef struct _DiversityEquipmentClass DiversityEquipmentClass; struct _DiversityEquipment { GObject parent_object; }; struct _DiversityEquipmentClass { GObjectClass parent_class; /* pure virtual methods */ gboolean (*equip)(DiversityEquipment *eqp); void (*unequip)(DiversityEquipment *eqp); gboolean (*set_config)(DiversityEquipment *eqp, const gchar *key, const GValue *val); gboolean (*get_config)(DiversityEquipment *eqp, const gchar *key, GValue *val); /* signals */ void (*config_changed)(DiversityEquipment *eqp, const gchar *key, const GValue *val); }; GType diversity_equipment_get_type(void) G_GNUC_CONST; const gchar *diversity_equipment_get_name(DiversityEquipment *eqp); #include gboolean diversity_equipment_equip(DiversityEquipment *eqp, DiversityBard *bard); void diversity_equipment_unequip(DiversityEquipment *eqp); gboolean diversity_equipment_set_config(DiversityEquipment *eqp, const gchar *key, const GValue *val); gboolean diversity_equipment_get_config(DiversityEquipment *eqp, const gchar *key, GValue *val); DiversityBard *diversity_equipment_get_equipper(DiversityEquipment *eqp); G_END_DECLS #endif /* _DIVERSITY_EQUIPMENT_H_ */