Comment 3 for bug 351316

Revision history for this message
Martin Luessi (mluessi) wrote : Re: [Bug 351316] Re: support for accessing Action fields

Hi Gian,

I agree that having different objects would be nicer. However, I'm not
sure on how to that with inheriting from gpointer, as I don't have a
lot of experience with creating python wrappers for GTK based
libraries. Can you give me any tips regarding this?

Thanks,

Martin

On Fri, Apr 10, 2009 at 4:21 PM, Gian Mario Tagliaretti
<email address hidden> wrote:
> Hi Martin, sorry for the huge delay.
>
> Being the Action an union makes things a lot more complicated of course,
> what about we create different objects (inheriting from gpointer) and we
> return the right one instead?
>
> Does it make any sense to you or it will just complicate things more
> than necessary? Beware that I didn't look carefully at poppler code so
> it can be a nonsense what I just wrote.
>
> --
> support for accessing Action fields
> https://bugs.launchpad.net/bugs/351316
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Poppler Python Bindings: New
>
> Bug description:
> Currently python poppler does not support accessing the fields of the various poppler action structs. Poppler uses action structs for various things such as links to external files, links within the PDF, launching external applications, etc.
>
> The attached patch adds several member functions to the Action class to allow accessing the struct fields. Note that poppler uses a different struct for each action type, while the python poppler bindings only use one Action class. If a member function to obtain a field that does not exist in the corresponding struct is called, a None object is returned.
>
> The additional member functions are the following:
>
> Action.get_action_type() : returns the action type, which is an object of type ActionType
>
> Action.get_title(): returns the title of the action (string or None)
>
> Action.get_uri(): returns the URI (string or None)
>
> Action.get_dest(): returns the destination (object of type Dest or None)
>
> Action.named_dest(): returns the named destinatin (string or None)
>
> Action.get_file_name(): returns the file name (string or None)
>
> Action.get_params(): returns the parameters (string or None)
>
> Best,
>
> Martin
>