X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkanimationdescription.c;h=c8bf5fb06add6af0e3051ab8e5e7250713efa595;hb=9d0febc9a64a5bfb0fcfc3a88de4757f6c1ff090;hp=f46ab4bef3b195ff08833e353e6299b1bb418209;hpb=920e8b434367f9aa8aab306721cc024e66892e2e;p=~andy%2Fgtk diff --git a/gtk/gtkanimationdescription.c b/gtk/gtkanimationdescription.c index f46ab4bef..c8bf5fb06 100644 --- a/gtk/gtkanimationdescription.c +++ b/gtk/gtkanimationdescription.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -123,6 +121,46 @@ _gtk_animation_description_from_string (const gchar *str) return _gtk_animation_description_new ((gdouble) duration, progress_type, loop); } +void +_gtk_animation_description_print (GtkAnimationDescription *desc, + GString *str) +{ + int duration; + + g_return_if_fail (desc != NULL); + g_return_if_fail (str != NULL); + + duration = desc->duration; + if (duration % 1000 == 0) + g_string_append_printf (str, "%ds", (int) desc->duration / 1000); + else + g_string_append_printf (str, "%dms", (int) desc->duration); + + switch (desc->progress_type) + { + case GTK_TIMELINE_PROGRESS_LINEAR: + g_string_append (str, " linear"); + break; + case GTK_TIMELINE_PROGRESS_EASE: + g_string_append (str, " ease"); + break; + case GTK_TIMELINE_PROGRESS_EASE_IN: + g_string_append (str, " ease-in"); + break; + case GTK_TIMELINE_PROGRESS_EASE_OUT: + g_string_append (str, " ease-out"); + break; + case GTK_TIMELINE_PROGRESS_EASE_IN_OUT: + g_string_append (str, " ease-in-out"); + break; + default: + g_assert_not_reached (); + } + + if (desc->loop) + g_string_append (str, " loop"); +} + GType _gtk_animation_description_get_type (void) {