Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > GIMP (GNU Image Manipulation Program) > Printing GIMP's...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2955 of 3157
Post > Topic >>

Printing GIMP's keyboard controls

by Arthur T. <arthur@[EMAIL PROTECTED] > May 11, 2008 at 11:03 PM

I found a PDF of GIMP's keyboard controls.  I couldn't use it
for several reasons: printing too close to edges for my printer,
font too small to read what did print, and some keys that did not
work on my implementation.

     It prompted me to write my own program as stage one (of two)
for printing them.  The program reads the menurc file looking for
actions with defined keys.  It strips all of the excess verbiage
and writes the sorted output.

     In stage two, I take the file into a word processing program.
I find that if I delete a few I'd never use, it fits well on one
page with 3 columns in 10 pitch.  (With plenty of room left over
for larger section headers and a large title.)

     In case anyone else wants it, here is the program.  It's
written in Regina REXX and requires the REGUTIL (sometimes called
the REXXUTIL) add-on package.  I'm sure it could easily be
modified for other flavors of REXX.  And, of course, it would be
easy to rewrite in whatever language you're familiar with.

>/*REXX - step one of making GIMP key assignments printable */
>/*
>  This program is designed to read the GIMP's menurc file.  It
>  then will create an output file.  That output file can be
>  opened by a word-processing program to create a reasonable-looking
>  reference of GIMP's keyboard shortcuts (with a little work).
>
>  This program is copyright 2008 by Arthur Tansky. License granted
>  for non-commercial use and distribution as long as:
>  1. copyright notice is maintained,
>  2. any modified versions are clearly marked as modified, and
>  3. no money changes hands.
>
>  You should make two changes for this program to
>  run correctly, both in the INITIALIZATION routine:
>
>  1.  The value for "file" must be the fully-qualified location
>      of your GIMP's menurc file.
>  2.  The value for "outfile" must be the filename and location of
>      the output file.
>
>*/
>
>
>  /* My standard entry routine */
>  arg temp1
>  do while temp1 \= ''
>    parse var temp1 temp2 temp1
>    if right(temp2,1) = ')' then
>      temp2 = translate(temp2,'= ','()')
>    if pos('=',temp2) = 0 then temp2 = temp2 || '= ""'
>    interpret temp2
>  end
>  drop temp1
>  drop temp2
>  if debug = 'TRACE' then trace ?i
>  else if debug \= "DEBUG" then trace i
>  /* end of my standard entry routine */
>
>  call INITIALIZE
>
>  /* read and sort the menurc file */
>  call RegStemRead file, inline.
>  call SysStemSort inline,,'insensitive'
>
>  max = inline.0
>
>  /*
>      Ignore all lines which don't define keyboard shortcuts.
>      Create tables for each group of shortcuts, getting rid of
>      extraneous data from the input lines.
>  */
>
>  do i = 1 to max
>    paren = pos(')',inline.i)
>    if paren < 3 then iterate i
>    if substr(inline.i,paren-2,2) == '""' then iterate i  /* no shortcut
key */
>    parse var inline.i . '>/' action '" "' key '"' .
>    parse var action actionGroup '/' . '-' function
>
>    /* next lines take care of actiongroup "plug-in" which has a hyphen
*/
>    if left(function,3) = 'in-' then
>      do
>        parse var function . 4 function
>      end
>
>    if table.actiongroup.0 = 255 then /* new action */
>      do
>        itemp = table.groups.0 + 1
>        table.groups.0 = itemp
>        table.groups.itemp = actionGroup
>        itemp = 1
>      end
>    else
>      do
>        itemp = table.actiongroup.0 + 1
>      end
>
>    table.actiongroup.0 = itemp
>    table.actiongroup.itemp = function || tab || key
>  end
>
>  /*
>      Gather all of the tables and write them.  It's likely I could have
>      bypassed either the sort in the input, or this separate section for
>      the output.  I thought this gave greater readability and
flexibility.
>  */
>
>  out = 0
>  do i = 1 to table.groups.0
>    actiongroup = table.groups.i
>    out = out + 1
>    line.out = actiongroup    /* separate line for the name of the group
*/
>    do j = 1 to table.actiongroup.0
>      out = out + 1
>      line.out = table.actiongroup.j
>    end
>  end
>  line.0 = out
>
>  call RegStemWrite outfile, line.
>
>  exit 0
>
>INITIALIZE:
>
>  call rxfuncadd 'sysloadfuncs','RexxUtil','sysloadfuncs'
>  call sysloadfuncs
>
>  if file = 'FILE' then file = 'C:\DO***E~1\Arthur\GIMP-2~1.4\menurc'
>  if outfile = 'OUTFILE' then outfile = 'f:\gimp.key'
>
>  table. = 255
>  table.groups.0 = 0
>  tab = x2c(9)
>
>  return

     Note 1:  It was pasted as quoted text so my newsreader
wouldn't wrap the lines.

     Note 2:  Except for the comments, it was written as a "quick
and dirty".  You may notice a lack of error handling.

     Note 3:  I run Windows.  I don't see any reason this
shouldn't run correctly on a Unix system.  If anyone tries it,
please let me know your results.

-- 
Arthur T. - ar23hur "at" intergate "dot" com
Looking for a z/OS (IBM mainframe) systems programmer position
 




 1 Posts in Topic:
Printing GIMP's keyboard controls
Arthur T. <arthur@[EMA  2008-05-11 23:03:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 22:15:36 CST 2008.