r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[AGG] to discus new Rebol/View with AGG

Volker
10-Nov-2005
[623]
Can we fold the paper?
Pekr
10-Nov-2005
[624]
:-)
Cyphre
10-Nov-2005
[625x2]
Velker, I think  you can. Send feedback to Carl about this issue. 
Maybe he will increase the priority after enough requests :-)
ups, Velker=Volker
DideC
10-Nov-2005
[627]
Cyphre: if your question is "should we create a FILL-PEN-PERCENT 
command to not overload FILL-PEN with percent values?" I say YES. 
(but the name is here as an example)

But overwhise I don't really understand what you mean.
shadwolf
11-Nov-2005
[628]
DIDEC you get the point ...  the ask is un precise. My case is particular 
a gradient iss that take in charge percent and vertorial orientation 
to feet SVG datas would be a plus. I think gradient the way they 
are yet implement in Draw/AGG are better than the SVG way. SVG is 
huum less natural less close to human way of thinking and in that 
philosophy it feets perfectly with the REBOL .
ICarii
11-Nov-2005
[629x3]
It'd be nice to have  VIEWPORT command for creating virtual surfaces 
inside AGG/Draw - especially to use it to constrain text for applications 
such as scrolling and spreadsheets..
viewport origin [pair!] size [pair!] contents [block!]
viewport 100x100 300x150 [font myfont text 150x50 "this is a large 
line of text..."]  ;here the text would use the viewport as its origin 
and screen size
Graham
18-Nov-2005
[632x3]
here here
There's already clipping commands.
Why not have a viewport which can be of any shape ?
ICarii
19-Nov-2005
[635]
Heh - i never saw the clip command before :)  Shame on me :)
shadwolf
21-Nov-2005
[636x3]
in my svg render i use push to make a drawing layer order and that 
work pretty good
SVG support the element  in a stackable way so it's good to be able 
to reproduce that feature with draw/AGG push
for example  you draw a black cirle and on top of it you put 2 spots 
yellow and a yellow line  SVG keep the track of that and rebol drew/AGG 
is abe re produce it perfectly...
[unknown: 9]
21-Nov-2005
[639]
IS ther a good description of AGG somewhere?
Ammon
21-Nov-2005
[640]
From the author: http://antigrain.com/about/index.html
Pekr
23-Nov-2005
[641x3]
would it be possible to use agg to create kind of Corel Draw? Simply 
to detect objects you draw? If I understand it correctly, currently 
when once you draw, it is laid down to face bitmap ...
The question is here because not of clone attempt of Core Draw, but 
just curious, if screen-painter could be created. Currently we have 
boxes as effect for 'edge, but ...
of course ability to change mouse pointers to reflect you are at 
right position would be handy to have too ....
Oldes
23-Nov-2005
[644]
do you mean: if I draw line if I can detect if I'm over the line?
Pekr
23-Nov-2005
[645]
yes, detect, press mouse button, have it somehow visually distinguished 
(like bezier curves, those little black boxes over the vector, to 
drag it, you know :-)
Oldes
23-Nov-2005
[646x2]
That's related to Rebol itself, not just AGG. And it's very bad that 
it's not possible.
I was thinking about making simple vector editor, but it's not possible 
without this feature. In Flash you can detect feels over shapes, 
in Rebol we are limited to faces:(
Pekr
23-Nov-2005
[648]
what do you mean by "shape"?
Oldes
23-Nov-2005
[649]
for example line
Pekr
23-Nov-2005
[650]
you mean non rectangular windows directly in rebol view kernel?
Oldes
23-Nov-2005
[651]
some place where is drawn something
Pekr
23-Nov-2005
[652]
but that would not be sufficient for drawing app as well ... dunno 
what such routines are based upon, but it cant be magic, no? :-)
Oldes
23-Nov-2005
[653x2]
just have to know what is shape and what is (event) transparent:)
but it should be done in Rebol internally. not that I will make images 
from all drawings and check if it's transparent or not under my cursor
Pekr
23-Nov-2005
[655]
IIRC Tao Intent has such capabilities, you can decide upon alpha 
channel even, so your events could be transparent etc ... well, that 
could be coded too, no? you just press mouse, you detect position 
of your press, and decide what is under the mouse - that is the most 
difficult part imo ...
Oldes
23-Nov-2005
[656]
I think cyphre have some simple examples how to do this but... it 
should be in Rebol internally:)
Pekr
23-Nov-2005
[657x2]
Paul Nolan once told me, that the most capable compositing engine 
he saw was Shake: http://www.apple.com/shake/- look at features. 
But Carl once told me, that View uses kind of "nodes" too or something 
like that, simply that View has some advanced compositing too ...
(well, except the blitting :-)
Graham
28-Nov-2005
[659]
Rebolek's AGG demo called "Cyphre" reminds me a bit of Tempest 2000 
- anyone planning on a Tempest 2000 clone ?? :)
shadwolf
5-Dec-2005
[660x5]
Hello folks  ^^
Here is a little somthing i was working on some month ago when the 
 Ritchtext edit  topic pops out -> RTE ...
