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-bookmarks.h File Reference
#include <glib-object.h>
#include "ev-metadata.h"
+ Include dependency graph for ev-bookmarks.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvBookmark
 

Macros

#define EV_TYPE_BOOKMARKS   (ev_bookmarks_get_type())
 
#define EV_BOOKMARKS(object)   (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_BOOKMARKS, EvBookmarks))
 
#define EV_BOOKMARKS_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_BOOKMARKS, EvBookmarksClass))
 
#define EV_IS_BOOKMARKS(object)   (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_BOOKMARKS))
 

Typedefs

typedef struct _EvBookmarks EvBookmarks
 
typedef struct _EvBookmarksClass EvBookmarksClass
 
typedef struct _EvBookmark EvBookmark
 

Functions

GType ev_bookmarks_get_type (void) G_GNUC_CONST
 
EvBookmarksev_bookmarks_new (EvMetadata *metadata)
 
GList * ev_bookmarks_get_bookmarks (EvBookmarks *bookmarks)
 
gboolean ev_bookmarks_has_bookmarks (EvBookmarks *bookmarks)
 
void ev_bookmarks_add (EvBookmarks *bookmarks, EvBookmark *bookmark)
 
void ev_bookmarks_delete (EvBookmarks *bookmarks, EvBookmark *bookmark)
 
void ev_bookmarks_update (EvBookmarks *bookmarks, EvBookmark *bookmark)
 

Macro Definition Documentation

#define EV_BOOKMARKS (   object)    (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_BOOKMARKS, EvBookmarks))

Definition at line 31 of file ev-bookmarks.h.

#define EV_BOOKMARKS_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_BOOKMARKS, EvBookmarksClass))

Definition at line 32 of file ev-bookmarks.h.

#define EV_IS_BOOKMARKS (   object)    (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_BOOKMARKS))

Definition at line 33 of file ev-bookmarks.h.

#define EV_TYPE_BOOKMARKS   (ev_bookmarks_get_type())

Definition at line 30 of file ev-bookmarks.h.

Typedef Documentation

typedef struct _EvBookmark EvBookmark
typedef struct _EvBookmarks EvBookmarks

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

Definition at line 36 of file ev-bookmarks.h.

Function Documentation

void ev_bookmarks_add ( EvBookmarks bookmarks,
EvBookmark bookmark 
)

Definition at line 236 of file ev-bookmarks.c.

238 {
239  EvBookmark *bm;
240 
241  g_return_if_fail (EV_IS_BOOKMARKS (bookmarks));
242  g_return_if_fail (bookmark->title != NULL);
243 
244  if (g_list_find_custom (bookmarks->items, bookmark, (GCompareFunc)ev_bookmark_compare))
245  return;
246 
247  bm = g_slice_new (EvBookmark);
248  *bm = *bookmark;
249  bookmarks->items = g_list_append (bookmarks->items, bm);
250  g_signal_emit (bookmarks, signals[CHANGED], 0);
251  ev_bookmarks_save (bookmarks);
252 }

+ Here is the caller graph for this function:

void ev_bookmarks_delete ( EvBookmarks bookmarks,
EvBookmark bookmark 
)

Definition at line 255 of file ev-bookmarks.c.

257 {
258  GList *bm_link;
259 
260  g_return_if_fail (EV_IS_BOOKMARKS (bookmarks));
261 
262  bm_link = g_list_find_custom (bookmarks->items, bookmark, (GCompareFunc)ev_bookmark_compare);
263  if (!bm_link)
264  return;
265 
266  bookmarks->items = g_list_delete_link (bookmarks->items, bm_link);
267  g_signal_emit (bookmarks, signals[CHANGED], 0);
268  ev_bookmarks_save (bookmarks);
269 }

+ Here is the caller graph for this function:

GList* ev_bookmarks_get_bookmarks ( EvBookmarks bookmarks)

Definition at line 220 of file ev-bookmarks.c.

221 {
222  g_return_val_if_fail (EV_IS_BOOKMARKS (bookmarks), NULL);
223 
224  return g_list_copy (bookmarks->items);
225 }

+ Here is the caller graph for this function:

GType ev_bookmarks_get_type ( void  )
gboolean ev_bookmarks_has_bookmarks ( EvBookmarks bookmarks)

Definition at line 228 of file ev-bookmarks.c.

229 {
230  g_return_val_if_fail (EV_IS_BOOKMARKS (bookmarks), FALSE);
231 
232  return bookmarks->items != NULL;
233 }
EvBookmarks* ev_bookmarks_new ( EvMetadata metadata)

Definition at line 184 of file ev-bookmarks.c.

185 {
186  g_return_val_if_fail (EV_IS_METADATA (metadata), NULL);
187 
188  return EV_BOOKMARKS (g_object_new (EV_TYPE_BOOKMARKS,
189  "metadata", metadata, NULL));
190 }

+ Here is the caller graph for this function:

void ev_bookmarks_update ( EvBookmarks bookmarks,
EvBookmark bookmark 
)

Definition at line 272 of file ev-bookmarks.c.

274 {
275  GList *bm_link;
276  EvBookmark *bm;
277 
278  g_return_if_fail (EV_IS_BOOKMARKS (bookmarks));
279  g_return_if_fail (bookmark->title != NULL);
280 
281  bm_link = g_list_find_custom (bookmarks->items, bookmark, (GCompareFunc)ev_bookmark_compare);
282  if (!bm_link)
283  return;
284 
285  bm = (EvBookmark *)bm_link->data;
286 
287  if (strcmp (bookmark->title, bm->title) == 0)
288  return;
289 
290  g_free (bm->title);
291  *bm = *bookmark;
292  g_signal_emit (bookmarks, signals[CHANGED], 0);
293  ev_bookmarks_save (bookmarks);
294 }

+ Here is the caller graph for this function: