[librsvg] test-display: Remove dead code



commit f14a347421b26e2887b66b1988c700a76377f72c
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Apr 17 10:19:40 2015 -0500

    test-display: Remove dead code

 test-display.c |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/test-display.c b/test-display.c
index cc97a44..8c5f56c 100644
--- a/test-display.c
+++ b/test-display.c
@@ -35,9 +35,6 @@
 #include <gio/gunixinputstream.h>
 #endif
 
-#define DEFAULT_WIDTH  640
-#define DEFAULT_HEIGHT 480
-
 /* RsvgImage */
 
 #define RSVG_TYPE_IMAGE (rsvg_image_get_type ())
@@ -509,24 +506,16 @@ tool_button_new (const char *icon_name)
 static void
 populate_window (GtkWidget * win, 
                  ViewerCbInfo * info, 
-                 cairo_surface_t *surface /* adopted */,
-                 gint win_width, 
-                 gint win_height)
+                 cairo_surface_t *surface /* adopted */)
 {
     GtkWidget *vbox;
     GtkWidget *scroll;
     GtkWidget *toolbar;
     GtkToolItem *toolitem;
-    GtkRequisition requisition;
-    gint img_width, img_height;
 
     vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
     gtk_container_add (GTK_CONTAINER (win), vbox);
 
-    /* pack the window with the image */
-    img_width = cairo_image_surface_get_width (surface);
-    img_height = cairo_image_surface_get_height (surface);
-
     /* create a new image */
     info->image = rsvg_image_new_take_surface (surface);
 
@@ -541,14 +530,6 @@ populate_window (GtkWidget * win,
     gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, 1);
     g_signal_connect (toolitem, "clicked", G_CALLBACK (zoom_out), info);
 
-    gtk_widget_size_request(toolbar, &requisition);
-
-    /* HACK: adjust for frame width & height + packing borders */
-    img_height += requisition.height + 30;
-    win_height += requisition.height + 30;
-    img_width  += 20;
-    win_width  += 20;
-
     scroll = gtk_scrolled_window_new (NULL, NULL);
     gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
                                     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -564,16 +545,12 @@ view_surface (ViewerCbInfo * info,
 {
     GtkWidget *win;
     GdkColor bg_color;
-    gint win_width, win_height;
 
     /* create toplevel window and set its title */
 
     win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-    win_width = DEFAULT_WIDTH;
-    win_height = DEFAULT_HEIGHT;
-
-    populate_window (win, info, surface, win_width, win_height);
+    populate_window (win, info, surface);
 
     /* exit when 'X' is clicked */
     g_signal_connect (win, "destroy", G_CALLBACK (quit_cb), NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]