Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 22 Aug 2014, 13:44
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
BDraw v1.7
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 4 [46 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Thu 22 Nov 2012, 12:08    Post subject:  

Thanks for the info Geoffrey!
__________

I don't know how could I missed the obvious and trudge into complex and unnecessary methods.
If the button is narrower (or not) than the window, it's enough to use <hbox homogeneous="true"> (this will nicely align it to center, horizontally), and calculate X position using:
X = ( Mouse_X_Pos - Window_X_Pos ) - ( ( Window_Width - Picture_Width ) / 2 )
Much more simple and elegant...

So, the height problem is gone and theoretically picture size is no longer limited, but I set the limit to 2048x2048; more causes terrible slow down and/or Gtk crashes.
Also, coordinates were displayed in a range from 0 to Picture_Width/Height what was wrong, it's been corrected: from 0 to (Picture_Width/Height - 1).
And, just for fun, I added simplified support for dashed lines.

Ok, now I'm quite satisfied with this...

Version 1.2 attached to the first post.
___________

@Zigbert:
Just tried <eventbox> and it's really promissing. The one and only problem is handling keystrokes (for "Arc"), because there's no way to catch focus on <evenbox><pixmap> area; it's always glued to (and intercepted by) one of bottom buttons.

If someone would like to play with it, I've attached it to this post, as version 1.2+.

Greetings!
bdraw-1.2+.sh.gz
Description  Unpack & click to launch.
Requires Gtkdialog >= 0.8.1
"Arc" doesn't work
gz

 Download 
Filename  bdraw-1.2+.sh.gz 
Filesize  4.98 KB 
Downloaded  467 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Fri 23 Nov 2012, 13:48    Post subject:  

RE: <eventbox><pixmap> and "Arc"

Nothing is unsolvable. Smile
I examined Zigbert's Pmusic - I had no idea that there's $BUTTON variable in Gtkdialog that makes possible to read which button is pressed.
So "Arc" is now handled by right mouse button instead of spacebar.

As a really nice side effect, it's possible to draw "rays" and similar stuff now - simply, when you left click on some point, then you can right click many times elsewhere, but the initial X/Y position stays unchanged.

Another thing I _thought_ it's impossible to implement: "Freehand" mode.
It's not perfect - a bit "edgy", but pretty amusing.


Important change:
AFAIK in frugally installed Puppies /tmp folder is kept in RAM, but not in case of full installs (I might be wrong).
Since there's a lot of constantly used (by BDraw) temp files stored in /tmp, I changed the location to /dev/shm (suggested to me by Technosaurus elsewhere), what (I guess) should improve performance in fully installed Puppies.
If I'm wrong about this, please let me know, so I'll roll it back.

BTW, I combined both methods into one script - one can choose at initial window to use <button> or <pixmap>.

First post updated.

PS. Sorry for such frequent updates, but every time I thought "Ok, that's it, done!", then suddenly in the middle of the night something new popped up in my mind.
This time I'm pretty sure - I'll give it a rest...at least for some time. Wink

Greetings!
screenshot.png
 Description   
 Filesize   61.64 KB
 Viewed   752 Time(s)

screenshot.png


_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1352
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Sun 25 Nov 2012, 05:41    Post subject:  

SFR wrote:
PS. Sorry for such frequent updates, but every time I thought "Ok, that's it, done!", then suddenly in the middle of the night something new popped up in my mind.
This time I'm pretty sure - I'll give it a rest...at least for some time.


Don't apologize, update as much as you like, I like to see things evolve like this, I'm liking it a lot. Smile

_________________
Carolina: Recent Repository Additions
Create strikethrough text HERE
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Sun 25 Nov 2012, 15:25    Post subject:  

Thanks Geoffrey Smile
Indeed - I forgot about one important feature: bitmap import/export.

"Import Clipart" usage: select with mouse a part of drawing area, then choose an image.
The image will be inserted within previously selected area.
Supported (but not fully tested) formats are: bdr, png, svg, xpm, bmp, gif, jpg, tif, ico, ppm, pnm, pcx, tga.

BTW, the image will be 'base64' encoded and embedded into the picture, not linked.

Another nice side effect - the direction of selecting matters, eg. from upper left to bottom right - image will be inserted normally, but eg. selecting from bottom right to upper left - image will be flipped both horizontally and vertically.

"Export clipart" is used in the same manner as "Import", but the output format is always .png and the trick with "direction of selecting" doesn't work.

First post updated.

Greetings!
screenshot.png
 Description   
 Filesize   115.95 KB
 Viewed   677 Time(s)

screenshot.png


_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Puppyt

Joined: 09 May 2008
Posts: 567
Location: Gatton, Queensland

PostPosted: Mon 26 Nov 2012, 02:07    Post subject:  

WOW! Fantastic work, SFR - I guess now we don't have to keep lamenting that Barry's EVE can't be ported into Puppy http://bkhome.org/eve/ Smile
_________________
Toowoomba Linux Community
http://groups.google.com/group/toowoombalinux
Back to top
View user's profile Send private message Visit poster's website 
charlie6


Joined: 30 Jun 2008
Posts: 1004
Location: South of Belgium

PostPosted: Tue 27 Nov 2012, 13:37    Post subject:  

Hi,
would like to get a try ...
Crying or Very sad i only got this on dPup-Exprimo an uPup-Precise-5.4.X.4...
BDraw-1.4 and 1.3
here gtkdialog is 0.8.2 (exprimo) and 0.8.3 (precise).
did i miss something..?
thanks for any answer
Charlie
capture22025.jpg
 Description   
 Filesize   13.56 KB
 Viewed   603 Time(s)

capture22025.jpg

Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Tue 27 Nov 2012, 14:42    Post subject:  

Hey Charlie6

Just tried BDraw-1.4 on the uPup-Precise-5.4.X.4 (fresh live boot as well as after creating pupsave) and everything's fine here...
Your screenshot suggests me that, for some reason, the initial, empty picture wasn't created properly and its resolution was set to contents of /root dir (Choices, Desktop), which is absolutely strange. Shocked

Could you please:

1. Redownload the app and verify its md5. Here are md5 sums of:
- uncompressed script:
Code:
7a8d7473b86b04d1342ab3926a89170a  bdraw-1.4.sh

- as well as gzip'ed file:
Code:
f6028d11539a7f3f64bfb76600ef0468  bdraw-1.4.sh.gz


2. Launch it from the terminal and post the results.

(3. And maybe try it on clean Puppy with pfix=ram ..?)

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.

Last edited by SFR on Tue 27 Nov 2012, 14:45; edited 1 time in total
Back to top
View user's profile Send private message 
pemasu


Joined: 08 Jul 2009
Posts: 5463
Location: Finland

PostPosted: Tue 27 Nov 2012, 14:43    Post subject:  

Tested it also. Very Happy
UpupPrecise54X4.png
 Description   
 Filesize   29.88 KB
 Viewed   586 Time(s)

UpupPrecise54X4.png

Back to top
View user's profile Send private message 
charlie6


Joined: 30 Jun 2008
Posts: 1004
Location: South of Belgium

PostPosted: Thu 29 Nov 2012, 01:35    Post subject:  

Hi SFR,
thanks for answering
- checked OK the md5sums;
- runs nice on a fresh upup-54X4 install;
- here is the console comment related to my above pet:
note: there are other pets already installed (see attachment)..maybe the cause would be there..?
Quote:
# ./bdraw-1.4.sh
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected
sh: line 4: [: Choices: integer expression expected
sh: line 4: [: Desktop: integer expression expected
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected
sh: line 4: [: Choices: integer expression expected
sh: line 4: [: Desktop: integer expression expected
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected

** (gtkdialog4:21541): WARNING **: The recently launched window "SURE" is missing an equivalently named variable directive <variable>SURE</variable> which is a requirement of the launch action.
sh: line 1: [: Choices: integer expression expected
sh: line 1: [: Desktop: integer expression expected
CUR_DISPLAY=" Start: 92,127 End: 92,127"
DASH_VAR="false"
FILL_VAR=""
M="Freehand"
OPAC="1.0"
PICTURE=""
RES_DISPLAY=" Width: Choices Height: Desktop"
STROKE_VAR=""
SUREWINDOW=""
SW="1"
EXIT="Exit"
#

thanks
Charlie
user-installed-packages.txt.gz
Description  just drop gz extension to read
gz

 Download 
Filename  user-installed-packages.txt.gz 
Filesize  2 KB 
Downloaded  451 Time(s) 
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Thu 29 Nov 2012, 08:26    Post subject:  

Hmm, I installed most of these packages (except TiMidity++-2.13.0 (but the newer 2.13.2 - yes), lxtask_NLS-0.1.4, ttf-bitstream-vera_1.10-8 and xorg_high_intel-0.0.1) and still can't reproduce this issue.
But my suspicions goes to Xdialog.

Would you like to do a little bit of debugging? Wink
About line 709 there's the following piece of code:

Code:
  RESOLUTION="`Xdialog --title "Choose picture resolution" --2spinsbox "" 0 0 1 $MAXX $DEFX "Width" 1 $MAXY $DEFY "Height" 2>&1`"
  [ "$?" -ne 0 ] && exec $MYNAME
  X="`echo $RESOLUTION | cut -f1 -d '/'`"
  Y="`echo $RESOLUTION | cut -f2 -d '/'`"
  echo $X $Y > $PICRES
  make_empty

Change it to:
Code:
  RESOLUTION="`Xdialog --title "Choose picture resolution" --2spinsbox "" 0 0 1 $MAXX $DEFX "Width" 1 $MAXY $DEFY "Height" 2>&1`"
  [ "$?" -ne 0 ] && exec $MYNAME
    echo "$RESOLUTION"     # DEBUG
  X="`echo $RESOLUTION | cut -f1 -d '/'`"
  Y="`echo $RESOLUTION | cut -f2 -d '/'`"
    echo $X $Y         # DEBUG
  echo $X $Y > $PICRES
    cat $PICRES         # DEBUG
  make_empty
    cat $PIC            # DEBUG
    exit 1   # Exit at this point

Launch it from terminal again and post the results.

Also, if debugging will return "Choices" and "Desktop" again, replace the first line (from above) with this:
Code:
  RESOLUTION="`Xdialog --stdout --title "Choose picture resolution" --2spinsbox "" 0 0 1 $MAXX $DEFX "Width" 1 $MAXY $DEFY "Height" 2>/dev/null`"

(it's single line)
Just a blindshot, but might work...

BTW, at the initial window when you press "New" button, the next window where you can choose resolution shows "512 Width" and "256 Height" or something else?

_______________

Puppyt wrote:
WOW! Fantastic work, SFR - I guess now we don't have to keep lamenting that Barry's EVE can't be ported into Puppy http://bkhome.org/eve/ Smile

Thanks Puppyt. Eve - yes...I played with it a little bit (as well as with Menuet OS) before I even knew what Puppy Linux is. Smile

@Pemasu: I like your drawings! Smile

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
charlie6


Joined: 30 Jun 2008
Posts: 1004
Location: South of Belgium

PostPosted: Thu 29 Nov 2012, 12:21    Post subject:  

Hi SFR,
SFR wrote:
Hmm, ...Would you like to do a little bit of debugging? Wink ...About line 709

thanks for your time !
attached: the console comments when doing the line 709 proposed replacements ...in both cases, BDraw-1.04 hangs up when pressing "New" Crying or Very sad .

I believe I've just found the cause and reproduced it:
in the attached comments, the first lines report a problem with gtk theme:
Quote:
# ./bdraw-1.4.sh
** WARNING (recursed) **: Invalid borders specified for theme pixmap:
/usr/share/themes/Mac4Lin_GTK_v0.4-MU/gtk-2.0/Buttons/button-default.png,
borders don't fit within the image
512/256


I compared with another theme running without such problem and which has gtk-2.0/button-default.png (i forgot which name...);
Mac4Lin_GTK_v0.4-MU/gtk-2.0/button-default.png size is 75x23;
whereas the other is 75x25;
I then edited Mac4Lin_GTK_v0.4-MU/gtk-2.0/button-default.png to 75x25 (using mTpaint); saved it and restarted jwm and X;
>>------> no more problem reported;
then ran BDraw >>-----> now runs OK Very Happy Very Happy
bdraw-debug.txt.gz
Description 
gz

 Download 
Filename  bdraw-debug.txt.gz 
Filesize  1.54 KB 
Downloaded  453 Time(s) 
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Thu 29 Nov 2012, 13:19    Post subject:  

At last I was able to reproduce this.
Hmm, theme interference, I would have never thought! Shocked

The debug shows that there is problem with Xdialog in combination with this theme also, and:
Code:
  RESOLUTION="`Xdialog --stdout --title "Choose picture resolution" --2spinsbox "" 0 0 1 $MAXX $DEFX "Width" 1 $MAXY $DEFY "Height" 2>/dev/null`"

was a good guess indeed...
There's a few more lines with faulty Xdialog syntax - I've corrected them in version 1.5, which works ok for me now with that specific theme.

I'm glad we have figured out what's going on, thanks! Very Happy
_____________

Another addition:
After many trials&errors, tricks I'm not proud of, and almost crossing the edge of comprehending my own code complexity Wink , I added (poor's man) "Preview" ability.
It's synchronized with coordinates updating (1 sec.).
It works with any tool except "Freehand" and "Text"; also, for "Arc" it shows only the final stage of creation (x3,y3).
I added togglebutton (an eye icon) to (de)activate it (default = off), because it can simply act too slow on slower machines.
This is rather experimental addition, so I'd be glad for any info how it works on other machines and if it's really usable or not..?

First post updated.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 29 Nov 2012, 14:03    Post subject:  

Dear SFR,

I have not yet tried a BaCon port, which I will, but since it is really C it would be instantaneous. Sorry for not responding, but I did not read that long thread fully until now.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Thu 29 Nov 2012, 15:24    Post subject:  

vovchik wrote:
I have not yet tried a BaCon port, which I will, but since it is really C it would be instantaneous.

Can't wait. Smile
BTW, I have no another updates in plans in the nearest future (unless some bug will pop up), so v1.5 can be considered as "final".

Thanks & Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Fri 30 Nov 2012, 19:15    Post subject:  

SFR wrote:
[...](unless some bug will pop up)[...]

I had a hunch about that...

I discovered that "Import Clipart" option doesn't work in Precise and uPup-Precise.
I don't really know why, my guess is that there is a newer, more strict library responsible for displaying SVG in this pair.

Anyway, I've managed to fix that.

But since I have found that:

1. In those two Puppies only the following formats are supported:
.bdr, .svg, .bmp, .gif, .jpg, .png
2. tif/tiff makes BDraw hangs (sooo "sweet" Rolling Eyes )
3. pnm seems to not work at all...

I just reduced allowed formats to those six above; they're most popular anyway (except .bdr of course Wink ).

Sorry for inconvenience.

Version 1.5 has been replaced with v1.5.1 in the first post.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 4 [46 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

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
[ Time: 0.1145s ][ Queries: 13 (0.0053s) ][ GZIP on ]