Commit 97be4332 authored by Inigo Martínez's avatar Inigo Martínez

Updated glib bindings.

Signed-off-by: Inigo Martínez's avatarIñigo Martínez <inigomartinez@gmail.com>
parent 5caac407
......@@ -277,32 +277,6 @@ get_markup_external_data (PopplerAnnotMarkup *poppler_annot)
return "Unknown";
}
const gchar *
get_text_icon (PopplerAnnotText *poppler_annot)
{
switch (poppler_annot_text_get_icon (poppler_annot))
{
case POPPLER_ANNOT_TEXT_ICON_COMMENT:
return "Icon Comment";
case POPPLER_ANNOT_TEXT_ICON_KEY:
return "Icon Key";
case POPPLER_ANNOT_TEXT_ICON_NOTE:
return "Icon Note";
case POPPLER_ANNOT_TEXT_ICON_HELP:
return "Icon Help";
case POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH:
return "Icon New Paragraph";
case POPPLER_ANNOT_TEXT_ICON_PARAGRAPH:
return "Icon Paragraph";
case POPPLER_ANNOT_TEXT_ICON_INSERT:
return "Icon Insert";
default:
break;
}
return "Unknown";
}
const gchar *
get_text_state (PopplerAnnotText *poppler_annot)
{
......@@ -408,10 +382,14 @@ pgd_annot_view_set_annot_text (GtkWidget *table,
PopplerAnnotText *annot,
gint *row)
{
gchar *text;
pgd_table_add_property (GTK_TABLE (table), "<b>Is open:</b>",
poppler_annot_text_get_is_open (annot) ? "Yes" : "No", row);
pgd_table_add_property (GTK_TABLE (table), "<b>Icon:</b>", get_text_icon (annot), row);
text = poppler_annot_text_get_icon (annot);
pgd_table_add_property (GTK_TABLE (table), "<b>Icon:</b>", text, row);
g_free (text);
pgd_table_add_property (GTK_TABLE (table), "<b>State:</b>", get_text_state (annot), row);
}
......
......@@ -562,36 +562,19 @@ poppler_annot_text_get_is_open (PopplerAnnotText *poppler_annot)
*
* Return value: #PopplerAnnotTextIcon of @poppler_annot.
**/
PopplerAnnotTextIcon
gchar *
poppler_annot_text_get_icon (PopplerAnnotText *poppler_annot)
{
AnnotText *annot;
GooString *text;
g_return_val_if_fail (POPPLER_IS_ANNOT_TEXT (poppler_annot), POPPLER_ANNOT_TEXT_ICON_NOTE);
g_return_val_if_fail (POPPLER_IS_ANNOT_TEXT (poppler_annot), NULL);
annot = static_cast<AnnotText *>(POPPLER_ANNOT (poppler_annot)->annot);
switch (annot->getIcon ())
{
case AnnotText::iconComment:
return POPPLER_ANNOT_TEXT_ICON_COMMENT;
case AnnotText::iconKey:
return POPPLER_ANNOT_TEXT_ICON_KEY;
case AnnotText::iconNote:
return POPPLER_ANNOT_TEXT_ICON_NOTE;
case AnnotText::iconHelp:
return POPPLER_ANNOT_TEXT_ICON_HELP;
case AnnotText::iconNewParagraph:
return POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH;
case AnnotText::iconParagraph:
return POPPLER_ANNOT_TEXT_ICON_PARAGRAPH;
case AnnotText::iconInsert:
return POPPLER_ANNOT_TEXT_ICON_INSERT;
default:
g_warning ("Unsupported Annot Text Icon");
}
text = annot->getIcon ();
return POPPLER_ANNOT_TEXT_ICON_NOTE;
return text ? _poppler_goo_string_to_utf8 (text) : NULL;
}
/**
......
......@@ -100,17 +100,6 @@ typedef enum
POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_UNKNOWN
} PopplerAnnotExternalDataType;
typedef enum
{
POPPLER_ANNOT_TEXT_ICON_COMMENT,
POPPLER_ANNOT_TEXT_ICON_KEY,
POPPLER_ANNOT_TEXT_ICON_NOTE,
POPPLER_ANNOT_TEXT_ICON_HELP,
POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH,
POPPLER_ANNOT_TEXT_ICON_PARAGRAPH,
POPPLER_ANNOT_TEXT_ICON_INSERT
} PopplerAnnotTextIcon;
typedef enum
{
POPPLER_ANNOT_TEXT_STATE_MARKED,
......@@ -162,7 +151,7 @@ PopplerAnnotExternalDataType poppler_annot_markup_get_external_data (
/* PopplerAnnotText */
GType poppler_annot_text_get_type (void) G_GNUC_CONST;
gboolean poppler_annot_text_get_is_open (PopplerAnnotText *poppler_annot);
PopplerAnnotTextIcon poppler_annot_text_get_icon (PopplerAnnotText *poppler_annot);
gchar *poppler_annot_text_get_icon (PopplerAnnotText *poppler_annot);
PopplerAnnotTextState poppler_annot_text_get_state (PopplerAnnotText *poppler_annot);
/* PopplerAnnotFreeText */
......
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