Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-find-sidebar.h File Reference
#include <gtk/gtk.h>
#include "ev-jobs.h"
+ Include dependency graph for ev-find-sidebar.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvFindSidebar
 
struct  _EvFindSidebarClass
 

Macros

#define EV_TYPE_FIND_SIDEBAR   (ev_find_sidebar_get_type ())
 
#define EV_FIND_SIDEBAR(object)   (G_TYPE_CHECK_INSTANCE_CAST ((object), EV_TYPE_FIND_SIDEBAR, EvFindSidebar))
 
#define EV_IS_FIND_SIDEBAR(object)   (G_TYPE_CHECK_INSTANCE_TYPE ((object), EV_TYPE_FIND_SIDEBAR))
 
#define EV_FIND_SIDEBAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_FIND_SIDEBAR, EvFindSidebarClass))
 
#define EV_IS_FIND_SIDEBAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_FIND_SIDEBAR))
 
#define EV_FIND_SIDEBAR_GET_CLASS(object)   (G_TYPE_INSTANCE_GET_CLASS ((object), EV_TYPE_FIND_SIDEBAR, EvFindSidebarClass))
 

Typedefs

typedef struct _EvFindSidebar EvFindSidebar
 
typedef struct _EvFindSidebarClass EvFindSidebarClass
 
typedef struct
_EvFindSidebarPrivate 
EvFindSidebarPrivate
 

Functions

GType ev_find_sidebar_get_type (void)
 
GtkWidget * ev_find_sidebar_new (void)
 
void ev_find_sidebar_start (EvFindSidebar *find_sidebar, EvJobFind *job)
 
void ev_find_sidebar_restart (EvFindSidebar *find_sidebar, gint page)
 
void ev_find_sidebar_update (EvFindSidebar *find_sidebar)
 
void ev_find_sidebar_clear (EvFindSidebar *find_sidebar)
 
void ev_find_sidebar_previous (EvFindSidebar *find_sidebar)
 
void ev_find_sidebar_next (EvFindSidebar *find_sidebar)
 

Macro Definition Documentation

#define EV_FIND_SIDEBAR (   object)    (G_TYPE_CHECK_INSTANCE_CAST ((object), EV_TYPE_FIND_SIDEBAR, EvFindSidebar))

Definition at line 32 of file ev-find-sidebar.h.

#define EV_FIND_SIDEBAR_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_FIND_SIDEBAR, EvFindSidebarClass))

Definition at line 34 of file ev-find-sidebar.h.

#define EV_FIND_SIDEBAR_GET_CLASS (   object)    (G_TYPE_INSTANCE_GET_CLASS ((object), EV_TYPE_FIND_SIDEBAR, EvFindSidebarClass))

Definition at line 36 of file ev-find-sidebar.h.

#define EV_IS_FIND_SIDEBAR (   object)    (G_TYPE_CHECK_INSTANCE_TYPE ((object), EV_TYPE_FIND_SIDEBAR))

Definition at line 33 of file ev-find-sidebar.h.

#define EV_IS_FIND_SIDEBAR_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_FIND_SIDEBAR))

Definition at line 35 of file ev-find-sidebar.h.

#define EV_TYPE_FIND_SIDEBAR   (ev_find_sidebar_get_type ())

Definition at line 31 of file ev-find-sidebar.h.

Typedef Documentation

typedef struct _EvFindSidebar EvFindSidebar

Definition at line 38 of file ev-find-sidebar.h.

Definition at line 39 of file ev-find-sidebar.h.

Definition at line 40 of file ev-find-sidebar.h.

Function Documentation

void ev_find_sidebar_clear ( EvFindSidebar find_sidebar)

Definition at line 621 of file ev-find-sidebar.c.

622 {
623  EvFindSidebarPrivate *priv = sidebar->priv;
624 
625  ev_find_sidebar_cancel (sidebar);
626 
627  /* It seems it's more efficient to set a new model in the tree view instead of
628  * clearing the model that would emit row-deleted signal for every row in the model
629  */
630  ev_find_sidebar_reset_model (sidebar);
631  g_clear_pointer (&priv->highlighted_result, (GDestroyNotify)gtk_tree_path_free);
632 }

+ Here is the caller graph for this function:

GType ev_find_sidebar_get_type ( void  )
GtkWidget* ev_find_sidebar_new ( void  )

Definition at line 241 of file ev-find-sidebar.c.

242 {
243  return g_object_new (EV_TYPE_FIND_SIDEBAR,
244  "orientation", GTK_ORIENTATION_VERTICAL,
245  NULL);
246 }

+ Here is the caller graph for this function:

void ev_find_sidebar_next ( EvFindSidebar find_sidebar)

Definition at line 655 of file ev-find-sidebar.c.

656 {
657  EvFindSidebarPrivate *priv = sidebar->priv;
658  GtkTreeModel *model;
659  GtkTreeIter iter;
660 
661  if (!priv->highlighted_result)
662  return;
663 
664  model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
665  gtk_tree_model_get_iter (model, &iter, priv->highlighted_result);
666  if (gtk_tree_model_iter_next (model, &iter)) {
667  gtk_tree_path_next (priv->highlighted_result);
668  } else {
669  gtk_tree_path_free (priv->highlighted_result);
670  priv->highlighted_result = gtk_tree_path_new_first ();
671  }
673 }

+ Here is the caller graph for this function:

void ev_find_sidebar_previous ( EvFindSidebar find_sidebar)

Definition at line 635 of file ev-find-sidebar.c.

636 {
637  EvFindSidebarPrivate *priv = sidebar->priv;
638 
639  if (!priv->highlighted_result)
640  return;
641 
642  if (!gtk_tree_path_prev (priv->highlighted_result)) {
643  GtkTreeModel *model;
644  GtkTreeIter iter;
645 
646  model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
647  gtk_tree_model_get_iter (model, &iter, priv->highlighted_result);
648  while (gtk_tree_model_iter_next (model, &iter))
649  gtk_tree_path_next (priv->highlighted_result);
650  }
652 }

+ Here is the caller graph for this function:

void ev_find_sidebar_restart ( EvFindSidebar find_sidebar,
gint  page 
)

Definition at line 580 of file ev-find-sidebar.c.

582 {
583  EvFindSidebarPrivate *priv = sidebar->priv;
584  gint first_match_page = -1;
585  gint i;
586 
587  if (!priv->job)
588  return;
589 
590  for (i = 0; i < priv->job->n_pages; i++) {
591  int index;
592 
593  index = page + i;
594 
595  if (index >= priv->job->n_pages)
596  index -= priv->job->n_pages;
597 
598  if (priv->job->pages[index]) {
599  first_match_page = index;
600  break;
601  }
602  }
603 
604  if (first_match_page != -1)
605  ev_find_sidebar_highlight_first_match_of_page (sidebar, first_match_page);
606 }

+ Here is the caller graph for this function:

void ev_find_sidebar_start ( EvFindSidebar find_sidebar,
EvJobFind job 
)

Definition at line 557 of file ev-find-sidebar.c.

559 {
560  EvFindSidebarPrivate *priv = sidebar->priv;
561 
562  if (priv->job == job)
563  return;
564 
565  ev_find_sidebar_clear (sidebar);
566  priv->job = g_object_ref (job);
567  g_signal_connect_object (job, "updated",
568  G_CALLBACK (find_job_updated_cb),
569  sidebar, 0);
570  g_signal_connect_object (job, "cancelled",
571  G_CALLBACK (find_job_cancelled_cb),
572  sidebar, 0);
573  priv->job_current_page = -1;
574  priv->first_match_page = -1;
575  priv->current_page = job->start_page;
576  priv->insert_position = 0;
577 }

+ Here is the caller graph for this function:

void ev_find_sidebar_update ( EvFindSidebar find_sidebar)

Definition at line 609 of file ev-find-sidebar.c.

610 {
611  EvFindSidebarPrivate *priv = sidebar->priv;
612 
613  if (!priv->job)
614  return;
615 
616  if (priv->process_matches_idle_id == 0)
617  priv->process_matches_idle_id = g_idle_add ((GSourceFunc)process_matches_idle, sidebar);
618 }

+ Here is the caller graph for this function: