[links] Links

yann.souro_sanou at iwedia.com yann.souro_sanou at iwedia.com
Fri Jul 27 07:21:30 MDT 2007


Karel Kulhavy a écrit :
> On Thu, Jul 26, 2007 at 01:35:54PM -0700, Dave Stuart wrote:
>   
>> Hello-
>>
>> I have a webpage that uses fixed image placement with the 'style' option.
>> The links browser doesn't seem to support this.  Or am I doing something
>> wrong?
>>     
>
> This is because Links doesn't support CSS.
>
>   
>> Are there any plans to add this functionality?  Has anything been started?  I
>>     
>
> Unfortunately no plans.
>
>   
>> would be more than happy to work on adding this option if I could be pointed
>> to a starting point.
>>     
>
> It would be a lot of work to add CSS into Links.
>
> CL<
>   
>> You can see an example of the webpage here:
>>
>> http://justdave.us/mcams.html
>>
>> thanks
>>
>> dave
>>
>>
>>     
> _______________________________________________
> links-list mailing list
> links-list at linuxfromscratch.org
> http://linuxfromscratch.org/mailman/listinfo/links-list
>
>   
Hi,
I am working on svg rendering support for Links and I was also 
considering CSS style and placement.
Indeed, as it is explained in another thread, I would like to display 
some links wherever I want on the screen. It has been one week now that 
I am working on it, and I only have a few results.
What I find difficult, is to understand how does the graphical rendering 
system work, and how are stored the data (trees like DOM).

If you want to add styles to a few tags, then I think, it is possible to 
modify the rendering system, as soon as you understand how it works.

I used the following steps to display links style in my project. It is 
not clean code, and only some part does work. You'll have to adapt it 
and/or modify it:
1. Add *int positionX, *and* int positionY* in *struct text_attrib {} 
*and in *struc link {}* in file links.h
2. In the end of the function *void html_a(...) *in /html.c/, I added:
/
char * style;
int X=0, Y=0;
if(style = get_attr_val(a, "style")){
getDimensionsFromStyle(style, &X ,&Y);
mem_free(style);
if (X && Y){
format.positionX = X;
format.positionY = Y;
}
}
/...........................
/getDimensionsFromStyle/ is a function I made to parse the elements in 
the style feature. It provides the X and Y position we need.
When you have done these two steps, you are able to read the coordinates 
of a html link. As far as i understand it, (and I only understand a 
little), you have to use the right function to display it on screen.

I noticed that many functions called *draw_text, draw_line, draw...* 
were available in /view_gr.c/ file. If you can use a debugger (it is 
very hard to use one under directfb), you'll notice, that :
- /draw_graphical_doc/ calls /g_area_draw
- //g_area_draw /calls /g_line_draw
- //g_line_draw /calls /g_text_draw/ (which is the one I am very 
interrested in).
All these functions pass parameters which seems like / are coordinates, 
but I still don't understand their structures, and the way they work.

I am keeping on trying to find a solution to display my links on the 
right position.
Just let me know if you understand the code better than I do, or if you 
have a clue.

Best regard.




More information about the links-list mailing list