the code is ugly but tiny there is some bugs but i think the idea 
is good  ^^
REBOL [
 Author: "Shadwolf"
 Starting_Date: 21-05-2005
 Purpose: {Research work on rebol draw capability to be 
 used to write a Ritch text editor} 
]
stylize/master [
	rte: box with [
		color: gray 
	    tampon: ""
	    buffer: []
	    line-index: 0
	    char-sz: none
	  	current-text-offset: 0x0
	  	cursor-text-offset: 0x0
	  	max-text-offset: 0x0
	  	text-color: black
	  	pane: []
	  	
	  	set-font-style: func [ font-s [word!]] [
	  		switch font-s [

      bold [insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset] [as-pair 0 
      (line-index * 20)]) "" ]]]

      normal [insert tail buffer compose/deep [[ [size: 11 style: []] ( 
      either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 (line-index 
      * 20)]) "" ]]]

      underline[insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 
      (line-index * 20)]) "" ]]]

      italic [insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 
      (line-index * 20)]) "" ]]]
	  		]
	  	]
	  	
		feel: make feel [
			engage: func [f a e] [
				switch a [
				   
					key [ probe e/key
						switch/default e/key [
							#"^M" [
							line-index: line-index + 1

       f/current-text-offset: as-pair 0 f/current-text-offset/y + 20]

       insert tail f/buffer compose/deep [[ [size: 11 style: [(font-s)]](as-pair 
       0 (line-index * 20)) "" ]]
							
						][
							f/tampon: rejoin [f/tampon to-string e/key]
							draw-text: []
							print "f/buffer:"
							probe f/buffer
							foreach line-to-draw f/buffer [
								print "line-to-draw"
							;line-to-draw: f/buffer/1
								;probe line-to-draw
							;set [font-style start-offset text-to-show ] line-to-draw
							
								font-style: line-to-draw/1
								start-offset: line-to-draw/2
								line-to-draw/3: rejoin [line-to-draw/3 to-string e/key]
							;probe font-style 
							;probe start-offset
							
								font-obj: make face/font font-style
							;probe font-obj 
								text-to-show: line-to-draw/3
								;probe text-to-show

         insert tail draw-text  compose [ font (font-obj) pen (f/text-color) 
         text (start-offset) (text-to-show)]
							] 
							;print "draw-text:"
							;probe draw-text
							

       ;draw-text: compose [ pen (f/text-color) text (f/current-text-offset) 
       (f/tampon)]
				    		f/effect: make effect reduce [ 'draw draw-text  ]
				    		draw-text: none 
				    		;probe f/current-text-offset

       f/cursor-text-offset: as-pair (f/cursor-text-offset/x + 9) f/current-text-offset/y 
				    		;show f
						]
						f/pane/1/offset: f/cursor-text-offset 
						show f
					]
					down [
						;insert f/buffer compose [(as-pair 0 (line-index * 20)) ""]
						focus f show f
					]
					
				]
			]
		]
		append init [

   insert buffer compose/deep [[[size: 11 style: []] (as-pair 0 (line-index 
   * 20)) ""]]
			probe buffer

   insert pane make face [ color: red size: 2x20 offset: cursor-text-offset 
    ]
			show self 
		]
	]
]


view layout [
  across
  	btn "bold" [test-rte/set-font-style 'bold]
  	btn "underline" [test-rte/set-font-style 'underline]
  	btn "italic" [test-rte/set-font-style 'italic]
  	btn "normal" [test-rte/set-font-style 'normal]
  return
  	test-rte: rte 300x300
]
Henrik
5-Dec-2005
[665]
shadwolf, well, it's a start :-)
shadwolf
5-Dec-2005
[666x4]
i will be really glad if  some AGG guru could have a look on this 
script and modify enhace it and maybe make a tiny lib  ^^
what we need for text  to begin is bold/italic/underline/normal/color 
 If you have 10 more minutes to pend on it  images  would be a plus 
 ^^
Henrik yes ... hum i guess you  didn't see this script runing lol 
it looks like I was drunk when i wrote that  lol
my main idea was to use draw and use a cursor /input output similator 
but i'm not really a specialist in that kind of motion
ICarii
5-Dec-2005
[670]
hiya shadwolf.. also working on something similar in the past.  Never 
finished it though an alpha for flounder is still on the website.
shadwolf
5-Dec-2005
[671x2]
As  all of us i use premade stuff included in over priced C libraries 
 for "prfessionnel"
icarii can you past url of this project here this will allow ppl 
to compare / merge technics ...