The time now is Fri 24 May 2013, 07:58
All times are UTC - 4 |
|
Page 10 of 36 [526 Posts] |
Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, ..., 34, 35, 36 Next |
| Author |
Message |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6862 Location: Perth, Western Australia
|
Posted: Fri 19 Nov 2010, 04:56 Post subject:
|
|
| 2lss wrote: | | PjotAwake wrote: | Hi 2lss,
Thanks for your contributions. In fact, I have plans for this editor - I would like to add the BaCon converter itself, as a whole, to the program, so it's all embedded in one. We would have a fourth incarnation of BaCon but completely graphical based on GTK.
For the conversion progress, this is something I would rewrite using a Progress Bar.
Furthermore I would add a configuration panel where it is possible to fill in which type of output terminal is being used: xterm, rxvt, Terminal, gnome-terminal. Also in which size it has to appear.
The 'hold' of the terminal, you could embed the execution of the resulting program in a script which simply finishes with a 'read' - this will wait for input from the keyboard.
Tabbing should be added as well.
Syntax completion would be nice but I could not get that to work.
Your additions are a valuable step to these ideas, thanks! So, lots to do, wish there was more time!
Regards
Peter |
Glad I could offer some help. I'll keep plugging away at it when I get time.
As far as the terminal "hold" I had a similar thought, but figured the extra script would confuse things. Unless the editor creates/downloads the script when run (similar to the syntax file).....
What do you think about a FIND/HIGHLIGHT option? I found some example C code that might work. |
Puppy already has a script for xterm. All Woof-built puppies have /usr/bin/xterm which is a script, unless any particular developer has replaced it.
Wary, Quirky, and many older versions of Puppy have it, in fact if my memory serves me right, even Puppy 4.3.1 has it.
Here is the script:
| Code: | #!/bin/sh
#rxvt does not understand the '-hold' option.
if [ "`echo -n ${*} | grep '\-hold '`" != "" ];then
EXECCOMMAND="`echo -n ${*} | grep -o ' \-e .*' | sed -e 's/ \-e //'`"
if [ "$EXECCOMMAND" != "" ];then
echo '#!/bin/sh' > /tmp/xterm_simulate_hold.sh
echo "$EXECCOMMAND" >> /tmp/xterm_simulate_hold.sh
echo 'echo' >> /tmp/xterm_simulate_hold.sh
echo 'echo -n "FINISHED. PRESS ENTER KEY TO CLOSE THIS WINDOW: "' >> /tmp/xterm_simulate_hold.sh
echo 'read simuldone' >> /tmp/xterm_simulate_hold.sh
chmod +x /tmp/xterm_simulate_hold.sh
exec rxvt -e /tmp/xterm_simulate_hold.sh
fi
fi
exec rxvt "${@}" |
...it tests for '-hold' on the commandline.
[/code]
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Fri 19 Nov 2010, 06:41 Post subject:
|
|
Dear Barry and Doyle,
Slightly more terse....
| Code: |
DECLARE prop$ ASSOC STRING
infile$ = "PUPSTATE"
OPEN infile$ FOR READING AS fh
WHILE NOT(ENDFILE(fh)) DO
READLN txt$ FROM fh
txt$ = CHOP$(txt$)
IF INSTR(txt$, "#") EQ 1 THEN CONTINUE
l$ = LEFT$(txt$,INSTR(txt$, "=") - 1)
prop$(l$) = CHOP$(MID$(txt$, INSTR(txt$, "=") + 1), "'")
WEND
PRINT prop$("DEV1FS")
PRINT prop$("ZDRV")
PRINT prop$("PUPSAVE")
|
With kind regards,
vovchik
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Fri 19 Nov 2010, 07:29 Post subject:
|
|
Version of previously posted apps loader using arrays:
http://jpeters.net/apps/MyPrograms.bac.txt
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Sun 21 Nov 2010, 13:40 Post subject:
picscale v. 0.1a - image converter/rescaler in BaCon |
|
Dear puppians,
Here is revised picture rescaler/converter written in BaCon that makes use of gdk_pixbuf to work its magic. It is pretty small (38k compiled). Since it is a command-line prog, you can use it in bash scripts for the batch processing of image directories etc.
The help screen looks like this:
| Code: |
picscale image resizer/converter - v.0.1a by vovchik, Puppy Linux Forum, Nov 2010
Input formats supported: pnm, pbm, pgm, ppm, tga, xpm, tiff, pcx, gif,
xbm, wmf, icns, bmp, png, jpg and ico.
Output formats supported: png, jpg, bmp, tiff and ico.
Input parameters: oldfilename newfilename height width quality/compression/depth
Example: picscale old.png new.png 128 128 9
Quality/compression/depth settings:
bmp (N/A): 0 - 100
jpeg (quality): 0 - 100
png (compression): 0 - 9
tiff (compression type): 1 - 8
ico (depth): 16, 24 or 32
Check out BaCon at www.basic-converter.org
|
If you have any suggestions or code mods, please tell me or post them here. The source is in the archive and a working binary in the pet file (installs in /usr/local/bin).
With kind regards,
vovchik
| Description |
|

