Lines Matching refs:show

110 push_load_image_func (GSTESlideshow *show)  in push_load_image_func()  argument
118 op->location = g_strdup (show->priv->images_location); in push_load_image_func()
119 op->slideshow = g_object_ref (show); in push_load_image_func()
121 g_async_queue_push (show->priv->op_q, op); in push_load_image_func()
123 show->priv->update_image_id = 0; in push_load_image_func()
129 start_new_load (GSTESlideshow *show, in start_new_load() argument
135 if (show->priv->update_image_id <= 0) in start_new_load()
137 show->priv->update_image_id = g_timeout_add_full (G_PRIORITY_LOW, timeout, in start_new_load()
139 show, NULL); in start_new_load()
144 start_fade (GSTESlideshow *show, in start_fade() argument
157 window_width = show->priv->window_width; in start_fade()
158 window_height = show->priv->window_height; in start_fade()
160 if (show->priv->pat2 != NULL) in start_fade()
162 cairo_pattern_destroy (show->priv->pat2); in start_fade()
170 if (gdk_pixbuf_get_has_alpha (pixbuf) && show->priv->background_color) in start_fade()
175 color = (show->priv->background_color->red << 16) in start_fade()
176 + (show->priv->background_color->green / 256 << 8) in start_fade()
177 + show->priv->background_color->blue / 256; in start_fade()
194 cr = cairo_create (show->priv->surf); in start_fade()
198 show->priv->pat2 = cairo_pattern_reference (cairo_get_source (cr)); in start_fade()
199 show->priv->pat2top = y; in start_fade()
200 show->priv->pat2bottom = y + ph; in start_fade()
201 show->priv->pat2left = x; in start_fade()
202 show->priv->pat2right = x + pw; in start_fade()
206 show->priv->fade_ticks = 0; in start_fade()
207 g_timer_start (show->priv->timer); in start_fade()
213 finish_fade (GSTESlideshow *show) in finish_fade() argument
217 if (show->priv->pat1 != NULL) in finish_fade()
219 cairo_pattern_destroy (show->priv->pat1); in finish_fade()
222 show->priv->pat1 = show->priv->pat2; in finish_fade()
223 show->priv->pat2 = NULL; in finish_fade()
225 start_new_load (show, IMAGE_LOAD_TIMEOUT); in finish_fade()
231 update_display (GSTESlideshow *show) in update_display() argument
239 cr = cairo_create (show->priv->surf); in update_display()
241 gs_theme_engine_get_window_size (GS_THEME_ENGINE (show), in update_display()
245 if (show->priv->pat2 != NULL) in update_display()
249 cairo_rectangle (cr, 0, 0, window_width, show->priv->pat2top); in update_display()
250 if (show->priv->background_color) in update_display()
252 cairo_set_source_rgba (cr, show->priv->background_color->red / 65535.0, in update_display()
253 show->priv->background_color->green / 65535.0, in update_display()
254 show->priv->background_color->blue / 65535.0, show->priv->alpha2); in update_display()
258 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2); in update_display()
262 cairo_rectangle (cr, 0, show->priv->pat2top, in update_display()
263 show->priv->pat2left, in update_display()
264 show->priv->pat2bottom - show->priv->pat2top); in update_display()
265 if (show->priv->background_color) in update_display()
267 cairo_set_source_rgba (cr, show->priv->background_color->red / 65535.0, in update_display()
268 show->priv->background_color->green / 65535.0, in update_display()
269 show->priv->background_color->blue / 65535.0, show->priv->alpha2); in update_display()
273 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2); in update_display()
277 cairo_rectangle (cr, 0, show->priv->pat2bottom, window_width, in update_display()
278 window_height - show->priv->pat2bottom); in update_display()
279 if (show->priv->background_color) in update_display()
281 cairo_set_source_rgba (cr, show->priv->background_color->red / 65535.0, in update_display()
282 show->priv->background_color->green / 65535.0, in update_display()
283 show->priv->background_color->blue / 65535.0, show->priv->alpha2); in update_display()
287 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2); in update_display()
291 cairo_rectangle (cr, show->priv->pat2right, in update_display()
292 show->priv->pat2top, in update_display()
293 window_width - show->priv->pat2right, in update_display()
294 show->priv->pat2bottom - show->priv->pat2top); in update_display()
295 if (show->priv->background_color) in update_display()
297 cairo_set_source_rgba (cr, show->priv->background_color->red / 65535.0, in update_display()
298 show->priv->background_color->green / 65535.0, in update_display()
299 show->priv->background_color->blue / 65535.0, show->priv->alpha2); in update_display()
303 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2); in update_display()
308 cairo_set_source (cr, show->priv->pat2); in update_display()
310 cairo_paint_with_alpha (cr, show->priv->alpha2); in update_display()
315 if (show->priv->pat1 != NULL) in update_display()
317 cairo_set_source (cr, show->priv->pat1); in update_display()
324 gtk_widget_queue_draw (GTK_WIDGET (show)); in update_display()
328 draw_iter (GSTESlideshow *show) in draw_iter() argument
333 if (show->priv->pat2 != NULL) in draw_iter()
338 if (show->priv->fade_disabled) in draw_iter()
340 show->priv->alpha2 = 1.0; in draw_iter()
341 update_display (show); in draw_iter()
342 finish_fade (show); in draw_iter()
347 show->priv->fade_ticks++; in draw_iter()
364 old_opacity = (double) (show->priv->fade_ticks - 1) / in draw_iter()
366 new_opacity = (double) show->priv->fade_ticks / in draw_iter()
368 show->priv->alpha2 = 1.0 - (1.0 - new_opacity) / in draw_iter()
371 update_display (show); in draw_iter()
373 elapsed = g_timer_elapsed (show->priv->timer, NULL); in draw_iter()
374 fps = (gdouble)show->priv->fade_ticks / elapsed; in draw_iter()
378 show->priv->fade_ticks = N_FADE_TICKS - 1; in draw_iter()
379 show->priv->fade_disabled = TRUE; in draw_iter()
382 if (show->priv->fade_ticks >= N_FADE_TICKS) in draw_iter()
384 finish_fade (show); in draw_iter()
392 process_new_pixbuf (GSTESlideshow *show, in process_new_pixbuf() argument
399 start_fade (show, pixbuf); in process_new_pixbuf()
403 start_new_load (show, 10); in process_new_pixbuf()
424 results_pull_func (GSTESlideshow *show) in results_pull_func() argument
428 g_async_queue_lock (show->priv->results_q); in results_pull_func()
430 result = g_async_queue_try_pop_unlocked (show->priv->results_q); in results_pull_func()
435 process_new_pixbuf (show, result->pixbuf); in results_pull_func()
438 result = g_async_queue_try_pop_unlocked (show->priv->results_q); in results_pull_func()
441 show->priv->results_pull_id = 0; in results_pull_func()
443 g_async_queue_unlock (show->priv->results_q); in results_pull_func()
560 get_pixbuf_from_local_dir (GSTESlideshow *show, in get_pixbuf_from_local_dir() argument
569 if (show->priv->filename_list == NULL) in get_pixbuf_from_local_dir()
571 show->priv->filename_list = build_filename_list_local_dir (location); in get_pixbuf_from_local_dir()
574 if (show->priv->filename_list == NULL) in get_pixbuf_from_local_dir()
580 if (show->priv->sort_images) in get_pixbuf_from_local_dir()
582 show->priv->filename_list = g_slist_sort (show->priv->filename_list, gste_strcmp_compare_func); in get_pixbuf_from_local_dir()
587 if (! show->priv->sort_images) in get_pixbuf_from_local_dir()
589 i = g_random_int_range (0, g_slist_length (show->priv->filename_list)); in get_pixbuf_from_local_dir()
590 l = g_slist_nth (show->priv->filename_list, i); in get_pixbuf_from_local_dir()
594 l = show->priv->filename_list; in get_pixbuf_from_local_dir()
611 show->priv->filename_list = g_slist_delete_link (show->priv->filename_list, l); in get_pixbuf_from_local_dir()
617 get_pixbuf_from_location (GSTESlideshow *show, in get_pixbuf_from_location() argument
632 pixbuf = get_pixbuf_from_local_dir (show, location); in get_pixbuf_from_location()
639 get_pixbuf (GSTESlideshow *show, in get_pixbuf() argument
652 pixbuf = get_pixbuf_from_location (show, location); in get_pixbuf()
656 scaled = scale_pixbuf (pixbuf, width, height, show->priv->no_stretch_hint); in get_pixbuf()
664 op_load_image (GSTESlideshow *show, in op_load_image() argument
671 window_width = show->priv->window_width; in op_load_image()
672 window_height = show->priv->window_height; in op_load_image()
676 op_result->pixbuf = get_pixbuf (show, in op_load_image()
681 g_async_queue_lock (show->priv->results_q); in op_load_image()
682 g_async_queue_push_unlocked (show->priv->results_q, op_result); in op_load_image()
684 if (show->priv->results_pull_id == 0) in op_load_image()
686 show->priv->results_pull_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE, in op_load_image()
688 show, NULL); in op_load_image()
691 g_async_queue_unlock (show->priv->results_q); in op_load_image()
719 gste_slideshow_set_images_location (GSTESlideshow *show, in gste_slideshow_set_images_location() argument
722 g_return_if_fail (GSTE_IS_SLIDESHOW (show)); in gste_slideshow_set_images_location()
724 g_free (show->priv->images_location); in gste_slideshow_set_images_location()
725 show->priv->images_location = g_strdup (location); in gste_slideshow_set_images_location()
730 gste_slideshow_set_sort_images (GSTESlideshow *show, in gste_slideshow_set_sort_images() argument
733 g_return_if_fail (GSTE_IS_SLIDESHOW (show)); in gste_slideshow_set_sort_images()
735 show->priv->sort_images = sort_images; in gste_slideshow_set_sort_images()
739 gste_slideshow_set_no_stretch_hint (GSTESlideshow *show, in gste_slideshow_set_no_stretch_hint() argument
742 g_return_if_fail (GSTE_IS_SLIDESHOW (show)); in gste_slideshow_set_no_stretch_hint()
744 show->priv->no_stretch_hint = no_stretch_hint; in gste_slideshow_set_no_stretch_hint()
748 gste_slideshow_set_background_color (GSTESlideshow *show, in gste_slideshow_set_background_color() argument
751 g_return_if_fail (GSTE_IS_SLIDESHOW (show)); in gste_slideshow_set_background_color()
753 if (show->priv->background_color != NULL) in gste_slideshow_set_background_color()
755 g_slice_free (PangoColor, show->priv->background_color); in gste_slideshow_set_background_color()
756 show->priv->background_color = NULL; in gste_slideshow_set_background_color()
761 show->priv->background_color = g_slice_new (PangoColor); in gste_slideshow_set_background_color()
763 if (pango_color_parse (show->priv->background_color, background_color) == FALSE) in gste_slideshow_set_background_color()
765 g_slice_free (PangoColor, show->priv->background_color); in gste_slideshow_set_background_color()
766 show->priv->background_color = NULL; in gste_slideshow_set_background_color()
839 GSTESlideshow *show = GSTE_SLIDESHOW (widget); in gste_slideshow_real_show() local
842 if (GTK_WIDGET_CLASS (parent_class)->show) in gste_slideshow_real_show()
844 GTK_WIDGET_CLASS (parent_class)->show (widget); in gste_slideshow_real_show()
847 start_new_load (show, 10); in gste_slideshow_real_show()
850 show->priv->timeout_id = g_timeout_add (delay, (GSourceFunc)draw_iter, show); in gste_slideshow_real_show()
852 if (show->priv->timer != NULL) in gste_slideshow_real_show()
854 g_timer_destroy (show->priv->timer); in gste_slideshow_real_show()
856 show->priv->timer = g_timer_new (); in gste_slideshow_real_show()
863 GSTESlideshow *show = GSTE_SLIDESHOW (widget); in gste_slideshow_real_draw() local
869 cairo_set_source_surface (cr, show->priv->surf, 0, 0); in gste_slideshow_real_draw()
882 GSTESlideshow *show = GSTE_SLIDESHOW (widget); in gste_slideshow_real_configure() local
887 gs_theme_engine_get_window_size (GS_THEME_ENGINE (show), in gste_slideshow_real_configure()
888 &show->priv->window_width, in gste_slideshow_real_configure()
889 &show->priv->window_height); in gste_slideshow_real_configure()
892 show->priv->window_width, in gste_slideshow_real_configure()
893 show->priv->window_height); in gste_slideshow_real_configure()
895 if (show->priv->surf != NULL) in gste_slideshow_real_configure()
897 cairo_surface_destroy (show->priv->surf); in gste_slideshow_real_configure()
901 show->priv->surf = cairo_surface_create_similar (cairo_get_target (cr), in gste_slideshow_real_configure()
903 show->priv->window_width, in gste_slideshow_real_configure()
904 show->priv->window_height); in gste_slideshow_real_configure()
930 widget_class->show = gste_slideshow_real_show; in gste_slideshow_class_init()
981 gste_slideshow_init (GSTESlideshow *show) in gste_slideshow_init() argument
983 show->priv = gste_slideshow_get_instance_private (show); in gste_slideshow_init()
985 show->priv->images_location = g_strdup (DEFAULT_IMAGES_LOCATION); in gste_slideshow_init()
987 show->priv->op_q = g_async_queue_new (); in gste_slideshow_init()
988 show->priv->results_q = g_async_queue_new (); in gste_slideshow_init()
990 g_thread_new ("loadthread", (GThreadFunc)load_threadfunc, show->priv->op_q); in gste_slideshow_init()
992 set_visual (GTK_WIDGET (show)); in gste_slideshow_init()
998 GSTESlideshow *show; in gste_slideshow_finalize() local
1004 show = GSTE_SLIDESHOW (object); in gste_slideshow_finalize()
1006 g_return_if_fail (show->priv != NULL); in gste_slideshow_finalize()
1008 if (show->priv->surf) in gste_slideshow_finalize()
1010 cairo_surface_destroy (show->priv->surf); in gste_slideshow_finalize()
1013 if (show->priv->timeout_id > 0) in gste_slideshow_finalize()
1015 g_source_remove (show->priv->timeout_id); in gste_slideshow_finalize()
1016 show->priv->timeout_id = 0; in gste_slideshow_finalize()
1019 if (show->priv->results_pull_id > 0) in gste_slideshow_finalize()
1021 g_source_remove (show->priv->results_pull_id); in gste_slideshow_finalize()
1022 show->priv->results_pull_id = 0; in gste_slideshow_finalize()
1025 if (show->priv->results_q != NULL) in gste_slideshow_finalize()
1027 result = g_async_queue_try_pop (show->priv->results_q); in gste_slideshow_finalize()
1031 result = g_async_queue_try_pop (show->priv->results_q); in gste_slideshow_finalize()
1033 g_async_queue_unref (show->priv->results_q); in gste_slideshow_finalize()
1036 g_free (show->priv->images_location); in gste_slideshow_finalize()
1037 show->priv->images_location = NULL; in gste_slideshow_finalize()
1039 if (show->priv->background_color) in gste_slideshow_finalize()
1041 g_slice_free (PangoColor, show->priv->background_color); in gste_slideshow_finalize()
1042 show->priv->background_color = NULL; in gste_slideshow_finalize()
1045 if (show->priv->timer != NULL) in gste_slideshow_finalize()
1047 g_timer_destroy (show->priv->timer); in gste_slideshow_finalize()