Commit 44205a9e authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

[libdcoument] Remove all Ev*Mapping types

parent 8dbd7b00
......@@ -359,62 +359,3 @@ ev_annotation_text_markup_iface_init (EvAnnotationMarkupIface *iface)
{
}
/* Annotation Mapping stuff */
static void
ev_annotation_mapping_free_foreach (EvAnnotationMapping *mapping)
{
g_object_unref (mapping->annotation);
g_free (mapping);
}
void
ev_annotation_mapping_free (GList *annotation_mapping)
{
if (!annotation_mapping)
return;
g_list_foreach (annotation_mapping, (GFunc) ev_annotation_mapping_free_foreach, NULL);
g_list_free (annotation_mapping);
}
EvAnnotation *
ev_annotation_mapping_find (GList *annotation_mapping,
gdouble x,
gdouble y)
{
GList *list;
for (list = annotation_mapping; list; list = list->next) {
EvAnnotationMapping *mapping = list->data;
if ((x >= mapping->x1) &&
(y >= mapping->y1) &&
(x <= mapping->x2) &&
(y <= mapping->y2)) {
return mapping->annotation;
}
}
return NULL;
}
void
ev_annotation_mapping_get_area (GList *annotation_mapping,
EvAnnotation *annotation,
EvRectangle *area)
{
GList *list;
for (list = annotation_mapping; list; list = list->next) {
EvAnnotationMapping *mapping = list->data;
if (mapping->annotation == annotation) {
area->x1 = mapping->x1;
area->y1 = mapping->y1;
area->x2 = mapping->x2;
area->y2 = mapping->y2;
break;
}
}
}
......@@ -122,26 +122,6 @@ void ev_annotation_markup_set_is_open (EvAnnotationMarkup *markup,
GType ev_annotation_text_get_type (void) G_GNUC_CONST;
EvAnnotation *ev_annotation_text_new (EvPage *page);
/* Annotation Mapping stuff */
typedef struct _EvAnnotationMapping EvAnnotationMapping;
struct _EvAnnotationMapping
{
EvAnnotation *annotation;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
};
void ev_annotation_mapping_free (GList *annotation_mapping);
EvAnnotation *ev_annotation_mapping_find (GList *annotation_mapping,
gdouble x,
gdouble y);
void ev_annotation_mapping_get_area (GList *annotation_mapping,
EvAnnotation *annotation,
EvRectangle *area);
G_END_DECLS
#endif /* EV_ANNOTATION_H */
......@@ -207,78 +207,3 @@ ev_form_field_signature_new (gint id)
return field;
}
/* EvFormFieldMapping */
static void
ev_form_field_mapping_free_foreach (EvFormFieldMapping *mapping)
{
g_object_unref (mapping->field);
g_free (mapping);
}
void
ev_form_field_mapping_free (GList *field_mapping)
{
if (!field_mapping)
return;
g_list_foreach (field_mapping, (GFunc)ev_form_field_mapping_free_foreach, NULL);
g_list_free (field_mapping);
}
EvFormField *
ev_form_field_mapping_find (GList *field_mapping,
gdouble x,
gdouble y)
{
GList *list;
for (list = field_mapping; list; list = list->next) {
EvFormFieldMapping *mapping = list->data;
if ((x >= mapping->x1) &&
(y >= mapping->y1) &&
(x <= mapping->x2) &&
(y <= mapping->y2)) {
return mapping->field;
}
}
return NULL;
}
void
ev_form_field_mapping_get_area (GList *field_mapping,
EvFormField *field,
EvRectangle *area)
{
GList *list;
for (list = field_mapping; list; list = list->next) {
EvFormFieldMapping *mapping = list->data;
if (mapping->field->id == field->id) {
area->x1 = mapping->x1;
area->y1 = mapping->y1;
area->x2 = mapping->x2;
area->y2 = mapping->y2;
break;
}
}
}
EvFormField *
ev_form_field_mapping_find_by_id (GList *field_mapping,
gint id)
{
GList *list;
for (list = field_mapping; list; list = list->next) {
EvFormFieldMapping *mapping = list->data;
if (id == mapping->field->id)
return mapping->field;
}
return NULL;
}
......@@ -208,26 +208,6 @@ GType ev_form_field_signature_get_type (void) G_GNUC_CONST;
EvFormField *ev_form_field_signature_new (gint id);
/* FormField Mapping stuff */
typedef struct _EvFormFieldMapping EvFormFieldMapping;
struct _EvFormFieldMapping {
EvFormField *field;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
};
void ev_form_field_mapping_free (GList *field_mapping);
EvFormField *ev_form_field_mapping_find (GList *field_mapping,
gdouble x,
gdouble y);
void ev_form_field_mapping_get_area (GList *field_mapping,
EvFormField *field,
EvRectangle *area);
EvFormField *ev_form_field_mapping_find_by_id (GList *form_field_mapping,
gint id);
G_END_DECLS
#endif /* !EV_FORM_FIELD_H */
......
......@@ -167,43 +167,5 @@ ev_image_get_tmp_uri (EvImage *image)
return image->priv->tmp_uri;
}
/* EvImageMapping */
static void
ev_image_mapping_free_foreach (EvImageMapping *mapping)
{
g_object_unref (mapping->image);
g_free (mapping);
}
void
ev_image_mapping_free (GList *image_mapping)
{
if (!image_mapping)
return;
g_list_foreach (image_mapping, (GFunc) ev_image_mapping_free_foreach, NULL);
g_list_free (image_mapping);
}
EvImage *
ev_image_mapping_find (GList *image_mapping,
gdouble x,
gdouble y)
{
GList *list;
for (list = image_mapping; list; list = list->next) {
EvImageMapping *mapping = list->data;
if ((x >= mapping->x1) &&
(y >= mapping->y1) &&
(x <= mapping->x2) &&
(y <= mapping->y2)) {
return mapping->image;
}
}
return NULL;
}
......@@ -63,21 +63,6 @@ const gchar *ev_image_save_tmp (EvImage *image,
const gchar *ev_image_get_tmp_uri (EvImage *image);
/* Image Mapping stuff */
typedef struct _EvImageMapping EvImageMapping;
struct _EvImageMapping {
EvImage *image;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
};
void ev_image_mapping_free (GList *image_mapping);
EvImage *ev_image_mapping_find (GList *image_mapping,
gdouble x,
gdouble y);
G_END_DECLS
#endif /* __EV_IMAGE_H__ */
......@@ -180,72 +180,6 @@ ev_link_new (const char *title,
NULL));
}
/* Link Mapping stuff */
static void
ev_link_mapping_free_foreach (EvLinkMapping *mapping)
{
g_object_unref (G_OBJECT (mapping->link));
g_free (mapping);
}
void
ev_link_mapping_free (GList *link_mapping)
{
if (link_mapping == NULL)
return;
g_list_foreach (link_mapping, (GFunc) (ev_link_mapping_free_foreach), NULL);
g_list_free (link_mapping);
}
EvLink *
ev_link_mapping_find (GList *link_mapping,
gdouble x,
gdouble y)
{
GList *list;
EvLink *link = NULL;
int i;
i = 0;
for (list = link_mapping; list; list = list->next) {
EvLinkMapping *mapping = list->data;
i++;
if ((x >= mapping->x1) &&
(y >= mapping->y1) &&
(x <= mapping->x2) &&
(y <= mapping->y2)) {
link = mapping->link;
break;
}
}
return link;
}
void
ev_link_mapping_get_area (GList *link_mapping,
EvLink *link,
EvRectangle *area)
{
GList *list;
for (list = link_mapping; list; list = list->next) {
EvLinkMapping *mapping = list->data;
if (mapping->link == link) {
area->x1 = mapping->x1;
area->y1 = mapping->y1;
area->x2 = mapping->x2;
area->y2 = mapping->y2;
break;
}
}
}
gint
ev_link_get_page (EvLink *link)
{
......
......@@ -50,24 +50,6 @@ const gchar *ev_link_get_title (EvLink *self);
EvLinkAction *ev_link_get_action (EvLink *self);
gint ev_link_get_page (EvLink *link);
/* Link Mapping stuff */
typedef struct _EvLinkMapping EvLinkMapping;
struct _EvLinkMapping
{
EvLink *link;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
};
void ev_link_mapping_free (GList *link_mapping);
EvLink *ev_link_mapping_find (GList *link_mapping,
gdouble x,
gdouble y);
void ev_link_mapping_get_area (GList *link_mapping,
EvLink *link,
EvRectangle *area);
G_END_DECLS
#endif /* !EV_LINK_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment