Commit Graph

11495 Commits

Author SHA1 Message Date
Vincent Sanders
7736a611a2 Improve gtk scaffolding documentation 2015-06-30 15:39:00 +01:00
Vincent Sanders
55260cc9a0 Ensure gtk windows have a default favicon at creation.
This ensures newly created gtk gui windows have a default favicon
set. This is necessary because new tab creation displays the new
windows contents before an icon has been set and the icon will not be
changed from the previously viewed tabs icon.
2015-06-30 12:09:45 +01:00
Vincent Sanders
65ef60d2b5 Fix missing unistd includes to allow building with older headers 2015-06-29 17:07:49 +01:00
Vincent Sanders
b208c60ddd Add missing include to gtk scaffolding
Without unistd access, close and unlink were not properly defined
2015-06-29 16:14:34 +01:00
Vincent Sanders
1c5a5207fb fix glib resource API usage even when gresource was disabled 2015-06-29 15:48:08 +01:00
Vincent Sanders
796ac470b5 Improve resource code to not try and use g_resource calls when disabled. 2015-06-29 15:11:26 +01:00
Vincent Sanders
822e3a8fd0 Allow gtk preferences language selection resource to be inline
This allows the languages resource to be read from file or from inline
data. Additionally it fixes a bug where the language combo box would
always be reset to en as the default regardless of what was currently
configured.
2015-06-25 23:46:35 +01:00
Vincent Sanders
73e45ff024 Fix error reporting from fetch_start
Any fetch start error was being reported as "out of memory" which was
clearly insufficient. Foe example bad urls (reported was file:// with
a missing /) were causing a warn_user with out of memory. This change
now at least causes a "bad url" message.
2015-06-24 10:31:13 +01:00
Vincent Sanders
5bd7606103 Update GTK url bar completion to navigate on selection 2015-06-23 23:22:42 +01:00
Vincent Sanders
ee74f9ac8c Change gtk message and language handling to use resource names
The GTK resource handling can now provide the path to resources rather
than having to compute them separately. This reduces run time
allocation and allows for the resources to be built in if required.

Additionally this tweaks the resource scheme handling to redirect
favicon.ico to resource:favicon.png instead of rewriting directly to
file scheme path allowing the favicon to be a compiled in resource.
2015-06-23 11:53:41 +01:00
Vincent Sanders
11dc7304d9 Allow GTK to include inline resources for default css 2015-06-22 21:03:00 +01:00
Vincent Sanders
3160f9fd89 fix unused variable warning in framebuffer Message loading 2015-06-22 20:56:36 +01:00
Chris Young
354de433e9 Scale cached favicons before they are cached. This avoids the need to scale icons on menu creation. 2015-06-22 19:12:57 +01:00
Chris Young
73d6b47e6a Remove the overwrite check in bitmap_save as it causes duplicate overwrite requesters. 2015-06-22 18:26:18 +01:00
Chris Young
2522ecf714 Add an appropriate file extension when saving, or leave the existing if we're saving source. This fixes the remainder of #2185 2015-06-22 18:25:08 +01:00
Michael Drake
83f77d3a41 Don't need gtkdefault.css now. 2015-06-22 14:24:51 +01:00
Michael Drake
51a92fbd84 Consolidate default style. 2015-06-22 14:17:02 +01:00
Vincent Sanders
c08bccbcea fixup missing lincludes from messages API update 2015-06-22 10:42:01 +01:00
Vincent Sanders
a94ae7a80a Allow translation messages to be compiled in as GTK resources 2015-06-21 23:27:22 +01:00
Vincent Sanders
67ded2a02a This moves message loading out of netsurf_init into each frontend
The translated message loading is dependant on configuration of
resource location in each frontend, additionally they should have the
ability to deal with errors in this loading in a implementation
specific manner.

This also extends the message loading API to be capable of loading
from an inline memory buffer instead of from a file.
2015-06-21 23:27:22 +01:00
Vincent Sanders
335bbe4f52 Move the browser identification and machine info logging.
Previously this information was logged when netsurf_init was called
which might be many lines out output into the log.

