Monday, 27 September 2021

Re: border values in libcss.

Hi,

On 25/09/2021 17:36, Rupesh gautam wrote:

> Does libcss support "border" ?
>
> div {
> width: 300px;
> * border: 10px solid #00FF00*
> padding: 50px;
> margin: 9px;
> }

Yes, that should work. You'll need a `;` before `margin`.


You will also need a non-zero device DPI in the css_unit_ctx:

http://git.netsurf-browser.org/libcss.git/tree/include/libcss/unit.h#n61


Best regards,


--
Michael Drake https://www.codethink.co.uk/
_______________________________________________
netsurf-dev mailing list -- netsurf-dev@netsurf-browser.org
To unsubscribe send an email to netsurf-dev-leave@netsurf-browser.org

Saturday, 25 September 2021

Re: border values in libcss.

Hi,

Please ignore my previous email. i got it working.

Thanks.

On Sat, Sep 25, 2021 at 10:48 PM Rupesh gautam <rupesh.gautam@gmail.com> wrote:
Hi,

corrected typo in previous email.

Does libcss support "border" ?

div {
    width: 300px;
    border: 10px solid #00FF00
    padding: 50px;
    margin: 9px;
}

I am trying to get the value using all available functions related to border computation but each function is returning 0.

i tried css_computed_border_left_width but it is returning 0. css_computed_border_left_width  appears to be wrong function for getting values from border: 10px solid #00FF00

Regards,
Rupesh

On Sat, Sep 25, 2021 at 10:06 PM Rupesh gautam <rupesh.gautam@gmail.com> wrote:
Hi,

Does libcss support "border" ?

div {
    width: 300px;
    border: 10px solid #00FF00
    padding: 50px;
    margin: 9px;
}

I am trying to get the value using all available functions related to margin computation but each function is returning 0.

i tried css_computed_border_left_width but it is returning 0. css_computed_border_left_width  appears to be wrong function for getting values from border: 10px solid #00FF00

Regards,
Rupesh

Re: border values in libcss.

Hi,

corrected typo in previous email.

Does libcss support "border" ?

div {
    width: 300px;
    border: 10px solid #00FF00
    padding: 50px;
    margin: 9px;
}

I am trying to get the value using all available functions related to border computation but each function is returning 0.

i tried css_computed_border_left_width but it is returning 0. css_computed_border_left_width  appears to be wrong function for getting values from border: 10px solid #00FF00

Regards,
Rupesh

On Sat, Sep 25, 2021 at 10:06 PM Rupesh gautam <rupesh.gautam@gmail.com> wrote:
Hi,

Does libcss support "border" ?

div {
    width: 300px;
    border: 10px solid #00FF00
    padding: 50px;
    margin: 9px;
}

I am trying to get the value using all available functions related to margin computation but each function is returning 0.

i tried css_computed_border_left_width but it is returning 0. css_computed_border_left_width  appears to be wrong function for getting values from border: 10px solid #00FF00

Regards,
Rupesh

border values in libcss.

Hi,

Does libcss support "border" ?

div {
    width: 300px;
    border: 10px solid #00FF00
    padding: 50px;
    margin: 9px;
}

I am trying to get the value using all available functions related to margin computation but each function is returning 0.

i tried css_computed_border_left_width but it is returning 0. css_computed_border_left_width  appears to be wrong function for getting values from border: 10px solid #00FF00

Regards,
Rupesh

Wednesday, 22 September 2021

[gccsdk] Patch to add public getters and setters for __riscosify_control

Index: recipe/files/gcc/libunixlib/incl-local/internal/local.h
===================================================================
--- recipe/files/gcc/libunixlib/incl-local/internal/local.h (revision 7569)
+++ recipe/files/gcc/libunixlib/incl-local/internal/local.h (working copy)
@@ -110,15 +110,6 @@

extern const char __filename_char_map[256];

