当前位置: 首页>>代码示例>>C++>>正文


C++ EvDocumentClass类代码示例

本文整理汇总了C++中EvDocumentClass的典型用法代码示例。如果您正苦于以下问题:C++ EvDocumentClass类的具体用法?C++ EvDocumentClass怎么用?C++ EvDocumentClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EvDocumentClass类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _ev_document_get_n_pages

static gint
_ev_document_get_n_pages (EvDocument  *document)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->get_n_pages (document);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:7,代码来源:ev-document.c

示例2: _ev_document_get_info

static EvDocumentInfo *
_ev_document_get_info (EvDocument *document)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->get_info (document);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:7,代码来源:ev-document.c

示例3: ev_document_load_gfile

/**
 * ev_document_load_gfile:
 * @document: a #EvDocument
 * @file: a #GFile
 * @flags: flags from #EvDocumentLoadFlags
 * @cancellable: (allow-none): a #GCancellable, or %NULL
 * @error: (allow-none): a #GError location to store an error, or %NULL
 *
 * Synchronously loads the document from @file.
 * See ev_document_load() for more information.
 *
 * Returns: %TRUE if loading succeeded, or %FALSE on error with @error filled in
 *
 * Since: 3.6
 */
gboolean
ev_document_load_gfile (EvDocument         *document,
                        GFile              *file,
                        EvDocumentLoadFlags flags,
                        GCancellable       *cancellable,
                        GError            **error)
{
        EvDocumentClass   *klass;
	EvDocumentPrivate *priv;

        g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
        g_return_val_if_fail (G_IS_FILE (file), FALSE);
        g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
        g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

        klass = EV_DOCUMENT_GET_CLASS (document);
        if (!klass->load_gfile) {
                g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
                                     "Backend does not support loading from GFile");
                return FALSE;
        }

        if (!klass->load_gfile (document, file, flags, cancellable, error))
                return FALSE;

        ev_document_setup_cache (document);

	priv = document->priv;
	priv->uri = g_file_get_uri (file);
	priv->info = _ev_document_get_info (document);

        return TRUE;
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:48,代码来源:ev-document.c

示例4: _ev_document_support_synctex

static gboolean
_ev_document_support_synctex (EvDocument *document)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->support_synctex ? klass->support_synctex (document) : FALSE;
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:7,代码来源:ev-document.c

示例5: ev_document_load_stream

/**
 * ev_document_load_stream:
 * @document: a #EvDocument
 * @stream: a #GInputStream
 * @flags: flags from #EvDocumentLoadFlags
 * @cancellable: (allow-none): a #GCancellable, or %NULL
 * @error: (allow-none): a #GError location to store an error, or %NULL
 *
 * Synchronously loads the document from @stream.
 * See ev_document_load() for more information.
 *
 * Returns: %TRUE if loading succeeded, or %FALSE on error with @error filled in
 *
 * Since: 3.6
 */
gboolean
ev_document_load_stream (EvDocument         *document,
                         GInputStream       *stream,
                         EvDocumentLoadFlags flags,
                         GCancellable       *cancellable,
                         GError            **error)
{
        EvDocumentClass *klass;

        g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
        g_return_val_if_fail (G_IS_INPUT_STREAM (stream), FALSE);
        g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
        g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

        klass = EV_DOCUMENT_GET_CLASS (document);
        if (!klass->load_stream) {
                g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
                                     "Backend does not support loading from stream");
                return FALSE;
        }

        if (!klass->load_stream (document, stream, flags, cancellable, error))
                return FALSE;

        ev_document_setup_cache (document);

        return TRUE;
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:43,代码来源:ev-document.c

示例6: ev_document_load

/**
 * ev_document_load:
 * @document: a #EvDocument
 * @uri: the document's URI
 * @error: a #GError location to store an error, or %NULL
 *
 * Loads @document from @uri.
 *
 * On failure, %FALSE is returned and @error is filled in.
 * If the document is encrypted, EV_DEFINE_ERROR_ENCRYPTED is returned.
 * If the backend cannot load the specific document, EV_DOCUMENT_ERROR_INVALID
 * is returned. Other errors are possible too, depending on the backend
 * used to load the document and the URI, e.g. #GIOError, #GFileError, and
 * #GConvertError.
 *
 * Returns: %TRUE on success, or %FALSE on failure.
 */
gboolean
ev_document_load (EvDocument  *document,
                  const char  *uri,
                  GError     **error)
{
    EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
    gboolean retval;
    GError *err = NULL;

    retval = klass->load (document, uri, &err);
    if (!retval) {
        if (err) {
            g_propagate_error (error, err);
        } else {
            g_warning ("%s::EvDocument::load returned FALSE but did not fill in @error; fix the backend!\n",
                       G_OBJECT_TYPE_NAME (document));

            /* So upper layers don't crash */
            g_set_error_literal (error,
                                 EV_DOCUMENT_ERROR,
                                 EV_DOCUMENT_ERROR_INVALID,
                                 "Internal error in backend");
        }
    } else {
        ev_document_setup_cache (document);
        document->priv->uri = g_strdup (uri);
        ev_document_initialize_synctex (document, uri);
    }

    return retval;
}
开发者ID:xbezdick,项目名称:evince-dualhead,代码行数:48,代码来源:ev-document.c

