From d28d25e4c00fe7276bef61b248de5d5dde2c34fd Mon Sep 17 00:00:00 2001 From: Søren Sandmann Date: Sat, 7 Jun 2008 17:55:39 -0400 Subject: Paint thumbnails --- main.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/main.c b/main.c index f289edb..4511490 100644 --- a/main.c +++ b/main.c @@ -28,29 +28,27 @@ get_widget (App *app, const char *name) static void on_thumbs_paint (FooScrollArea *scroll_area, - cairo_t *cr, - GdkRectangle *extents, - GdkRegion *region, - gpointer data) + cairo_t *cr, + GdkRectangle *extents, + GdkRegion *region, + gpointer data) { - - g_print ("paint thumbs\n"); + App *app = data; + + deck_paint (app->deck, scroll_area, cr); } static void on_thumbs_viewport_size_changed (FooScrollArea *scroll_area, GdkRectangle *viewport, - GdkRectangle *old_viewport) + GdkRectangle *old_viewport, + gpointer data) { - g_print ("thumbs viewport changed size\n"); -} - -#define MARGIN 20 -#define RATIO 1.414 -#define N_SLIDES 10 + App *app = data; + int height = deck_get_height (app->deck, viewport); -int slide_width; -int slide_height; + foo_scroll_area_set_size (scroll_area, viewport->width, height); +} static void on_main_paint (FooScrollArea *scroll_area, @@ -93,12 +91,10 @@ static void on_deck_changed (gpointer data) { App *app = data; - - } static void -set_size (GtkWindow *window) +set_window_size (GtkWindow *window) { GdkScreen *screen; int monitor_num; @@ -155,7 +151,7 @@ main (int argc, char **argv) g_signal_connect (app->thumbnails, "viewport_size_changed", G_CALLBACK (on_thumbs_viewport_size_changed), app); - set_size (get_widget (app, "main_window")); + set_window_size (get_widget (app, "main_window")); gtk_widget_show_all (get_widget (app, "main_window")); gtk_main (); -- cgit v1.2.3