|
Post by alexfish on Apr 6, 2020 22:59:10 GMT 1
Hi All
+ thanks to Vovchik & Joe for testing
now have an all BaCon version
FUNCTION next_utf8_char(unsigned char *utf8, int *codepoint ,int * ps) TYPE unsigned char * LOCAL seqlen=0 TYPE int LOCAL p = utf8 TYPE unsigned char * '0xxxxxxx IF NOT(utf8[0] & 0x80) THEN *codepoint = (wchar_t) utf8[0]; seqlen = 1 '110xxxxx ELIF (utf8[0] & 0xE0) == 0xC0 THEN *codepoint = (int)(((utf8[0] & 0x1F) << 6) | (utf8[1] & 0x3F)) seqlen = 2
ELIF (utf8[0] & 0xF0) == 0xE0 THEN *codepoint = (int)(((utf8[0] & 0x0F) << 12) | ((utf8[1] & 0x3F) << 6) | (utf8[2] & 0x3F)) seqlen = 3 ELSE RETURN NULL END IF *ps = seqlen INCR p , seqlen RETURN p END FUNCTION
' ============================================================================== SUB utf_Info( const char *s)
LOCAL character,ptr,cdp TYPE int LOCAL ss TYPE unsigned char * ss = (unsigned char *)s
WHILE (ss ) DO ss = next_utf8_char(ss, &character, &cdp) IF (ss == NULL) THEN BREAK
END IF
PRINT "char :", ptr , ":" , cdp ' printf ("char : %d : %d\n", ptr , cdp); INCR ptr WEND
END SUB
' ============================================================================== FUNCTION GetPostition( const char * s,int pos) TYPE int
LOCAL character,ptr,cdp,ps TYPE int LOCAL ss TYPE unsigned char * ss = (unsigned char *)s WHILE ss DO ss = next_utf8_char(ss, &character, &cdp) IF (ss == NULL) THEN RETURN ps END IF
IF ptr == pos THEN RETURN ps BREAK END IF
INCR ps,cdp INCR ptr WEND RETURN ps
END FUNCTION
' ============================================================================== FUNCTION InsertChars( const char * A,int pos ,STRING ch) TYPE const char * LOCAL x TYPE int LOCAL AB$ = (char*)A TYPE STRING LOCAL CP$ TYPE STRING CP$ = AB$ LOCAL r$ TYPE STRING LOCAL sp$ TYPE STRING x= GetPostition(A,pos) sp$ = MID$(AB$,1,x) r$ = MID$(AB$,x+1) sp$ = sp$ & ch & r$ A = (const char*)sp$ RETURN A
END FUNCTION
+ some code
DECLARE A$ = "½¹²þø↓ŧ" TYPE STRING LOCAL curpos =2 TYPE int FOR t = 0 TO 5 B$ = InsertChars(A$,curpos+t,STR$(t)) A$ = B$ NEXT
PRINT B$
BR Alex
+ stay home , stay well
&
DECLARE hello[] = {'H','e','j',',',' ','v', 0xc3, 0xa4,'r' , 'l','d' ,'e','n',0} TYPE char DECLARE A$ = "" TYPE STRING B$ = InsertChars(A$,LEN(A$),hello)
PRINT B$
|
|
|
Post by alexfish on Apr 12, 2020 11:40:39 GMT 1
Hi All Now have a working editor , not best in the world , so room for some improvements in the future when I say the future : only looking at arrow keys and other paging bits. Now looking at the actual terminal as in poor-mans terminal and capturing term-cap commands to that end can we get our own vte have written a small bacon program called Bterm and can see from the poor-mans terminal the results: So now need to interpret the bits and put it into action But this is where I halt:: In a few days will post the code-base and can take things from there the program CLEAR PRINT "HELLO WORLD" PRINT "COLUMS X Y" PRINT "X,Y: ", COLUMNS, ",", ROWS
CLEAR FOR x = 5 TO 10 GOTOXY x, x PRINT "Hello world" NEXT GOTOXY 1, 12
BR Alex And a Picky Attachments:
|
|
|
Post by vovchik on Apr 12, 2020 13:42:29 GMT 1
Dear Alex, Thanks to you and the Easter bunny you have secretly been collaborating with we may have something soon. With kind regards, vovchik
|
|
|
Post by alexfish on Apr 12, 2020 17:48:53 GMT 1
Thank you the only problem in one arena is the bacon GETXY as in COLUMNS & ROWS but already have that function built in as GETXY as can see GOTOXY one can clearly see [6;6 that is part of cairo api , so easy to translate colors [31m = red foreground [47m = white background as for translating color have this type of function to use pango mark up here assume markup for bacon syntax KeyWord$="<span foreground='red'></span>" b$ =INSERT$(KeyWord$,24,"PRINT")
PRINT b$
b$=INSERT$(KetWord$,24,"INSTR") CURSOR (position) . again built in yet that does not presume there will be hiccups hence the 'here I stop' BR Alex
|
|
|
Post by alexfish on Apr 19, 2020 20:23:30 GMT 1
Hi Vovchik and All
Hiccups ,, hick hick
have tested the draw text function & decided to go for it as in 'speed it up'
this involves 3 functions :: at first could not get the cursor to align :: still slight bug.
Reason the the scroll function and edit function were to me diabolic in terms of speed
since all of the buffer was been rendered , hence the new functions render to View size Only
:: a lot of work has gone into these & now pleased to say that the interface is now
just as fast as any other gui editor .
also added temp button and entry to test bacon.
So what I am doing ,, tomorrow will post the c compiled version for Raspberry pi for testing this has only one buffer to play with , but will detail what to do; there is a slight bug in that editing utf8 chars on two lines // deletes newline = misses back step up of the cursor ; but overall the feel is good. I hope says he.
Having said that , the same functions allow for compositing text to any area on the surface
and betwixt I will convert using latest bacon4 stable . hoping this not will take to long
so as I write have done a quick "hello world" in the editor + compile and run the same with the results showing on the same interface
BR Alex
|
|
|
Post by alexfish on Apr 20, 2020 18:46:50 GMT 1
Hi Raspberry Pi users have a c++ compiled version , implements @beta testing poor-mans terminal , cairo pango editor now have left the cursor bug as is , if get lost click where you need it have put some gtk widget back in the top tool bar , menu-bar is hidden , but right click brings up the view menu only the paste command works .. there are some bits to tidy up before re-implementing top bar buttons will either bring up zenity file dialog or will take file from the entry box or can load file using cat 'filename' at the bottom status line for the terminal look for the tild '~' can start by clicking in the poor mans terminal type PRINT "Hello World" click on the run button click restore to view the code stored in test.bac , hint do not use an app that requires INPUT , as said this beta hence need to tie up the loose ends as regards buffers; and the cursor , but can see what is going on if launched from a terminal left arrow key clears the status line :: note this bit is not pango :: no utf8:: up arrow restore last command : a few bash commands have been disabled ; so will get a warning on the status line BR Alex Attachments:cairotest.bz2 (71.51 KB)
|
|
|
Post by alexfish on Apr 23, 2020 16:05:00 GMT 1
Hi All Update on progress RE cairo pango text things are looking good 1. utf8 main bits resloved: 2. hi-lite edits / menu select resolved as in delete copy and paste in foreword notation - reverse notation hi-ligh to resolve. but edits do work need to get the final bits in when done this forms the base of all as in the widget.. other than widget rect but we need the class LABEL as in text to fill the bits in, as say label, entry, editor,list,table, blagh blagh as a bit of reading look at some of fltk c++' looks like the base is xforms. queried that on as in the fltk browser :: re if think dillo:: in short. copy this snippet <xforms>
<model> <instance> <person> <fname/> <lname/> </person> </instance> <submission id="form1" method="get" action="submit.asp"/> </model>
<input ref="fname"> <label>First Name</label></input><br />
<input ref="lname"> <label>Last Name</label></input><br /><br />
<submit submission="form1"> <label>Submit</label></submit> </xforms>
save it as html and point your browser added screenshot ;edited the colors to emphasize ; here showing hi-lighted text and a live copy from that to here this line of text 12: : this line of text 13: : this line of text 14: : this line added some utf8 łe¶ŧ←↓đŋ¢ of text 15: : this line of text 16: : this line of text 17: : this line of text 18: : this line compiling bacon with error Converting 'test.bac'... Converting 'test.bac'... done, 3 lines were processed in 0.001 seconds. Compiling 'test.bac'... cc -c test.bac.c Makefile.bacon:6: recipe for target 'test.bac.o' failed
test.bac:2:24: warning: missing terminating " character PRINT "Height BR Alex Attachments:
|
|
|
Post by alexfish on Apr 26, 2020 11:33:57 GMT 1
Hi All still on with the editor :: only one bit to do in there , there where I stop went a bit further: betwix that, had look at the poor mans terminal , a lot of reading and a lot of suggestion hence been tying a lot of this fork bits including bacon exec. results == fail's lot of them yesterday looked at popen again failed the fail bit was getting user input in example PRINT "How old are you >" ; INPUT A$ PRINT "You are " ,A$ , " years old" in short twiddled with the read as in setting none blocking now have a configuration that can read the input & then wait and send a reply back this is the terminal result using popen; How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >How old are you >You are 9 years old You are 9 years old
if can pas this to the poor mans terminal then it would read How old are you > press a key 9, then the result in the terminal would look like You are 9 years old meltdown will be Monday BR Alex ADDED ::now have read once Then reply terminal results How old are you > 9 You are 9 years old Picky of results Attachments:
|
|
|
Post by alexfish on Apr 26, 2020 13:47:11 GMT 1
Hi All
tried this a with two request . looks a bit odd so now looking at the buffers
PRINT "How old are you >" INPUT A$ PRINT "You are " ,A$ , " years old"
PRINT "Do you feal old >" INPUT A$ PRINT A$ , " What"
results
How old are you >
90 You are 90 years old
Do you feal old > ld
no no What eal old > ld
Alex
|
|
|
Post by alexfish on Apr 26, 2020 14:44:25 GMT 1
change the inputs
then the results are different
RESET PRINT "How old are you >" INPUT A$
PRINT "You are " ,A$ , " years old does that change"
INPUT A$
results
How old are you >
90 You are 90 years old does that change
yes
looks like something to play with on Monday
Alex
don a bit more twiddling with the buffers , can get 99% of what happens in a terminal , that 1% is the cursor placement
some bacon code
and the results
PRINT PRINT "How old are you >"; INPUT A$ PRINT PRINT "You are " ,A$ , " years old does\n that change" INPUT A$ PRINT FOR t = 1 TO 10
PRINT t
NEXT PRINT
results
How old are you > 9
You are 9 years old does that change yes
1 2 3 4 5 6 7 8 9 10
|
|
|
Post by alexfish on Apr 27, 2020 19:59:00 GMT 1
Project on hold RE : thinking can get a poor-mans terminal using glib IO channels HEREBR Alex
|
|
|
Post by alexfish on Apr 27, 2020 21:37:17 GMT 1
Ok reference to the above.. gio was thinking,thinking, some time ago downloaded source code for a terminal call vtesixel did not take much notice of this one, since the fontsize was well err not readable. however prowling though the bits found the source code , agh well glib bits are in there and so is the original vte header files and c files in a separate folder, reading the hacking these are embed-able now looking further will not compile on rpi but the source in github vtesixelBR Alex
|
|
|
Post by bigbass on Apr 28, 2020 3:20:10 GMT 1
Hello Alex vte-sixel will compile on the RPI3 I just gave it a try even after reading the config had to run it several times to get all the deps there is no guide but this worked for me I needed these you may need more or less sudo apt-get install gtk-doc-tools sudo apt-get install libtool sudo apt-get install autoconf autogen intltool sudo apt-get install libpcre2-dev sudo apt-get install libgnutls28-dev sudo apt-get install gperf then I ran ./autogen.sh --disable-introspection --disable-vala make sudo make install inside src/.libs there is an executable called testvte that launches the terminal Joe P.S my version of RPI may differ so the package names will be correct or close enough to figure out what you need
|
|
|
Post by alexfish on Apr 28, 2020 5:18:00 GMT 1
Thanks Joe will do that
BR Alex
|
|
|
Post by alexfish on Apr 28, 2020 6:00:45 GMT 1
MM!
tried the doc tools ;; need to see if some bits are needed or not
I get this at doc tools
Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: gir1.2-clutter-1.0 gir1.2-clutter-gst-2.0 gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gir1.2-evince-3.0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gtkclutter-1.0 gir1.2-gtksource-3.0 gir1.2-json-1.0 libaa1 libavc1394-0 libclutter-1.0-0 libclutter-1.0-common libclutter-gst-2.0-0 libclutter-gtk-1.0-0 libcogl-common libcogl-pango20 libcogl-path20 libcogl20 libdjvulibre-text libdjvulibre21 libevdocument3-4 libevview3-3 libgjs0e libgtksourceview-3.0-1 libgtksourceview-3.0-common libgxps2 libiec61883-0 libmusicbrainz5-1 libsoxr0 libtag1-vanilla libtag1c2a Use 'apt-get autoremove' to remove them. The following extra packages will be installed: docbook docbook-dsssl docbook-to-man gnome-common highlight highlight-common intltool jade libsp1c2 sp Suggested packages: docbook-defguide psgml jadetex docbook-dsssl-doc dblatex doc-base The following NEW packages will be installed: docbook docbook-dsssl docbook-to-man gnome-common gtk-doc-tools highlight highlight-common intltool jade libsp1c2 sp 0 upgraded, 11 newly installed, 0 to remove and 109 not upgraded. Need to get 3,601 kB of archives. After this operation, 14.7 MB of additional disk space will be used.
BR Alex
|
|