From 423af80ad421a8a19e1c4be0c6851dff845a0f6c Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 10 Jul 2014 13:50:37 +0530 Subject: Files for EvWebView, thumbnails possible with GTK+-2.0 My last commit was supposed to have ev-web-view.c and ev-web-view.h however due to some reason I missed them last time, so here they are now. i am able to achieve thumbnails for my epub however these are of absurdly large size. Still struggling to get the webview done due to thread problems that I am encountering. --- libview/ev-web-view.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 libview/ev-web-view.h (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h new file mode 100644 index 00000000..6aaa17ff --- /dev/null +++ b/libview/ev-web-view.h @@ -0,0 +1,64 @@ +/* this file is part of atril, a mate document web_viewer + * + * Copyright (C) 2014 Avishkar Gupta + * Based on ev-view.h + * + * Atril 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 of the License, or + * (at your option) any later version. + * + * Atril 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. + */ + +#if !defined (__EV_ATRIL_VIEW_H_INSIDE__) && !defined (ATRIL_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __EV_WEB_VIEW_H__ +#define __EV_WEB_VIEW_H__ + +#include + +#include + +#include "ev-document-model.h" +#include +G_BEGIN_DECLS + + +typedef struct _EvWebView EvWebView; +typedef struct _EvWebViewClass EvWebViewClass; + +#define EV_TYPE_WEB_VIEW (ev_web_view_get_type ()) +#define EV_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_WEB_VIEW, EvWebView)) +#define EV_IS_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_WEB_VIEW)) + +GType ev_web_view_get_type (void) G_GNUC_CONST; + +GtkWidget* ev_web_view_new (void); +void ev_web_view_set_model (EvWebView *webview, + EvDocumentModel *model); +void ev_web_view_reload (EvWebView *webview); + +/* Navigation */ +gboolean ev_web_view_next_page (EvWebView *webview); +gboolean ev_web_view_previous_page (EvWebView *webview); + +/*Sidebar links*/ +void ev_web_view_handle_link (EvWebView *webview, EvLink* link); + +/*Searching*/ +void ev_web_view_find_next (EvWebView *webview); +void ev_web_view_find_previous (EvWebView *webview); + +G_END_DECLS + +#endif /* __EV_WEB_VIEW_H__ */ -- cgit v1.2.1 From 46fce038996fa84784df775d0b2e941228388b66 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 19 Jul 2014 10:47:43 +0530 Subject: Thumbnails for all documents Now other problems with webkit. After much fidgeting I was able to resolve the previous problems of threads. However, now there is a different webkit error. --- libview/ev-web-view.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 6aaa17ff..55736871 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -47,7 +47,10 @@ GtkWidget* ev_web_view_new (void); void ev_web_view_set_model (EvWebView *webview, EvDocumentModel *model); void ev_web_view_reload (EvWebView *webview); - +void +ev_web_view_reload_page (EvWebView *webview, + gint page); + /* Navigation */ gboolean ev_web_view_next_page (EvWebView *webview); gboolean ev_web_view_previous_page (EvWebView *webview); -- cgit v1.2.1 From 4a3ac19d1365cb87a31eecea4759484673fad667 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sun, 20 Jul 2014 16:08:07 +0530 Subject: Active properties dialog, other actions Properties dialog for epub documents, will some basic properties. Also set toolbar and menu sensitivity for the actions available in epub, will add more(find) once I write the module. Also inverted colors needs to be done with CSS or the like. --- libview/ev-web-view.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 55736871..19d6c8a1 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -62,6 +62,9 @@ void ev_web_view_handle_link (EvWebView *webview, EvLink* link); void ev_web_view_find_next (EvWebView *webview); void ev_web_view_find_previous (EvWebView *webview); +/*Selection*/ +gboolean ev_web_view_get_has_selection (EvWebView *webview); + G_END_DECLS #endif /* __EV_WEB_VIEW_H__ */ -- cgit v1.2.1 From b219a4a96ed7f38bf3de46bff790b139955bd927 Mon Sep 17 00:00:00 2001 From: rootavish Date: Wed, 23 Jul 2014 00:18:47 +0530 Subject: Cleaned some code, added select-all functionality Select all functionality to select all content from the webview. Cleaned ev-jobs.c, it had a lot of unused code. --- libview/ev-web-view.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 19d6c8a1..eaa2ef3f 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -64,6 +64,7 @@ void ev_web_view_find_previous (EvWebView *webview); /*Selection*/ gboolean ev_web_view_get_has_selection (EvWebView *webview); +void ev_web_view_select_all (EvWebView *webview); G_END_DECLS -- cgit v1.2.1 From df1fce63dca7bd7ac85c720a357adba0f1b7108a Mon Sep 17 00:00:00 2001 From: rootavish Date: Wed, 23 Jul 2014 22:19:20 +0530 Subject: Added Zoom control, Window thubnail Added zoom-in and zoom out capabilities, also re-enabled window thumbnail which I had disabled previously when the thumbnails were not implemented. Still trying to get the document to display, need to make the right changes, also trying to stop the window from entering presentation view, but that does happen and needs to be fixed. --- libview/ev-web-view.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index eaa2ef3f..ac957f5d 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -66,6 +66,10 @@ void ev_web_view_find_previous (EvWebView *webview); gboolean ev_web_view_get_has_selection (EvWebView *webview); void ev_web_view_select_all (EvWebView *webview); +/*Zoom control*/ +gboolean ev_web_view_zoom_in (EvWebView *webview); +gboolean ev_web_view_zoom_out (EvWebView *webview); + G_END_DECLS #endif /* __EV_WEB_VIEW_H__ */ -- cgit v1.2.1 From 57a3618d9254364157a12df39caebbf9247d5aca Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 26 Jul 2014 12:26:32 +0530 Subject: Reading epub documents possible Alebit with a bit of bugs as far as navigation etc. are possible, we can read an epub document in Atril. The document will be displayed with thumbnails, and all keyboard shortcuts work. Menu options, the ones that I have currently added do work. I Will now move on to features such as inverted colors, document index, etc, most of which should be simple to add. Also made changes so that the presentation view does not fire up while displaying an epub document. Also added the feature to copy text to clipboard using the Atril menu. --- libview/ev-web-view.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index ac957f5d..2c920434 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -1,7 +1,7 @@ -/* this file is part of atril, a mate document web_viewer +/* this file is part of atril, a mate document viewer * * Copyright (C) 2014 Avishkar Gupta - * Based on ev-view.h + * Based on ev-view.h, also a part of atril, a mate document viewer * * Atril is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -63,8 +63,9 @@ void ev_web_view_find_next (EvWebView *webview); void ev_web_view_find_previous (EvWebView *webview); /*Selection*/ -gboolean ev_web_view_get_has_selection (EvWebView *webview); -void ev_web_view_select_all (EvWebView *webview); +gboolean ev_web_view_get_has_selection (EvWebView *webview); +void ev_web_view_select_all (EvWebView *webview); +void ev_web_view_copy (EvWebView *webview); /*Zoom control*/ gboolean ev_web_view_zoom_in (EvWebView *webview); -- cgit v1.2.1 From 60b002aab6c2ee610377d46208ee16dda1e94fc3 Mon Sep 17 00:00:00 2001 From: rootavish Date: Tue, 29 Jul 2014 19:57:02 +0530 Subject: Searching single pages in epub ..and other fixing other bugs that were present once the webview was added, like the escape key command etc. Will look to refactor the thumbnails into ev-web-view.c. In the next commit I'll extend this search over the entire document.Also will incorporate document index(table of contents). --- libview/ev-web-view.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 2c920434..aa2d5492 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -28,7 +28,7 @@ #include #include - +#include "ev-jobs.h" #include "ev-document-model.h" #include G_BEGIN_DECLS @@ -44,30 +44,37 @@ typedef struct _EvWebViewClass EvWebViewClass; GType ev_web_view_get_type (void) G_GNUC_CONST; GtkWidget* ev_web_view_new (void); + void ev_web_view_set_model (EvWebView *webview, EvDocumentModel *model); -void ev_web_view_reload (EvWebView *webview); -void -ev_web_view_reload_page (EvWebView *webview, + +void ev_web_view_reload (EvWebView *webview); + +void ev_web_view_reload_page (EvWebView *webview, gint page); /* Navigation */ gboolean ev_web_view_next_page (EvWebView *webview); gboolean ev_web_view_previous_page (EvWebView *webview); -/*Sidebar links*/ +/* Sidebar links */ void ev_web_view_handle_link (EvWebView *webview, EvLink* link); -/*Searching*/ -void ev_web_view_find_next (EvWebView *webview); -void ev_web_view_find_previous (EvWebView *webview); +/* Searching */ +void ev_web_view_find_next (EvWebView *webview); +void ev_web_view_find_previous (EvWebView *webview); +void ev_web_view_find_changed (EvWebView *webview, gint page_found_on,EvJobFind *job); +void ev_web_view_find_search_changed (EvWebView *webview); +void ev_web_view_find_cancel (EvWebView *webview); +void ev_web_view_find_set_highlight_search (EvWebView *webview,gboolean visible); +void ev_web_view_empty_search (EvWebView *webview); -/*Selection*/ +/* Selection */ gboolean ev_web_view_get_has_selection (EvWebView *webview); void ev_web_view_select_all (EvWebView *webview); void ev_web_view_copy (EvWebView *webview); -/*Zoom control*/ +/* Zoom control */ gboolean ev_web_view_zoom_in (EvWebView *webview); gboolean ev_web_view_zoom_out (EvWebView *webview); -- cgit v1.2.1 From 56880392a6678ccec12bbec016939597acd49b07 Mon Sep 17 00:00:00 2001 From: rootavish Date: Wed, 6 Aug 2014 15:34:02 +0530 Subject: Searching in epub documents I added the capability to search through documents. The search is quite buggy, and we'll be taking care of each bug one at a time. --- libview/ev-web-view.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index aa2d5492..751e7381 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -63,11 +63,15 @@ void ev_web_view_handle_link (EvWebView *webview, EvLink* link); /* Searching */ void ev_web_view_find_next (EvWebView *webview); void ev_web_view_find_previous (EvWebView *webview); -void ev_web_view_find_changed (EvWebView *webview, gint page_found_on,EvJobFind *job); -void ev_web_view_find_search_changed (EvWebView *webview); + +void ev_web_view_find_changed (EvWebView *webview, + guint *results, + gchar *text, + gboolean case_sensitive); + +void ev_web_view_find_search_changed (EvWebView *webview,gboolean visible); void ev_web_view_find_cancel (EvWebView *webview); void ev_web_view_find_set_highlight_search (EvWebView *webview,gboolean visible); -void ev_web_view_empty_search (EvWebView *webview); /* Selection */ gboolean ev_web_view_get_has_selection (EvWebView *webview); -- cgit v1.2.1 From ff0a79e545356046c7145bff0630a7cd50ad977c Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 7 Aug 2014 17:43:55 +0530 Subject: Ability to search through epub documents You can now search through the entire epub document. In the next commit I'm adding support for webkit2 with gtk3. --- libview/ev-web-view.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 751e7381..661ed9d0 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -69,10 +69,10 @@ void ev_web_view_find_changed (EvWebView *webview, gchar *text, gboolean case_sensitive); -void ev_web_view_find_search_changed (EvWebView *webview,gboolean visible); +void ev_web_view_find_search_changed (EvWebView *webview); void ev_web_view_find_cancel (EvWebView *webview); void ev_web_view_find_set_highlight_search (EvWebView *webview,gboolean visible); - +void ev_web_view_set_handler (EvWebView *webview,gboolean visible); /* Selection */ gboolean ev_web_view_get_has_selection (EvWebView *webview); void ev_web_view_select_all (EvWebView *webview); -- cgit v1.2.1 From 1548bcb4629a6a41641a0188003215b3098aa5fc Mon Sep 17 00:00:00 2001 From: rootavish Date: Sun, 10 Aug 2014 01:05:45 +0530 Subject: Page Label handling, other fixes Added the function to handle links from the toolbar, also added functions to disconnect all ev-view handlers once it has been replaced by ev-web-view, and vice-versa(to drop all handler associated to ev-web-view). Also the unref call to job_thumb was causing thumbnail jobs to crash with GTK2, so had to revert that, now we're back to the document folder not getting deleted from disk. --- libview/ev-web-view.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libview/ev-web-view.h') diff --git a/libview/ev-web-view.h b/libview/ev-web-view.h index 661ed9d0..74b7eb6b 100644 --- a/libview/ev-web-view.h +++ b/libview/ev-web-view.h @@ -74,14 +74,16 @@ void ev_web_view_find_cancel (EvWebView *webview); void ev_web_view_find_set_highlight_search (EvWebView *webview,gboolean visible); void ev_web_view_set_handler (EvWebView *webview,gboolean visible); /* Selection */ -gboolean ev_web_view_get_has_selection (EvWebView *webview); -void ev_web_view_select_all (EvWebView *webview); -void ev_web_view_copy (EvWebView *webview); +gboolean ev_web_view_get_has_selection (EvWebView *webview); +void ev_web_view_select_all (EvWebView *webview); +void ev_web_view_copy (EvWebView *webview); /* Zoom control */ -gboolean ev_web_view_zoom_in (EvWebView *webview); -gboolean ev_web_view_zoom_out (EvWebView *webview); +gboolean ev_web_view_zoom_in (EvWebView *webview); +gboolean ev_web_view_zoom_out (EvWebView *webview); +/*For safe replacement by an EvView*/ +void ev_web_view_disconnect_handlers (EvWebView *webview); G_END_DECLS #endif /* __EV_WEB_VIEW_H__ */ -- cgit v1.2.1