Commit e10d9cbb authored by Evgeny Stambulchik's avatar Evgeny Stambulchik Committed by Albert Astals Cid

glib: Add poppler_movie_get_aspect

parent 2c17c9ed
......@@ -170,7 +170,7 @@ Release 0.80.0:
glib:
* Make print scaling getter visible
* Make Duplex/NumCopies/PrintPageRange preference available in API
* Implement Movie API
* Complement Movie API
utils:
* pdftotext: Add -nodiag flag to remove diagonal text on output
......
......@@ -563,6 +563,7 @@ pgd_movie_view_set_movie (GtkWidget *movie_view,
GtkWidget *table;
GtkWidget *button;
GEnumValue *enum_value;
gint width, height;
gint row = 0;
table = gtk_bin_get_child (GTK_BIN (movie_view));
......@@ -597,6 +598,8 @@ pgd_movie_view_set_movie (GtkWidget *movie_view,
pgd_table_add_property (GTK_GRID (table), "<b>Start:</b>", g_strdup_printf("%g s", poppler_movie_get_start (movie)/1e9), &row);
pgd_table_add_property (GTK_GRID (table), "<b>Duration:</b>", g_strdup_printf("%g s", poppler_movie_get_duration (movie)/1e9), &row);
pgd_table_add_property (GTK_GRID (table), "<b>Rotation Angle:</b>", g_strdup_printf("%u", poppler_movie_get_rotation_angle (movie)), &row);
poppler_movie_get_aspect (movie, &width, &height);
pgd_table_add_property (GTK_GRID (table), "<b>Aspect:</b>", g_strdup_printf("%dx%d", width, height), &row);
button = gtk_button_new_with_mnemonic ("_Play");
g_signal_connect (button, "clicked",
......
......@@ -44,6 +44,8 @@ struct _PopplerMovie
guint64 start;
guint64 duration;
gushort rotation_angle;
gint width;
gint height;
};
struct _PopplerMovieClass
......@@ -138,6 +140,8 @@ _poppler_movie_new (const Movie *poppler_movie)
movie->rotation_angle = poppler_movie->getRotationAngle();
poppler_movie->getAspect(&movie->width, &movie->height);
return movie;
}
......@@ -325,3 +329,24 @@ poppler_movie_get_duration (PopplerMovie *poppler_movie)
return poppler_movie->duration;
}
/**
* poppler_movie_get_aspect:
* @poppler_movie: a #PopplerMovie
* @width: width of the movie's bounding box
* @height: height of the movie's bounding box
*
* Returns the dimensions of the movie's bounding box (in pixels).
* The respective PDF movie dictionary entry is optional; if missing,
* -1x-1 will be returned.
*
* Since: 0.89
*/
void
poppler_movie_get_aspect (PopplerMovie *poppler_movie, gint *width, gint *height)
{
g_return_if_fail (POPPLER_IS_MOVIE (poppler_movie));
*width = poppler_movie->width;
*height = poppler_movie->height;
}
......@@ -73,6 +73,8 @@ POPPLER_PUBLIC
guint64 poppler_movie_get_start (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
guint64 poppler_movie_get_duration (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
void poppler_movie_get_aspect (PopplerMovie *poppler_movie, gint *width, gint *height);
G_END_DECLS
......
......@@ -586,6 +586,7 @@ poppler_media_get_type
<TITLE>Poppler Movie</TITLE>
PopplerMovie
PopplerMoviePlayMode
poppler_movie_get_aspect
poppler_movie_get_duration
poppler_movie_get_filename
poppler_movie_get_play_mode
......@@ -593,9 +594,9 @@ poppler_movie_get_rate
poppler_movie_get_rotation_angle
poppler_movie_get_start
poppler_movie_get_volume
poppler_movie_is_synchronous
poppler_movie_need_poster
poppler_movie_show_controls
poppler_movie_is_synchronous
<SUBSECTION Standard>
POPPLER_MOVIE
......
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