New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PDF as a target Surface #143

Merged
merged 1 commit into from Jul 15, 2017

Conversation

Projects
None yet
3 participants
@savage13

savage13 commented Jul 15, 2017

This was modeled after ImageSurface. It is missing the rest of the PDF Surface functions at https://www.cairographics.org/manual/cairo-PDF-Surfaces.html

I am unsure if the conversion to ToGlibPtr functions work properly.

I would image Postscript would be similar.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Can't it be generated automatically? Try adding "cairo.PDFSurface" into Gir.toml and then run make gir.

Member

GuillaumeGomez commented Jul 15, 2017

Can't it be generated automatically? Try adding "cairo.PDFSurface" into Gir.toml and then run make gir.

@savage13

This comment has been minimized.

Show comment
Hide comment
@savage13

savage13 Jul 15, 2017

I cannot find any gir files in the cairo repo.

Is the Gir.toml file for cairo contained within the gtk-rs/gtk repo?

savage13 commented Jul 15, 2017

I cannot find any gir files in the cairo repo.

Is the Gir.toml file for cairo contained within the gtk-rs/gtk repo?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Ah no, sorry! cairo isn't generated automatically... Then it's good, just let me check your code now. :p

Member

GuillaumeGomez commented Jul 15, 2017

Ah no, sorry! cairo isn't generated automatically... Then it's good, just let me check your code now. :p

@@ -0,0 +1,141 @@

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Extra empty line.

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Extra empty line.

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Still not removed. :)

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Still not removed. :)

Show outdated Hide outdated src/pdf_surface.rs
Show outdated Hide outdated src/lib.rs
Show outdated Hide outdated src/lib.rs
if surface.get_type() == SurfaceType::Pdf {
Ok(PDFSurface(surface))
} else {
Err(surface)

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

It's... strange... What do you think of this @EPashkin?

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

It's... strange... What do you think of this @EPashkin?

This comment has been minimized.

@EPashkin

EPashkin Jul 15, 2017

Member

We do same on ImageSurface and Win32Surface.
Normally error branch not work, but if it happened user get surface and can check it thoroughly

@EPashkin

EPashkin Jul 15, 2017

Member

We do same on ImageSurface and Win32Surface.
Normally error branch not work, but if it happened user get surface and can check it thoroughly

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Ok, all good for me then!

@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Ok, all good for me then!

Show outdated Hide outdated src/pdf_surface.rs
Show outdated Hide outdated src/pdf_surface.rs
Show outdated Hide outdated src/pdf_surface.rs
Show outdated Hide outdated src/pdf_surface.rs
Show outdated Hide outdated src/pdf_surface.rs
@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Just one last nit. Then I'm waiting for @EPashkin's opinion for your returned Err.

Member

GuillaumeGomez commented Jul 15, 2017

Just one last nit. Then I'm waiting for @EPashkin's opinion for your returned Err.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

Please remove the last nit and squash your commits, then I merge. Thanks!

Member

GuillaumeGomez commented Jul 15, 2017

Please remove the last nit and squash your commits, then I merge. Thanks!

Brian Savage
@savage13

This comment has been minimized.

Show comment
Hide comment
@savage13

savage13 Jul 15, 2017

I was unsure about the first line, so I added the copyright at the top of pdf_surface.rs, as in image_surface.rs

savage13 commented Jul 15, 2017

I was unsure about the first line, so I added the copyright at the top of pdf_surface.rs, as in image_surface.rs

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 15, 2017

Member

That's fine too. Thanks a lot!

Member

GuillaumeGomez commented Jul 15, 2017

That's fine too. Thanks a lot!

@GuillaumeGomez GuillaumeGomez merged commit d10d626 into gtk-rs:master Jul 15, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment