<sriram_>
it gives it mk.svg as a parameter (but for what purpose)
<Regenaxer>
T
<Regenaxer>
tankf33der, right, so it seems a lock problem
<Regenaxer>
(dbSync)
<Regenaxer>
'lock' or 'dbSync' are not covered by the unit tests
<sriram_>
as far as i can see, csDrawImage sets the src of the canvas to be (sesId (pack "!mk.svg?" (ht:Fmt This (: cnt)))
<Regenaxer>
yes, the Img soure argument
<Regenaxer>
So you are right
<sriram_>
right in what way?
<Regenaxer>
At the bottom the canvas is filled with an image generated by SVG
<Regenaxer>
Now I remember
<Regenaxer>
This is necessary
<sriram_>
at the bottom?
<Regenaxer>
all drawing must be done in the same way
<Regenaxer>
bottom of the code
<Regenaxer>
all drawing must be done with exactly the same method
<tankf33der>
Regenaxer: archlinux works, maybe centos problem
<Regenaxer>
otherwise we don't get WYSIWYG
<Regenaxer>
tankf33der, ok
<Regenaxer>
you could test manually with 'ctl'
orivej has quit [Ping timeout: 240 seconds]
<Regenaxer>
In one terminal (ctl "file" (key))
<Regenaxer>
And in a second one also
<Regenaxer>
or just (ctl "file") in the second
<Regenaxer>
second will hang until you type any key in the first
<sriram_>
drawPage calls csDrawImage with two parameters (more than two but I am puzzled about these 2).
<sriram_>
Param 1: (sesId (pack "!mk.svg?" (ht:Fmt This (: cnt)))
<sriram_>
Param2 : a list of drawing commands
<sriram_>
drawPage sets param 1 to image src
<sriram_>
and calls renderCanvas on the second parameter
<Regenaxer>
T
<sriram_>
no svg is used in the rendercanvas, they are just commands like csDrawRect etc
<Regenaxer>
drawPage calls csDrawImage with 4 params
<Regenaxer>
with Img X Y and Lst
andyjpb has joined #picolisp
andyjpb has quit [Client Quit]
<sriram_>
yes, i did not mention X and Y
<sriram_>
or even dX and dY
<Regenaxer>
yes, but omitted here
<sriram_>
correct
<sriram_>
i am puzzled by how the src argument works....and why svg> is needed when renderCanvas already drew the canvas
<Regenaxer>
The browser fetches the image from the server
<sriram_>
ah so a dynamic url is created and stored
<sriram_>
for that session
<Regenaxer>
yes
<Regenaxer>
Where did you find renderCanvas?
rob_w has quit [Remote host closed the connection]
<Regenaxer>
ah
<Regenaxer>
in .js, yes
<sriram_>
if (cmd[4]) renderCanvas(cvs, cmd[4]);
<sriram_>
yes
<Regenaxer>
T
<sriram_>
thats what puzzling me ...the whole "framework"... the rendercanvas draws the list and also constructs an url
<sriram_>
is the canvas updated immediately then?
<Regenaxer>
yes, because drawPage is called by draw>
<Regenaxer>
which is called by drawCanvas which triggers itself
<Regenaxer>
either periodically or when needed
<sriram_>
ok...so the canvas is drawn by rendercanvas and a url is stored in the canvas image src field. so now if i click on the canvas, that url is invoked?
<Regenaxer>
It is invoked whenever the browser needs to refresh the view
<Regenaxer>
so also upon mouse clicks, yes
<Regenaxer>
# Draw (drawCanvas Id Dly)
<Regenaxer>
# Click (drawCanvas Id Dly 1 X Y)
<Regenaxer>
# Double (drawCanvas Id Dly 2 X Y)
<Regenaxer>
# Start (drawCanvas Id Dly 0 X Y X2 Y2)
<Regenaxer>
# Move (drawCanvas Id Dly -1 X Y X2 Y2)
<sriram_>
and for this it does not suffice to save the list that was used to render the canvas, but svg> is used to update the canvas
<Regenaxer>
The list is not saved I think, as it may change all the time
<Regenaxer>
(drawPage) is called whenever something happens
<Regenaxer>
or something was changed
<sriram_>
the "url" consists of session id, !mk.svg and a count
<Regenaxer>
T
<sriram_>
not sure how this is used though to update the image (sorry for the long questions)
<tankf33der>
Regenaxer: will you add lock and dbSync to tests ?
<Regenaxer>
tankf33der, this is difficult I think, that's why I omitted them
<Regenaxer>
Or do you see a way?
<Regenaxer>
With forking processes, and checking their wait behavior
<tankf33der>
dbsync with and without forks.
<Regenaxer>
timeouts etc
<Regenaxer>
yes
<tankf33der>
but it will always success
<Regenaxer>
I'm not sure how to really test this
<Regenaxer>
sriram_, no problem!
<Regenaxer>
When the browser wants to update the image, it calls the URL. Very simple
<sriram_>
ok... so the first time, a url is generated, and the image is drawn on the canvas
<sriram_>
from then on, on any interaction with canvas, mouse click etc, the the url is called, which uses svg> +PdfPage to generate the output
<Regenaxer>
in fact each time, but always the same URL
<sriram_>
so essentially svg commands are being used to draw on the canvas element
<sriram_>
and also (in addition to url), draw> +PdfPage is also being called by drawCanvas periodically to update the canvas element
<Regenaxer>
yes, an on mouse clicks
<Regenaxer>
not periodically in *this* application
<sriram_>
that is what i think is puzzling to me.....both draw> and svg> methods are used to update canvas
<Regenaxer>
svg> generates only SVG code, which is used by the browser to fill into th canvas as an image
<Regenaxer>
The browser expects an image from the url
<Regenaxer>
When it calls it, it receives SVG code
<Regenaxer>
ok as an image for the browser it seems :)
<sriram_>
yes, but draw> explicitly draws the image on the canvas using csDraw commands, so why are both ways needed
<Regenaxer>
draw> is called first
<Regenaxer>
only if it calls (drawPage) the rest happens
<Regenaxer>
for example while dragging, (drawPage) is *not* called
<Regenaxer>
only the dragged object is drawn into the canvas directly
<sriram_>
ah good...on a click though drawPage is called
<Regenaxer>
yes, looks like
<sriram_>
on a click, the dots and the selected rectangle are drawn and the url is updated (based on : cnt)
<Regenaxer>
dragging does call (drawPage) too, it seems, but only if the zoom was changed (?)
<sriram_>
thats right, and in the default case, none of the above also drawPage is called
<Regenaxer>
not zoom but scrolling
<Regenaxer>
(: cnt) is only needed to force the browser to fetch the new image
<sriram_>
perhaps this may help clarify for me..
<Regenaxer>
otherwise it caches it, regardless of no-cache etc
<sriram_>
on a clock, drawPage is called, which draws the dots and the selected rectangle if any, the image url is updated
<sriram_>
and then.....what happens next is unclear
<sriram_>
(i mean on a click :) )
<Regenaxer>
on top level drawCanvas is called, not drawPage
<Regenaxer>
it may be periodically or on events
<sriram_>
ok..yes, drawCanvas was called on the mouse click, and the url was updated, the image was drawn explicitly by drawPage
<Regenaxer>
T
<sriram_>
but when is the image url used then? i.e when is the svg> method used. I am thinking that when there is an event that does not call drawPage to generate a new url, or does not explicitly draw on the canvas?
<sriram_>
perhaps when csPost is called?
<sriram_>
or does that result in a call to drawCanvas
<Regenaxer>
csPost is needed to POST back to the server
<Regenaxer>
it does an XmlHttpRequest to the server
<Regenaxer>
post() function in JS
<tankf33der>
at the same time misc/stress.l works on centos
<Regenaxer>
tankf33der, right, stress.l uses a lot of locking
<tankf33der>
the same dbsync-commit pair
<tankf33der>
maybe ulimit on my centos
<Regenaxer>
hmm, then it would rather crash if it were some ulimit
<tankf33der>
the difference stress fork-do-steps-bye
<tankf33der>
in atomic fork work in loop
<Regenaxer>
tankf33der, so you think too many processes?
<tankf33der>
in atomic only several
<tankf33der>
in stress 40
<Regenaxer>
T
<tankf33der>
did you try atomic on your linux server ?
<tankf33der>
and why archlinux works.
<Regenaxer>
No, I did not try this code now
<Regenaxer>
I suppose I did when I wrote it
<sriram_>
i am thinking the svg> is used when the entire image needs to be redrawn (what events cause this?) otherwise portions of it are redrawn (e.g drawPage or draw>) using direct csXXX calls
<sriram_>
hence the need for two different pieces of code
<Regenaxer>
Hmm, I don't see two different pieces (?)
<sriram_>
well...by two different pieces I meant svg> which draws whole canvas as image using svg commands, and drawPage, or draw> which use individual canvas.js commands e.g csDrawRect to draw on canvas
<Regenaxer>
It is always drawCanvas -> draw> -> drawPage -> "!mk.svg?"
<sriram_>
but drawPage draws on canvas directly too (e.gcsDrawDots) if i am not misunderstanding
<Regenaxer>
drawPage only *passes* these commands in the Lst
<sriram_>
yes...and renderCanvas does the drawing of the list
<sriram_>
is it not?
<Regenaxer>
yes
<Regenaxer>
drawPage runs on the server
<Regenaxer>
and the SVG is ran in the client JS
<Regenaxer>
no
<sriram_>
?
<Regenaxer>
the csXXX is running in the client JS
<sriram_>
yes, as canvas.js commands
<Regenaxer>
T
beneroth has joined #picolisp
<sriram_>
so there are two paths for drawing on canvas...as an image in its entirety, or by individual renderCanvas js commands
<sriram_>
yes?
<Regenaxer>
yes
<beneroth>
hi :)
<Regenaxer>
Hi beneroth! :)
<sriram_>
beneroth> hi...:)
<sriram_>
thats what i was meaning by the two different pieces...the code in the server has two different options to draw in the client
<Regenaxer>
hmm, but csDrawImage is also just a csXXX command
<sriram_>
via svg, and via renderCanvas. I was thinking the former is used only when the entire image needs to be drawn, otherwise the latter is used to make minor updates e.g font changes
<Regenaxer>
I think it is always completely drawn, only not at interactions like dragging
grp has joined #picolisp
<Regenaxer>
(drawPage) is called by draw> only when necessary
<Regenaxer>
depending on the changes of contents
<Regenaxer>
but then always all is redrawn
<sriram_>
all is redrawn by the url you mean? even if the url is not updated by drawPage, since drawPage is not called?
<Regenaxer>
by (drawPage)
<Regenaxer>
(drawPage) draws the page ;)
<sriram_>
:) yes...but drawPage is not called in some cases, so in those cases, only a portion of the image is drawn?
<Regenaxer>
yes, via a call to the server URL
<Regenaxer>
I think only the dragged rectangle and such things
<Regenaxer>
interactions which do not go into the final result
<sriram_>
ah I understand now...temporary interactions
<Regenaxer>
yes
<sriram_>
now I understand why you felt there is only one (dominant) mechanism
<Regenaxer>
it is only called by draw> whenever necessary
<sriram_>
always all is redrawn (via drawPage) unless it is an intermediate step
<Regenaxer>
a user interaction would be too slow if it would redraw all the time
<Regenaxer>
yes
<Regenaxer>
eg a click always redraws
<Regenaxer>
first clause in the cond
<sriram_>
yes
<Regenaxer>
((gt0 F) # Click
<Regenaxer>
But drag does not always
<sriram_>
drawPage just draws the dots and the selected rectangle
<sriram_>
and the ruler
<Regenaxer>
yes, passed in Lst
<Regenaxer>
right
<Regenaxer>
all these are not part of the resulting document
<Regenaxer>
They are below or on top of the document data
<Regenaxer>
not sure which one
<tankf33der>
Regenaxer: what was the test for lock for cygwin ?
<sriram_>
but drawPage does not draw all the rectangles that are on the canvas, just the selected one
<tankf33der>
maybe centos is broken
<Regenaxer>
you can use a DB and (lock) or easier (ctl ...)
<Regenaxer>
Is Centos not a Linux?
<tankf33der>
redhat based
<tankf33der>
linux
<Regenaxer>
OK
<tankf33der>
modern, wide used, bla-bla
<Regenaxer>
:)
<sriram_>
was wondering why drawPage does not draw all rectangles that are on the canvas, instead it just draws : sel
<Regenaxer>
yes, cause (: sel) is not part of the document
<Regenaxer>
The other rects are there
<sriram_>
oh i see...so drawPage just draws what is not there in the document
<Regenaxer>
Not "draws" but passes in the Lst
<Regenaxer>
ok
<Regenaxer>
it draws in this sense
<sriram_>
the image will be drawn first by the updated url, and then the extra items passed in the list will be drawn by renderCanvas?
<sriram_>
or perhaps other way around
<sriram_>
no...i think i understand now
<sriram_>
when the src field is set, the url is used at that time to draw the image from the url
<Regenaxer>
ok :) It gives the source to JS, so it is not clear when it is drawn
<sriram_>
and then later the list commands are handled by renderCanvas
<Regenaxer>
right
<Regenaxer>
Might well be that JS handles this in parallel
<Regenaxer>
draws while the image is loading (fetched)
<sriram_>
yes, but so should just keep in mind that csDrawImage results in the url being fetched (svg> executed to draw permanent portion of image) and the Lst commands processed by renderCanvas to show temporary portions.
<sriram_>
At the end of csImageDraw the composite image is visible on canvas
<Regenaxer>
yep
<sriram_>
ok good! thanks, I have a much better understanding now...will go back to source..thanks a lot :)
<Regenaxer>
great :)
<Regenaxer>
I'm away for a while
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
<beneroth>
tankf33der, problems with pil on CentOS ?
<beneroth>
I'm interested. I'm planning a deployment on CentOS / RedHat servers later this year.
karswell has quit [Read error: Connection reset by peer]
<tankf33der>
beneroth: what is your current os for pil?