/* diversity-viewport.h - DiversityViewport, a glance at the glorious world * * 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_VIEWPORT_H_ #define _DIVERSITY_VIEWPORT_H_ #define G_DISABLE_CAST_CHECKS #include #include #include G_BEGIN_DECLS #define DIVERSITY_TYPE_VIEWPORT (diversity_viewport_get_type()) #define DIVERSITY_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DIVERSITY_TYPE_VIEWPORT, DiversityViewport)) #define DIVERSITY_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DIVERSITY_TYPE_VIEWPORT, DiversityViewportClass)) #define DIVERSITY_IS_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DIVERSITY_TYPE_VIEWPORT)) #define DIVERSITY_IS_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DIVERSITY_TYPE_VIEWPORT)) #define DIVERSITY_VIEWPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DIVERSITY_TYPE_VIEWPORT, DiversityViewportClass)) typedef struct _DiversityViewport DiversityViewport; typedef struct _DiversityViewportClass DiversityViewportClass; typedef gboolean (*DiversityViewportFilter)(DiversityViewport *view, DiversityObject *obj, gpointer data); struct _DiversityViewport { DiversityObject parent_object; }; struct _DiversityViewportClass { DiversityObjectClass parent_class; void (*enabled)(DiversityViewport *view, gboolean enabled); void (*object_added)(DiversityViewport *view, DiversityObject *obj); void (*object_removed)(DiversityViewport *view, DiversityObject *obj); void (*object_cleared)(DiversityViewport *view); void (*filter_changed)(DiversityViewport *view); }; GType diversity_viewport_get_type(void) G_GNUC_CONST; DiversityViewport *diversity_viewport_new(gdouble lon1, gdouble lat1, gdouble lon2, gdouble lat2); gboolean diversity_viewport_add_object(DiversityViewport *view, DiversityObject *obj); void diversity_viewport_remove_object(DiversityViewport *view, DiversityObject *obj); void diversity_viewport_set_filter(DiversityViewport *view, DiversityViewportFilter filter, gpointer data); void diversity_viewport_set_rule(DiversityViewport *view, DiversityObjectType type, gint mask, gint value); void diversity_viewport_clear_objects(DiversityViewport *view); guint diversity_viewport_count_objects(DiversityViewport *view); const GSList *diversity_viewport_get_objects(DiversityViewport *view); void diversity_viewport_set_enabled(DiversityViewport *view, gboolean enabled); gboolean diversity_viewport_get_enabled(DiversityViewport *view); G_END_DECLS #endif /* _DIVERSITY_VIEWPORT_H_ */