Download |
| Filename |
picscale.bac.tar.gz |
| Filesize |
2.49 KB |
| Downloaded |
312 Time(s) |
| Description |
|

Download |
| Filename |
picscale-0.1a.pet |
| Filesize |
13.37 KB |
| Downloaded |
355 Time(s) |
|
|
Back to top
|
|
 |
big_bass

Joined: 13 Aug 2007 Posts: 1736
|
Posted: Sun 21 Nov 2010, 17:04 Post subject:
|
|
Hey vovchik
fast and small
what more can you want and
compiled it in bacon
I can see many good apps to follow from you
thanks for posting the app and the source
Joe
_________________ slackware 14
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Sun 21 Nov 2010, 19:00 Post subject:
|
|
| big_bass wrote: | Hey vovchik
fast and small
what more can you want and
compiled it in bacon
I can see many good apps to follow from you
thanks for posting the app and the source
Joe |
Great example, although similar cli scaling can be done with about 3 lines using something like exactimage:
example: 'scale old.png new.png 16'
note: econvert also has --quality, which could be the fourth argument
| Code: |
#!/bin/sh
OldSize=`edentify $1 | cut -d"x" -f1 | cut -d" " -f3`
size=`dc $3 $OldSize / p`
econvert -i $1 --scale $size -o $2
|
Last edited by jpeps on Sun 21 Nov 2010, 19:14; edited 1 time in total
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Sun 21 Nov 2010, 19:10 Post subject:
Thanks |
|
Dear Joe,
Thanks. I am trying to understand gdk_pixbuf_composite, and once I do satisfactorily, I will change pikona to use only gtk/gdk calls. That means a binary of about 70k without any ImageMagick dependencies that will run on any standard Puppy. Of course, the various background, object and overlay files will still be needed, but the main bulk for the user is now IM and that will be gone. And the transformations will be faster, since they will be made in RAM. And input pics will be able to be in any of the formats that can be read by gtk_pixbuf. Have to get onto this....
With kind regards,
vovchik
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Sun 21 Nov 2010, 19:20 Post subject:
image conversion |
|
Dear jpeps,
No it can't do that in three lines, unless you install either IM (a good 6 MB binary with libs) or ExactImage (a good 3+ MB binary with libs). Of course econvert and IM's convert can do the job, but I think you may have missed my point above about ugly and huge dependencies. Puppy is supposed to be small and capable, and exploiting gdk_pixbuf (included in the GFK libs in every Puppy by default) is, I think, a good idea.
With kind regards,
vovchik
|
|
Back to top
|
|
 |
big_bass