示例7: ev_document_render

cairo_surface_t *
ev_document_render (EvDocument      *document,
		    EvRenderContext *rc)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->render (document, rc);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:8,代码来源:ev-document.c

示例8: ev_document_get_page

/**
 * ev_document_get_page:
 * @document: a #EvDocument
 * @index: index of page
 *
 * Returns: (transfer full): Newly created #EvPage for the given index.
 */
EvPage *
ev_document_get_page (EvDocument *document,
		      gint        index)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->get_page (document, index);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:15,代码来源:ev-document.c

示例9: _ev_document_get_page_label

static gchar *
_ev_document_get_page_label (EvDocument *document,
			     EvPage     *page)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->get_page_label ?
		klass->get_page_label (document, page) : NULL;
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:9,代码来源:ev-document.c

示例10: ev_document_save

/**
 * ev_document_save:
 * @document: a #EvDocument
 * @uri: the target URI
 * @error: a #GError location to store an error, or %NULL
 *
 * Saves @document to @uri.
 * 
 * Returns: %TRUE on success, or %FALSE on error with @error filled in
 */
gboolean
ev_document_save (EvDocument  *document,
		  const char  *uri,
		  GError     **error)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	return klass->save (document, uri, error);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:19,代码来源:ev-document.c

示例11: _ev_document_get_page_size

static void
_ev_document_get_page_size (EvDocument *document,
			    EvPage     *page,
			    double     *width,
			    double     *height)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	klass->get_page_size (document, page, width, height);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:10,代码来源:ev-document.c

示例12: ev_document_get_thumbnail

/**
 * ev_document_get_thumbnail:
 * @document: an #EvDocument
 * @rc: an #EvRenderContext
 *
 * Returns: (transfer full): a #GdkPixbuf
 */
GdkPixbuf *
ev_document_get_thumbnail (EvDocument      *document,
			   EvRenderContext *rc)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);

	if (klass->get_thumbnail)
		return klass->get_thumbnail (document, rc);

	return _ev_document_get_thumbnail (document, rc);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:18,代码来源:ev-document.c

示例13: ev_document_get_backend_info

gboolean
ev_document_get_backend_info (EvDocument *document, EvDocumentBackendInfo *info)
{
	g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);

	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
	if (klass->get_backend_info == NULL)
		return FALSE;

	return klass->get_backend_info (document, info);
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:11,代码来源:ev-document.c

示例14: ev_document_load

/**
 * ev_document_load:
 * @document: a #EvDocument
 * @uri: the document's URI
 * @error: a #GError location to store an error, or %NULL
 *
 * Loads @document from @uri.
 * 
 * On failure, %FALSE is returned and @error is filled in.
 * If the document is encrypted, EV_DEFINE_ERROR_ENCRYPTED is returned.
 * If the backend cannot load the specific document, EV_DOCUMENT_ERROR_INVALID
 * is returned. Other errors are possible too, depending on the backend
 * used to load the document and the URI, e.g. #GIOError, #GFileError, and
 * #GConvertError.
 *
 * Returns: %TRUE on success, or %FALSE on failure.
 */
gboolean
ev_document_load (EvDocument  *document,
		  const char  *uri,
		  GError     **error)
{
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
	gboolean retval;
	GError *err = NULL;

	retval = klass->load (document, uri, &err);
	if (!retval) {
		if (err) {
			g_propagate_error (error, err);
		} else {
			g_warning ("%s::EvDocument::load returned FALSE but did not fill in @error; fix the backend!\n",
				   G_OBJECT_TYPE_NAME (document));

			/* So upper layers don't crash */
			g_set_error_literal (error,
					     EV_DOCUMENT_ERROR,
					     EV_DOCUMENT_ERROR_INVALID,
					     "Internal error in backend");
		}
	} else {
                EvDocumentPrivate *priv = document->priv;

                ev_document_setup_cache (document);

                priv->uri = g_strdup (uri);
                priv->info = _ev_document_get_info (document);
                if (_ev_document_support_synctex (document)) {
                        gchar *filename;

                        filename = g_filename_from_uri (uri, NULL, NULL);
                        if (filename != NULL) {
                                priv->synctex_scanner =
                                        synctex_scanner_new_with_output_file (filename, NULL, 1);
                                g_free (filename);
                        }
                }
        }

	return retval;
}
开发者ID:sciamp,项目名称:evince-mirror,代码行数:61,代码来源:ev-document.c


注:本文中的EvDocumentClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。