Commit 4ef2020d authored by Christian Persch's avatar Christian Persch

glib: Only export symbols in the public API

poppler-glib exported lots of internal C++ symbols
that are not in the public API, nor have any ABI
guarantees.

Mark all public functions with POPPLER_PUBLIC, and
use symbol visibility to hide everything else.
parent 1d8df8e3
......@@ -86,6 +86,9 @@ set(poppler_glib_generated_SRCS
)
add_library(poppler-glib ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS})
set_target_properties(poppler-glib PROPERTIES VERSION 8.9.0 SOVERSION 8)
set_target_properties(poppler-glib PROPERTIES C_VISIBILITY_PRESET hidden)
set_target_properties(poppler-glib PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(poppler-glib PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
if(MINGW)
get_target_property(POPPLER_GLIB_SOVERSION poppler-glib SOVERSION)
set_target_properties(poppler-glib PROPERTIES SUFFIX "-${POPPLER_GLIB_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
......
......@@ -299,16 +299,22 @@ union _PopplerAction
#define POPPLER_TYPE_ACTION (poppler_action_get_type ())
#define POPPLER_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ACTION, PopplerAction))
POPPLER_PUBLIC
GType poppler_action_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
void poppler_action_free (PopplerAction *action);
POPPLER_PUBLIC
PopplerAction *poppler_action_copy (PopplerAction *action);
#define POPPLER_TYPE_DEST (poppler_dest_get_type ())
POPPLER_PUBLIC
GType poppler_dest_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
void poppler_dest_free (PopplerDest *dest);
POPPLER_PUBLIC
PopplerDest *poppler_dest_copy (PopplerDest *dest);
G_END_DECLS
......
This diff is collapsed.
......@@ -72,10 +72,13 @@ typedef struct _PopplerAttachmentClass
} PopplerAttachmentClass;
POPPLER_PUBLIC
GType poppler_attachment_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
gboolean poppler_attachment_save (PopplerAttachment *attachment,
const char *filename,
GError **error);
POPPLER_PUBLIC
gboolean poppler_attachment_save_to_callback (PopplerAttachment *attachment,
PopplerAttachmentSaveFunc save_func,
gpointer user_data,
......
......@@ -23,8 +23,11 @@
#include "poppler.h"
G_BEGIN_DECLS
POPPLER_PUBLIC
gboolean poppler_date_parse (const gchar *date,
time_t *timet);
G_END_DECLS
#endif /* __POPPLER_DATE_H__ */
This diff is collapsed.
......@@ -5,6 +5,8 @@
#include <glib-object.h>
#include "poppler.h"
G_BEGIN_DECLS
/*** END file-header ***/
......@@ -14,6 +16,7 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN value-header ***/
POPPLER_PUBLIC
GType @enum_name@_get_type (void) G_GNUC_CONST;
#define POPPLER_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
......
......@@ -58,52 +58,85 @@ typedef enum
POPPLER_FORM_CHOICE_LIST
} PopplerFormChoiceType;
POPPLER_PUBLIC
GType poppler_form_field_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
PopplerFormFieldType poppler_form_field_get_field_type (PopplerFormField *field);
POPPLER_PUBLIC
gint poppler_form_field_get_id (PopplerFormField *field);
POPPLER_PUBLIC
gdouble poppler_form_field_get_font_size (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_is_read_only (PopplerFormField *field);
POPPLER_PUBLIC
gchar *poppler_form_field_get_partial_name (PopplerFormField *field);
POPPLER_PUBLIC
gchar *poppler_form_field_get_mapping_name (PopplerFormField *field);
POPPLER_PUBLIC
gchar *poppler_form_field_get_name (PopplerFormField *field);
POPPLER_PUBLIC
PopplerAction *poppler_form_field_get_action (PopplerFormField *field);
/* Button Field */
POPPLER_PUBLIC
PopplerFormButtonType poppler_form_field_button_get_button_type (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_button_get_state (PopplerFormField *field);
POPPLER_PUBLIC
void poppler_form_field_button_set_state (PopplerFormField *field,
gboolean state);
/* Text Field */
POPPLER_PUBLIC
PopplerFormTextType poppler_form_field_text_get_text_type (PopplerFormField *field);
POPPLER_PUBLIC
gchar *poppler_form_field_text_get_text (PopplerFormField *field);
POPPLER_PUBLIC
void poppler_form_field_text_set_text (PopplerFormField *field,
const gchar *text);
POPPLER_PUBLIC
gint poppler_form_field_text_get_max_len (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_text_do_spell_check (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_text_do_scroll (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_text_is_rich_text (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_text_is_password (PopplerFormField *field);
/* Choice Field */
POPPLER_PUBLIC
PopplerFormChoiceType poppler_form_field_choice_get_choice_type (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_choice_is_editable (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_choice_can_select_multiple (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_choice_do_spell_check (PopplerFormField *field);
POPPLER_PUBLIC
gboolean poppler_form_field_choice_commit_on_change (PopplerFormField *field);
POPPLER_PUBLIC
gint poppler_form_field_choice_get_n_items (PopplerFormField *field);
POPPLER_PUBLIC
gchar *poppler_form_field_choice_get_item (PopplerFormField *field,
gint index);
POPPLER_PUBLIC
gboolean poppler_form_field_choice_is_item_selected (PopplerFormField *field,
gint index);
POPPLER_PUBLIC
void poppler_form_field_choice_select_item (PopplerFormField *field,
gint index);
POPPLER_PUBLIC
void poppler_form_field_choice_unselect_all (PopplerFormField *field);
POPPLER_PUBLIC
void poppler_form_field_choice_toggle_item (PopplerFormField *field,
gint index);
POPPLER_PUBLIC
void poppler_form_field_choice_set_text (PopplerFormField *field,
const gchar *text);
POPPLER_PUBLIC
gchar *poppler_form_field_choice_get_text (PopplerFormField *field);
G_END_DECLS
......
......@@ -29,13 +29,20 @@ G_BEGIN_DECLS
#define POPPLER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_LAYER, PopplerLayer))
#define POPPLER_IS_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_LAYER))
POPPLER_PUBLIC
GType poppler_layer_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
const gchar *poppler_layer_get_title (PopplerLayer *layer);
POPPLER_PUBLIC
gboolean poppler_layer_is_visible (PopplerLayer *layer);
POPPLER_PUBLIC
void poppler_layer_show (PopplerLayer *layer);
POPPLER_PUBLIC
void poppler_layer_hide (PopplerLayer *layer);
POPPLER_PUBLIC
gboolean poppler_layer_is_parent (PopplerLayer *layer);
POPPLER_PUBLIC
gint poppler_layer_get_radio_button_group_id (PopplerLayer *layer);
G_END_DECLS
......
/*
* Copyright © 2018 Christian Persch
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __POPPLER_MACROS_H__
#define __POPPLER_MACROS_H__
/**
* POPPLER_PUBLIC:
*/
#if defined(_WIN32)
# define POPPLER_PUBLIC __declspec(dllexport)
#elif defined(__GNUC__)
# define POPPLER_PUBLIC __attribute__((visibility("default"))) extern
#else
# define POPPLER_PUBLIC
#endif
#endif /* __POPPLER_MACROS_H__ */
......@@ -55,13 +55,19 @@ typedef gboolean (*PopplerMediaSaveFunc) (const gchar *buf,
gpointer data,
GError **error);
POPPLER_PUBLIC
GType poppler_media_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
gboolean poppler_media_is_embedded (PopplerMedia *poppler_media);
POPPLER_PUBLIC
const gchar *poppler_media_get_filename (PopplerMedia *poppler_media);
POPPLER_PUBLIC
const gchar *poppler_media_get_mime_type (PopplerMedia *poppler_media);
POPPLER_PUBLIC
gboolean poppler_media_save (PopplerMedia *poppler_media,
const char *filename,
GError **error);
POPPLER_PUBLIC
gboolean poppler_media_save_to_callback (PopplerMedia *poppler_media,
PopplerMediaSaveFunc save_func,
gpointer user_data,
......
......@@ -51,10 +51,15 @@ typedef enum
POPPLER_MOVIE_PLAY_MODE_PALINDROME
} PopplerMoviePlayMode;
POPPLER_PUBLIC
GType poppler_movie_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
const gchar *poppler_movie_get_filename (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
gboolean poppler_movie_need_poster (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
gboolean poppler_movie_show_controls (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
PopplerMoviePlayMode poppler_movie_get_play_mode (PopplerMovie *poppler_movie);
G_END_DECLS
......
This diff is collapsed.
This diff is collapsed.
......@@ -21,8 +21,11 @@
#include <glib-object.h>
#include "poppler-macros.h"
G_BEGIN_DECLS
POPPLER_PUBLIC
GQuark poppler_error_quark (void);
#define POPPLER_ERROR poppler_error_quark ()
......@@ -220,7 +223,9 @@ typedef enum
POPPLER_BACKEND_CAIRO
} PopplerBackend;
POPPLER_PUBLIC
PopplerBackend poppler_get_backend (void);
POPPLER_PUBLIC
const char * poppler_get_version (void);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment