diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ev-application.c | 14 | ||||
-rw-r--r-- | shell/ev-open-recent-action.c | 4 | ||||
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 6 | ||||
-rw-r--r-- | shell/ev-window.c | 11 | ||||
-rw-r--r-- | shell/meson.build | 168 |
5 files changed, 193 insertions, 10 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c index 56279aca..57f1b922 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -419,9 +419,17 @@ on_register_uri_cb (GObject *source_object, g_variant_builder_add (&builder, "{sv}", "display", g_variant_new_string (gdk_display_get_name (gdk_screen_get_display (data->screen)))); - g_variant_builder_add (&builder, "{sv}", - "screen", - g_variant_new_int32 (gdk_x11_screen_get_screen_number (data->screen))); + + if (GDK_IS_X11_SCREEN (data->screen)) { + g_variant_builder_add (&builder, "{sv}", + "screen", + g_variant_new_int32 (gdk_x11_screen_get_screen_number (data->screen))); + } else { + /*Do not crash on wayland, use the first monitor for now*/ + g_variant_builder_add (&builder, "{sv}", + "screen", + g_variant_new_int32 (0)); + } if (data->dest) { switch (ev_link_dest_get_dest_type (data->dest)) { case EV_LINK_DEST_TYPE_PAGE_LABEL: diff --git a/shell/ev-open-recent-action.c b/shell/ev-open-recent-action.c index 3186f261..46d5eda8 100644 --- a/shell/ev-open-recent-action.c +++ b/shell/ev-open-recent-action.c @@ -65,7 +65,9 @@ ev_open_recent_action_create_tool_item (GtkAction *action) gtk_recent_filter_add_application (filter, g_get_application_name ()); gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (toolbar_recent_menu), filter); - tool_item = GTK_WIDGET (gtk_menu_tool_button_new_from_stock ("gtk-open")); + GtkWidget *icon = gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_SMALL_TOOLBAR); + tool_item = GTK_WIDGET (gtk_menu_tool_button_new (icon, NULL)); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (tool_item), _("Open a recently used document")); gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (tool_item), diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 11e43267..c12a7a10 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -581,6 +581,10 @@ ev_sidebar_thumbnails_fill_model (EvSidebarThumbnails *sidebar_thumbnails) GtkTreeIter iter; int i; + if (priv->document->iswebdocument) { + return; + } + for (i = 0; i < sidebar_thumbnails->priv->n_pages; i++) { gchar *page_label; gchar *page_string; @@ -1018,7 +1022,7 @@ static gboolean ev_sidebar_thumbnails_support_document (EvSidebarPage *sidebar_page, EvDocument *document) { - return (EV_IS_DOCUMENT_THUMBNAILS (document)); + return (EV_IS_DOCUMENT_THUMBNAILS (document) && !document->iswebdocument); } static const gchar* diff --git a/shell/ev-window.c b/shell/ev-window.c index 9f9576f6..5281acda 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -537,7 +537,7 @@ ev_window_update_actions (EvWindow *ev_window) page = ev_document_model_get_page (ev_window->priv->model); n_pages = ev_document_get_n_pages (ev_window->priv->document); has_pages = n_pages > 0; - dual_mode = ev_document_model_get_dual_page (ev_window->priv->model); + dual_mode = ev_document_model_get_page_layout (ev_window->priv->model); } #if ENABLE_EPUB if (ev_window->priv->document && ev_window->priv->document->iswebdocument == TRUE ) { @@ -1592,7 +1592,8 @@ ev_window_refresh_window_thumbnail (EvWindow *ev_window) EvDocument *document = ev_window->priv->document; if (!document || ev_document_get_n_pages (document) <= 0 || - !ev_document_check_dimensions (document)) { + !ev_document_check_dimensions (document) || + document->iswebdocument) { return; } @@ -4843,7 +4844,7 @@ ev_window_cmd_edit_save_settings (GtkAction *action, EvWindow *ev_window) g_settings_set_boolean (settings, "continuous", ev_document_model_get_continuous (model)); g_settings_set_boolean (settings, "dual-page", - ev_document_model_get_dual_page (model)); + ev_document_model_get_page_layout (model)); g_settings_set_boolean (settings, "dual-page-odd-left", ev_document_model_get_dual_page_odd_pages_left (model)); g_settings_set_boolean (settings, "fullscreen", @@ -5332,7 +5333,7 @@ ev_window_update_dual_page_action (EvWindow *window) g_signal_handlers_block_by_func (action, G_CALLBACK (ev_window_cmd_dual), window); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), - ev_document_model_get_dual_page (window->priv->model)); + ev_document_model_get_page_layout (window->priv->model)); G_GNUC_END_IGNORE_DEPRECATIONS; g_signal_handlers_unblock_by_func (action, G_CALLBACK (ev_window_cmd_dual), window); @@ -5347,7 +5348,7 @@ ev_window_dual_mode_changed_cb (EvDocumentModel *model, if (ev_window->priv->metadata && !ev_window_is_empty (ev_window)) ev_metadata_set_boolean (ev_window->priv->metadata, "dual-page", - ev_document_model_get_dual_page (model)); + ev_document_model_get_page_layout (model)); } static void diff --git a/shell/meson.build b/shell/meson.build new file mode 100644 index 00000000..268416ef --- /dev/null +++ b/shell/meson.build @@ -0,0 +1,168 @@ +# Define include directories +include_dirs = include_directories( + '.', # Current directory + '..', # Parent directory + '../cut-n-paste/zoom-control', + '../cut-n-paste/toolbar-editor', + '../libdocument', + '../libview', + '../libmisc', + '../properties' +) + +# Define preprocessor definitions +c_args = [ + '-DATRILDATADIR="' + join_paths(get_option('prefix'), get_option('datadir'), 'atril') + '"', + '-DMATEDATADIR="' + get_option('datadir') + '"', + '-DLIBEXECDIR="' + get_option('libexecdir') + '"', + '-DATRIL_COMPILATION' +] + +shell_sources = [ + 'eggfindbar.c', + 'eggfindbar.h', + 'ev-annotation-properties-dialog.h', + 'ev-annotation-properties-dialog.c', + 'ev-bookmarks.h', + 'ev-bookmarks.c', + 'ev-bookmark-action.h', + 'ev-bookmark-action.c', + 'ev-application.c', + 'ev-application.h', + 'ev-file-monitor.h', + 'ev-file-monitor.c', + 'ev-history.c', + 'ev-history.h', + 'ev-loading-message.h', + 'ev-loading-message.c', + 'ev-keyring.h', + 'ev-keyring.c', + 'ev-message-area.c', + 'ev-message-area.h', + 'ev-media-player-keys.h', + 'ev-media-player-keys.c', + 'ev-metadata.c', + 'ev-metadata.h', + 'ev-navigation-action.h', + 'ev-navigation-action.c', + 'ev-navigation-action-widget.h', + 'ev-navigation-action-widget.c', + 'ev-password-view.h', + 'ev-password-view.c', + 'ev-progress-message-area.h', + 'ev-progress-message-area.c', + 'ev-properties-dialog.c', + 'ev-properties-dialog.h', + 'ev-properties-fonts.c', + 'ev-properties-fonts.h', + 'ev-properties-license.c', + 'ev-properties-license.h', + 'ev-open-recent-action.c', + 'ev-open-recent-action.h', + 'ev-utils.c', + 'ev-utils.h', + 'ev-window.c', + 'ev-window.h', + 'ev-window-title.c', + 'ev-window-title.h', + 'ev-sidebar.c', + 'ev-sidebar.h', + 'ev-sidebar-annotations.c', + 'ev-sidebar-annotations.h', + 'ev-sidebar-attachments.c', + 'ev-sidebar-attachments.h', + 'ev-sidebar-bookmarks.h', + 'ev-sidebar-bookmarks.c', + 'ev-sidebar-layers.c', + 'ev-sidebar-layers.h', + 'ev-sidebar-links.c', + 'ev-sidebar-links.h', + 'ev-sidebar-page.c', + 'ev-sidebar-page.h', + 'ev-sidebar-thumbnails.c', + 'ev-sidebar-thumbnails.h', +] + +ev_resources = gnome.compile_resources( + 'atril-resources', + 'atril.gresource.xml', + source_dir: '../data', + c_name: 'ev', +) + +shell_sources += ev_resources + +atril_deps = [ + libdocument_dep, + config_h, + gio, + glib, + gtk, + libsecret, + math, + mate_desktop, + mate_submodules_dep, + libtoolbareditor_dep, + libevproperties_dep +] + +if get_option('enable_dbus') + dbus_generated = gnome.gdbus_codegen( + 'ev-gdbus-generated', + 'ev-gdbus.xml', + interface_prefix: 'org.mate.atril', + namespace: 'Ev', + object_manager: true, + ) + + shell_sources += dbus_generated + + # Generate the daemon D-Bus code + dbus_daemon_generated = gnome.gdbus_codegen( + 'ev-daemon-gdbus-generated', + 'ev-daemon-gdbus.xml', + interface_prefix: 'org.mate.atril', + namespace: 'Ev', + object_manager: true, + ) + + executable( + 'atrild', + sources: ['ev-daemon.c', ] + dbus_daemon_generated, + include_directories: include_dirs, + dependencies: atril_deps, + c_args: c_args, + install: true, + install_dir: libexecdir, + ) +endif + +libshell_deps = [ + atril_deps, + libview_dep, + libmisc_dep, + mate_submodules_dep, + libephyzoom_dep, +] + +libshell = static_library( + 'shell', + shell_sources, + dependencies: libshell_deps, + include_directories: include_dirs, +) + +libshell_dep = declare_dependency( + link_whole: libshell, # Need the whole lib for gresource lookup + dependencies: libshell_deps, + include_directories: include_dirs, +) + +atril = executable( + 'atril', + 'main.c', + dependencies: [libshell_dep] + atril_deps, + include_directories: include_dirs, + c_args: c_args, + install: true, +) |