How do I test my custom GtkPrintBackend ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I test my custom GtkPrintBackend ?

Nilanjana Lodh
I am trying to develop my own GtkPrintBackend ,
taking help from here:
https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html

But, I now want to test my print backend( by making the print dialog use my backend instead). How do I do that?
That is , how do I make the Print dialog use my backend instead?

I didn't find much help on this online. Help would be awesome!

Thanks and reagrds ,

Nilanjana Lodh

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: How do I test my custom GtkPrintBackend ?

Rafal Luzynski
21.05.2017 23:07 Nilanjana Lodh <[hidden email]> wrote:
>
>  I am trying to develop my own GtkPrintBackend ,
>  taking help from here:
>
> https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html

Note that this tutorial has been written for GTK+ 2.x
series and things may work differently in GTK+ 3.x and
soon coming GTK+ 4.x.

>  But, I now want to test my print backend( by making the print dialog use my
> backend instead). How do I do that?
>  That is , how do I make the Print dialog use my backend instead?
> [...]

It's been a while since I was working with print backends
so my memory may be incomplete or outdated. But as far
as I remember there is no such thing as "use this print
backend instead of that". All print backends work in parallel,
or more precisely: are available concurrently and loaded
and called by the framework as needed. All you have to do
is to implement the backend, install it, and make it provide
at least one printer. As soon as you do it correctly you
can run any GTK application, open the default print dialog,
and select a printer provided by your backend. Of course
you can disable (e.g., uninstall) other backends if you
have a good reason but most probably you don't need it.

You did not write more details like whether your backend
supports physical or virtual printers, and whether these
printers are already supported by other backends. You may
want to avoid conflicts and make sure it's your backend
running rather than another one which supports the same
printer, or to avoid wasting physical resources like real
paper or lots of electrical energy.

However, do not hesitate to ask if you have more questions.

Regards,

Rafal
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: How do I test my custom GtkPrintBackend ?

Nilanjana Lodh
Hi Rafal,
Thanks for the help!
I am trying to develop an alternative CUPS backend  using the new CUPS API - so it is going to list all the CUPS printers as well as the IPP printers;
Also, is there a way I can test my backend without installing it (to avoid messing with my system)- Is using JHBuild an option?

Thanks and regards,

Nilanjana.
Inline image 1
NILANJANA LODH
CS Undergrad 
@ IIEST, Shibpur

On Tue, May 23, 2017 at 4:33 AM, Rafal Luzynski <[hidden email]> wrote:
21.05.2017 23:07 Nilanjana Lodh <[hidden email]> wrote:
>
>  I am trying to develop my own GtkPrintBackend ,
>  taking help from here:
>
> https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html

Note that this tutorial has been written for GTK+ 2.x
series and things may work differently in GTK+ 3.x and
soon coming GTK+ 4.x.

>  But, I now want to test my print backend( by making the print dialog use my
> backend instead). How do I do that?
>  That is , how do I make the Print dialog use my backend instead?
> [...]

It's been a while since I was working with print backends
so my memory may be incomplete or outdated. But as far
as I remember there is no such thing as "use this print
backend instead of that". All print backends work in parallel,
or more precisely: are available concurrently and loaded
and called by the framework as needed. All you have to do
is to implement the backend, install it, and make it provide
at least one printer. As soon as you do it correctly you
can run any GTK application, open the default print dialog,
and select a printer provided by your backend. Of course
you can disable (e.g., uninstall) other backends if you
have a good reason but most probably you don't need it.

You did not write more details like whether your backend
supports physical or virtual printers, and whether these
printers are already supported by other backends. You may
want to avoid conflicts and make sure it's your backend
running rather than another one which supports the same
printer, or to avoid wasting physical resources like real
paper or lots of electrical energy.

However, do not hesitate to ask if you have more questions.

Regards,

Rafal


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: How do I test my custom GtkPrintBackend ?

Rafal Luzynski
23.05.2017 10:41 Nilanjana Lodh <[hidden email]> wrote:
>  [...]
>  I am trying to develop an alternative CUPS backend  using the new
>  CUPS API - so it is going to list all the CUPS printers as well as
>  the IPP printers;

Is it supposed to land in the main gtk repo eventually? Instead of
developing a new backend you may consider updating the existing one.
I have a feeling that the maintainers will be more likely to accept
the patches for the existing backend than those which create a new
backend which is supposed to work side-by-side with another existing
one which would be nominated as deprecated but still would be around.

While you are developing it as a completely new backend my suggestion
is to make all your printer names have some visible suffix or prefix
so you will easily distinguish your printers from the original
CUPS printers (because I guess these will be two identical sets of
physical devices).

>  Also, is there a way I can test my backend without installing it
>  (to avoid messing with my system)- Is using JHBuild an option?

Unfortunately, again my answer is "I don't know" but IMHO JHBuild
is such a powerful tool that it may really help with your backend.

My another suggestion is to install the gtk source repository and
step inside gtk_enumerate_printers() with a debugger to see how it
loads print backend and how each of them delivers its printers.

I hope there are people around here who will provide more accurate
answers.

Regards,

Rafal
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: How do I test my custom GtkPrintBackend ?

Nilanjana Lodh

Thanks a lot for the suggestions @rafal. I was able to test the modified backend without installing it directly into my system using JHBuild.
Also, the following tutorial( https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html) was written for GTK2 and lacks completeness. If similar tutorial on creating print backends could be written (wrt GTK3 / GTK4) by someone ,that would be quite useful to the community IMHO.

Thanks and regards,
Nilanjana

On Tue, May 23, 2017 at 3:52 PM, Rafal Luzynski <[hidden email]> wrote:
23.05.2017 10:41 Nilanjana Lodh <[hidden email]> wrote:
>  [...]
>  I am trying to develop an alternative CUPS backend  using the new
>  CUPS API - so it is going to list all the CUPS printers as well as
>  the IPP printers;

Is it supposed to land in the main gtk repo eventually? Instead of
developing a new backend you may consider updating the existing one.
I have a feeling that the maintainers will be more likely to accept
the patches for the existing backend than those which create a new
backend which is supposed to work side-by-side with another existing
one which would be nominated as deprecated but still would be around.

While you are developing it as a completely new backend my suggestion
is to make all your printer names have some visible suffix or prefix
so you will easily distinguish your printers from the original
CUPS printers (because I guess these will be two identical sets of
physical devices).

>  Also, is there a way I can test my backend without installing it
>  (to avoid messing with my system)- Is using JHBuild an option?

Unfortunately, again my answer is "I don't know" but IMHO JHBuild
is such a powerful tool that it may really help with your backend.

My another suggestion is to install the gtk source repository and
step inside gtk_enumerate_printers() with a debugger to see how it
loads print backend and how each of them delivers its printers.

I hope there are people around here who will provide more accurate
answers.

Regards,

Rafal


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: How do I test my custom GtkPrintBackend ?

Rafal Luzynski
24.05.2017 09:05 Nilanjana Lodh <[hidden email]> wrote:
>  
>  Thanks a lot for the suggestions @rafal. I was able to test the
>  modified backend without installing it directly into my system
>  using JHBuild.

I'm glad to know this.

>  Also, the following tutorial(
>
> https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html)
>  was written for GTK2 and lacks completeness. If similar tutorial
>  on creating print backends could be written (wrt GTK3 / GTK4) by
>  someone ,that would be quite useful to the community IMHO.

Would you consider writing such tutorial? I think it's a good idea.

Regards,

Rafal
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list