-/* Gets the __riscosify_control value which can be defined by
- the global variable __riscosify_control in the user program.
- Returns a copy of __riscosify_control_internal (with a default
- value of 0) when __riscosify_control is not defined. */
-extern int __get_riscosify_control (void);
-/* Sets the __riscosify_control value when it's defined.
- Otherwise __riscosify_control_internal gets written. */
-extern void __set_riscosify_control (int __riscosify_flags);
-
/* Get an object's filetype, object type, etc and do some common checks.
Returns nonzero and sets errno on error. Returns riscosified filename
in __buffer. __objtype, __ftype and __attr may be NULL if not needed. */
Index: recipe/files/gcc/libunixlib/include/unixlib/local.h
===================================================================
--- recipe/files/gcc/libunixlib/include/unixlib/local.h (revision 7569)
+++ recipe/files/gcc/libunixlib/include/unixlib/local.h (working copy)
@@ -32,6 +32,16 @@

extern int __riscosify_control; /* Note: this is a weak symbol. */

+/* Gets the __riscosify_control value which can be defined by
+ the global variable __riscosify_control in the user program.
+ Returns a copy of __riscosify_control_internal (with a default
+ value of 0) when __riscosify_control is not defined. */
+extern int __get_riscosify_control (void);
+
+/* Sets the __riscosify_control value when it's defined.
+ Otherwise __riscosify_control_internal gets written. */
+extern void __set_riscosify_control (int __riscosify_flags);
+
/* Bits 1 - 5 (incl), 7 and 15 - 31 (incl) of __riscosify_control are not
allocated. */

Hi

This patch adds __get_riscosify_control() and __set_riscosify_control() to unixlib/local.h. It's useful for checking the state of __riscosify_control in library code without requiring it to be provided in the main application code.

Regards
Cameron

[PATCH] window: add url_filter field

This allows a frontend to filter the URLs which the browser will
navigate to.
---
desktop/browser_window.c | 3 +++
include/netsurf/window.h | 12 ++++++++++++
2 files changed, 15 insertions(+)

diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 7b553f4e0..522772bbc 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -3313,6 +3313,9 @@ browser_window_navigate(struct browser_window *bw,
assert(bw);
assert(url);

+ if (guit->window->url_filter) {
+ url = guit->window->url_filter(bw->window, url);
+ }
NSLOG(netsurf, INFO, "bw %p, url %s", bw, nsurl_access(url));

/*
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index 16fd95e30..8ebbfee92 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -376,6 +376,18 @@ struct gui_window_table {
const char *msg,
size_t msglen,
browser_window_console_flags flags);
+
+ /**
+ * Filter URLs for navigation. Return the same nsurl if no filtering is
+ * desired, or leave this table field NULL. The browser will reference
+ * the returned URL.
+ *
+ * \param gw The gui window which is navigating to a URL
+ * \param url The URL being navigated to
+ * \return The same URL, or another URL to load instead.
+ */
+ struct nsurl *(*url_filter)(struct gui_window *gw,
+ struct nsurl *url);
};

Monday, 20 September 2021

Re: [gccsdk] Updates to the libsdl1.2debian package

Hi

Adding to the previous email, I would also like to upstream the final remaining patch to allow SDL to be easily built separately from the autobuilder. I've prepared a commit that switches to using GAS syntax and allows disabling the assembler code for compatibility with older toolchains, and if there are no objections I'll submit it upstream and the relevant patch can be dropped from the autobuilder.


Regards
Cameron

On Mon, 6 Sept 2021 at 21:54, Cameron Cawley <ccawley2011@gmail.com> wrote:
Hi

Attached is a patch that switches SDL 1.2 to building from Git instead of Mercurial, and removes some additional files that are no longer used.

Regards
Cameron

Re: libcss actual values

On Mon, Sep 20, 2021 at 12:47:17PM +0530, Rupesh gautam wrote:
> Hi,
>
> I was trying out libcss and found that the following code snippet returns
> value multiplied by 1024.
>
> *css_unit unit;*
>
> *css_fixed val;css_computed_margin_top(styles[0], &val, &unit);std::cout <<
> val << std::endl;*

css_fixed is libcss's fixed point type: it is not an integer. You can
see the functions and macros available to manipulate and convert them in
fpmath.h:

http://git.netsurf-browser.org/libcss.git/tree/include/libcss/fpmath.h

B.
_______________________________________________
netsurf-dev mailing list -- netsurf-dev@netsurf-browser.org
To unsubscribe send an email to netsurf-dev-leave@netsurf-browser.org

