Gnome2-Print

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

	Gnome2::Print::Font changed to Gnome2::Print::Font::Constants.

	* t/00.GnomePrint.t: my version of Test::More's ok() was mortally
	confused by Gnome2::Print->get_version_info returning a list; check
	that it returns three elements instead.

2003/11/29 18:45 (+0100) ebassi

	* xs/GnomePrintJob.xs, xs/GnomeFont.xs, xs/GnomeFontFace.xs,
	  xs/GnomePrintConfig.xs, xs/GnomePrintDialog.xs: better apidoc for
	  PPCODE in methods.

2003/11/29 18:15 (+0100) ebassi

	* t/*: updated tests for constants modules change, and for unused
	  variables.
	* Makefile.PL: put constants modules in the right place.

2003/11/28 23:20 (+0100) ebassi

	* xs/GnomePrint2.xs: added methods:
		
		Gnome2::Print->get_version_info
		Gnome2::Print->check_version
	  
	  based on code from Torsten Schoenfeld; those methods replace the
	  get_version class method.

2003/11/28 19:00 (+0100) ebassi

	* xs/GnomeFont.xs, xs/GnomePrintJob.xs, xs/GnomePrintDialog.xs: added
	  apidoc for PPCODE sections.

2003/11/28 18:34 (+0100) ebassi

	* Makefile.PL, pm/Config.pm, pm/Font.pm, t/05.GnomeFont.t: moved
	  constants to another namespace to avoid collisions with the
	  respective classes; these are the new namespaces for Config and
	  Font constants:
	  	
		Gnome2::Print::Config -> Gnome2::Print::Config::Constants
		Gnome2::Print::Font   -> Gnome2::Print::Font::Constants

xs/GnomeFont.xs  view on Meta::CPAN

##ArtPoint *gnome_font_get_glyph_stdadvance (GnomeFont *font, gint glyph, ArtPoint *advance);
=for apidoc
=signature ($x, $y) = $font->get_glyph_stdadvance ($glyph)
=cut
void
gnome_font_get_glyph_stadvance (font, glyph)
	GnomeFont	* font
	gint		glyph
    PREINIT:
    	ArtPoint advance;
    PPCODE:
	gnome_font_get_glyph_stdadvance (font, glyph, &advance);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (advance.x)));
	PUSHs (sv_2mortal (newSVnv (advance.y)));

##ArtDRect *gnome_font_get_glyph_stdbbox (GnomeFont *font, gint glyph, ArtDRect *bbox);
=for apidoc
=signature ($x0, $y0, $x1, $y1) = $font->get_glyph_stdbbox ($glyph)
=cut
void
gnome_font_get_glyph_stdbbox (font, glyph)
	GnomeFont	* font
	gint		glyph
    PREINIT:
    	ArtDRect bbox;
    PPCODE:
	gnome_font_get_glyph_stdbbox (font, glyph, &bbox);
	EXTEND (SP, 4);
	PUSHs (sv_2mortal (newSVnv (bbox.x0)));
	PUSHs (sv_2mortal (newSVnv (bbox.y0)));
	PUSHs (sv_2mortal (newSVnv (bbox.x1)));
	PUSHs (sv_2mortal (newSVnv (bbox.y1)));

### ArtBpath is a matrix (2x3) of double, representing a bezier path element.
### Unfortunately, it has also an element taken from an enum that declares the
### state of the bezier path; the enum is not a registered type.

xs/GnomeFont.xs  view on Meta::CPAN

=for apidoc
=signature ($x, $y) = $font->get_glyph_stdkerning ($glyph0, $glyph1)
=cut
void
gnome_font_get_glyph_stdkerning (font, glyph0, glyph1)
	GnomeFont	* font
	gint		glyph0
	gint		glyph1
    PREINIT:
    	ArtPoint kerning;
    PPCODE:
    	gnome_font_get_glyph_stdkerning (font, glyph0, glyph1, &kerning);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (kerning.x)));
	PUSHs (sv_2mortal (newSVnv (kerning.y)));

gdouble 
gnome_font_get_glyph_width (font, glyph)
	GnomeFont 	* font
	gint 		glyph

xs/GnomeFont.xs  view on Meta::CPAN

### These lists are lists of strings.
##GList  *gnome_font_list (void);
=for apidoc
This method returns a list of strings, each one containing a font name present
on this system.
=cut
void
gnome_font_list (class)
    PREINIT:
    	GList *list, *i;
    PPCODE:
    	list = gnome_font_list ();
	if (! list)
		XSRETURN_EMPTY;
	for (i = list; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
	/* according to docs, it's up to us to free this. */	
	gnome_font_list_free(list);

##void    gnome_font_list_free (GList *fontlist);

##GList  *gnome_font_family_list (void);
=for apidoc
This method returns a list of strings, each one containing a font family
present on this system.
=cut
void
gnome_font_family_list (class)
    PREINIT:
    	GList *list, *i;
    PPCODE:
    	list = gnome_font_family_list ();
	if (! list)
		XSRETURN_EMPTY;
	for (i = list; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
	/* according to docs, it's up to us to free this. */	
	gnome_font_family_list_free(list);

##void    gnome_font_family_list_free (GList *fontlist);

##GList  *gnome_font_style_list (const guchar *family);
=for apidoc
This method returns a list of strings, each one containing a style for the
given font family.
=cut
void
gnome_font_style_list (class, family)
	const guchar * family
    PREINIT:
    	GList *list, *i;
    PPCODE:
    	list = gnome_font_style_list (family);
	if (! list)
		XSRETURN_EMPTY;
	for (i = list; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGChar (i->data)));
	/* according to docs, it's up to us to free this. */	
	gnome_font_style_list_free (list);

##void    gnome_font_style_list_free (GList *styles);

xs/GnomeFontFace.xs  view on Meta::CPAN


##const ArtDRect *gnome_font_face_get_stdbbox (GnomeFontFace *face);
=for apidoc
=signature ($x0, $y0, $x1, $y1) = $face->get_stdbbox
=cut
void
gnome_font_face_get_stdbbox (face)
	GnomeFontFace * face
    PREINIT:
    	const ArtDRect * rect;
    PPCODE:
    	rect = gnome_font_face_get_stdbbox (face);
	if (! rect)
		XSRETURN_UNDEF;
	
	EXTEND (SP, 4);
	PUSHs (sv_2mortal (newSVnv (rect->x0)));
	PUSHs (sv_2mortal (newSVnv (rect->y0)));
	PUSHs (sv_2mortal (newSVnv (rect->x1)));
	PUSHs (sv_2mortal (newSVnv (rect->y1)));

##ArtDRect *gnome_font_face_get_glyph_stdbbox (GnomeFontFace *face, gint glyph, ArtDRect * bbox);
=for apidoc
=signature ($x0, $y0, $x1, $y1) = $face->get_glyph_stdbbox ($glyph)
=cut
void
gnome_font_face_get_glyph_stdbbox (face, glyph)
	GnomeFontFace * face
	gint glyph
    PREINIT:
    	ArtDRect bbox;
    PPCODE:
    	gnome_font_face_get_glyph_stdbbox (face, glyph, &bbox);
	EXTEND (SP, 4);
	PUSHs (sv_2mortal (newSVnv (bbox.x0)));
	PUSHs (sv_2mortal (newSVnv (bbox.y0)));
	PUSHs (sv_2mortal (newSVnv (bbox.x1)));
	PUSHs (sv_2mortal (newSVnv (bbox.y1)));

##ArtPoint *gnome_font_face_get_glyph_stdadvance (GnomeFontFace *face, gint glyph, ArtPoint * advance);
=for apidoc
=signature ($x, $y) = $face->get_glyph_stdadvance ($glyph)
=cut
void
gnome_font_face_get_glyph_stdadvance (face, glyph)
	GnomeFontFace * face
	gint glyph
    PREINIT:
    	ArtPoint advance;
    PPCODE:
    	gnome_font_face_get_glyph_stdadvance (face, glyph, &advance);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (advance.x)));
	PUSHs (sv_2mortal (newSVnv (advance.y)));

