r4332 bursa - /trunk/netsurf/riscos/bitmap.c
by netsurf@semichrome.net
Author: bursa
Date: Sat Jun 14 18:13:19 2008
New Revision: 4332
URL: http://source.netsurf-browser.org?rev=4332&view=rev
Log:
Don't crash when attempting to save a bitmap with no data. This can happen when out of memory.
Modified:
trunk/netsurf/riscos/bitmap.c
Modified: trunk/netsurf/riscos/bitmap.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/bitmap.c?rev=4332&...
==============================================================================
--- trunk/netsurf/riscos/bitmap.c (original)
+++ trunk/netsurf/riscos/bitmap.c Sat Jun 14 18:13:19 2008
@@ -1057,7 +1057,12 @@
os_error *error;
struct bitmap_compressed_header *header;
- assert(bitmap && (bitmap->compressed || bitmap->sprite_area));
+ assert(bitmap);
+
+ if (!bitmap->compressed && !bitmap->sprite_area) {
+ LOG(("bitmap has no data"));
+ return;
+ }
/* unmodified bitmaps will still have their file available */
if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {
15 years, 5 months
r4331 bursa - in /trunk/netsurf: !NetSurf/Resources/de/ !NetSurf/Resources/en/ !NetSurf/Resources/fr/ !NetSurf/Resources/nl/ riscos/configure/
by netsurf@semichrome.net
Author: bursa
Date: Sat Jun 14 17:47:00 2008
New Revision: 4331
URL: http://source.netsurf-browser.org?rev=4331&view=rev
Log:
Remove nonsensical disc cache section from Choices window.
Modified:
trunk/netsurf/!NetSurf/Resources/de/Messages
trunk/netsurf/!NetSurf/Resources/de/Templates,fec
trunk/netsurf/!NetSurf/Resources/en/Messages
trunk/netsurf/!NetSurf/Resources/en/Templates,fec
trunk/netsurf/!NetSurf/Resources/fr/Messages
trunk/netsurf/!NetSurf/Resources/fr/Templates,fec
trunk/netsurf/!NetSurf/Resources/nl/Messages
trunk/netsurf/!NetSurf/Resources/nl/Templates,fec
trunk/netsurf/riscos/configure/con_cache.c
Modified: trunk/netsurf/!NetSurf/Resources/de/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/de/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/de/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/de/Messages Sat Jun 14 17:47:00 2008
@@ -819,13 +819,9 @@
HelpCacheConfig3:SpeichergröÃe, die verwendet wird um Inhalte zwischenzuspeichern.
HelpCacheConfig4:Klicken mit AUSWAHL verringert die GröÃe des Cachespeichers.
HelpCacheConfig5:Klicken mit AUSWAHL vergröÃert die GröÃe des Cachespeichers.
-HelpCacheConfig10:Zeitdauer für die Objekte im Cache gespeichert bleiben.
-HelpCacheConfig11:Klicken mit AUSWAHL verringert die Zeitdauer.
-HelpCacheConfig12:Klicken mit AUSWAHL vergröÃert die Zeitdauer.
-HelpCacheConfig14:Löscht alle mehrfach vorhandenen Objekte aus dem Cache.
-HelpCacheConfig15:Stellt die Standardeinstellungen wieder her.
-HelpCacheConfig16:Klicken mit AUSWAHL schlieÃt das Fenster ohne die Ãnderungen zu speichern.|MKlicken mit SPEZIAL stellt die zuletzt abgespeicherten Einstellungen wieder her.
-HelpCacheConfig17:Klicken mit AUSWAHL speichert die Einstellungen und schlieÃt das Fenster.|MKlicken mit SPEZIAL speichert die Einstellungen ohne das Fenster zu schlieÃen.
+HelpCacheConfig7:Stellt die Standardeinstellungen wieder her.
+HelpCacheConfig8:Klicken mit AUSWAHL schlieÃt das Fenster ohne die Ãnderungen zu speichern.|MKlicken mit SPEZIAL stellt die zuletzt abgespeicherten Einstellungen wieder her.
+HelpCacheConfig9:Klicken mit AUSWAHL speichert die Einstellungen und schlieÃt das Fenster.|MKlicken mit SPEZIAL speichert die Einstellungen ohne das Fenster zu schlieÃen.
HelpConnectConfig:Das ist das Fenster zur Einstellung der Parameter für die Netzanbindung.
HelpConnectConfig3:Aktuell gewählter Proxytyp.|MMit dem Menü kann ein anderer Typ eingestellt werden.
Modified: trunk/netsurf/!NetSurf/Resources/de/Templates,fec
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/de/T...
==============================================================================
Binary files - no diff available.
Modified: trunk/netsurf/!NetSurf/Resources/en/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/en/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/en/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/en/Messages Sat Jun 14 17:47:00 2008
@@ -819,13 +819,9 @@
HelpCacheConfig3:\Tamount of memory to be used for caching content.
HelpCacheConfig4:\Sreduce the amount of memory.
HelpCacheConfig5:\Sincrease the amount of memory.
-HelpCacheConfig10:\Tlength of time items are kept in the cache.
-HelpCacheConfig11:\Sreduce the cache duration.
-HelpCacheConfig12:\Sincrease the cache duration.
-HelpCacheConfig14:\Sdelete any redundant files from NetSurf's disc cache.
-HelpCacheConfig15:\Sreset the Cache options back to their default values.
-HelpCacheConfig16:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
-HelpCacheConfig17:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
+HelpCacheConfig7:\Sreset the Cache options back to their default values.
+HelpCacheConfig8:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
+HelpCacheConfig9:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
HelpConnectConfig:\Tconnection configuration \w
HelpConnectConfig3:\Tcurrently selected proxy type.|MUse the menu to select a proxy type.
Modified: trunk/netsurf/!NetSurf/Resources/en/Templates,fec
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/en/T...
==============================================================================
Binary files - no diff available.
Modified: trunk/netsurf/!NetSurf/Resources/fr/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/fr/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/fr/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/fr/Messages Sat Jun 14 17:47:00 2008
@@ -819,13 +819,9 @@
HelpCacheConfig3:\Tla quantité de mémoire à utiliser pour le contenu du cache.
HelpCacheConfig4:\Sréduire la quantité de mémoire.
HelpCacheConfig5:\Saugmenter la quantité de mémoire.
-HelpCacheConfig10:\Tla durée de rétention dans le cache.
-HelpCacheConfig11:\Sréduire la durée du cache.
-HelpCacheConfig12:\Saugmenter la durée du cache.
-HelpCacheConfig14:\Ssupprimer tout fichier redondant du cache-disque de Netsurf.
-HelpCacheConfig15:\Srevenir aux valeurs par défaut des options du Cache.
-HelpCacheConfig16:\Sfermer cette fenêtre sans sauver les changements.|M\Arevenir aux options de Cache précédemment sauvegardées.
-HelpCacheConfig17:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
+HelpCacheConfig7:\Srevenir aux valeurs par défaut des options du Cache.
+HelpCacheConfig8:\Sfermer cette fenêtre sans sauver les changements.|M\Arevenir aux options de Cache précédemment sauvegardées.
+HelpCacheConfig9:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
HelpConnectConfig:\Tla fenêtre de configuration de connexion.
HelpConnectConfig3:\Tle type de proxy sélectionné en ce moment.|MUtiliser le menu pour choisir un type de proxy.
Modified: trunk/netsurf/!NetSurf/Resources/fr/Templates,fec
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/fr/T...
==============================================================================
Binary files - no diff available.
Modified: trunk/netsurf/!NetSurf/Resources/nl/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/nl/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/nl/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/nl/Messages Sat Jun 14 17:47:00 2008
@@ -819,13 +819,9 @@
HelpCacheConfig3:\Tamount of memory to be used for caching content.
HelpCacheConfig4:\Sreduce the amount of memory.
HelpCacheConfig5:\Sincrease the amount of memory.
-HelpCacheConfig10:\Tlength of time items are kept in the cache.
-HelpCacheConfig11:\Sreduce the cache duration.
-HelpCacheConfig12:\Sincrease the cache duration.
-HelpCacheConfig14:\Sdelete any redundant files from NetSurf's disc cache.
-HelpCacheConfig15:\Sreset the Cache options back to their default values.
-HelpCacheConfig16:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
-HelpCacheConfig17:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
+HelpCacheConfig7:\Sreset the Cache options back to their default values.
+HelpCacheConfig8:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
+HelpCacheConfig9:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
HelpConnectConfig:\Tconnection configuration \w
HelpConnectConfig3:\Tcurrently selected proxy type.|MUse the menu to select a proxy type.
Modified: trunk/netsurf/!NetSurf/Resources/nl/Templates,fec
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/nl/T...
==============================================================================
Binary files - no diff available.
Modified: trunk/netsurf/riscos/configure/con_cache.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/configure/con_cach...
==============================================================================
--- trunk/netsurf/riscos/configure/con_cache.c (original)
+++ trunk/netsurf/riscos/configure/con_cache.c Sat Jun 14 17:47:00 2008
@@ -33,13 +33,9 @@
#define CACHE_MEMORY_SIZE 3
#define CACHE_MEMORY_DEC 4
#define CACHE_MEMORY_INC 5
-#define CACHE_DURATION_SIZE 10
-#define CACHE_DURATION_DEC 11
-#define CACHE_DURATION_INC 12
-#define CACHE_MAINTAIN_BUTTON 14
-#define CACHE_DEFAULT_BUTTON 15
-#define CACHE_CANCEL_BUTTON 16
-#define CACHE_OK_BUTTON 17
+#define CACHE_DEFAULT_BUTTON 7
+#define CACHE_CANCEL_BUTTON 8
+#define CACHE_OK_BUTTON 9
static bool ro_gui_options_cache_click(wimp_pointer *pointer);
static bool ro_gui_options_cache_ok(wimp_w w);
@@ -48,13 +44,10 @@
/* set the current values */
ro_gui_set_icon_decimal(w, CACHE_MEMORY_SIZE,
(option_memory_cache_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(w, CACHE_DURATION_SIZE, option_disc_cache_age, 0);
/* initialise all functions for a newly created window */
ro_gui_wimp_event_register_numeric_field(w, CACHE_MEMORY_SIZE,
CACHE_MEMORY_INC, CACHE_MEMORY_DEC, 0, 64, 1, 1);
- ro_gui_wimp_event_register_numeric_field(w, CACHE_DURATION_SIZE,
- CACHE_DURATION_INC, CACHE_DURATION_DEC, 0, 28, 1, 0);
ro_gui_wimp_event_register_mouse_click(w, ro_gui_options_cache_click);
ro_gui_wimp_event_register_cancel(w, CACHE_CANCEL_BUTTON);
ro_gui_wimp_event_register_ok(w, CACHE_OK_BUTTON,
@@ -71,13 +64,6 @@
/* set the default values */
ro_gui_set_icon_decimal(pointer->w, CACHE_MEMORY_SIZE,
20, 1);
- ro_gui_set_icon_decimal(pointer->w, CACHE_DURATION_SIZE,
- 28, 0);
- return true;
- case CACHE_MAINTAIN_BUTTON:
- xhourglass_on();
- filename_flush();
- xhourglass_off();
return true;
}
return false;
@@ -86,7 +72,6 @@
bool ro_gui_options_cache_ok(wimp_w w) {
option_memory_cache_size = (((ro_gui_get_icon_decimal(w,
CACHE_MEMORY_SIZE, 1) + 1) << 20) - 1) / 10;
- option_disc_cache_age = ro_gui_get_icon_decimal(w, CACHE_DURATION_SIZE, 0);
ro_gui_save_options();
return true;
15 years, 5 months
r4330 tlsa - /trunk/netsurf/gtk/dialogs/gtk_about.c
by netsurf@semichrome.net
Author: tlsa
Date: Sat Jun 14 17:30:30 2008
New Revision: 4330
URL: http://source.netsurf-browser.org?rev=4330&view=rev
Log:
Fix NetSurf capitalisation and add me.
Modified:
trunk/netsurf/gtk/dialogs/gtk_about.c
Modified: trunk/netsurf/gtk/dialogs/gtk_about.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/dialogs/gtk_about.c?r...
==============================================================================
--- trunk/netsurf/gtk/dialogs/gtk_about.c (original)
+++ trunk/netsurf/gtk/dialogs/gtk_about.c Sat Jun 14 17:30:30 2008
@@ -22,25 +22,25 @@
GtkAboutDialog* about_dialog;
-static gchar *authors[] = {"John-Mark Bell", "James Bursa",
- "Rob Kendrick", "Adrian Lees", "Vincent Sanders", "Daniel Silverstone",
+static gchar *authors[] = {"John-Mark Bell", "James Bursa", "Michael Drake",
+ "Rob Kendrick", "Adrian Lees", "Vincent Sanders", "Daniel Silverstone",
"Richard Wilson", "\nContributors:", "Kevin Bagust", "Stefaan Claes",
- "Matthew Hambley", "Rob Jackson", "Jeffrey Lee", "Phil Mellor",
+ "Matthew Hambley", "Rob Jackson", "Jeffrey Lee", "Phil Mellor",
"Philip Pemberton", "Darren Salt", "Andrew Timmins", "John Tytgat",
"Chris Williams", "\nGoogle Summer of Code Contributors:", "Adam Blokus",
"Sean Fox", "Michael Lester", "Andrew Sidwell", NULL};
static gchar *translators = "Sebastian Barthel \nBruno D'Arcangeli \nGerard van Katwijk \nJérôme Mathevet \nSimon Voortman.";
-static gchar *artists[] = {"Michael Drake", "\nContributors:",
+static gchar *artists[] = {"Michael Drake", "\nContributors:",
"Andrew Duffell", "John Duffell", "Richard Hallas", "Phil Mellor", NULL};
static gchar *documenters[] = {"John-Mark Bell", "James Bursa", "Michael Drake", "Richard Wilson", "\nContributors:", "James Shaw", NULL};
static gchar *name = "NetSurf";
-static gchar *description = "Small as a mouse, fast as a cheetah, and available for free.\nNetsurf is a web browser for RISC OS and UNIX-like platforms.";
-static gchar *url = "http://www.netsurf-browser.org";
+static gchar *description = "Small as a mouse, fast as a cheetah, and available for free.\nNetSurf is a web browser for RISC OS and UNIX-like platforms.";
+static gchar *url = "http://www.netsurf-browser.org/";
static gchar *url_label = "NetSurf Website";
static gchar *copyright = "Copyright © 2003 - 2008 The NetSurf Developers";
-static gchar* licence = "licence";
+static gchar* licence = "licence";
static void launch_url (GtkAboutDialog *about_dialog, const gchar *url, gpointer data){
struct browser_window *bw = data;
@@ -50,12 +50,12 @@
void nsgtk_about_dialog_init(GtkWindow *parent, struct browser_window *bw, const char *version) {
g_file_get_contents(g_strconcat(res_dir_location, licence, NULL), &licence, NULL, NULL);
gtk_about_dialog_set_url_hook (launch_url, (gpointer) bw, NULL);
-
+
gtk_show_about_dialog(parent, "artists", artists, "authors", authors,
"comments", description,"copyright", copyright, "documenters", documenters,
"license", licence,
"program-name", name, "translator-credits", translators,
- "version", version, "website", url, "website-label", url_label,
+ "version", version, "website", url, "website-label", url_label,
"wrap-license", FALSE, NULL);
-}
-
+}
+
15 years, 5 months
r4329 bursa - /trunk/netsurf/content/fetchers/fetch_curl.c
by netsurf@semichrome.net
Author: bursa
Date: Sat Jun 14 16:43:52 2008
New Revision: 4329
URL: http://source.netsurf-browser.org?rev=4329&view=rev
Log:
Handle errors returned by curl_multi_perform(), such as out of memory, instead of exiting.
Modified:
trunk/netsurf/content/fetchers/fetch_curl.c
Modified: trunk/netsurf/content/fetchers/fetch_curl.c
URL: http://source.netsurf-browser.org/trunk/netsurf/content/fetchers/fetch_cu...
==============================================================================
--- trunk/netsurf/content/fetchers/fetch_curl.c (original)
+++ trunk/netsurf/content/fetchers/fetch_curl.c Sat Jun 14 16:43:52 2008
@@ -718,7 +718,12 @@
/* do any possible work on the current fetches */
do {
codem = curl_multi_perform(fetch_curl_multi, &running);
- assert(codem == CURLM_OK || codem == CURLM_CALL_MULTI_PERFORM);
+ if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
+ LOG(("curl_multi_perform: %i %s",
+ codem, curl_multi_strerror(codem)));
+ warn_user("MiscError", curl_multi_strerror(codem));
+ return;
+ }
} while (codem == CURLM_CALL_MULTI_PERFORM);
/* process curl results */
@@ -1138,7 +1143,7 @@
/* file: URL and file exists */
/* create etag */
char etag_buf[20];
- snprintf(etag_buf, sizeof etag_buf,
+ snprintf(etag_buf, sizeof etag_buf,
"ETag: \"%10d\"", (int) s.st_mtime);
/* And send it to the header handler */
fetch_send_callback(FETCH_HEADER, f->fetch_handle, etag_buf,
15 years, 5 months
r4328 adamblokus - in /branches/adamblokus/netsurf: desktop/print.c pdf/TODO pdf/pdf_plotters.c
by netsurf@semichrome.net
Author: adamblokus
Date: Fri Jun 13 06:52:15 2008
New Revision: 4328
URL: http://source.netsurf-browser.org?rev=4328&view=rev
Log:
Added primitive width adjustment and outputing the whole
website in multiple pages.
Modified:
branches/adamblokus/netsurf/desktop/print.c
branches/adamblokus/netsurf/pdf/TODO
branches/adamblokus/netsurf/pdf/pdf_plotters.c
Modified: branches/adamblokus/netsurf/desktop/print.c
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/desktop/pri...
==============================================================================
--- branches/adamblokus/netsurf/desktop/print.c (original)
+++ branches/adamblokus/netsurf/desktop/print.c Fri Jun 13 06:52:15 2008
@@ -18,37 +18,48 @@
#include "desktop/print.h"
#include "desktop/printer.h"
+#include "content/content.h"
+#include "utils/log.h"
static struct content *print_init(struct content *);
-static bool print_apply_settings(struct print_settings *);
+static bool print_apply_settings(struct content *, struct print_settings *);
static bool print_cleanup(struct content *, struct printer *);
bool print_run(struct content *, struct printer *, struct print_settings *);
struct print_settings *print_make_settings(print_configuration configuration);
+static float content_width,content_height;
bool print_run(struct content *content,
struct printer *printer,
struct print_settings *settings){
struct content *printed_content;
+ float done_height;
printed_content = print_init(content);
if (settings == NULL)
settings = print_make_settings(DEFAULT);
- print_apply_settings(settings);
+ print_apply_settings(printed_content, settings);
printer->print_begin(settings->output);
/*Do some printing :)*/
- printer->print_next_page();
+
+ /*TODO:Plotter will have to be duplicated and passed
+ as an argument - to allow simultaneous screen and
+ page plotting*/
plot = *(printer->plotter);
-
- content_redraw(printed_content, 0, 0, 0,
- 0,INT_MIN, INT_MIN, INT_MAX, INT_MAX, 1, 0xffffff);
+ while (done_height < printed_content->height){
+ printer->print_next_page();
+ content_redraw(printed_content, 0, -done_height, 0,
+ 0, 0, 0, settings->page_width, settings->page_height,
+ 1, 0xffffff);
+ done_height += settings->page_height;
+ }
print_cleanup(printed_content, printer);
}
@@ -58,16 +69,26 @@
return content;
}
-bool print_apply_settings(struct print_settings *settings){
+bool print_apply_settings(struct content *content,
+ struct print_settings *settings){
if (settings == NULL)
return false;
/*Apply settings - adjust page size etc*/
+
+ content_width = content->width;
+ content_height = content->height;
+
+ content_reformat(content, settings->page_width, settings->page_height);
+ LOG(("New layout applied.New height = %d ; New width = %d ",
+ content->height, content->width));
+
return true;
}
bool print_cleanup(struct content *content, struct printer *printer){
- printer->print_end();
+ printer->print_end();
+ content_reformat(content, content_width, content_height);
return true;
}
Modified: branches/adamblokus/netsurf/pdf/TODO
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/pdf/TODO?re...
==============================================================================
--- branches/adamblokus/netsurf/pdf/TODO (original)
+++ branches/adamblokus/netsurf/pdf/TODO Fri Jun 13 06:52:15 2008
@@ -1,13 +1,19 @@
-- bitmap_tile at page-border
- finish all graphic primitives
- allow adding raw bitmaps
- make image-aware (embed the image in its native/original type if possible)
- adjust content width to page width
+- divide output into multiple pages (not just the first one)
+- rearrange file structure
+
+- separate print-plotting as much as possible from window redrawing
- add text-scaling (if not yet using the original font - make the default one
have the same width)
- add a save file.. dialogue
-- divide output into multiple pages (not just the first one)
-- rearrange file structure
- add utf support to Haru ( doable? )
-- wait for browser to end fetching?
+- wait for browser to end fetching?
+- analyze and deal with performance issues(huge file hangs some pdf viewers,
+ for example kpdf when viewing plotted http://www.onet.pl)
+- deal with to wide pages - when window layouting adds a horizontal scrollbar,
+ we should treat it otherwise - either print horizontal or scale or,
+ better, find a new layout.
Modified: branches/adamblokus/netsurf/pdf/pdf_plotters.c
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/pdf/pdf_plo...
==============================================================================
--- branches/adamblokus/netsurf/pdf/pdf_plotters.c (original)
+++ branches/adamblokus/netsurf/pdf/pdf_plotters.c Fri Jun 13 06:52:15 2008
@@ -588,15 +588,15 @@
page_clipped = false;
#ifdef PDF_DEBUG
LOG(("%f %f", page_width, page_height));
-#endif
-}
-
-void pdf_end(){
-
-#ifdef PDF_DEBUG
- LOG(("pdf_end begins"));
pdf_plot_grid(10, 10, 0xCCCCCC);
pdf_plot_grid(100, 100, 0xCCCCFF);
+#endif
+}
+
+void pdf_end(){
+
+#ifdef PDF_DEBUG
+ LOG(("pdf_end begins"));
#endif
HPDF_SaveToFile(pdf_doc, filename);
15 years, 5 months
r4327 adamblokus - in /branches/adamblokus/netsurf: Makefile.sources desktop/print.c desktop/print.h desktop/printer.h gtk/gtk_scaffolding.c pdf/pdf_plotters.c pdf/pdf_plotters.h pdf/pdf_printer.h
by netsurf@semichrome.net
Author: adamblokus
Date: Thu Jun 12 10:46:34 2008
New Revision: 4327
URL: http://source.netsurf-browser.org?rev=4327&view=rev
Log:
Added a first prototype of the paged-output organization.
Still not sure about naming, file locations etc.
Works with the same pdf plotting as before.
Added:
branches/adamblokus/netsurf/desktop/print.c
branches/adamblokus/netsurf/desktop/print.h
branches/adamblokus/netsurf/desktop/printer.h
branches/adamblokus/netsurf/pdf/pdf_printer.h
Modified:
branches/adamblokus/netsurf/Makefile.sources
branches/adamblokus/netsurf/gtk/gtk_scaffolding.c
branches/adamblokus/netsurf/pdf/pdf_plotters.c
branches/adamblokus/netsurf/pdf/pdf_plotters.h
Modified: branches/adamblokus/netsurf/Makefile.sources
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/Makefile.so...
==============================================================================
--- branches/adamblokus/netsurf/Makefile.sources (original)
+++ branches/adamblokus/netsurf/Makefile.sources Thu Jun 12 10:46:34 2008
@@ -57,9 +57,10 @@
gtk_history.c gtk_window.c gtk_filetype.c gtk_download.c
S_GTK := $(addprefix gtk/,$(S_GTK))
-# S_PDF are sources of the pdf plotter
-S_PDF := pdf_plotters.c
-S_PDF := $(addprefix pdf/,$(S_PDF))
+# S_PDF are sources of the pdf plotter + the ones for paged-printing
+S_PDF := pdf_plotters.c
+S_PRINT := print.c
+S_PDF := $(addprefix pdf/,$(S_PDF)) $(addprefix desktop/,$(S_PRINT))
# Some extra rules for building the scanner etc.
css/css_enum.c css/css_enum.h: css/css_enums css/makeenum
Added: branches/adamblokus/netsurf/desktop/print.c
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/desktop/pri...
==============================================================================
--- branches/adamblokus/netsurf/desktop/print.c (added)
+++ branches/adamblokus/netsurf/desktop/print.c Thu Jun 12 10:46:34 2008
@@ -1,0 +1,102 @@
+/*
+ * Copyright 2008 Adam Blokus <adamblokus(a)gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "desktop/print.h"
+#include "desktop/printer.h"
+
+static struct content *print_init(struct content *);
+static bool print_apply_settings(struct print_settings *);
+static bool print_cleanup(struct content *, struct printer *);
+
+bool print_run(struct content *, struct printer *, struct print_settings *);
+
+struct print_settings *print_make_settings(print_configuration configuration);
+
+
+bool print_run(struct content *content,
+ struct printer *printer,
+ struct print_settings *settings){
+
+ struct content *printed_content;
+
+ printed_content = print_init(content);
+
+ if (settings == NULL)
+ settings = print_make_settings(DEFAULT);
+
+ print_apply_settings(settings);
+
+ printer->print_begin(settings->output);
+
+ /*Do some printing :)*/
+ printer->print_next_page();
+ plot = *(printer->plotter);
+
+ content_redraw(printed_content, 0, 0, 0,
+ 0,INT_MIN, INT_MIN, INT_MAX, INT_MAX, 1, 0xffffff);
+
+ print_cleanup(printed_content, printer);
+}
+
+struct content *print_init(struct content *content){
+ /*TODO:Duplicate content*/
+ return content;
+}
+
+bool print_apply_settings(struct print_settings *settings){
+ if (settings == NULL)
+ return false;
+
+ /*Apply settings - adjust page size etc*/
+ return true;
+}
+
+bool print_cleanup(struct content *content, struct printer *printer){
+ printer->print_end();
+ return true;
+}
+
+struct print_settings *print_make_settings(print_configuration configuration){
+
+ struct print_settings *settings;
+
+ switch (configuration){
+ case DEFAULT:
+ settings = (struct print_settings*)
+ malloc(sizeof(struct print_settings));
+
+ settings->page_width = 595;
+ settings->page_height = 840;
+
+ settings->copies = 1;
+
+ settings->margins[LEFT] = 0;
+ settings->margins[RIGHT] = 0;
+ settings->margins[TOP] = 0;
+ settings->margins[BOTTOM] = 0;
+
+ settings->output = NULL;
+
+ break;
+
+ default:
+ return NULL;
+ }
+
+ return settings;
+}
Added: branches/adamblokus/netsurf/desktop/print.h
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/desktop/pri...
==============================================================================
--- branches/adamblokus/netsurf/desktop/print.h (added)
+++ branches/adamblokus/netsurf/desktop/print.h Thu Jun 12 10:46:34 2008
@@ -1,0 +1,55 @@
+/*
+ * Copyright 2008 Adam Blokus <adamblokus(a)gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/** \file
+ Conception:
+ Generalized output-in-pages. Allows the current content to be 'printed':
+either into a pdf file (any other later?) or to any kind of other output
+destination that divides the website into pages - as a printer.
+*/
+
+#ifndef NETSURF_DESKTOP_PRINT_H
+#define NETSURF_DESKTOP_PRINT_H
+
+#include <stdbool.h>
+
+struct content;
+struct printer;
+
+enum {MARGINLEFT = 0, MARGINRIGHT = 1, MARGINTOP = 2, MARGINBOTTOM = 3};
+
+typedef enum {DEFAULT} print_configuration;
+
+struct print_settings{
+ /*Standard parameters*/
+ float page_width, page_height;
+ float margins[4];
+
+ unsigned int copies;
+
+ /*Output destinations - file/printer name*/
+ const char *output;
+
+ /*TODO: more options?*/
+};
+
+bool print_run(struct content *, struct printer *, struct print_settings *);
+
+struct print_settings *print_make_settings(print_configuration configuration);
+
+#endif
Added: branches/adamblokus/netsurf/desktop/printer.h
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/desktop/pri...
==============================================================================
--- branches/adamblokus/netsurf/desktop/printer.h (added)
+++ branches/adamblokus/netsurf/desktop/printer.h Thu Jun 12 10:46:34 2008
@@ -1,0 +1,38 @@
+/*
+ * Copyright 2008 Adam Blokus <adamblokus(a)gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/** \file
+ Printer interface - plotter and handling pages
+*/
+
+#ifndef NETSURF_DESKTOP_PRINTER_H
+#define NETSURF_DESKTOP_PRINTER_H
+
+#include "desktop/plotters.h"
+
+struct printer{
+ struct plotter_table *plotter;
+
+ bool (*print_begin) (const char *);
+
+ void (*print_next_page)();
+
+ void (*print_end)();
+};
+
+#endif
Modified: branches/adamblokus/netsurf/gtk/gtk_scaffolding.c
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/gtk/gtk_sca...
==============================================================================
--- branches/adamblokus/netsurf/gtk/gtk_scaffolding.c (original)
+++ branches/adamblokus/netsurf/gtk/gtk_scaffolding.c Thu Jun 12 10:46:34 2008
@@ -47,7 +47,10 @@
#include "render/html.h"
#include "utils/messages.h"
#include "utils/utils.h"
-#include "pdf/pdf_plotters.h"
+
+#include "pdf/pdf_printer.h"
+#include "desktop/print.h"
+
#undef NDEBUG
#include "utils/log.h"
@@ -427,17 +430,7 @@
LOG(("Print preview (generating PDF) started."));
- pdf_begin("out.pdf");
- pdf_next_page();
- plot = pdf_plotters;
-
-// content_redraw(bw->current_content, 0, 0, bw->current_content->width,
-// bw->current_content->height,INT_MIN, INT_MIN, INT_MAX, INT_MAX, 1, 0xffffff);
-
- content_redraw(bw->current_content, 0, 0, 0,
- 0,INT_MIN, INT_MIN, INT_MAX, INT_MAX, 1, 0xffffff);
-
- pdf_end("out.pdf");
+ print_run(bw->current_content,&pdf_printer,NULL);
return TRUE;
}
Modified: branches/adamblokus/netsurf/pdf/pdf_plotters.c
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/pdf/pdf_plo...
==============================================================================
--- branches/adamblokus/netsurf/pdf/pdf_plotters.c (original)
+++ branches/adamblokus/netsurf/pdf/pdf_plotters.c Thu Jun 12 10:46:34 2008
@@ -63,7 +63,7 @@
bool pdf_begin(const char *);
void pdf_next_page();
-void pdf_end(const char *);
+void pdf_end();
void error_handler (HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data);
@@ -80,6 +80,8 @@
/*Remeber if pdf_plot_clip was invoked for current page*/
static bool page_clipped;
+
+static char *filename;
extern struct plotter_table plot;
@@ -112,16 +114,16 @@
#endif
HPDF_Page_SetLineWidth(pdf_page, line_width);
- if(dotted)
+ if (dotted)
pdf_set_dotted();
- else if(dashed)
+ else if (dashed)
pdf_set_dashed();
HPDF_Page_SetRGBStroke(pdf_page, R(c), G(c), B(c));
HPDF_Page_Rectangle(pdf_page, x0, page_height - y0 + height, width, height);
HPDF_Page_Stroke(pdf_page);
- if(dotted||dashed)
+ if (dotted||dashed)
pdf_set_solid();
return true;
@@ -134,9 +136,9 @@
#endif
HPDF_Page_SetLineWidth(pdf_page, width);
- if(dotted)
+ if (dotted)
pdf_set_dotted();
- else if(dashed)
+ else if (dashed)
pdf_set_dashed();
HPDF_Page_SetRGBStroke(pdf_page, R(c), G(c), B(c));
@@ -145,7 +147,7 @@
HPDF_Page_LineTo(pdf_page, x1, page_height - y1);
HPDF_Page_Stroke(pdf_page);
- if(dotted||dashed)
+ if (dotted||dashed)
pdf_set_solid();
return true;
@@ -158,7 +160,7 @@
#ifdef PDF_DEBUG
LOG(("."));
#endif
- if(n == 0)
+ if (n == 0)
return true;
HPDF_Page_SetRGBFill(pdf_page, R(fill), G(fill), B(fill));
@@ -210,7 +212,7 @@
#ifdef PDF_DEBUG
LOG(("%d %d %d %d", clip_x0, clip_y0, clip_x1, clip_y1));
#endif
- if(page_clipped)
+ if (page_clipped)
HPDF_Page_GRestore(pdf_page);
/*Normalize cllipping area - to prevent overflows*/
@@ -239,7 +241,7 @@
HPDF_REAL size;
word = (char*)malloc(sizeof(char)*(length+1));
- if(word == NULL)
+ if (word == NULL)
return false;
strncpy(word, text, length);
@@ -266,14 +268,14 @@
#ifdef PDF_DEBUG
LOG(("."));
#endif
- if(filled)
+ if (filled)
HPDF_Page_SetRGBFill(pdf_page, R(c), G(c), B(c));
else
HPDF_Page_SetRGBStroke(pdf_page, R(c), G(c), B(c));
HPDF_Page_Circle(pdf_page, x, page_height-y, radius);
- if(filled)
+ if (filled)
HPDF_Page_Fill(pdf_page);
else
HPDF_Page_Stroke(pdf_page);
@@ -290,7 +292,7 @@
/*Normalize angles*/
angle1 %= 360;
angle2 %= 360;
- if(angle1 > angle2)
+ if (angle1 > angle2)
angle1 -= 360;
HPDF_Page_SetRGBStroke(pdf_page, R(c), G(c), B(c));
@@ -313,7 +315,7 @@
image = pdf_extract_image(bitmap, content);
- if(image){
+ if (image){
HPDF_Page_DrawImage(pdf_page, image,
x, page_height-y-height,
width, height);
@@ -336,7 +338,7 @@
image = pdf_extract_image(bitmap, content);
- if(image){
+ if (image){
//The position of the next tile
HPDF_REAL current_x, current_y ;
HPDF_REAL max_width, max_height;
@@ -371,7 +373,7 @@
int img_width, img_height, img_rowstride;
int i, j;
- if(content){
+ if (content){
/*Not sure if I don't have to check if downloading has been
finished.
Other way - lock pdf plotting while fetching a website
@@ -392,7 +394,7 @@
}
}
- if(!image){
+ if (!image){
/*Handle pixmaps*/
img_buffer = bitmap_get_buffer(bitmap);
@@ -401,13 +403,13 @@
img_rowstride = bitmap_get_rowstride(bitmap);
rgb_buffer = (char*)malloc(3 * img_width * img_height);
- if(rgb_buffer == NULL){
+ if (rgb_buffer == NULL){
LOG(("Not enough memory to create RGB buffer"));
return NULL;
}
alpha_buffer = (char*)malloc(img_width * img_height);
- if(alpha_buffer == NULL){
+ if (alpha_buffer == NULL){
LOG(("Not enough memory to create alpha buffer"));
free(rgb_buffer);
return NULL;
@@ -469,10 +471,10 @@
unsigned int i;
bool empty_path = true;
- if(n == 0)
+ if (n == 0)
return true;
- if((c == TRANSPARENT) && (fill == TRANSPARENT))
+ if ((c == TRANSPARENT) && (fill == TRANSPARENT))
return true;
if (p[0] != PLOTTER_PATH_MOVE) {
@@ -490,13 +492,13 @@
transform[5] = 0;
for(i = 0 ; i<n ; ){
- if(p[i] == PLOTTER_PATH_MOVE){
+ if (p[i] == PLOTTER_PATH_MOVE){
HPDF_Page_MoveTo(pdf_page,
transform_x(transform, p[i+1], p[i+2]),
transform_y(transform, p[i+1], p[i+2]));
i+= 3;
}else if (p[i] == PLOTTER_PATH_CLOSE) {
- if(!empty_path)
+ if (!empty_path)
HPDF_Page_ClosePath(pdf_page);
i++;
} else if (p[i] == PLOTTER_PATH_LINE) {
@@ -521,13 +523,13 @@
}
}
- if(empty_path){
+ if (empty_path){
HPDF_Page_EndPath(pdf_page);
return true;
}
- if(fill!=TRANSPARENT){
- if(c!=TRANSPARENT)
+ if (fill!=TRANSPARENT){
+ if (c!=TRANSPARENT)
HPDF_Page_FillStroke(pdf_page);
else
HPDF_Page_Fill(pdf_page);
@@ -559,13 +561,19 @@
#else
pdf_doc = HPDF_New(NULL, NULL);
#endif
- if(!pdf_doc){
+ if (!pdf_doc){
LOG(("Error creating pdf_doc"));
return false;
}
HPDF_SetCompressionMode(pdf_doc, HPDF_COMP_ALL); /*Compression on*/
pdf_font = HPDF_GetFont (pdf_doc, "Times-Roman", "StandardEncoding");
+
+ if (path == NULL)
+ filename = strdup("out.pdf");
+ else
+ filename = strdup(path);
+
#ifdef PDF_DEBUG
LOG(("pdf_begin finishes"));
#endif
@@ -583,7 +591,7 @@
#endif
}
-void pdf_end(const char *path){
+void pdf_end(){
#ifdef PDF_DEBUG
LOG(("pdf_end begins"));
@@ -591,7 +599,7 @@
pdf_plot_grid(100, 100, 0xCCCCFF);
#endif
- HPDF_SaveToFile(pdf_doc, path);
+ HPDF_SaveToFile(pdf_doc, filename);
HPDF_Free(pdf_doc);
#ifdef PDF_DEBUG
Modified: branches/adamblokus/netsurf/pdf/pdf_plotters.h
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/pdf/pdf_plo...
==============================================================================
--- branches/adamblokus/netsurf/pdf/pdf_plotters.h (original)
+++ branches/adamblokus/netsurf/pdf/pdf_plotters.h Thu Jun 12 10:46:34 2008
@@ -34,6 +34,6 @@
void pdf_next_page();
/**Close pdf document and save changes to file*/
-void pdf_end(const char *);
+void pdf_end();
#endif /*NETSURF_PDF_PLOTTERS_H*/
Added: branches/adamblokus/netsurf/pdf/pdf_printer.h
URL: http://source.netsurf-browser.org/branches/adamblokus/netsurf/pdf/pdf_pri...
==============================================================================
--- branches/adamblokus/netsurf/pdf/pdf_printer.h (added)
+++ branches/adamblokus/netsurf/pdf/pdf_printer.h Thu Jun 12 10:46:34 2008
@@ -1,0 +1,32 @@
+/*
+ * Copyright 2008 Adam Blokus <adamblokus(a)gmail.com>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NETSURF_PDF_PRINTER_H
+#define NETSURF_PDF_PRINTER_H
+
+#include "desktop/printer.h"
+#include "pdf/pdf_plotters.h"
+
+struct printer pdf_printer= {
+ &pdf_plotters,
+ pdf_begin,
+ pdf_next_page,
+ pdf_end
+};
+
+#endif
15 years, 5 months
r4326 jmb - in /trunk/netsurf: ./ desktop/ gtk/ gtk/dialogs/ gtk/res/
by netsurf@semichrome.net
Author: jmb
Date: Wed Jun 11 05:57:44 2008
New Revision: 4326
URL: http://source.netsurf-browser.org?rev=4326&view=rev
Log:
Merged revisions 4114-4265,4267-4272,4275-4285,4287-4325 via svnmerge from
svn://source.netsurf-browser.org/branches/mikeL/netsurf
........
r4116 | mikeL | 2008-05-01 22:15:12 +0100 (Thu, 01 May 2008) | 2 lines
Redesigned right-click menu: added back, forward, and reload, previously default menu items are now hidden unless view->toolbars->menu bar is disabled
........
r4117 | mikeL | 2008-05-02 03:54:10 +0100 (Fri, 02 May 2008) | 2 lines
Added a Current Page button to Preferences next to the url entry for setting the home page
........
r4118 | mikeL | 2008-05-02 04:27:37 +0100 (Fri, 02 May 2008) | 1 line
Cleanup
........
r4119 | mikeL | 2008-05-02 21:09:44 +0100 (Fri, 02 May 2008) | 1 line
Preferences window is now initialized the first time edit->preferences is clicked instead of during nsgtk initialization. Expedites start-up time because preferences is a non-essential dialog.
........
r4123 | mikeL | 2008-05-04 15:43:20 +0100 (Sun, 04 May 2008) | 1 line
Converted Preferences window to a dialog. Fixed spacing and naming in Preferences dialog. Split Preferences section of the Glade file into its own gtk_options.glade file. Moved all Preferences related files to gtk/dialogs.
........
r4127 | mikeL | 2008-05-05 20:45:44 +0100 (Mon, 05 May 2008) | 1 line
Fixed a glaring error in directory structure. All glade files are now stored in the res directory.
........
r4128 | mikeL | 2008-05-05 20:52:08 +0100 (Mon, 05 May 2008) | 1 line
Added directory 'dialogs' to revision control
........
r4129 | mikeL | 2008-05-05 20:58:53 +0100 (Mon, 05 May 2008) | 1 line
Cleaned up gtk folder by removing gtk_options.c and gtk_options.h (Moved to dialogs folder)
........
r4130 | mikeL | 2008-05-05 23:42:15 +0100 (Mon, 05 May 2008) | 1 line
Huzzah\! Preferences dialog is now instant apply\!
........
r4131 | mikeL | 2008-05-06 20:43:26 +0100 (Tue, 06 May 2008) | 1 line
nsgtk_reflow_all_windows() is now called whenever an option that requires redrawing of the current page is changed. Preferences dialog is now *completely* instant apply
........
r4132 | mikeL | 2008-05-06 20:55:05 +0100 (Tue, 06 May 2008) | 1 line
Renamed macros to better reflect their purpose
........
r4133 | mikeL | 2008-05-06 21:30:44 +0100 (Tue, 06 May 2008) | 1 line
Added gtk/res/options.glade to svn control
........
r4134 | mikeL | 2008-05-06 21:39:12 +0100 (Tue, 06 May 2008) | 1 line
Preferences window is now resizable
........
r4135 | mikeL | 2008-05-06 21:42:00 +0100 (Tue, 06 May 2008) | 1 line
Fixed reload menu item in popup menu
........
r4136 | mikeL | 2008-05-07 00:24:35 +0100 (Wed, 07 May 2008) | 1 line
Proxy configurations are now insensitive if proxy type is set to no proxy. Changing the home page with the Current Page button is now saved. Moved Current Page button in Preferences window and added Default Page.
........
r4137 | mikeL | 2008-05-07 00:41:29 +0100 (Wed, 07 May 2008) | 1 line
Solved a problem with all options being saved prematurely on initialization
........
r4145 | mikeL | 2008-05-11 18:07:06 +0100 (Sun, 11 May 2008) | 1 line
Optimized prefences window signal handling, entry signals are now caught on focus-out-event and checked for changes
........
r4146 | mikeL | 2008-05-11 18:16:04 +0100 (Sun, 11 May 2008) | 1 line
Fixed regression where 'Set Current Page' button stopped working
........
r4147 | mikeL | 2008-05-11 18:32:10 +0100 (Sun, 11 May 2008) | 1 line
Added 'Default Page' button functionality
........
r4148 | mikeL | 2008-05-11 18:33:03 +0100 (Sun, 11 May 2008) | 1 line
Updated TODO list
........
r4149 | mikeL | 2008-05-12 01:04:00 +0100 (Mon, 12 May 2008) | 1 line
Added 'Hide Advertisement' functionality
........
r4150 | mikeL | 2008-05-12 01:30:40 +0100 (Mon, 12 May 2008) | 1 line
Re-activated the option 'Disable Animation' and fixed bug where it would actually enable animation
........
r4151 | mikeL | 2008-05-12 01:42:43 +0100 (Mon, 12 May 2008) | 1 line
Added 'Send site referral information' functionality
........
r4152 | mikeL | 2008-05-12 02:01:00 +0100 (Mon, 12 May 2008) | 1 line
Added 'Disc cache age' functionality
........
r4154 | mikeL | 2008-05-13 20:35:29 +0100 (Tue, 13 May 2008) | 1 line
Fixed regression where preferences were not written to file in some cases and preferences dialog could not be reopened.
........
r4158 | mikeL | 2008-05-14 21:57:50 +0100 (Wed, 14 May 2008) | 1 line
Added 'preview' button to fonts tab of preferences dialog. nsgtk_reflow_all_windows is now called only when that button is clicked.
........
r4162 | mikeL | 2008-05-15 20:09:30 +0100 (Thu, 15 May 2008) | 1 line
Possible fix to segfault due to invalid test
........
r4163 | mikeL | 2008-05-15 20:25:28 +0100 (Thu, 15 May 2008) | 1 line
Fixed typo that caused preferences dialog to be unopenable
........
r4164 | mikeL | 2008-05-15 20:57:49 +0100 (Thu, 15 May 2008) | 1 line
Added initialization statement for preferences_dialog to make sure that
........
r4169 | mikeL | 2008-05-17 00:30:54 +0100 (Sat, 17 May 2008) | 1 line
Added a 'parent_window' initialization parameter to the preferences dialog so that it may center itself on parent. This also optimizes the closing code as destroy is now called on the dialog when the main window is closed
........
r4174 | mikeL | 2008-05-18 15:46:43 +0100 (Sun, 18 May 2008) | 1 line
Animation speed option is now insensitive when 'Disable animations' is true
........
r4175 | mikeL | 2008-05-18 15:50:06 +0100 (Sun, 18 May 2008) | 1 line
Added tooltip to preview button
........
r4176 | mikeL | 2008-05-18 16:04:05 +0100 (Sun, 18 May 2008) | 1 line
Animation speed is now always sensitive
........
r4177 | mikeL | 2008-05-19 02:32:21 +0100 (Mon, 19 May 2008) | 1 line
Redesigned about dialog as a GtkAboutDialog and removed the respective section from netsurf.glade (May need string revision)
........
r4178 | mikeL | 2008-05-19 02:36:15 +0100 (Mon, 19 May 2008) | 1 line
Fixed compile warning relating to improper cast of netsurf_version
........
r4180 | mikeL | 2008-05-19 21:42:04 +0100 (Mon, 19 May 2008) | 1 line
Updated credits
........
r4181 | mikeL | 2008-05-19 21:43:16 +0100 (Mon, 19 May 2008) | 1 line
launch_url is no longer static
........
r4182 | mikeL | 2008-05-19 21:50:03 +0100 (Mon, 19 May 2008) | 1 line
netsurf_version is now const in function which addresses jmb's concern
........
r4183 | mikeL | 2008-05-19 21:59:55 +0100 (Mon, 19 May 2008) | 1 line
Updated header
........
r4184 | mikeL | 2008-05-19 22:03:28 +0100 (Mon, 19 May 2008) | 1 line
local variables are now static
........
r4186 | mikeL | 2008-05-21 22:03:43 +0100 (Wed, 21 May 2008) | 1 line
Removed 'Main Development Team' from the beginning of all credits
........
r4219 | mikeL | 2008-05-28 18:17:12 +0100 (Wed, 28 May 2008) | 1 line
Removed wndOpenFile from glade file.
........
r4236 | mikeL | 2008-05-31 23:25:32 +0100 (Sat, 31 May 2008) | 1 line
Fixed proxy options for both riscos and gtk versions thanks to a tip from Leon Stringer
........
r4275 | mikeL | 2008-06-06 17:16:29 +0100 (Fri, 06 Jun 2008) | 1 line
Added support for dragging, clicks are now emited on button release
........
r4276 | mikeL | 2008-06-06 17:18:18 +0100 (Fri, 06 Jun 2008) | 1 line
gtk_window.c now sets the current_redraw_browser. Text selection now highlights properly
........
r4277 | mikeL | 2008-06-06 17:47:35 +0100 (Fri, 06 Jun 2008) | 1 line
Cleaned up the button detection code
........
r4278 | mikeL | 2008-06-06 17:58:51 +0100 (Fri, 06 Jun 2008) | 1 line
Removed leftover variables
........
r4279 | mikeL | 2008-06-06 18:13:58 +0100 (Fri, 06 Jun 2008) | 1 line
Enabled 'Select All'
........
r4280 | mikeL | 2008-06-06 18:31:56 +0100 (Fri, 06 Jun 2008) | 1 line
Fixed bug where mouse state would always remain as PRESS even if dragging
........
r4281 | mikeL | 2008-06-06 18:45:16 +0100 (Fri, 06 Jun 2008) | 1 line
Fixed regression where mouse state was cleared improperly
........
r4287 | mikeL | 2008-06-07 00:21:32 +0100 (Sat, 07 Jun 2008) | 1 line
Mouse code can now handle modifiers. Fixed bug where end of drag was not detected until mouse moved after being released. Improved mouse handling.
........
r4294 | mikeL | 2008-06-07 03:21:03 +0100 (Sat, 07 Jun 2008) | 1 line
Added ability to handle modifiers pressed during a drag event. Mouse movement handling now uses switch statements (Thanks tlsa)
........
r4295 | mikeL | 2008-06-07 03:40:11 +0100 (Sat, 07 Jun 2008) | 1 line
Fixed bug where modifier keys were being detected incorrectly
........
r4296 | mikeL | 2008-06-07 03:42:31 +0100 (Sat, 07 Jun 2008) | 1 line
Reversed accidental file modification
........
r4299 | mikeL | 2008-06-07 21:32:15 +0100 (Sat, 07 Jun 2008) | 1 line
Fixed inclusion of gtk_about source file instead of header
........
r4300 | mikeL | 2008-06-07 22:27:39 +0100 (Sat, 07 Jun 2008) | 1 line
Fixed problem with about.h not linking properly.
........
r4301 | mikeL | 2008-06-07 22:37:28 +0100 (Sat, 07 Jun 2008) | 1 line
Moved definitions of gui_window and browser_mouse to gtk_window.h. Moved all selection related functions to gtk_selection.c. Implemented copy functionality.
........
r4302 | mikeL | 2008-06-07 22:48:18 +0100 (Sat, 07 Jun 2008) | 1 line
Implemented paste functionality
........
r4303 | mikeL | 2008-06-07 22:48:40 +0100 (Sat, 07 Jun 2008) | 1 line
Removed old test case
........
r4304 | mikeL | 2008-06-07 22:53:56 +0100 (Sat, 07 Jun 2008) | 1 line
Fixed bug where click would be sent at the end of a button 2 drag (Thanks tlsa)
........
r4305 | mikeL | 2008-06-07 23:48:01 +0100 (Sat, 07 Jun 2008) | 1 line
Prevented gui_copy_to_clipboard from overwriting clipboard with a NULL string.
........
r4306 | mikeL | 2008-06-08 00:00:55 +0100 (Sun, 08 Jun 2008) | 1 line
Fixed regression where the state of the modifier keys would alternate as the mouse moved. Fixed bug that prevented drags from being registered if a modifier key was pressed
........
r4308 | mikeL | 2008-06-08 00:53:26 +0100 (Sun, 08 Jun 2008) | 1 line
Changed 'Select All' menu item to stock
........
r4314 | mikeL | 2008-06-09 19:09:23 +0100 (Mon, 09 Jun 2008) | 1 line
Added function nsgtk_scaffolding_set_sensitive
........
r4315 | mikeL | 2008-06-09 19:14:14 +0100 (Mon, 09 Jun 2008) | 1 line
Added function nsgtk_scaffolding_set_sensitive
........
r4316 | mikeL | 2008-06-09 19:20:16 +0100 (Mon, 09 Jun 2008) | 1 line
Removed option 'Use Cairo for anti-aliased rendering'
........
r4317 | mikeL | 2008-06-09 20:10:55 +0100 (Mon, 09 Jun 2008) | 1 line
Fixed bug where text would be selected in all windows instead of only the active one
........
r4318 | mikeL | 2008-06-09 20:29:42 +0100 (Mon, 09 Jun 2008) | 1 line
(Drastically) Improved redraw handling. (Thanks jmb)
........
r4319 | mikeL | 2008-06-09 21:10:17 +0100 (Mon, 09 Jun 2008) | 1 line
Removed old test case
........
r4320 | mikeL | 2008-06-10 07:27:32 +0100 (Tue, 10 Jun 2008) | 1 line
Implemented (almost) the rest of the clipboard functionality. Clipboard functions now handle the url bar correctly. Clipboard menu items are now appropriately sensitive.
........
r4321 | mikeL | 2008-06-10 19:08:05 +0100 (Tue, 10 Jun 2008) | 1 line
Added clipboard functions to contextual right click menu
........
r4323 | mikeL | 2008-06-10 23:57:43 +0100 (Tue, 10 Jun 2008) | 1 line
Fixed regression where modifiers key states would be cleared on button release. Modifier keys are now set only on button press and can only be removed during motion or upon release. Fixed spacing (thanks tlsa)
........
Added:
trunk/netsurf/gtk/dialogs/
- copied from r4236, branches/mikeL/netsurf/gtk/dialogs/
trunk/netsurf/gtk/dialogs/gtk_about.h
- copied unchanged from r4323, branches/mikeL/netsurf/gtk/dialogs/gtk_about.h
trunk/netsurf/gtk/gtk_selection.c
- copied unchanged from r4323, branches/mikeL/netsurf/gtk/gtk_selection.c
trunk/netsurf/gtk/gtk_selection.h
- copied unchanged from r4323, branches/mikeL/netsurf/gtk/gtk_selection.h
trunk/netsurf/gtk/res/license
- copied unchanged from r4236, branches/mikeL/netsurf/gtk/res/license
trunk/netsurf/gtk/res/options.glade
- copied, changed from r4236, branches/mikeL/netsurf/gtk/res/options.glade
Removed:
trunk/netsurf/gtk/gtk_options.c
trunk/netsurf/gtk/gtk_options.h
Modified:
trunk/netsurf/ (props changed)
trunk/netsurf/Makefile.sources
trunk/netsurf/desktop/options.c
trunk/netsurf/desktop/selection.c
trunk/netsurf/gtk/dialogs/gtk_about.c
trunk/netsurf/gtk/dialogs/gtk_options.c
trunk/netsurf/gtk/gtk_gui.c
trunk/netsurf/gtk/gtk_gui.h
trunk/netsurf/gtk/gtk_scaffolding.c
trunk/netsurf/gtk/gtk_window.c
trunk/netsurf/gtk/gtk_window.h
trunk/netsurf/gtk/res/netsurf.glade
[This mail would be too long, it was shortened to contain the URLs only.]
Modified: trunk/netsurf/Makefile.sources
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.sources?rev=4326...
Modified: trunk/netsurf/desktop/options.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/options.c?rev=432...
Modified: trunk/netsurf/desktop/selection.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/selection.c?rev=4...
Modified: trunk/netsurf/gtk/dialogs/gtk_about.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/dialogs/gtk_about.c?r...
Modified: trunk/netsurf/gtk/dialogs/gtk_options.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/dialogs/gtk_options.c...
Modified: trunk/netsurf/gtk/gtk_gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_gui.c?rev=4326&r1...
Modified: trunk/netsurf/gtk/gtk_gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_gui.h?rev=4326&r1...
Removed: trunk/netsurf/gtk/gtk_options.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_options.c?rev=432...
Removed: trunk/netsurf/gtk/gtk_options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_options.h?rev=432...
Modified: trunk/netsurf/gtk/gtk_scaffolding.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_scaffolding.c?rev...
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_window.c?rev=4326...
Modified: trunk/netsurf/gtk/gtk_window.h
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_window.h?rev=4326...
Modified: trunk/netsurf/gtk/res/netsurf.glade
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/res/netsurf.glade?rev...
Copied: trunk/netsurf/gtk/res/options.glade (from r4236, branches/mikeL/netsurf/gtk/res/options.glade)
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/res/options.glade?p2=...
15 years, 5 months
r4325 jmb - /trunk/netsurf/
by netsurf@semichrome.net
Author: jmb
Date: Wed Jun 11 05:54:22 2008
New Revision: 4325
URL: http://source.netsurf-browser.org?rev=4325&view=rev
Log:
Blocked revisions 4273-4274,4286 via svnmerge
........
r4273 | mikeL | 2008-06-06 17:08:17 +0100 (Fri, 06 Jun 2008) | 1 line
Merged core patch which adds extra mouse states
........
r4274 | mikeL | 2008-06-06 17:15:05 +0100 (Fri, 06 Jun 2008) | 1 line
Added case to test if box->parent exists to avoid crash on selection
........
r4286 | mikeL | 2008-06-06 23:15:00 +0100 (Fri, 06 Jun 2008) | 1 line
Patched from trunk: scrollbars now respond on HOLDING
........
Modified:
trunk/netsurf/ (props changed)
Propchange: trunk/netsurf/
------------------------------------------------------------------------------
svnmerge-blocked = /branches/mikeL/netsurf:4273-4274,4286
15 years, 5 months
r4323 mikeL - /branches/mikeL/netsurf/gtk/gtk_window.c
by netsurf@semichrome.net
Author: mikeL
Date: Tue Jun 10 17:57:43 2008
New Revision: 4323
URL: http://source.netsurf-browser.org?rev=4323&view=rev
Log:
Fixed regression where modifiers key states would be cleared on button release. Modifier keys are now set only on button press and can only be removed during motion or upon release. Fixed spacing (thanks tlsa)
Modified:
branches/mikeL/netsurf/gtk/gtk_window.c
Modified: branches/mikeL/netsurf/gtk/gtk_window.c
URL: http://source.netsurf-browser.org/branches/mikeL/netsurf/gtk/gtk_window.c...
==============================================================================
--- branches/mikeL/netsurf/gtk/gtk_window.c (original)
+++ branches/mikeL/netsurf/gtk/gtk_window.c Tue Jun 10 17:57:43 2008
@@ -327,29 +327,25 @@
bool shift = event->state & GDK_SHIFT_MASK;
bool ctrl = event->state & GDK_CONTROL_MASK;
- if (g->mouse->state & BROWSER_MOUSE_PRESS_1){
- /* Start button 1 drag */
- browser_window_mouse_click(g->bw, BROWSER_MOUSE_DRAG_1,
- event->x / g->bw->scale,
- event->y / g->bw->scale);
- /* Button 1 drag in progress */
- g->mouse->state = BROWSER_MOUSE_HOLDING_1;
- g->mouse->state |= BROWSER_MOUSE_DRAG_ON;
-
- if (shift) g->mouse->state |= BROWSER_MOUSE_MOD_1;
- if (ctrl) g->mouse->state |= BROWSER_MOUSE_MOD_2;
+ if (g->mouse->state & BROWSER_MOUSE_PRESS_1){
+ /* Start button 1 drag */
+ browser_window_mouse_click(g->bw, BROWSER_MOUSE_DRAG_1,
+ event->x / g->bw->scale,
+ event->y / g->bw->scale);
+ /* Replace PRESS with HOLDING and declare drag in progress */
+ g->mouse->state ^= (BROWSER_MOUSE_PRESS_1 |
+ BROWSER_MOUSE_HOLDING_1);
+ g->mouse->state |= BROWSER_MOUSE_DRAG_ON;
}
else if (g->mouse->state & BROWSER_MOUSE_PRESS_2){
- /* Start button 2 drag */
- browser_window_mouse_click(g->bw, BROWSER_MOUSE_DRAG_2,
- event->x / g->bw->scale,
- event->y / g->bw->scale);
- /* Button 2 drag in progress */
- g->mouse->state = BROWSER_MOUSE_HOLDING_2;
- g->mouse->state |= BROWSER_MOUSE_DRAG_ON;
-
- if (shift) g->mouse->state |= BROWSER_MOUSE_MOD_1;
- if (ctrl) g->mouse->state |= BROWSER_MOUSE_MOD_2;
+ /* Start button 2 drag */
+ browser_window_mouse_click(g->bw, BROWSER_MOUSE_DRAG_2,
+ event->x / g->bw->scale,
+ event->y / g->bw->scale);
+ /* Replace PRESS with HOLDING and declare drag in progress */
+ g->mouse->state ^= (BROWSER_MOUSE_PRESS_2 |
+ BROWSER_MOUSE_HOLDING_2);
+ g->mouse->state |= BROWSER_MOUSE_DRAG_ON;
}
/* Handle modifiers being removed */
if (g->mouse->state & BROWSER_MOUSE_MOD_1 && !shift)
@@ -357,8 +353,8 @@
if (g->mouse->state & BROWSER_MOUSE_MOD_2 && !ctrl)
g->mouse->state ^= BROWSER_MOUSE_MOD_2;
- browser_window_mouse_track(g->bw, g->mouse->state, event->x / g->bw->scale,
- event->y / g->bw->scale);
+ browser_window_mouse_track(g->bw, g->mouse->state,
+ event->x / g->bw->scale, event->y / g->bw->scale);
g->last_x = event->x;
g->last_y = event->y;
@@ -381,8 +377,10 @@
case 2: g->mouse->state = BROWSER_MOUSE_PRESS_2; break;
}
/* Handle the modifiers too */
- if (event->state & GDK_SHIFT_MASK) g->mouse->state |= BROWSER_MOUSE_MOD_1;
- if (event->state & GDK_CONTROL_MASK) g->mouse->state |= BROWSER_MOUSE_MOD_2;
+ if (event->state & GDK_SHIFT_MASK)
+ g->mouse->state |= BROWSER_MOUSE_MOD_1;
+ if (event->state & GDK_CONTROL_MASK)
+ g->mouse->state |= BROWSER_MOUSE_MOD_2;
browser_window_mouse_click(g->bw, g->mouse->state, event->x / g->bw->scale,
event->y / g->bw->scale);
@@ -393,14 +391,22 @@
{
int button;
struct gui_window *g = data;
+ bool shift = event->state & GDK_SHIFT_MASK;
+ bool ctrl = event->state & GDK_CONTROL_MASK;
/* If the mouse state is PRESS then we are waiting for a release to emit
* a click event, otherwise just reset the state to nothing*/
if (g->mouse->state & BROWSER_MOUSE_PRESS_1)
- g->mouse->state = BROWSER_MOUSE_CLICK_1;
+ g->mouse->state ^= (BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_CLICK_1);
else if (g->mouse->state & BROWSER_MOUSE_PRESS_2)
- g->mouse->state = BROWSER_MOUSE_CLICK_2;
-
+ g->mouse->state ^= (BROWSER_MOUSE_PRESS_2 | BROWSER_MOUSE_CLICK_2);
+
+ /* Handle modifiers being removed */
+ if (g->mouse->state & BROWSER_MOUSE_MOD_1 && !shift)
+ g->mouse->state ^= BROWSER_MOUSE_MOD_1;
+ if (g->mouse->state & BROWSER_MOUSE_MOD_2 && !ctrl)
+ g->mouse->state ^= BROWSER_MOUSE_MOD_2;
+
if (g->mouse->state & (BROWSER_MOUSE_CLICK_1|BROWSER_MOUSE_CLICK_2))
browser_window_mouse_click(g->bw, g->mouse->state, event->x / g->bw->scale,
event->y / g->bw->scale);
15 years, 5 months