It is useful to have this information at the beginning of the log to
make it easily found. In addition it makes netsurf_init less complex.
2015-06-21 23:27:21 +01:00
Vincent Sanders
9ccf0cee9f Change GTK resource path to use the users netsurf directory
This changes the path used to find resources from containg a hard
coded ${HOME}/.netsurf to using the computed path to the users netsurf
config.
2015-06-21 23:27:21 +01:00
Vincent Sanders
010306e1ad Clean up doxygen errors in image handlers. 2015-06-21 23:27:21 +01:00
Chris Young
fcadb1f6f8 Space ARexx menu items correctly. 2015-06-21 19:24:46 +01:00
Chris Young
451b021c36 Fix the capitalisation of "New tab" to matach "New window" etc. 2015-06-21 18:54:52 +01:00
Chris Young
57ca8bbd21 Require gadtools 53.7
OS4.1u6 does not cope well with image menus, so insist on a component in FE to ensure the layouting is sane and menu creation is fast.
2015-06-20 18:09:44 +01:00
Vincent Sanders
fbbb6d664d Stop unused variable warning when no core image handlers are enabled. 2015-06-18 10:26:24 +01:00
Vincent Sanders
8aa04c2447 Fix cocoa_bitmap_modified scope error introduced in cleanup 2015-06-18 10:12:11 +01:00
Vincent Sanders
9c6b3e8c32 Fix several warnings in cocoa frontend 2015-06-18 10:07:46 +01:00
Vincent Sanders
e1bbe4528b Add direct resources to GTK
This adds API to obtain direct pointers to arrays of data from
compiled in resources. Additionally it hooks this up to provide data
for the resourece scheme handler.
2015-06-17 21:35:45 +01:00
Vincent Sanders
e9b89f776d Allow the resource scheme to provide data directly.
This allows front ends to provide resources from compiled in data
instead of requiring the resources to be available on disc and forcing
a redirect.
2015-06-17 21:35:40 +01:00
Vincent Sanders
be7a45fefe Change gtk to use resource API for throbber 2015-06-17 21:35:40 +01:00
Vincent Sanders
3e2270482f Make GTK resource handling configurable
This makes the GTK resource handling configurable in the same way as
all other pkg-config style feature options.

It is now possible to completely disable compiled in resources if
wanted as well as forcing inline pixdata on if desired.
2015-06-17 21:35:40 +01:00
Vincent Sanders
59fbd51a77 Add legacy support for inline pixbuf usage
Before GResource it was possible to compile pixbufs as inline
elements. This has historically been done for the menu cursor
only.

This change integrates the inline support and uses it when the
GResource support is not selected.
2015-06-17 21:35:40 +01:00
Vincent Sanders
61fdc8fd6f update default gtk window icon source to use resources 2015-06-17 21:35:40 +01:00
Vincent Sanders
8ef292b9ca Change GTK UI builder handling to use resource API
GTK UI builder resources have till now been exclusively stored on disc
requiring netsurf to ship numerous additional resource files. This
requires going to disc every time a UI action is performed which can
become a lot of unwanted file handling.

GLib/GTK has moved towards GResource handling for such resources
instead. It now seems that migrating to this style of usage is
expected and indeed the only portable way to include pixbufs.

This introduces an API to hide the various implementation details of
how resources are handled from the rest of the codebase.
2015-06-17 21:35:40 +01:00
Vincent Sanders
16fbb97dbb Add links to dutch resources for gtk frontend 2015-06-17 21:35:40 +01:00
Chris Young
3db1e7381a Prettify pull-down (not context) menu. 2015-06-16 19:36:09 +01:00
Chris Young
d8ce401591 Remove some workarounds to make image menus conform better on OS4.1u6. They never quite matched normal menus so are going to look odd when we add more images anyway. 2015-06-16 18:44:52 +01:00
Vincent Sanders
c4d5393a97 move gtk menu cursor creation into separate resourec handling module
The gtk resource handling must be changed for GTK3 as creating from
inline is depricated. This is the first step to splitting out the
support.
2015-06-04 22:43:11 +01:00
Daniel Silverstone
c8ae744680 Only iterate the form when freeing a control if there is one.
This fixes Bug#2322
2015-06-03 20:24:32 +01:00
Dick Tanis
b62fad759a Updated Dutch messages for NetSurf 2015-06-02 13:42:14 +01:00
Vincent Sanders
51c5f7f142 Set the default cache size on RISC OS to zero (off) 2015-06-01 11:52:41 +01:00
Vincent Sanders
25d7f0c657 use logfile as variable name as cocoa gives an error about the symbol type of logf 2015-05-29 16:32:12 +01:00
Vincent Sanders
faf9b9d919 Improve logging interface to reduce overhead
This reduces logging overhead by only calling the log output function
once instead of three times.

Additionally the nslog_gettime interface no longer needs to be
exported and the static function is directly inlined further reducing
function call overhead.

Finally the appending of a newline uses fputc instead of a full printf
call which is considerably more simple and further reduces overhead
time.
2015-05-29 16:18:18 +01:00
Vincent Sanders
4324bf535f Allow verbose logging to be directed to a file 2015-05-29 16:14:42 +01:00
Vincent Sanders
20d29c0537 fixup logging macros that incorrectly override the LOG() macro name 2015-05-28 17:33:18 +01:00
Vincent Sanders
0d811963c1 fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to
reason about callsites which have now been manually cleaned up
2015-05-28 17:06:18 +01:00
Vincent Sanders
30c2962faa Fixup javascript logging to cope with new varadic LOG macro 2015-05-28 16:33:30 +01:00
Vincent Sanders
c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00