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-window.h File Reference
#include <glib.h>
#include <gtk/gtk.h>
#include "ev-link.h"
#include "ev-history.h"
#include "ev-document-model.h"
+ Include dependency graph for ev-window.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EvPrintRange
 
struct  _EvWindow
 
struct  _EvWindowClass
 

Macros

#define EV_TYPE_WINDOW   (ev_window_get_type())
 
#define EV_WINDOW(object)   (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_WINDOW, EvWindow))
 
#define EV_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_WINDOW, EvWindowClass))
 
#define EV_IS_WINDOW(object)   (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_WINDOW))
 
#define EV_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_WINDOW))
 
#define EV_WINDOW_GET_CLASS(object)   (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_WINDOW, EvWindowClass))
 

Typedefs

typedef struct _EvWindow EvWindow
 
typedef struct _EvWindowClass EvWindowClass
 
typedef struct _EvWindowPrivate EvWindowPrivate
 

Enumerations

enum  EvWindowRunMode { EV_WINDOW_MODE_NORMAL, EV_WINDOW_MODE_FULLSCREEN, EV_WINDOW_MODE_PRESENTATION }
 
enum  EvPrintPageSet { EV_PRINT_PAGE_SET_ALL, EV_PRINT_PAGE_SET_EVEN, EV_PRINT_PAGE_SET_ODD }
 

Functions

GType ev_window_get_type (void) G_GNUC_CONST
 
GtkWidget * ev_window_new (void)
 
const char * ev_window_get_uri (EvWindow *ev_window)
 
void ev_window_open_uri (EvWindow *ev_window, const char *uri, EvLinkDest *dest, EvWindowRunMode mode, const gchar *search_string)
 
void ev_window_open_document (EvWindow *ev_window, EvDocument *document, EvLinkDest *dest, EvWindowRunMode mode, const gchar *search_string)
 
void ev_window_open_recent_view (EvWindow *ev_window)
 
gboolean ev_window_is_empty (const EvWindow *ev_window)
 
void ev_window_print_range (EvWindow *ev_window, int first_page, int last_page)
 
const gchar * ev_window_get_dbus_object_path (EvWindow *ev_window)
 
GMenuModel * ev_window_get_bookmarks_menu (EvWindow *ev_window)
 
EvHistoryev_window_get_history (EvWindow *ev_window)
 
EvDocumentModelev_window_get_document_model (EvWindow *ev_window)
 
void ev_window_focus_view (EvWindow *ev_window)
 
GtkWidget * ev_window_get_toolbar (EvWindow *ev_window)
 

Macro Definition Documentation

#define EV_IS_WINDOW (   object)    (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_WINDOW))

Definition at line 59 of file ev-window.h.

#define EV_IS_WINDOW_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_WINDOW))

Definition at line 60 of file ev-window.h.

#define EV_TYPE_WINDOW   (ev_window_get_type())

Definition at line 56 of file ev-window.h.

#define EV_WINDOW (   object)    (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_WINDOW, EvWindow))

Definition at line 57 of file ev-window.h.

#define EV_WINDOW_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_WINDOW, EvWindowClass))

Definition at line 58 of file ev-window.h.

#define EV_WINDOW_GET_CLASS (   object)    (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_WINDOW, EvWindowClass))

Definition at line 61 of file ev-window.h.

Typedef Documentation

typedef struct _EvWindow EvWindow

Definition at line 52 of file ev-window.h.

typedef struct _EvWindowClass EvWindowClass

Definition at line 53 of file ev-window.h.

Definition at line 54 of file ev-window.h.

Enumeration Type Documentation

Enumerator
EV_PRINT_PAGE_SET_ALL 
EV_PRINT_PAGE_SET_EVEN 
EV_PRINT_PAGE_SET_ODD 

Definition at line 46 of file ev-window.h.

Enumerator
EV_WINDOW_MODE_NORMAL 
EV_WINDOW_MODE_FULLSCREEN 
EV_WINDOW_MODE_PRESENTATION 

Definition at line 35 of file ev-window.h.

Function Documentation

void ev_window_focus_view ( EvWindow ev_window)

Definition at line 7193 of file ev-window.c.

7194 {
7195  g_return_if_fail (EV_WINDOW (ev_window));
7196 
7197  gtk_widget_grab_focus (ev_window->priv->view);
7198 }

+ Here is the caller graph for this function:

GMenuModel* ev_window_get_bookmarks_menu ( EvWindow ev_window)

Definition at line 7161 of file ev-window.c.

7162 {
7163  g_return_val_if_fail (EV_WINDOW (ev_window), NULL);
7164 
7165  return G_MENU_MODEL (ev_window->priv->bookmarks_menu);
7166 }

+ Here is the caller graph for this function:

const gchar* ev_window_get_dbus_object_path ( EvWindow ev_window)

Definition at line 7151 of file ev-window.c.

7152 {
7153 #ifdef ENABLE_DBUS
7154  return ev_window->priv->dbus_object_path;
7155 #else
7156  return NULL;
7157 #endif
7158 }
EvDocumentModel* ev_window_get_document_model ( EvWindow ev_window)

Definition at line 7177 of file ev-window.c.

7178 {
7179  g_return_val_if_fail (EV_WINDOW (ev_window), NULL);
7180 
7181  return ev_window->priv->model;
7182 }

+ Here is the caller graph for this function:

EvHistory* ev_window_get_history ( EvWindow ev_window)

Definition at line 7169 of file ev-window.c.

7170 {
7171  g_return_val_if_fail (EV_WINDOW (ev_window), NULL);
7172 
7173  return ev_window->priv->history;
7174 }

+ Here is the caller graph for this function:

GtkWidget* ev_window_get_toolbar ( EvWindow ev_window)

Definition at line 7185 of file ev-window.c.

7186 {
7187  g_return_val_if_fail (EV_WINDOW (ev_window), NULL);
7188 
7189  return ev_window->priv->toolbar;
7190 }

+ Here is the caller graph for this function:

GType ev_window_get_type ( void  )
const char* ev_window_get_uri ( EvWindow ev_window)

ev_window_get_uri: : The instance of the EvWindow.

It returns the uri of the document showed in the EvWindow.

Returns: the uri of the document showed in the EvWindow.

Definition at line 1803 of file ev-window.c.

1804 {
1805  return ev_window->priv->uri;
1806 }
gboolean ev_window_is_empty ( const EvWindow ev_window)

ev_window_is_empty: : The instance of the EvWindow.

It does look if there is any document loaded or if there is any job to load a document.

Returns: TRUE if there isn't any document loaded or any any documente to be loaded, FALSE in other case.

Definition at line 693 of file ev-window.c.

694 {
695  g_return_val_if_fail (EV_IS_WINDOW (ev_window), FALSE);
696 
697  return (ev_window->priv->document == NULL) &&
698  (ev_window->priv->load_job == NULL);
699 }

+ Here is the caller graph for this function:

GtkWidget* ev_window_new ( void  )

ev_window_new:

Creates a #GtkWidget that represents the window.

Returns: the #GtkWidget that represents the window.

Definition at line 7137 of file ev-window.c.

7138 {
7139  GtkWidget *ev_window;
7140 
7141  ev_window = GTK_WIDGET (g_object_new (EV_TYPE_WINDOW,
7142  "type", GTK_WINDOW_TOPLEVEL,
7143  "application", g_application_get_default (),
7144  "show-menubar", FALSE,
7145  NULL));
7146 
7147  return ev_window;
7148 }

+ Here is the caller graph for this function:

void ev_window_open_document ( EvWindow ev_window,
EvDocument document,
EvLinkDest dest,
EvWindowRunMode  mode,
const gchar *  search_string 
)

Definition at line 2184 of file ev-window.c.

2189 {
2190  if (document == ev_window->priv->document)
2191  return;
2192 
2193  ev_window_close_dialogs (ev_window);
2194  ev_window_clear_load_job (ev_window);
2195  ev_window_clear_local_uri (ev_window);
2196 
2197  if (ev_window->priv->monitor) {
2198  g_object_unref (ev_window->priv->monitor);
2199  ev_window->priv->monitor = NULL;
2200  }
2201 
2202  if (ev_window->priv->uri)
2203  g_free (ev_window->priv->uri);
2204  ev_window->priv->uri = g_strdup (ev_document_get_uri (document));
2205 
2206  setup_size_from_metadata (ev_window);
2207  setup_model_from_metadata (ev_window);
2208 
2209  ev_document_model_set_document (ev_window->priv->model, document);
2210 
2211  setup_document_from_metadata (ev_window);
2212  setup_view_from_metadata (ev_window);
2213 
2214  if (dest) {
2215  EvLink *link;
2216  EvLinkAction *link_action;
2217 
2218  link_action = ev_link_action_new_dest (dest);
2219  link = ev_link_new (NULL, link_action);
2220  ev_view_handle_link (EV_VIEW (ev_window->priv->view), link);
2221  g_object_unref (link_action);
2222  g_object_unref (link);
2223  }
2224 
2225  switch (mode) {
2227  ev_window_run_fullscreen (ev_window);
2228  break;
2230  ev_window_run_presentation (ev_window);
2231  break;
2232  default:
2233  break;
2234  }
2235 
2236  if (search_string && EV_IS_DOCUMENT_FIND (document) &&
2237  mode != EV_WINDOW_MODE_PRESENTATION) {
2238  GtkSearchEntry *entry;
2239 
2240  ev_window_show_find_bar (ev_window, FALSE);
2241  entry = ev_search_box_get_entry (EV_SEARCH_BOX (ev_window->priv->search_box));
2242  gtk_entry_set_text (GTK_ENTRY (entry), search_string);
2243  }
2244 
2245  /* Create a monitor for the document */
2246  ev_window->priv->monitor = ev_file_monitor_new (ev_window->priv->uri);
2247  g_signal_connect_swapped (ev_window->priv->monitor, "changed",
2248  G_CALLBACK (ev_window_file_changed),
2249  ev_window);
2250 }

+ Here is the caller graph for this function:

void ev_window_open_recent_view ( EvWindow ev_window)

Definition at line 2253 of file ev-window.c.

2254 {
2255  if (ev_window->priv->recent_view)
2256  return;
2257 
2258  gtk_widget_hide (ev_window->priv->hpaned);
2259 
2261  g_signal_connect_object (ev_window->priv->recent_view,
2262  "item-activated",
2263  G_CALLBACK (recent_view_item_activated_cb),
2264  ev_window, 0);
2265  gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box),
2266  GTK_WIDGET (ev_window->priv->recent_view),
2267  TRUE, TRUE, 0);
2268 
2269  gtk_widget_show (GTK_WIDGET (ev_window->priv->recent_view));
2270  ev_toolbar_set_mode (EV_TOOLBAR (ev_window->priv->toolbar),
2273 
2275 }

+ Here is the caller graph for this function:

void ev_window_open_uri ( EvWindow ev_window,
const char *  uri,
EvLinkDest dest,
EvWindowRunMode  mode,
const gchar *  search_string 
)

Definition at line 2101 of file ev-window.c.

2106 {
2107  GFile *source_file;
2108 
2109  ev_window->priv->in_reload = FALSE;
2110 
2111  g_clear_pointer (&ev_window->priv->search_string, g_free);
2112  ev_window->priv->search_string = search_string ?
2113  g_strdup (search_string) : NULL;
2114 
2115  if (ev_window->priv->uri &&
2116  g_ascii_strcasecmp (ev_window->priv->uri, uri) == 0) {
2117  ev_window_reload_document (ev_window, dest);
2118  return;
2119  }
2120 
2121  if (ev_window->priv->monitor) {
2122  g_object_unref (ev_window->priv->monitor);
2123  ev_window->priv->monitor = NULL;
2124  }
2125 
2126  ev_window_close_dialogs (ev_window);
2127  ev_window_clear_load_job (ev_window);
2128  ev_window_clear_local_uri (ev_window);
2129 
2130  ev_window->priv->window_mode = mode;
2131 
2132  if (ev_window->priv->uri)
2133  g_free (ev_window->priv->uri);
2134  ev_window->priv->uri = g_strdup (uri);
2135 
2136  if (ev_window->priv->metadata)
2137  g_object_unref (ev_window->priv->metadata);
2138  if (ev_window->priv->bookmarks)
2139  g_object_unref (ev_window->priv->bookmarks);
2140 
2141  source_file = g_file_new_for_uri (uri);
2142  if (ev_is_metadata_supported_for_file (source_file)) {
2143  ev_window->priv->metadata = ev_metadata_new (source_file);
2145  } else {
2146  ev_window->priv->metadata = NULL;
2147  }
2148 
2149  if (ev_window->priv->metadata) {
2150  ev_window->priv->bookmarks = ev_bookmarks_new (ev_window->priv->metadata);
2152  ev_window->priv->bookmarks);
2153  g_signal_connect_swapped (ev_window->priv->bookmarks, "changed",
2154  G_CALLBACK (ev_window_setup_bookmarks),
2155  ev_window);
2156  ev_window_setup_bookmarks (ev_window);
2157  } else {
2158  ev_window->priv->bookmarks = NULL;
2159  }
2160 
2161  if (ev_window->priv->dest)
2162  g_object_unref (ev_window->priv->dest);
2163  ev_window->priv->dest = dest ? g_object_ref (dest) : NULL;
2164 
2165  setup_size_from_metadata (ev_window);
2166  setup_model_from_metadata (ev_window);
2167 
2168  ev_window->priv->load_job = ev_job_load_new (uri);
2169  g_signal_connect (ev_window->priv->load_job,
2170  "finished",
2171  G_CALLBACK (ev_window_load_job_cb),
2172  ev_window);
2173 
2174  if (!g_file_is_native (source_file) && !ev_window->priv->local_uri) {
2175  ev_window_load_file_remote (ev_window, source_file);
2176  } else {
2177  ev_window_show_loading_message (ev_window);
2178  g_object_unref (source_file);
2180  }
2181 }

+ Here is the caller graph for this function:

void ev_window_print_range ( EvWindow ev_window,
int  first_page,
int  last_page 
)