Document

class Document : ObjectG {}

Constructors

this
this(EvDocument* evDocument, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

checkDimensions
bool checkDimensions()
findPageByLabel
bool findPageByLabel(string pageLabel, int* pageIndex)
getBackendInfo
bool getBackendInfo(EvDocumentBackendInfo* info)
getDocumentStruct
EvDocument* getDocumentStruct(bool transferOwnership)

Get the main Gtk struct

getInfo
DocumentInfo getInfo()

Returns the #EvDocumentInfo for the document.

getMaxLabelLen
int getMaxLabelLen()
getMaxPageSize
void getMaxPageSize(double* width, double* height)
getMinPageSize
void getMinPageSize(double* width, double* height)
getModified
bool getModified()
getNPages
int getNPages()
getPage
Page getPage(int index)
getPageLabel
string getPageLabel(int pageIndex)
getPageSize
void getPageSize(int pageIndex, double width, double height)
getSize
ulong getSize()
getStruct
void* getStruct()

the main Gtk struct as a void*

getThumbnail
Pixbuf getThumbnail(RenderContext rc)
getThumbnailSurface
Surface getThumbnailSurface(RenderContext rc)
getTitle
string getTitle()
getUri
string getUri()
hasSynctex
bool hasSynctex()
hasTextPageLabels
bool hasTextPageLabels()
isPageSizeUniform
bool isPageSizeUniform()
load
bool load(string uri)

Loads @document from @uri.

loadFull
bool loadFull(string uri, EvDocumentLoadFlags flags)

Loads @document from @uri.

loadGfile
bool loadGfile(FileIF file, EvDocumentLoadFlags flags, Cancellable cancellable)

Synchronously loads the document from @file. See ev_document_load() for more information.

loadStream
bool loadStream(InputStream stream, EvDocumentLoadFlags flags, Cancellable cancellable)

Synchronously loads the document from @stream. See ev_document_load() for more information.

render
Surface render(RenderContext rc)
save
bool save(string uri)

Saves @document to @uri.

setModified
void setModified(bool modified)

Set the @document modification state as @modified.

synctexBackwardSearch
SourceLink synctexBackwardSearch(int pageIndex, float x, float y)

Peforms a Synctex backward search to obtain the TeX input file, line and (possibly) column corresponding to the position (@x,@y) (in 72dpi coordinates) in the @page of @document.

synctexForwardSearch
EvMapping* synctexForwardSearch(SourceLink sourceLink)

Peforms a Synctex forward search to obtain the area in the document corresponding to the position (line and column in @source_link) in the source Tex file.

Static functions

docMutexLock
void docMutexLock()
docMutexTrylock
bool docMutexTrylock()
docMutexUnlock
void docMutexUnlock()
factoryAddFilters
void factoryAddFilters(Widget chooser, Document document)

Adds some file filters to @chooser.

factoryGetDocument
Document factoryGetDocument(string uri)

Creates a #EvDocument for the document at @uri; or, if no backend handling the document's type is found, or an error occurred on opening the document, returns %NULL and fills in @error. If the document is encrypted, it is returned but also @error is set to %EV_DOCUMENT_ERROR_ENCRYPTED.

factoryGetDocumentForGfile
Document factoryGetDocumentForGfile(FileIF file, EvDocumentLoadFlags flags, Cancellable cancellable)

Synchronously creates a #EvDocument for the document at @file; or, if no backend handling the document's type is found, or an error occurred on opening the document, returns %NULL and fills in @error. If the document is encrypted, it is returned but also @error is set to %EV_DOCUMENT_ERROR_ENCRYPTED.

factoryGetDocumentForStream
Document factoryGetDocumentForStream(InputStream stream, string mimeType, EvDocumentLoadFlags flags, Cancellable cancellable)

Synchronously creates a #EvDocument for the document from @stream; or, if no backend handling the document's type is found, or an error occurred on opening the document, returns %NULL and fills in @error. If the document is encrypted, it is returned but also @error is set to %EV_DOCUMENT_ERROR_ENCRYPTED.

factoryGetDocumentFull
Document factoryGetDocumentFull(string uri, EvDocumentLoadFlags flags)

Creates a #EvDocument for the document at @uri; or, if no backend handling the document's type is found, or an error occurred on opening the document, returns %NULL and fills in @error. If the document is encrypted, it is returned but also @error is set to %EV_DOCUMENT_ERROR_ENCRYPTED.

fcMutexLock
void fcMutexLock()
fcMutexTrylock
bool fcMutexTrylock()
fcMutexUnlock
void fcMutexUnlock()
getDocMutex
Mutex getDocMutex()
getFcMutex
Mutex getFcMutex()
getType
GType getType()
miscFormatDate
string miscFormatDate(GTime utime)
miscFormatDatetime
string miscFormatDatetime(DateTime dt)

Determine the preferred date and time representation for the current locale for @dt.

miscGetLoadingThumbnail
Pixbuf miscGetLoadingThumbnail(int width, int height, bool invertedColors)
miscGetPageBorderSize
void miscGetPageBorderSize(int pageWidth, int pageHeight, Border border)
miscGetPointerPosition
void miscGetPointerPosition(Widget widget, int x, int y)

Get the pointer's x and y position relative to @widget.

miscGetScreenDpi
double miscGetScreenDpi(Screen screen)
miscGetThumbnailFrame
Pixbuf miscGetThumbnailFrame(int width, int height, Pixbuf sourcePixbuf)
miscGetWidgetDpi
double miscGetWidgetDpi(Widget widget)

Returns DPI for monitor on which given widget has been realized. Returns DPI of primary monitor or DPI of first monitor in the list inside of GdkDisplay if the widget has not been realized yet. Returns 96 as fallback value.

miscInvertPixbuf
void miscInvertPixbuf(Pixbuf pixbuf)
miscInvertSurface
void miscInvertSurface(Surface surface)
miscPaintOnePage
void miscPaintOnePage(Context cr, Widget widget, GdkRectangle* area, Border border, bool highlight, bool invertedColors)
miscPixbufFromSurface
Pixbuf miscPixbufFromSurface(Surface surface)
miscRenderLoadingThumbnail
Pixbuf miscRenderLoadingThumbnail(Widget widget, int width, int height, bool invertedColors)
miscRenderLoadingThumbnailSurface
Surface miscRenderLoadingThumbnailSurface(Widget widget, int width, int height, bool invertedColors)
miscRenderThumbnailSurfaceWithFrame
Surface miscRenderThumbnailSurfaceWithFrame(Widget widget, Surface sourceSurface, int width, int height)
miscRenderThumbnailWithFrame
Pixbuf miscRenderThumbnailWithFrame(Widget widget, Pixbuf sourcePixbuf)
miscSurfaceFromPixbuf
Surface miscSurfaceFromPixbuf(Pixbuf pixbuf)
miscSurfaceRotateAndScale
Surface miscSurfaceRotateAndScale(Surface surface, int destWidth, int destHeight, int destRotation)

Variables

evDocument
EvDocument* evDocument;

the main Gtk struct

Meta