Commit f3649a5b authored by Dom Lachowicz's avatar Dom Lachowicz

bug 327177

parent fc05e001
2006-01-16 Rob Staudinger <robert.staudinger@gmail.com>
* test-display.c: Bug 327177 - add Zoom toolbar
2006-01-16 Dom Lachowicz <cinamod@hotmail.com>
* TODO: update to reflect work done and future goals
2006-01-12 Dom Lachowicz <cinamod@hotmail.com>
* TODO: updated our roadmap
......
......@@ -12,13 +12,6 @@ Higher priority:
* Ideally would use Cairo->PS for this
* In a pinch, embedding a PNG inside of a PS snippet would also work
* Improvements to the rsvg-view application
* Add zooming
* Add panning
* Improvements to the rsvg application
* Support input from stdin
* Areas in need of improvement:
* multiImage
* Text
......@@ -31,16 +24,20 @@ Higher priority:
* CSS-defined fonts (do we want to support this?)
* SVG fonts (do we want to support this?)
* Interfaces for rescaling and transforming by external applications
* Improved GError support in the loader and error propegation, rather then the g_warnings that we currently use.
* Make error messages translatable (requires adding gettext).
Lower Priority:
* Improvements to the rsvg-view application
* Add panning
* Add menus
* Set a better size hint
* Use cairo
* Any SVG 1.2 features that we want to sneak in. SVG 1.2 conformance is not a priority. Top candidates include:
* <pageSet>
* Improved GError support in the loader and error propegation, rather then the g_warnings that we currently use.
* Make error messages translatable (requires adding gettext).
* Improved Gimp plugin (choose 1 of "A" or "B". "A" would be easier, but perhaps less compelling. Jimmac and Tigert would be estatic if we could do either.)
* A) Store layer names, composite layers onto the Gimp itself
* B) Implement a Gimp-based RsvgRender that drew SVGs in terms of Gimp's path, gradient, pattern, etc. APIs
......
......@@ -540,18 +540,61 @@ quit_cb (GtkWidget *win, gpointer unused)
gtk_main_quit();
}
static void
populate_window (GtkWidget * win, ViewerCbInfo * info, int xid, gint win_width, gint win_height)
{
GtkWidget *vbox;
GtkWidget *toolbar;
GtkWidget *scroll;
GtkToolItem *toolitem;
gint img_width, img_height;
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (win), vbox);
toolbar = gtk_toolbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 0);
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_IN);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, 0);
g_signal_connect (G_OBJECT (toolitem), "clicked", G_CALLBACK (zoom_in), info);
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_OUT);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, 1);
g_signal_connect (G_OBJECT (toolitem), "clicked", G_CALLBACK (zoom_out), info);
/* create a new image */
info->image = gtk_image_new_from_pixbuf (info->pixbuf);
/* pack the window with the image */
img_width = gdk_pixbuf_get_width (info->pixbuf);
img_height = gdk_pixbuf_get_height (info->pixbuf);
if ((xid > 0 && (img_width > win_width || img_height > win_height))
|| (xid <= 0)) {
gtk_window_set_default_size(GTK_WINDOW(win), MIN(img_width, win_width),
MIN(img_height, win_height));
scroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scroll), info->image);
gtk_box_pack_start (GTK_BOX(vbox), scroll, TRUE, TRUE, 0);
} else {
gtk_box_pack_start (GTK_BOX(vbox), info->image, TRUE, TRUE, 0);
gtk_window_set_default_size(GTK_WINDOW(win), img_width, img_height);
}
}
static void
view_pixbuf (ViewerCbInfo * info, int xid, const char * color)
{
GtkWidget *win, *scroll;
gint img_width, img_height, win_width, win_height;
GtkWidget *win;
GdkColor bg_color;
gint win_width, win_height;
/* create toplevel window and set its title */
img_width = gdk_pixbuf_get_width (info->pixbuf);
img_height = gdk_pixbuf_get_height (info->pixbuf);
#ifdef ENABLE_XEMBED
if(xid > 0)
{
......@@ -576,32 +619,14 @@ view_pixbuf (ViewerCbInfo * info, int xid, const char * color)
gtk_window_set_title (GTK_WINDOW(win), _("SVG Viewer"));
}
populate_window (win, info, xid, win_width, win_height);
rsvg_window_set_default_icon (GTK_WINDOW(win), info->pixbuf);
/* exit when 'X' is clicked */
g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(quit_cb), NULL);
g_signal_connect(G_OBJECT(win), "delete_event", G_CALLBACK(quit_cb), NULL);
/* create a new image */
info->image = gtk_image_new_from_pixbuf (info->pixbuf);
/* pack the window with the image */
if ((xid > 0 && (img_width > win_width || img_height > win_height))
|| (xid <= 0)) {
gtk_window_set_default_size(GTK_WINDOW(win), MIN(img_width, win_width),
MIN(img_height, win_height));
scroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scroll), info->image);
gtk_container_add(GTK_CONTAINER(win), scroll);
} else {
gtk_container_add(GTK_CONTAINER(win), info->image);
gtk_window_set_default_size(GTK_WINDOW(win), img_width, img_height);
}
if (color && strcmp (color, "none") != 0)
{
if (gdk_color_parse (color, &bg_color))
......
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