libcss actual values

Hi,

I was trying out libcss and found that the following code snippet returns value multiplied by 1024.

css_unit unit;
css_fixed val;
css_computed_margin_top(styles[0], &val, &unit);
std::cout << val << std::endl;


For example: if my margin is set to 2px, returned Val would be 2048.

Is there a function that can return actual values (Not bit-shifted values)?

if not, then could you please confirm that all CSS values are left-shifted by 10 bits. in that case, I can right shift for all the values. 

Regards


Monday, 6 September 2021

[gccsdk] Updates to the libsdl1.2debian package

Index: libraries/sdl/libsdl1.2debian/depends
===================================================================
--- libraries/sdl/libsdl1.2debian/depends (revision 7579)
+++ libraries/sdl/libsdl1.2debian/depends (nonexistent)
@@ -1,4 +0,0 @@
-libjpeg8
-libtiff5
-libpng16-16
-zlib1g
Index: libraries/sdl/libsdl1.2debian/preprocess
===================================================================
--- libraries/sdl/libsdl1.2debian/preprocess (revision 7579)
+++ libraries/sdl/libsdl1.2debian/preprocess (nonexistent)
@@ -1,3 +0,0 @@
-# Apply pending RISC OS patches from the SDL bugzilla
-# (no patches currently pending)
-#hg import https://bugzilla-attachments.libsdl.org/attachment.cgi?id=3561 # https://bugzilla.libsdl.org/show_bug.cgi?id=4448
Index: libraries/sdl/libsdl1.2debian/setvars
===================================================================
--- libraries/sdl/libsdl1.2debian/setvars (revision 7579)
+++ libraries/sdl/libsdl1.2debian/setvars (working copy)
@@ -1,10 +1,9 @@
-AB_HG=https://hg.libsdl.org/SDL/
-AB_HG_BRANCH=SDL-1.2
+AB_GIT=https://github.com/libsdl-org/SDL-1.2.git

AB_PVERSION=1.2.16
AB_ROVERSION=1
AB_LICENCE=Free

-AB_INSTALLDOCS="COPYING README README.RISCOS README-SDL.txt WhatsNew"
+AB_INSTALLDOCS="COPYING README.md README.RISCOS README-SDL.txt WhatsNew"
AB_SHORTDESC="Allows programs portable low level access to a video, audio, mouse, and keyboard"

# AB_INSTALL=yes
Hi

Attached is a patch that switches SDL 1.2 to building from Git instead of Mercurial, and removes some additional files that are no longer used.

Regards
Cameron

[PATCH] docs/implementing-new-frontend.md: scheduler tips

This adds a few details which I would have found welcome while working
on my frontend scheduler.
---
docs/implementing-new-frontend.md | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/docs/implementing-new-frontend.md b/docs/implementing-new-frontend.md
index 4bda47af0..76d73e94b 100644
--- a/docs/implementing-new-frontend.md
+++ b/docs/implementing-new-frontend.md
@@ -126,11 +126,26 @@ The only mandantory operation in this table is schedule.

When schedule is called the frontend must arrange for the passed
callback to be called with the context parameter after a number of
-miliseconds.
+miliseconds. All combinations of callback & context are only to be
+scheduled once, the scheduler should remove any existing callbacks
+for a given tuple before scheduling anew. The scheduler will be
+called with a timeout less than zero to have any previously
+scheduled callbacks removed.

This callback is typicaly driven through the toolkits event loop and
it is important such callbacks are not attempted from an operation.

+There are some important factors to consider for your event loop:
+
+- When a callback is due, you must remove it from your schedule
+ *before* calling it.
+- You should run pending callbacks before calling `fetch_fdset`
+ (which is something you should call, by the way).
+
+Failure to uphold these criteria will unleash eldritch horrors upon
+your frontend and waste your entire morning trying to figure out
+bizzare race conditions.
+
### window operation table

The window operations (poorly named as already mentioned) are where
--
2.33.0
_______________________________________________
netsurf-dev mailing list -- netsurf-dev@netsurf-browser.org
To unsubscribe send an email to netsurf-dev-leave@netsurf-browser.org