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

shadwolf
21-Nov-2005
[638]
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 ...
ICarii
5-Dec-2005
[673x2]
http://rebol.mustard.co.nz/projects.htm
I'm intending to move flounder to AGG when i get a spare moment
shadwolf
5-Dec-2005
[675]
by extension i was planing this to be once a short and full working 
solution will be found to insert it to RebGUI as a basic widget  
of this set  ^^
ICarii
5-Dec-2005
[676x2]
uses draw at present but not many differences
nice idea for widget
shadwolf
5-Dec-2005
[678]
but u know ... hen u are drunk  you have full ideas then the next 
morning on wake up you read back the code and  "Hoooooooo damn ... 
was is this ?? i made it  ?? no serrious that can be ... What does 
all those lines are supposed to do  ???"
ICarii
5-Dec-2005
[679]
hehe
shadwolf
5-Dec-2005
[680]
Shadwolf -> Drunk Coder .....  hum not all the  time but this time 
yes  ..
Graham
5-Dec-2005
[681]
Hey Shadwolf ... don't miss Ashley's message to you in RebGUI channel!
shadwolf
5-Dec-2005
[682x6]
done  ^^
but then i have a abnormal bug witch means nothing ...
how can a widget in external context mode works better than a widget 
internal context mode
having the same strict code lol
Founder-a4 with rebol/view 1.3 ** Script Error: Invalid argument: 
+
** Where: view
** Near: show scr-face
if new [do-events]
>>
i have looked long time ago at rebconsole code ... but without understanding 
it mutch ...