Commit d307bdce authored by Dom Lachowicz's avatar Dom Lachowicz

remove deprecated functionality

parent 8d1fc689
2005-02-25 Dom Lachowicz <cinamod@hotmail.com>
* *: Get rid of deprecated stuff.
* configure.in: Bump version number
2005-02-25 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-paint-server.c: more de-artification of the core
......
......@@ -18,7 +18,6 @@ libm = -lm
endif
headers = \
rsvg-gz.h \
rsvg.h
enum_sources = \
......@@ -28,7 +27,6 @@ enum_sources = \
lib_LTLIBRARIES = librsvg-2.la
librsvg_2_la_SOURCES = \
rsvg-gz.c \
rsvg-affine.c \
librsvg-features.c \
rsvg-bpath-util.c \
......@@ -126,8 +124,6 @@ EXTRA_DIST = \
librsvg-2.0.pc.in \
librsvg-2.0-uninstalled.pc.in \
librsvg-zip.in \
rsvg-gz.c \
rsvg-gz.h \
$(man_MANS) \
$(rsvg_view_SOURCES)
......@@ -146,7 +142,6 @@ pkgconfig_DATA = librsvg-2.0.pc
dist-hook: librsvg.spec
cp librsvg.spec $(distdir)
librsvg-enum-types.h: s-enum-types-h
@true
......
......@@ -19,7 +19,7 @@ AC_SUBST(POPT_REQUIRED)
dnl ===========================================================================
LIBRSVG_MAJOR_VERSION=2
LIBRSVG_MINOR_VERSION=10
LIBRSVG_MINOR_VERSION=99
LIBRSVG_MICRO_VERSION=0
AC_SUBST(LIBRSVG_MAJOR_VERSION)
AC_SUBST(LIBRSVG_MINOR_VERSION)
......
......@@ -74,68 +74,3 @@ Utility/Convenience Functions
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_ex ##### -->
<para>
</para>
@handle:
@file_name:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_zoom_ex ##### -->
<para>
</para>
@handle:
@file_name:
@x_zoom:
@y_zoom:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_size_ex ##### -->
<para>
</para>
@handle:
@file_name:
@width:
@height:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_max_size_ex ##### -->
<para>
</para>
@handle:
@file_name:
@max_width:
@max_height:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_zoom_with_max_ex ##### -->
<para>
</para>
@handle:
@file_name:
@x_zoom:
@y_zoom:
@max_width:
@max_height:
@error:
@Returns:
......@@ -14,11 +14,3 @@ Creating a SVGZ reader
</para>
<!-- ##### FUNCTION rsvg_handle_new_gz ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION rsvg_handle_new_gz ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_max_size_ex ##### -->
<para>
</para>
@handle:
@file_name:
@max_width:
@max_height:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_size_ex ##### -->
<para>
</para>
@handle:
@file_name:
@width:
@height:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_zoom_ex ##### -->
<para>
</para>
@handle:
@file_name:
@x_zoom:
@y_zoom:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_at_zoom_with_max_ex ##### -->
<para>
</para>
@handle:
@file_name:
@x_zoom:
@y_zoom:
@max_width:
@max_height:
@error:
@Returns:
<!-- ##### FUNCTION rsvg_pixbuf_from_file_ex ##### -->
<para>
</para>
@handle:
@file_name:
@error:
@Returns:
......@@ -37,10 +37,10 @@ Core API
</para>
@dpi:
<!-- # Unused Parameters # -->
@dpi_x:
@dpi_y:
<!-- # Unused Parameters # -->
@dpi:
<!-- ##### FUNCTION rsvg_handle_new ##### -->
......@@ -57,10 +57,10 @@ Core API
</para>
@handle:
@dpi:
<!-- # Unused Parameters # -->
@dpi_x:
@dpi_y:
<!-- # Unused Parameters # -->
@dpi:
<!-- ##### FUNCTION rsvg_handle_set_size_callback ##### -->
......
......@@ -113,42 +113,6 @@ rsvg_size_callback (int *width,
}
}
static GdkPixbuf *
rsvg_pixbuf_from_file_with_size_data_ex (RsvgHandle * handle,
const gchar * file_name,
struct RsvgSizeCallbackData * data,
GError ** error)
{
GdkPixbuf *retval;
gchar *base_uri;
GByteArray *f;
base_uri = rsvg_get_base_uri_from_filename(file_name);
f = _rsvg_acquire_xlink_href_resource (file_name, base_uri, error);
if (f)
{
rsvg_handle_set_base_uri (handle, base_uri);
rsvg_handle_set_size_callback (handle, rsvg_size_callback, data, NULL);
rsvg_handle_write (handle, f->data, f->len, error);
rsvg_handle_close (handle, error);
retval = rsvg_handle_get_pixbuf (handle);
g_byte_array_free (f, TRUE);
}
else
{
retval = NULL;
}
g_free(base_uri);
return retval;
}
/* private */
GdkPixbuf *
rsvg_pixbuf_from_data_with_size_data (const guchar * buff,
......@@ -239,183 +203,6 @@ rsvg_pixbuf_from_file_with_size_data (const gchar * file_name,
return pixbuf;
}
/**
* rsvg_pixbuf_from_file_at_size_ex:
* @handle: The RSVG handle you wish to render with (either normal or gzipped)
* @file_name: A file name
* @width: The new width, or -1
* @height: The new height, or -1
* @error: return location for errors
*
* Loads a new #GdkPixbuf from @file_name and returns it. This pixbuf is scaled
* from the size indicated to the new size indicated by @width and @height. If
* either of these are -1, then the default size of the image being loaded is
* used. The caller must assume the reference to the returned pixbuf. If an
* error occurred, @error is set and %NULL is returned. Returned handle is closed
* by this call and must be freed by the caller.
*
* Return value: A newly allocated #GdkPixbuf, or %NULL
*
* Since: 2.4
*/
GdkPixbuf *
rsvg_pixbuf_from_file_at_size_ex (RsvgHandle * handle,
const gchar *file_name,
gint width,
gint height,
GError **error)
{
struct RsvgSizeCallbackData data;
data.type = RSVG_SIZE_WH;
data.width = width;
data.height = height;
data.keep_aspect_ratio = FALSE;
return rsvg_pixbuf_from_file_with_size_data_ex (handle, file_name, &data, error);
}
/**
* rsvg_pixbuf_from_file_ex:
* @handle: The RSVG handle you wish to render with (either normal or gzipped)
* @file_name: A file name
* @error: return location for errors
*
* Loads a new #GdkPixbuf from @file_name and returns it. The caller must
* assume the reference to the reurned pixbuf. If an error occurred, @error is
* set and %NULL is returned. Returned handle is closed by this call and must be
* freed by the caller.
*
* Return value: A newly allocated #GdkPixbuf, or %NULL
*
* Since: 2.4
*/
GdkPixbuf *
rsvg_pixbuf_from_file_ex (RsvgHandle * handle,
const gchar *file_name,
GError **error)
{
return rsvg_pixbuf_from_file_at_size_ex (handle, file_name, -1, -1, error);
}
/**
* rsvg_pixbuf_from_file_at_zoom_ex:
* @handle: The RSVG handle you wish to render with (either normal or gzipped)
* @file_name: A file name
* @x_zoom: The horizontal zoom factor
* @y_zoom: The vertical zoom factor
* @error: return location for errors
*
* Loads a new #GdkPixbuf from @file_name and returns it. This pixbuf is scaled
* from the size indicated by the file by a factor of @x_zoom and @y_zoom. The
* caller must assume the reference to the returned pixbuf. If an error
* occurred, @error is set and %NULL is returned. Returned handle is closed by this
* call and must be freed by the caller.
*
* Return value: A newly allocated #GdkPixbuf, or %NULL
*
* Since: 2.4
*/
GdkPixbuf *
rsvg_pixbuf_from_file_at_zoom_ex (RsvgHandle * handle,
const gchar *file_name,
double x_zoom,
double y_zoom,
GError **error)
{
struct RsvgSizeCallbackData data;
g_return_val_if_fail (file_name != NULL, NULL);
g_return_val_if_fail (x_zoom > 0.0 && y_zoom > 0.0, NULL);
data.type = RSVG_SIZE_ZOOM;
data.x_zoom = x_zoom;
data.y_zoom = y_zoom;
data.keep_aspect_ratio = FALSE;
return rsvg_pixbuf_from_file_with_size_data_ex (handle, file_name, &data, error);
}
/**
* rsvg_pixbuf_from_file_at_max_size_ex:
* @handle: The RSVG handle you wish to render with (either normal or gzipped)
* @file_name: A file name
* @max_width: The requested max width
* @max_height: The requested max heigh
* @error: return location for errors
*
* Loads a new #GdkPixbuf from @file_name and returns it. This pixbuf is uniformly
* scaled so that the it fits into a rectangle of size max_width * max_height. The
* caller must assume the reference to the returned pixbuf. If an error occurred,
* @error is set and %NULL is returned. Returned handle is closed by this call and
* must be freed by the caller.
*
* Return value: A newly allocated #GdkPixbuf, or %NULL
*
* Since: 2.4
*/
GdkPixbuf *
rsvg_pixbuf_from_file_at_max_size_ex (RsvgHandle * handle,
const gchar *file_name,
gint max_width,
gint max_height,
GError **error)
{
struct RsvgSizeCallbackData data;
data.type = RSVG_SIZE_WH_MAX;
data.width = max_width;
data.height = max_height;
data.keep_aspect_ratio = FALSE;
return rsvg_pixbuf_from_file_with_size_data_ex (handle, file_name, &data, error);
}
/**
* rsvg_pixbuf_from_file_at_zoom_with_max_ex:
* @handle: The RSVG handle you wish to render with (either normal or gzipped)
* @file_name: A file name
* @x_zoom: The horizontal zoom factor
* @y_zoom: The vertical zoom factor
* @max_width: The requested max width
* @max_height: The requested max heigh
* @error: return location for errors
*
* Loads a new #GdkPixbuf from @file_name and returns it. This pixbuf is scaled
* from the size indicated by the file by a factor of @x_zoom and @y_zoom. If the
* resulting pixbuf would be larger than max_width/max_heigh it is uniformly scaled
* down to fit in that rectangle. The caller must assume the reference to the
* returned pixbuf. If an error occurred, @error is set and %NULL is returned.
* Returned handle is closed by this call and must be freed by the caller.
*
* Return value: A newly allocated #GdkPixbuf, or %NULL
*
* Since: 2.4
*/
GdkPixbuf *
rsvg_pixbuf_from_file_at_zoom_with_max_ex (RsvgHandle * handle,
const gchar *file_name,
double x_zoom,
double y_zoom,
gint max_width,
gint max_height,
GError **error)
{
struct RsvgSizeCallbackData data;
g_return_val_if_fail (file_name != NULL, NULL);
g_return_val_if_fail (x_zoom > 0.0 && y_zoom > 0.0, NULL);
data.type = RSVG_SIZE_ZOOM_MAX;
data.x_zoom = x_zoom;
data.y_zoom = y_zoom;
data.width = max_width;
data.height = max_height;
data.keep_aspect_ratio = FALSE;
return rsvg_pixbuf_from_file_with_size_data_ex (handle, file_name, &data, error);
}
/**
* rsvg_pixbuf_from_file:
* @file_name: A file name
......
/* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
rsvg-gz.c: SAX-based renderer for SVGZ files into a GdkPixbuf.
Copyright (C) 2003 Dom Lachowicz <cinamod@hotmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "rsvg-gz.h"
#include "rsvg-private.h"
/**
* rsvg_handle_new_gz
*
* DEPRECATED. Please use rsvg_handle_new () instead.
*
* Returns: a new SVGZ handle
*/
RsvgHandle *
rsvg_handle_new_gz (void)
{
return rsvg_handle_new ();
}
/* vim: set sw=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
rsvg-gz.h: SAX-based renderer for SVGZ files into a GdkPixbuf.
Copyright (C) 2003 Dom Lachowicz
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef RSVG_GZ_H
#define RSVG_GZ_H
#include "rsvg.h"
G_BEGIN_DECLS
#ifndef RSVG_DISABLE_DEPRECATED
RsvgHandle * rsvg_handle_new_gz (void);
#endif
G_END_DECLS
#endif /* RSVG_GZ_H */
......@@ -1706,7 +1706,7 @@ rsvg_new_drawing_ctx(RsvgHandle * handle)
}
/**
* rsvg_set_default_dpi_x_y
* rsvg_set_default_dpi
* @dpi_x: Dots Per Inch (aka Pixels Per Inch)
* @dpi_y: Dots Per Inch (aka Pixels Per Inch)
*
......@@ -1717,7 +1717,7 @@ rsvg_new_drawing_ctx(RsvgHandle * handle)
* Since: 2.8
*/
void
rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y)
rsvg_set_default_dpi (double dpi_x, double dpi_y)
{
if (dpi_x <= 0.)
internal_dpi_x = RSVG_DEFAULT_DPI_X;
......@@ -1731,24 +1731,7 @@ rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y)
}
/**
* rsvg_set_default_dpi
* @dpi: Dots Per Inch (aka Pixels Per Inch)
*
* Sets the DPI for the all future outgoing pixbufs. Common values are
* 75, 90, and 300 DPI. Passing a number <= 0 to #dpi will
* reset the DPI to whatever the default value happens to be.
*
* Since: 2.2
* DEPRECATED. Use rsvg_set_default_dpi_x_y() instead
*/
void
rsvg_set_default_dpi (double dpi)
{
rsvg_set_default_dpi_x_y (dpi, dpi);
}
/**
* rsvg_handle_set_dpi_x_y
* rsvg_handle_set_dpi
* @handle: An #RsvgHandle
* @dpi_x: Dots Per Inch (aka Pixels Per Inch)
* @dpi_y: Dots Per Inch (aka Pixels Per Inch)
......@@ -1760,7 +1743,7 @@ rsvg_set_default_dpi (double dpi)
* Since: 2.8
*/
void
rsvg_handle_set_dpi_x_y (RsvgHandle * handle, double dpi_x, double dpi_y)
rsvg_handle_set_dpi (RsvgHandle * handle, double dpi_x, double dpi_y)
{
g_return_if_fail (handle != NULL);
......@@ -1775,24 +1758,6 @@ rsvg_handle_set_dpi_x_y (RsvgHandle * handle, double dpi_x, double dpi_y)
handle->dpi_y = dpi_y;
}
/**
* rsvg_handle_set_dpi
* @handle: An #RsvgHandle
* @dpi: Dots Per Inch (aka Pixels Per Inch)
*
* Sets the DPI for the outgoing pixbuf. Common values are
* 75, 90, and 300 DPI. Passing a number <= 0 to #dpi will
* reset the DPI to whatever the default value happens to be.
*
* Since: 2.2
* DEPRECATED. Use rsvg_handle_set_dpi_x_y() instead
*/
void
rsvg_handle_set_dpi (RsvgHandle * handle, double dpi)
{
rsvg_handle_set_dpi_x_y (handle, dpi, dpi);
}
/**
* rsvg_handle_set_size_callback:
* @handle: An #RsvgHandle
......
......@@ -56,8 +56,8 @@ typedef void (* RsvgSizeFunc) (gint *width,
void rsvg_init (void);
void rsvg_term (void);
void rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y);
void rsvg_handle_set_dpi_x_y (RsvgHandle * handle, double dpi_x, double dpi_y);
void rsvg_set_default_dpi (double dpi_x, double dpi_y);
void rsvg_handle_set_dpi (RsvgHandle * handle, double dpi_x, double dpi_y);
RsvgHandle *rsvg_handle_new (void);
void rsvg_handle_set_size_callback (RsvgHandle *handle,
......@@ -108,37 +108,6 @@ G_CONST_RETURN char *rsvg_handle_get_title (RsvgHandle *handle);
G_CONST_RETURN char *rsvg_handle_get_desc (RsvgHandle *handle);
G_CONST_RETURN char *rsvg_handle_get_metadata (RsvgHandle *handle);
#ifndef RSVG_DISABLE_DEPRECATED
void rsvg_set_default_dpi (double dpi);
void rsvg_handle_set_dpi (RsvgHandle * handle, double dpi);
GdkPixbuf * rsvg_pixbuf_from_file_at_size_ex (RsvgHandle * handle,
const gchar *file_name,
gint width,
gint height,
GError **error);
GdkPixbuf * rsvg_pixbuf_from_file_ex (RsvgHandle * handle,
const gchar *file_name,
GError **error);
GdkPixbuf * rsvg_pixbuf_from_file_at_zoom_ex (RsvgHandle * handle,
const gchar *file_name,
double x_zoom,
double y_zoom,
GError **error);
GdkPixbuf * rsvg_pixbuf_from_file_at_max_size_ex (RsvgHandle * handle,
const gchar *file_name,
gint max_width,
gint max_height,
GError **error);
GdkPixbuf * rsvg_pixbuf_from_file_at_zoom_with_max_ex (RsvgHandle * handle,
const gchar *file_name,
double x_zoom,
double y_zoom,
gint max_width,
gint max_height,
GError **error);
#endif
G_END_DECLS
#endif /* RSVG_H */
......@@ -623,7 +623,7 @@ main (int argc, char **argv)
gtk_init (&argc, &argv) ;
rsvg_init ();
rsvg_set_default_dpi_x_y (dpi_x, dpi_y);
rsvg_set_default_dpi (dpi_x, dpi_y);
/* if both are unspecified, assume user wants to zoom the pixbuf in at least 1 dimension */
if (width == -1 && height == -1)
......
......@@ -95,7 +95,7 @@ main (int argc, const char **argv)
rsvg_init ();
rsvg_set_default_dpi_x_y (dpi_x, dpi_y);
rsvg_set_default_dpi (dpi_x, dpi_y);
/* if both are unspecified, assume user wants to zoom the pixbuf in at least 1 dimension */
if (width == -1 && height == -1)
......
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