##const ArtBpath *gnome_font_face_get_glyph_stdoutline (GnomeFontFace *face, gint glyph);
##ArtPoint *gnome_font_face_get_glyph_stdkerning (GnomeFontFace *face, gint glyph0, gint glyph1, ArtPoint *kerning);
=for apidoc
=signature ($x, $y) = $face->get_glyph_stdkerning ($glyph0, $glyph1)
=cut
void
gnome_font_face_get_glyph_stdkerning (face, glyph0, glyph1)
	GnomeFontFace * face
	gint glyph0
	gint glyph1
    PREINIT:
    	ArtPoint kerning;
    PPCODE:
    	gnome_font_face_get_glyph_stdkerning (face, glyph0, glyph1, &kerning);
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (kerning.x)));
	PUSHs (sv_2mortal (newSVnv (kerning.y)));

##GnomeFontWeight gnome_font_face_get_weight_code (GnomeFontFace *face);

gboolean
gnome_font_face_is_italic (face)
	GnomeFontFace * face

xs/GnomeGlyphList.xs  view on Meta::CPAN

void
gnome_glyphlist_glyph (GnomeGlyphList * gl, gint glyph)

##void gnome_glyphlist_glyphs      (GnomeGlyphList *gl, gint *glyphs, gint num_glyphs);
void
gnome_glyphlist_glyphs (gl, glyphs, ...)
	GnomeGlyphList * gl
    PREINIT:
	gint * g;
	gint i;
    PPCODE:
	g = g_new0 (gint, items - 1);
	for (i = 1; i < items; i++)
		g[i - 1] = SvIV (ST (i));
	gnome_glyphlist_glyphs (gl, g, i);

##void gnome_glyphlist_text_dumb       (GnomeGlyphList *gl, const guchar *text);
void
gnome_glyphlist_text_dumb (GnomeGlyphList * gl, const guchar * text)

##void gnome_glyphlist_text_sized_dumb (GnomeGlyphList *gl, const guchar *text, gint length);

xs/GnomePrint2.xs  view on Meta::CPAN


BOOT:
#include "register.xsh"
#include "boot.xsh"

=for apidoc
=signature (major_version, minor_version, micro_version) = Gnome2::Print->GET_VERSION_INFO
=cut
void
GET_VERSION_INFO (class)
    PPCODE:
	EXTEND (SP, 3);
	PUSHs (sv_2mortal (newSViv (GNOMEPRINT_MAJOR_VERSION)));
	PUSHs (sv_2mortal (newSViv (GNOMEPRINT_MINOR_VERSION)));
	PUSHs (sv_2mortal (newSViv (GNOMEPRINT_MICRO_VERSION)));
	PERL_UNUSED_VAR (ax);

bool
CHECK_VERSION (class, major, minor, micro)
	int major
	int minor

xs/GnomePrintConfig.xs  view on Meta::CPAN


=for apidoc
=signature ($width, $height) = $gpc->get_page_size
=cut
void
gnome_print_config_get_page_size (gpc)
	GnomePrintConfig	* gpc
    PREINIT:
    	gdouble width;
	gdouble height;
    PPCODE:
    	if (!gnome_print_config_get_page_size (gpc, &width, &height))
		XSRETURN_EMPTY;
	
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (width)));
	PUSHs (sv_2mortal (newSVnv (height)));


### The get* methods should all FALSE if the key is not found (except
### gnome_print_config_get, which returns NULL), and use the "value"

xs/GnomePrintConfig.xs  view on Meta::CPAN

### wanted scalar in case of success.
void
gnome_print_config_gets (config, key)
	GnomePrintConfig * config
	const guchar * key
    ALIAS:
    	Gnome2::Print::Config::get = 0
	Gnome2::Print::Config::get_int = 1
	Gnome2::Print::Config::get_boolean = 2
	Gnome2::Print::Config::get_double = 3
    PPCODE:
    	switch (ix) {
		case 0: {
			gchar_own *value;
			value = (gchar_own *) gnome_print_config_get (config, key);
			if (! value)
				XSRETURN_UNDEF;
			EXTEND (SP, 1);
			PUSHs (sv_2mortal (newSVGChar (value)));
			break;
		}

xs/GnomePrintDialog.xs  view on Meta::CPAN

## void gnome_print_dialog_get_copies (GnomePrintDialog *gpd, gint *copies, gint *collate);
=for apidoc
=signature ($copies, $collate) = $gpd->get_copies
=cut
void
gnome_print_dialog_get_copies (gpd)
	GnomePrintDialog *gpd
    PREINIT:
    	gint copies;
	gint collate;
    PPCODE:
    	gnome_print_dialog_get_copies (gpd, &copies, &collate);

	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (copies)));
	PUSHs (sv_2mortal (newSVnv (collate)));

