/* diversity-control.h - Everthing is under control * * Copyright 2007-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_CONTROL_H_ #define _DIVERSITY_CONTROL_H_ #define G_DISABLE_CAST_CHECKS #include #include #include #include G_BEGIN_DECLS #define DIVERSITY_TYPE_CONTROL (diversity_control_get_type()) #define DIVERSITY_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DIVERSITY_TYPE_CONTROL, DiversityControl)) #define DIVERSITY_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DIVERSITY_TYPE_CONTROL, DiversityControlClass)) #define DIVERSITY_IS_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DIVERSITY_TYPE_CONTROL)) #define DIVERSITY_IS_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DIVERSITY_TYPE_CONTROL)) #define DIVERSITY_CONTROL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DIVERSITY_TYPE_CONTROL, DiversityControlClass)) typedef struct _DiversityControl DiversityControl; typedef struct _DiversityControlClass DiversityControlClass; struct _DiversityControl { GObject parent_object; }; struct _DiversityControlClass { GObjectClass parent_class; }; typedef struct _DiversityControlExport DiversityControlExport; struct _DiversityControlExport { DiversityControl *ctrl; DBusGConnection *connection; gchar *path; const gchar *owner; }; GType diversity_control_get_type(void) G_GNUC_CONST; DiversityControl *diversity_control_new(DiversityWorld *world, DBusGConnection *connection, const gchar *path); /* owner will be freed */ DiversityControlExport *diversity_control_object_export(DiversityControl *ctrl, DiversityObject *obj, gchar *owner); void diversity_control_object_unexport(DiversityControl *ctrl, DiversityObject *obj); DiversityObject *diversity_control_object_lookup(DiversityControl *ctrl, const gchar *path); DiversityControl *diversity_control_from_world(DiversityWorld *world); DiversityControl *diversity_control_from_object(DiversityObject *obj); DiversityControl *diversity_control_from_equipment(DiversityEquipment *eqp); #define DIVERSITY_CONTROL_ERROR (diversity_control_error_quark()) GQuark diversity_control_error_quark(); G_END_DECLS #endif /* _DIVERSITY_CONTROL_H_ */