Re: PDF page not rendering properly if the page is changed

2018-11-28 Thread Germán Poo-Caamaño
On Wed, 2018-11-28 at 17:17 +0100, Радомир Хаџић via gtk-app-devel-list 
> Hello.
> I've sent as an attachment a code for a very simple PDF viewer. It is
> not that well written but that's because I wanted it to be simple and
> easy to understand. The purpose of the program is to illustrate a
> problem that I'm having with my larger project.
> The problem is that if a user changes page (by clicking "Previous
> Page" or "Next Page") and the page when scaled accordingly is bigger
> than the visible portion of the page rendering area (GtkDrawingArea),
> then only the part of the page will render. You can try this
> yourself:
> 1. Open a document 2. Make sure that the next page is not completely
> visible on the screen (so the scrollbars appear, this can be usually
> achieved by clicking "Fit Width") 3. Click "Next page" and try
> scrolling. You'll notice that one part of the page is not rendered.
> So, why is this happening and how can I solve it? What also confuses
> me is that rendering() function is definitely called when I scroll
> but
> the page does not render (though it does render as it should when I
> scroll the first page of a just opened document) properly, but if I
> then resize the window the page renders properly.

I do not see any attachment.

My guess is: the page maybe cached somewhere, and it is reloaded (re-
rendered) when the view size changes.

Germán Poo-Caamaño
gtk-app-devel-list mailing list

Re: How to make text in rendered PDF pages selectable?

2018-11-19 Thread Germán Poo-Caamaño
On Mon, 2018-11-19 at 16:39 +0100, Радомир Хаџић via gtk-app-devel-list 
> Hello.
> I'm using Poppler to render PDF page onto GtkDrawingArea surface.
> Everything renders correctly so far, but I can't figure out how to
> make text selectable. For example, a user may wish to select some
> text
> using mouse with the intention of copying it, or when user searches a
> document for a string it would be practical to make that text stand
> out by selecting it.
> All I'm asking for is some guidance and/or brief explanation how am I
> supposed to achieve that, since I cannot find anything online or in
> the documentation.

You might want to check poppler-glib-demo, and its source code. In
particular, selections.c which is done with GtkDrawingArea.

Germán Poo-Caamaño,
gtk-app-devel-list mailing list

Re: That reminds me -- is there a signal that can be used when mouse over mainwin titlebar?

2018-10-04 Thread Germán Poo-Caamaño
On Wed, 2018-09-26 at 18:52 -0500, David C. Rankin wrote:
> All,
> Thanks to the other "is there a signal?" question, that reminded me I
> have been looking for a signal (or way) to detect when the user has
> the mouse over  the titlebar of the main window in an editor where I
> would like to activate a tooltip showing the absolute path for the
> file in the currently focused textview. I just cannot find a signal
> or event window scheme to do it
> --
> probably because the main window titlebar is owned by the window
> manager and not the application. But still, I see other editors that
> are capable of this.
>   Is there any such signal, or something that can be used in
> conjunction with
> the set_window_title call that would also provide a tooltip on
> mouseover I could respond to?

In the specific case of Client Side Decorations (CSD), like in Gnome,
applications can use GtkHeaderBar, where you can set a tooltip.

In Evince we do that for a similar use case you mention. A GtkHeaderBar
can have a title and subtitle. In the subtitle we present the filename
(basename), but you can get the full path through the tooltip.

Germán Poo-Caamaño
gtk-app-devel-list mailing list