Joined: 13 Aug 2007 Posts: 1736
|
Posted: Sun 21 Nov 2010, 20:40 Post subject:
|
|
| Quote: | | I will change pikona to use only gtk/gdk calls. That means a binary of about 70k without any ImageMagick dependencies |
there are a few small apps that do image resize
but there is a little history here that just took place over a long period of time
its hard to follow all the threads so here is a short recap
pikona a great icon making app (compiled in bacon)
uses image magic to do the resize
there is a great small cli c code app MU wrote and compiled
but for some reason the alpha channel had a small error
during the conversion with png that was fixed
then converted from c code to bacon basic
and expanded on adding the IMPORTS
a lot of work went to getting all that to work
so vovchik savor the moment friend
what I like about bacon the most is having
apps that work on all linux distros not
special apps that only work for one special version (like the gtkdialog3 if you plan to share work with the linux
community
Joe
_________________ slackware 14
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Sat 27 Nov 2010, 09:16 Post subject:
|
|
Dear Puppians,
I think I have finally understood gdk_pixbuf_composite. Here is a little demo (archive includes src, binary and images). Now I can change Pikona
With kind regards,
vovchik
| Description |
|
| Filesize |
28.91 KB |
| Viewed |
1308 Time(s) |

|
| Description |
|
| Filesize |
26.22 KB |
| Viewed |
1320 Time(s) |

|
| Description |
|
| Filesize |
18.48 KB |
| Viewed |
1321 Time(s) |

|
| Description |
|

Download |
| Filename |
composite-test.tar.gz |
| Filesize |
57.78 KB |
| Downloaded |
295 Time(s) |
|
|
Back to top
|
|
 |
PjotAwake

Joined: 03 Nov 2010 Posts: 34 Location: The Hague, The Netherlands
|
Posted: Sun 28 Nov 2010, 16:38 Post subject:
|
|
Gents,
Updated the Source Code Editor a bit more.
Tabbing: done.
| Quote: |
What do you think about a FIND/HIGHLIGHT option?
|
Done.
Furthermore did some preparations to integrate with the complete BaCon source. So I am working on it, also looking at contributions from 2lss and mechanic.
For now, code of version 1.4 is here. More to come...
Regards,
Peter
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Sun 28 Nov 2010, 17:24 Post subject:
|
|
Dear PjotAwake,
We are grateful to you for your brains, effort and conscientiousness. I think the IDE will be a VERY useful addition. If we have this, Doyle's glade2bac plus a few utilities that can scan BaCon code and find the (i) undefined function calls to external shared libs (that is, ultimately, compiler errors) and (ii) then do something like an nm -D on the probable libs to automatically produce the imports with proper type defs, life will be a breeze. In a way, one could, for instance, load the entire GTK/GDK stuff, then do a diff on the code to grab only those functions as IMPORTs that are really called, and produce the import list on the basis of matches. I am giving that some thought...
With thanks and kind regards,
vovchik
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Mon 29 Nov 2010, 06:59 Post subject:
pnotify revisited |
|
Dear puppians,
I revised my notification prog and have attached it here. I eliminated the global HUG dependencies, doing the IMPORTs by hand, and, in so doing, reduced the size of the binary by 50% - now 42k. It is similar to the gnome notify prog, but no icons yet and no command-line argument for duration of the popup, but with complete use of markup. Shall I do the icon and duration bits (we could make it into a 1:1 clone of notify, but without the gnome deps)? It's not a bad way of giving users information about an event that has transpired - i.e. successful inet connection or the completion of some long process such as indexing or backup. Please have a look. The archive contains the source, binary and a bash demo launcher (which shows how to do the markup).
With kind regards,
vovchik
| Description |
|

Download |
| Filename |
pnotify-0.1a.tar.gz |
| Filesize |
18.19 KB |
| Downloaded |
289 Time(s) |
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 836
|
Posted: Mon 29 Nov 2010, 13:42 Post subject:
|
|
vovchik,
Thanks for working on this.
I get this -
| Code: | ./pnotify
ERROR: signal for SEGMENTATION FAULT received - memory invalid or array out of bounds? Try to compile the program with TRAP LOCAL to find the cause.
|
Could it be a bash 3 problem?
I also wondered if the BaCon larger font size rendering problem has seen any resolution.
Best Regards,
s
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: Mon 29 Nov 2010, 17:12 Post subject:
|
|
Dear Seaside,
Yep, I spoke to Peter about this and our suspicion is that it is bash3 -related. Although Peter recommends bash4 for BaCon (for good reason), I have used GNU bash, version 3.2.48(1)-release (i686-pc-linux-gnu) successfully. Shall I post that binary here? I think Joe has posted a useful bash4 somewhere, and Barry has one posted too. The binary should work in any case -- I hope
With kind regards,
vovchik
|
|
Back to top
|
|
 |
|
|
Page 10 of 36 [526 Posts] |
Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, ..., 34, 35, 36 Next |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|