From 7a3042dd10d8ff75450887653b67d71ea22769c3 Mon Sep 17 00:00:00 2001 From: Marc Lehmann Date: Sat, 11 Sep 1999 20:15:33 +0000 Subject: [PATCH] see plug-ins/perl/Changes --- plug-ins/perl/Gimp.pm | 85 ++++++++--------- plug-ins/perl/examples/PDB | 182 +++++++++++++++++++------------------ 2 files changed, 137 insertions(+), 130 deletions(-) diff --git a/plug-ins/perl/Gimp.pm b/plug-ins/perl/Gimp.pm index 5ad582ca52..e41dc64a12 100644 --- a/plug-ins/perl/Gimp.pm +++ b/plug-ins/perl/Gimp.pm @@ -13,7 +13,7 @@ require DynaLoader; @ISA=qw(DynaLoader); -$VERSION = 1.13; +$VERSION = 1.14; @_param = qw( PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE @@ -27,24 +27,26 @@ $VERSION = 1.13; @_consts = (@_param, #ENUM_NAME# 'PRESSURE', 'SOFT', 'HARD', 'RGBA_IMAGE', 'INDEXED_IMAGE', 'GRAYA_IMAGE', 'RGB_IMAGE', -'INDEXEDA_IMAGE', 'GRAY_IMAGE', 'CUSTOM', 'FG_BG_HSV', 'FG_TRANS', 'FG_BG_RGB', 'CONTINUOUS', -'INCREMENTAL', 'APPLY', 'DISCARD', 'BLUE_CHANNEL', 'GREEN_CHANNEL', 'GRAY_CHANNEL', 'AUXILLARY_CHANNEL', -'INDEXED_CHANNEL', 'RED_CHANNEL', 'UNKNOWN', 'VERTICAL', 'HORIZONTAL', 'DODGEBURN_HIGHLIGHTS','DODGEBURN_SHADOWS', -'DODGEBURN_MIDTONES', 'ALPHA_LUT', 'GREEN_LUT', 'BLUE_LUT', 'VALUE_LUT', 'RED_LUT', 'OFFSET_BACKGROUND', -'OFFSET_TRANSPARENT', 'BG_BUCKET_FILL', 'FG_BUCKET_FILL', 'PATTERN_BUCKET_FILL', 'PDB_SUCCESS', 'PDB_CALLING_ERROR', 'PDB_EXECUTION_ERROR', -'PDB_PASS_THROUGH', 'WHITE_IMAGE_FILL', 'FG_IMAGE_FILL', 'TRANS_IMAGE_FILL', 'BG_IMAGE_FILL', 'NO_IMAGE_FILL', 'LOOP_SAWTOOTH', -'ONCE_BACKWARDS', 'ONCE_FORWARD', 'ONCE_END_COLOR', 'LOOP_TRIANGLE', 'MONO_PALETTE', 'WEB_PALETTE', 'MAKE_PALETTE', -'REUSE_PALETTE', 'CUSTOM_PALETTE', 'BURN', 'DODGE', 'CYAN_HUES', 'RED_HUES', 'GREEN_HUES', -'YELLOW_HUES', 'ALL_HUES', 'MAGENTA_HUES', 'BLUE_HUES', 'POINTS', 'PIXELS', 'DIVIDE_MODE', -'SUBTRACT_MODE', 'SATURATION_MODE', 'ADDITION_MODE', 'SCREEN_MODE', 'BEHIND_MODE', 'MULTIPLY_MODE', 'DARKEN_ONLY_MODE', -'DIFFERENCE_MODE', 'DISSOLVE_MODE', 'VALUE_MODE', 'LIGHTEN_ONLY_MODE', 'COLOR_MODE', 'NORMAL_MODE', 'HUE_MODE', -'OVERLAY_MODE', 'BLUR_CONVOLVE', 'CUSTOM_CONVOLVE', 'SHARPEN_CONVOLVE', 'SHADOWS', 'MIDTONES', 'HIGHLIGHTS', -'REPLACE', 'SUB', 'ADD', 'INTERSECT', 'IMAGE_CLONE', 'PATTERN_CLONE', 'INDEXED', -'RGB', 'GRAY', 'BLACK_MASK', 'WHITE_MASK', 'ALPHA_MASK', 'BILINEAR', 'SPIRAL_CLOCKWISE', -'SQUARE', 'RADIAL', 'CONICAL_SYMMETRIC', 'SHAPEBURST_DIMPLED', 'CONICAL_ASYMMETRIC', 'LINEAR', 'SPIRAL_ANTICLOCKWISE', -'SHAPEBURST_ANGULAR', 'SHAPEBURST_SPHERICAL','PLUGIN', 'EXTENSION', 'INTERNAL', 'MESSAGE_BOX', 'ERROR_CONSOLE', -'CONSOLE', 'EXPAND_AS_NECESSARY', 'CLIP_TO_BOTTOM_LAYER','CLIP_TO_IMAGE', 'FLATTEN_IMAGE', 'RUN_INTERACTIVE', 'RUN_WITH_LAST_VALS', -'RUN_NONINTERACTIVE', 'REPEAT_NONE', 'REPEAT_SAWTOOTH', 'REPEAT_TRIANGULAR', +'INDEXEDA_IMAGE', 'GRAY_IMAGE', 'CUSTOM', 'FG_BG_HSV', 'FG_TRANS', 'FG_BG_RGB', 'BLUE_CHANNEL', +'GREEN_CHANNEL', 'GRAY_CHANNEL', 'AUXILLARY_CHANNEL', 'INDEXED_CHANNEL', 'RED_CHANNEL', 'CONTINUOUS', 'INCREMENTAL', +'APPLY', 'DISCARD', 'UNKNOWN', 'VERTICAL', 'HORIZONTAL', 'ORIENTATION_VERTICAL','ORIENTATION_HORIZONTAL', +'ORIENTATION_UNKNOWN', 'DODGEBURN_HIGHLIGHTS','DODGEBURN_SHADOWS', 'DODGEBURN_MIDTONES', 'CUBIC_INTERPOLATION', 'LINEAR_INTERPOLATION','NEAREST_NEIGHBOR_INTERPOLATION', +'ALPHA_LUT', 'GREEN_LUT', 'BLUE_LUT', 'VALUE_LUT', 'RED_LUT', 'OFFSET_BACKGROUND', 'OFFSET_TRANSPARENT', +'BG_BUCKET_FILL', 'FG_BUCKET_FILL', 'PATTERN_BUCKET_FILL', 'FSLOWBLEED_DITHER', 'NODESTRUCT_DITHER', 'FS_DITHER', 'NO_DITHER', +'FIXED_DITHER', 'PDB_SUCCESS', 'PDB_CALLING_ERROR', 'PDB_EXECUTION_ERROR', 'PDB_PASS_THROUGH', 'WHITE_IMAGE_FILL', 'FG_IMAGE_FILL', +'TRANS_IMAGE_FILL', 'BG_IMAGE_FILL', 'NO_IMAGE_FILL', 'LOOP_SAWTOOTH', 'ONCE_BACKWARDS', 'ONCE_FORWARD', 'ONCE_END_COLOR', +'LOOP_TRIANGLE', 'MONO_PALETTE', 'WEB_PALETTE', 'MAKE_PALETTE', 'REUSE_PALETTE', 'CUSTOM_PALETTE', 'BURN', +'DODGE', 'CYAN_HUES', 'RED_HUES', 'GREEN_HUES', 'YELLOW_HUES', 'ALL_HUES', 'MAGENTA_HUES', +'BLUE_HUES', 'POINTS', 'PIXELS', 'DIVIDE_MODE', 'SUBTRACT_MODE', 'SATURATION_MODE', 'ADDITION_MODE', +'SCREEN_MODE', 'BEHIND_MODE', 'MULTIPLY_MODE', 'DARKEN_ONLY_MODE', 'DIFFERENCE_MODE', 'DISSOLVE_MODE', 'VALUE_MODE', +'LIGHTEN_ONLY_MODE', 'COLOR_MODE', 'NORMAL_MODE', 'HUE_MODE', 'OVERLAY_MODE', 'NEGATIVE_CONVOL', 'NORMAL_CONVOL', +'ABSOLUTE_CONVOL', 'BLUR_CONVOLVE', 'CUSTOM_CONVOLVE', 'SHARPEN_CONVOLVE', 'TOOL_CAN_HANDLE_CHANGING_BRUSH','REPLACE', 'SUB', +'ADD', 'INTERSECT', 'SHADOWS', 'MIDTONES', 'HIGHLIGHTS', 'IMAGE_CLONE', 'PATTERN_CLONE', +'INDEXED', 'RGB', 'GRAY', 'BLACK_MASK', 'WHITE_MASK', 'ALPHA_MASK', 'BILINEAR', +'SPIRAL_CLOCKWISE', 'SQUARE', 'RADIAL', 'CONICAL_SYMMETRIC', 'SHAPEBURST_DIMPLED', 'CONICAL_ASYMMETRIC', 'LINEAR', +'SPIRAL_ANTICLOCKWISE','SHAPEBURST_ANGULAR', 'SHAPEBURST_SPHERICAL','PLUGIN', 'EXTENSION', 'INTERNAL', 'MESSAGE_BOX', +'ERROR_CONSOLE', 'CONSOLE', 'EXPAND_AS_NECESSARY', 'CLIP_TO_BOTTOM_LAYER','CLIP_TO_IMAGE', 'FLATTEN_IMAGE', 'RUN_INTERACTIVE', +'RUN_WITH_LAST_VALS', 'RUN_NONINTERACTIVE', 'REPEAT_NONE', 'REPEAT_SAWTOOTH', 'REPEAT_TRIANGULAR', #ENUM_NAME# 'STATUS_CALLING_ERROR', 'STATUS_EXECUTION_ERROR', 'STATUS_PASS_THROUGH', 'STATUS_SUCCESS', 'PARASITE_PERSISTENT', 'PARASITE_ATTACH_PARENT', @@ -73,23 +75,26 @@ bootstrap Gimp $VERSION; #ENUM_DEFS# sub PRESSURE (){ 2} sub SOFT (){ 1} sub HARD (){ 0} sub RGBA_IMAGE (){ 1} sub INDEXED_IMAGE (){ 4} sub GRAYA_IMAGE (){ 3} sub RGB_IMAGE (){ 0} sub INDEXEDA_IMAGE (){ 5} sub GRAY_IMAGE (){ 2} sub CUSTOM (){ 3} -sub FG_BG_HSV (){ 1} sub FG_TRANS (){ 2} sub FG_BG_RGB (){ 0} sub CONTINUOUS (){ 0} sub INCREMENTAL (){ 1} -sub APPLY (){ 0} sub DISCARD (){ 1} sub BLUE_CHANNEL (){ 2} sub GREEN_CHANNEL (){ 1} sub GRAY_CHANNEL (){ 3} -sub AUXILLARY_CHANNEL (){ 5} sub INDEXED_CHANNEL (){ 4} sub RED_CHANNEL (){ 0} sub UNKNOWN (){ 2} sub VERTICAL (){ 1} -sub HORIZONTAL (){ 0} sub DODGEBURN_HIGHLIGHTS(){ 0} sub DODGEBURN_SHADOWS (){ 2} sub DODGEBURN_MIDTONES (){ 1} sub ALPHA_LUT (){ 4} -sub GREEN_LUT (){ 2} sub BLUE_LUT (){ 3} sub VALUE_LUT (){ 0} sub RED_LUT (){ 1} sub OFFSET_BACKGROUND (){ 0} -sub OFFSET_TRANSPARENT (){ 1} sub BG_BUCKET_FILL (){ 1} sub FG_BUCKET_FILL (){ 0} sub PATTERN_BUCKET_FILL (){ 2} sub PDB_SUCCESS (){ 3} -sub PDB_CALLING_ERROR (){ 1} sub PDB_EXECUTION_ERROR (){ 0} sub PDB_PASS_THROUGH (){ 2} sub WHITE_IMAGE_FILL (){ 2} sub FG_IMAGE_FILL (){ 0} -sub TRANS_IMAGE_FILL (){ 3} sub BG_IMAGE_FILL (){ 1} sub NO_IMAGE_FILL (){ 4} sub LOOP_SAWTOOTH (){ 2} sub ONCE_BACKWARDS (){ 1} -sub ONCE_FORWARD (){ 0} sub ONCE_END_COLOR (){ 4} sub LOOP_TRIANGLE (){ 3} sub MONO_PALETTE (){ 3} sub WEB_PALETTE (){ 2} -sub MAKE_PALETTE (){ 0} sub REUSE_PALETTE (){ 1} sub CUSTOM_PALETTE (){ 4} sub BURN (){ 1} sub DODGE (){ 0} -sub CYAN_HUES (){ 4} sub RED_HUES (){ 1} sub GREEN_HUES (){ 3} sub YELLOW_HUES (){ 2} sub ALL_HUES (){ 0} -sub MAGENTA_HUES (){ 6} sub BLUE_HUES (){ 5} sub POINTS (){ 1} sub PIXELS (){ 0} sub DIVIDE_MODE (){15} -sub SUBTRACT_MODE (){ 8} sub SATURATION_MODE (){12} sub ADDITION_MODE (){ 7} sub SCREEN_MODE (){ 4} sub BEHIND_MODE (){ 2} -sub MULTIPLY_MODE (){ 3} sub DARKEN_ONLY_MODE (){ 9} sub DIFFERENCE_MODE (){ 6} sub DISSOLVE_MODE (){ 1} sub VALUE_MODE (){14} -sub LIGHTEN_ONLY_MODE (){10} sub COLOR_MODE (){13} sub NORMAL_MODE (){ 0} sub HUE_MODE (){11} sub OVERLAY_MODE (){ 5} -sub BLUR_CONVOLVE (){ 0} sub CUSTOM_CONVOLVE (){ 2} sub SHARPEN_CONVOLVE (){ 1} sub SHADOWS (){ 0} sub MIDTONES (){ 1} -sub HIGHLIGHTS (){ 2} sub REPLACE (){ 2} sub SUB (){ 1} sub ADD (){ 0} sub INTERSECT (){ 3} +sub FG_BG_HSV (){ 1} sub FG_TRANS (){ 2} sub FG_BG_RGB (){ 0} sub BLUE_CHANNEL (){ 2} sub GREEN_CHANNEL (){ 1} +sub GRAY_CHANNEL (){ 3} sub AUXILLARY_CHANNEL (){ 5} sub INDEXED_CHANNEL (){ 4} sub RED_CHANNEL (){ 0} sub CONTINUOUS (){ 0} +sub INCREMENTAL (){ 1} sub APPLY (){ 0} sub DISCARD (){ 1} sub UNKNOWN (){ 2} sub VERTICAL (){ 1} +sub HORIZONTAL (){ 0} sub ORIENTATION_VERTICAL(){ 2} sub ORIENTATION_HORIZONTAL(){ 1} sub ORIENTATION_UNKNOWN (){ 0} sub DODGEBURN_HIGHLIGHTS(){ 0} +sub DODGEBURN_SHADOWS (){ 2} sub DODGEBURN_MIDTONES (){ 1} sub CUBIC_INTERPOLATION (){ 1} sub LINEAR_INTERPOLATION(){ 0} sub NEAREST_NEIGHBOR_INTERPOLATION(){ 2} +sub ALPHA_LUT (){ 4} sub GREEN_LUT (){ 2} sub BLUE_LUT (){ 3} sub VALUE_LUT (){ 0} sub RED_LUT (){ 1} +sub OFFSET_BACKGROUND (){ 0} sub OFFSET_TRANSPARENT (){ 1} sub BG_BUCKET_FILL (){ 1} sub FG_BUCKET_FILL (){ 0} sub PATTERN_BUCKET_FILL (){ 2} +sub FSLOWBLEED_DITHER (){ 2} sub NODESTRUCT_DITHER (){ 4} sub FS_DITHER (){ 1} sub NO_DITHER (){ 0} sub FIXED_DITHER (){ 3} +sub PDB_SUCCESS (){ 3} sub PDB_CALLING_ERROR (){ 1} sub PDB_EXECUTION_ERROR (){ 0} sub PDB_PASS_THROUGH (){ 2} sub WHITE_IMAGE_FILL (){ 2} +sub FG_IMAGE_FILL (){ 0} sub TRANS_IMAGE_FILL (){ 3} sub BG_IMAGE_FILL (){ 1} sub NO_IMAGE_FILL (){ 4} sub LOOP_SAWTOOTH (){ 2} +sub ONCE_BACKWARDS (){ 1} sub ONCE_FORWARD (){ 0} sub ONCE_END_COLOR (){ 4} sub LOOP_TRIANGLE (){ 3} sub MONO_PALETTE (){ 3} +sub WEB_PALETTE (){ 2} sub MAKE_PALETTE (){ 0} sub REUSE_PALETTE (){ 1} sub CUSTOM_PALETTE (){ 4} sub BURN (){ 1} +sub DODGE (){ 0} sub CYAN_HUES (){ 4} sub RED_HUES (){ 1} sub GREEN_HUES (){ 3} sub YELLOW_HUES (){ 2} +sub ALL_HUES (){ 0} sub MAGENTA_HUES (){ 6} sub BLUE_HUES (){ 5} sub POINTS (){ 1} sub PIXELS (){ 0} +sub DIVIDE_MODE (){15} sub SUBTRACT_MODE (){ 8} sub SATURATION_MODE (){12} sub ADDITION_MODE (){ 7} sub SCREEN_MODE (){ 4} +sub BEHIND_MODE (){ 2} sub MULTIPLY_MODE (){ 3} sub DARKEN_ONLY_MODE (){ 9} sub DIFFERENCE_MODE (){ 6} sub DISSOLVE_MODE (){ 1} +sub VALUE_MODE (){14} sub LIGHTEN_ONLY_MODE (){10} sub COLOR_MODE (){13} sub NORMAL_MODE (){ 0} sub HUE_MODE (){11} +sub OVERLAY_MODE (){ 5} sub NEGATIVE_CONVOL (){ 2} sub NORMAL_CONVOL (){ 0} sub ABSOLUTE_CONVOL (){ 1} sub BLUR_CONVOLVE (){ 0} +sub CUSTOM_CONVOLVE (){ 2} sub SHARPEN_CONVOLVE (){ 1} sub TOOL_CAN_HANDLE_CHANGING_BRUSH(){0x0001} sub REPLACE (){ 2} sub SUB (){ 1} +sub ADD (){ 0} sub INTERSECT (){ 3} sub SHADOWS (){ 0} sub MIDTONES (){ 1} sub HIGHLIGHTS (){ 2} sub IMAGE_CLONE (){ 0} sub PATTERN_CLONE (){ 1} sub INDEXED (){ 2} sub RGB (){ 0} sub GRAY (){ 1} sub BLACK_MASK (){ 1} sub WHITE_MASK (){ 0} sub ALPHA_MASK (){ 2} sub BILINEAR (){ 1} sub SPIRAL_CLOCKWISE (){ 9} sub SQUARE (){ 3} sub RADIAL (){ 2} sub CONICAL_SYMMETRIC (){ 4} sub SHAPEBURST_DIMPLED (){ 8} sub CONICAL_ASYMMETRIC (){ 5} @@ -336,7 +341,7 @@ sub quiet_die { $in_top ? exit(1) : die "IGNORE THIS MESSAGE\n"; } -unless ($no_SIG) { +unless($no_SIG) { $SIG{__DIE__} = sub { unless ($^S || !defined $^S || $in_quit) { die_msg $_[0]; @@ -498,11 +503,6 @@ sub AUTOLOAD { goto &$AUTOLOAD; } } - # for performance reasons: supply a DESTROY method - if($name eq "DESTROY") { - *{$AUTOLOAD} = sub {}; - return; - } croak "function/macro \"$name\" not found in $class"; } @@ -510,6 +510,7 @@ sub _pseudoclass { my ($class, @prefixes)= @_; unshift(@prefixes,""); *{"Gimp::$class\::AUTOLOAD"} = \&AUTOLOAD; + *{"Gimp::$class\::DESTROY"} = sub {}; push(@{"$class\::ISA"} , "Gimp::$class"); push(@{"Gimp::$class\::PREFIXES"} , @prefixes); @prefixes=@{"Gimp::$class\::PREFIXES"}; push(@{"$class\::PREFIXES"} , @prefixes); @prefixes=@{"$class\::PREFIXES"}; diff --git a/plug-ins/perl/examples/PDB b/plug-ins/perl/examples/PDB index 8438520111..6c82a0054e 100755 --- a/plug-ins/perl/examples/PDB +++ b/plug-ins/perl/examples/PDB @@ -7,6 +7,8 @@ use Gimp (':consts'); use Gimp::Fu; use Gtk; use Gtk::Gdk; +use Gimp::UI (); # for the logo +use POSIX 'strftime'; Gtk->init; @@ -31,12 +33,20 @@ my @args; # the arguments of the current function my @function; # the names of all functions my %function; # the same as hash -my %completion; # a hash that maps completion names to values +my @completion; # list of completions +my @compdata; # index completion -> data +my %plugin_info;# function -> [...] sub refresh { undef %function; @function = Gimp->procedural_db_query("","","","","","",""); @function{@function}=(1) x @function; + eval { + my ($a, $b, $c, $d, $e, $f) = Gimp->plugins_query(""); + for $i (0..$#$a) { + $plugin_info{$f->[$i]} = [map $_->[$i], $a, $b, $c, $d, $e]; + } + } } sub get_words { @@ -139,36 +149,45 @@ sub set_current_function { $function{$fun} or die; ($blurb,$help,$author,$copyright,$date,$type,$args,$results)= Gimp->procedural_db_proc_info($fun); + $blurb_label->set($blurb); for(0..$args-1) { push(@args,[Gimp->procedural_db_proc_arg($fun,$_)]); } new_cinfo; - }; + + $help_text->delete_text(0,-1); + $help_text->insert_text($help,0); + eval { + my ($menupath, $accel, $path, $imagetypes, $mtime) = @{$plugin_info{$fun}}; + $menupath_label->set($menupath); + $accelerator_label->set($accel); + $plugin_path_label->set($path); + $imagetypes_label->set($imagetypes); + $last_modified_label->set(strftime("%Y-%m-%d %H:%M:%S (%Z)", localtime ($mtime))); + }; + } } -my $block_sel_changed; # gtk is braindamaged -my $block_changed; # gtk is broken - sub set_clist { - $block_sel_changed++; - $clist->clear_items(0,99999); - %completion=@_; + $clist->freeze; + $clist->clear; + @completion = (); + @compdata = (); while(@_) { - $clist->add(new Gtk::ListItem(shift)); - shift; + $clist->append(@_[0]); + push @completion, shift; + push @compdata, shift; } - $clist->unselect_item(0); - $clist->show_all; - $block_sel_changed--; + $clist->thaw; } sub complete_function { my $name = shift; $name=~s/[-_]/[-_]/g; my @matches = eval { sort grep /$name/i,@function }; - if(@matches>70) { - set_clist map(($_,$_),@matches[0..69]); - $synopsis->set("showing only the first 70 matches (of ".(scalar@matches).")"); + if(@matches>1e6) {#d# + set_clist map(($_,$_),@matches[0..149]); + $synopsis->set("showing only the first 150 matches (of ".(scalar@matches).")"); } elsif(@matches>1) { set_clist map(($_,$_),@matches); $synopsis->set(scalar@matches." matching functions"); @@ -235,14 +254,14 @@ sub do_completion { my($word)=$words[$idx]; $word=~s/[-_]/[-_]/g; - my(@matches)=grep /$word/i,keys %completion; + my(@matches)=grep /$word/i,@completion; my $new; if (@matches>1) { if (join("\n",@matches) =~ ("^(".$words[$idx].".*).*?".("\n\\1.*" x scalar@matches-1))) { $new=$1; } } elsif(@matches==1) { - $new=$completion{$matches[0]}; + $new=$compdata[0]; } else { Gtk::Gdk->beep; } @@ -287,7 +306,6 @@ sub inputline { my $e = new Gtk::Entry; $e->set_text(""); $e->signal_connect("changed",sub { - return if $block_changed; undef $last_arg; do_idle; }); @@ -309,19 +327,15 @@ sub inputline { $e->set_usize($ex*40,0); $inputline=$e; - my $c = new Gtk::List; + my $c = new Gtk::CList(1); $clist = $c; - $c->set_selection_mode(-single); - $c->set_selection_mode(-browse); - $c->signal_connect("selection_changed", sub { - return if $block_sel_changed; + $c->set_selection_mode(-extended); + $c->signal_connect("select_row", sub { eval { my($idx,$pos,@words)=get_words; - $words[$idx]=$completion{$c->selection->children->get}."\0"; - $block_changed++; + $words[$idx]=$compdata[$_[1]]."\0"; set_words (@words); set_current_function (substr($words[0],0,-1)) unless $idx; - $block_changed--; }; do_idle; }); @@ -332,6 +346,48 @@ sub inputline { $r->set_selection_mode(-browse); } +sub info { + my $info = new Gtk::Dialog; + $info->set_title("Function Info"); + $info->signal_connect(delete_event => sub { $info->hide }); + + my $close = new Gtk::Button "Close"; + $close->signal_connect(clicked => sub { $info->hide }); + $info->action_area->add($close); + + local *add_info = sub { + my ($label, $widget, $large) = @_; + my $h = new Gtk::HBox(0, 0); + $h->pack_start((new Gtk::Label $label.": "), 0, 0, 0); + $h->add($widget); + $info->vbox->pack_start($h, $large, 1, 5); + }; + + $blurb_label = new Gtk::Label; + add_info("Menu Path", $menupath_label = new Gtk::Label); + add_info("Accelerator", $accelerator_label = new Gtk::Label); + add_info("Image Types", $imagetypes_label = new Gtk::Label); + + $help_text = new Gtk::Text; + $help_text->set_editable(0); + $help_text->set_word_wrap(1); + my $cs = new Gtk::ScrolledWindow undef,undef; + $cs->set_policy(-automatic,-automatic); + $cs->add ($help_text); + add_info ("Description", $cs, 1); + + add_info("Author", $author_label = new Gtk::Label); + add_info("Last Modified", $last_modified_label = new Gtk::Label); + add_info("Plug-In Path", $plugin_path_label = new Gtk::Label); + + my $h = new Gtk::HBox(0,5); + my $more = new Gtk::Button "More..."; + $more->signal_connect(clicked => sub { $info->visible ? $info->hide : $info->show_all }); + $h->add($blurb_label); + $h->add($more); + $h; +} + sub create_main { my $b; my $t; @@ -345,7 +401,7 @@ sub create_main { $ex = $w->style->font->string_width ('Mn')*0.5; $ey = $w->style->font->string_width ('My'); - $w->set_title('PDB Explorer - the alpha version'); + $w->set_title('PDB Explorer - the olof edition (yet still an alpha version)'); $w->signal_connect("destroy",sub {main_quit Gtk}); $b = new Gtk::Button "Close"; @@ -365,12 +421,12 @@ sub create_main { my $cs = new Gtk::ScrolledWindow undef,undef; $cs->set_policy(-automatic,-automatic); - $cs->add_with_viewport ($clist); + $cs->add ($clist); my $rs = new Gtk::ScrolledWindow undef,undef; $rs->set_policy(-automatic,-automatic); $rs->add_with_viewport ($rlist); - $rs->set_usize(0,200); + $rs->set_usize(0,$ey*6); $result = new Gtk::Entry; $result->set_editable(0); @@ -382,7 +438,7 @@ sub create_main { $table->attach(new Gtk::Label("Synopsis") ,0,1,0,1,{},{},0,0); $table->attach($synopsis ,1,2,0,1,{},{},0,0); - #$table->attach(logo(),2,3,0,1,{},{},0,0); + $table->attach(Gimp::UI::logo($w),2,3,0,1,{},{},0,0); $table->attach(new Gtk::Label("Command") ,0,1,1,2,{},{},0,0); $table->attach($inputline,1,2,1,2,['expand','fill'],{},0,0); $table->attach($result,2,3,1,2,['expand','fill'],{},0,0); @@ -392,8 +448,12 @@ sub create_main { $table->attach(new Gtk::Label("Status"),0,1,3,4,{},{},0,0); $table->attach($statusbar,1,3,3,4,['expand','fill'],['expand','fill'],0,0); - my $ci = new Gtk::Frame "Command Info"; + # the Info frame + my $ci = new Gtk::Frame "Info"; $ci->border_width(10); + my $v = new Gtk::VBox(0,5); + $ci->add($v); + $v->pack_start(info, 0, 1, 0); my $sw = new Gtk::ScrolledWindow; $sw->set_policy(-automatic, -automatic); $cinfo = new_with_titles Gtk::CList '','TYPE','NAME','DESCRIPTION'; @@ -401,16 +461,15 @@ sub create_main { $cinfo->set_column_auto_resize (1,1); $cinfo->set_column_auto_resize (2,1); $cinfo->set_selection_mode('single'); + $cinfo->set_usize(0, $ey*4); $sw->add ($cinfo); - $ci->add ($sw); + $v->add ($sw); $w->vbox->pack_start ($ci,1,1,0); idle; $w->realize; - $w->window->resize($ex*60,$ey*25); show_all $w; - $w->window->resize($ex*60,$ey*25); } register "extension_pdb_explorer", @@ -434,56 +493,3 @@ register "extension_pdb_explorer", exit main; -sub logo { - new Gtk::Pixmap(Gtk::Gdk::Pixmap->create_from_xpm_d($window->window,$window->style->black, - #%XPM:logo% - '79 33 25 1', ' c None', '. c #020204', '+ c #848484', '@ c #444444', - '# c #C3C3C4', '$ c #252524', '% c #A5A5A4', '& c #646464', '* c #E4E4E4', - '= c #171718', '- c #989898', '; c #585858', '> c #D7D7D7', ', c #383838', - '\' c #B8B8B8', ') c #787878', '! c #F7F7F8', '~ c #0B0B0C', '{ c #8C8C8C', - '] c #4C4C4C', '^ c #CCCCCC', '/ c #2C2C2C', '( c #ABABAC', '_ c #6C6C6C', - ': c #EBEBEC', - ' ', - ' ]&@;% ', - ' ;]_ ]];{_,&( ^{__{^ #);^ ', - ' ]);;+;) ,//,@;@@)_ #_......_^ (..; ', - ' ;-\'\'@];@ /$=$/@_@;& #]........]\' ^..{ ', - ' @@_+%-,,] ,/$///_^)&@; -...{^>+./( \'*^! {{ ##( ##\' {{ ##( ', - ' ;))@/; //]);/$]_(\');] %,..+ ^*! #/,{ #,/%&..@*&..,^ >,,(;..,^ ', - ' /,)];]] ,/],+%;_%-#!#()_ \'...> >)_)_))\'\'.._ (..=~...=.~..; ^..=....=> ', - ' ,]]&;;] /@;->>+-+{(\'\'-+] #...# #.....=\'\'..) \'..]*\'..$>>../-^..$##,..- ', - ' @_{@/, @$@_^*>(_;_&;{);\'] \'~..> ^,,/../-\'.._ (..{ ^..; \'=./-^..% #..& ', - ' ,&);,& ,])-^:>#%#%+;)>->] ;..) >(..; \'..) \'..- #.._ -=./-^..( ^..& ', - ' ,&&%]-&/]]_::^\'#--(#!:#:]& ^...)^#-~..# \'.._ (..% #.._ %=./-^..,>*;..+ ', - ' ,/&%;{%;//_#^#+%+{%#!:-#%]] -........{ \'..) \'..% #.._ %=./-^..~....~* ', - ' ;$@%+)#)@$/-\')%-+-)+^#@;)@, #@..../\' #~~) \'~~% #~=_ -/~,-^..)/..=\' ', - ' ,@+(\'#);,={)]%^);@;&@=]] , %#\'#^( (%( (% %%( (%% ^..{>### ', - ' ,@)^#;,/={)_\'-;///$$=;@ ,, ^..{ ', - ' ],&)_=$==/])\'+),],,/$)@ @, %(\'((\'((\' ^..{ ', - ' @@]/=====@-)-]$$, ]_/ , %=~~=~==& >%%^ ', - ' =$@/@,@]/]$=/ ])$ & {{{{ %=====~=_ \'-{% ', - ' ,$// /$/@ /$, $,, %;@,,,;{> (\'\'\'\'\'\'\'\' #~.$- ', - ' //=/ $,/; $,, @@ ($......,> #~.${ ', - ' /$, /,,, @@ ,, %$..],...{ ^~.$- ', - ' ], ]@] )& , ($..>({..; #\'+)\'^ ^#\'*>(-!~.${ ', - ' @, -- (; @ %$..^({..] *,..../* ^.._,.$!~.$- ', - ' _, @\' ;\' ) %$..@@...)!@.$#(=.; ^..~.~,!~.${ ', - ' ]/ ]) - ] ($......=>^..;--@.~^>...(^#:~.$- ', - ' ; ;-__ ; ($../,])> %........#>..@( #~.${ ', - ' _ )* ] %$..>{ \'..->^*>>\'>..; #~.$- ', - ' ) &&+ _ %$..\' >=.]>>)&^ ^..; #~.${ ', - ' ;- @;];] &- ($..\' \'~.....+ ^..; #~.$- ', - ' \') ]_& @ __ %{))# >_@,;\' >)+( #+){ ', - ' &% @; ', - ' ,{_ ' - #%XPM% - )); -} - - - - - - - -