##void gnome_print_dialog_set_copies (GnomePrintDialog *gpd, gint copies, gint collate);
void
gnome_print_dialog_set_copies (gpd, copies, collate)
	GnomePrintDialog	* gpd

xs/GnomePrintJob.xs  view on Meta::CPAN


=for apidoc
=signature ($width, $height) = $job->get_page_size
=cut
void
gnome_print_job_get_page_size (job)
	GnomePrintJob	* job
    PREINIT:
	gdouble width;
	gdouble height;
    PPCODE:
	if (!gnome_print_job_get_page_size (job, &width, &height))
		XSRETURN_EMPTY;
	
	EXTEND (SP, 2);
	PUSHs (sv_2mortal (newSVnv (width)));
	PUSHs (sv_2mortal (newSVnv (height)));

xs/GnomePrintPaper.xs  view on Meta::CPAN


## gnome_print_paper_get_list returns a list of GnomePrintPaper.
##GList * gnome_print_paper_get_list (void);
=for apidoc
This method returns an array containing all the registered paper types.
=cut
void
gnome_print_paper_get_list (class)
    PREINIT:
	GList *l, *tmp;
    PPCODE:
	PERL_UNUSED_VAR (ax);
	l = gnome_print_paper_get_list ();
	for (tmp = l; tmp != NULL; tmp = g_list_next (tmp))
		XPUSHs (sv_2mortal (newSVGnomePrintPaper (tmp->data)));
	gnome_print_paper_free_list (l);

##void    gnome_print_paper_free_list (GList *papers);

xs/GnomePrintUnit.xs  view on Meta::CPAN


##GList * gnome_print_unit_get_list (guint bases);
=for apidoc
This function returns a list of Gnome2::Print::Unit.
=cut
void
gnome_print_unit_get_list (bases)
	guint bases
    PREINIT:
    	GList * list, * i;
    PPCODE:
    	list = gnome_print_unit_get_list (bases);
	for (i = list; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGnomePrintUnit_copy (i->data)));
	gnome_print_unit_free_list (list);

##void    gnome_print_unit_free_list (GList *units);

	
MODULE = Gnome2::Print::Unit PACKAGE = Gnome2::Print::Unit PREFIX = gnome_print_

xs/GnomePrintUnit.xs  view on Meta::CPAN

	
This function returns a double on success or undef on failure.
=cut
void
gnome_print_convert_distance (from, to)
	GnomePrintUnit * from
	GnomePrintUnit * to
    PREINIT:
    	gboolean res;
    	gdouble distance;
    PPCODE:
    	res = gnome_print_convert_distance (&distance,
			(const GnomePrintUnit *)from,
			(const GnomePrintUnit *)to);
	if (! res)
		XSRETURN_UNDEF;
	EXTEND (SP, 1);
	PUSHs (sv_2mortal (newSVnv (distance)));

##gboolean gnome_print_convert_distance_full (gdouble *distance, const GnomePrintUnit *from, const GnomePrintUnit *to, gdouble ctmscale, gdouble devicescale);
=for apidoc

xs/GnomePrintUnit.xs  view on Meta::CPAN

=cut
void
gnome_print_convert_distance_full (from, to, ctmscale, devicescale)
	GnomePrintUnit * from
	GnomePrintUnit * to
	gdouble ctmscale
	gdouble devicescale
    PREINIT:
    	gboolean res;
    	gdouble distance;
    PPCODE:
    	res = gnome_print_convert_distance_full (&distance, 
			(const GnomePrintUnit *)from,
			(const GnomePrintUnit *)to,
			ctmscale, devicescale);
	if (! res)
		XSRETURN_UNDEF;
	EXTEND (SP, 1);
	PUSHs (sv_2mortal (newSVnv (distance)));



( run in 0.714 second using v1.01-cache-2.11-cpan-5511b514fd6 )