Presdec Example Output

After unpacking the presdec.zip on your computer and installing everything, you will find the pilrctst.prc file in the examples directory.

This prc file, which is shamelessly taken from the PilRC distribution, just demonstrates numerous GUI elements. To decompile it just enter something similar to:

innot$ cd examples/
innot$ presdec -s -t ascii pilrctst.prc
    
The options tell Presdec to

-s

Sort the resources in the resulting file

-t ascii

save all bitmaps and icons as plain ascii files



After Presdec has finished, you will find the following files on your disk:

innot$ ls -l
total 34
-rw-r--r--   1 innot    innot        2638 Oct 20 17:49 bmp1000.asc
-rw-r--r--   1 innot    innot        2638 Oct 20 17:49 bmp1001.asc
-rw-r--r--   1 innot    innot        2638 Oct 20 17:49 bmp1002.asc
-rw-r--r--   1 innot    innot        2638 Oct 20 17:49 bmp1003.asc
-rw-r--r--   1 innot    innot        2638 Oct 20 17:49 bmp1004.asc
-rw-r--r--   1 innot    innot        1278 Oct 20 17:49 icn1000.asc
-rw-r--r--   1 innot    innot        8147 Oct 19 07:56 pilrctst.prc
-rw-r--r--   1 innot    innot        8643 Oct 20 17:49 pilrctst.rcp



    

The GUI description file (pilrctst.rcp) looks like this:

innot$ cat pilrctst.rcp

// This file was automatically generated from pilrctst.prc
// by "presdec" version 1.0 at 15:49:53 20-Oct-1998
// presdec is (c) T.Holland
// For more information and the latest version contact thomas@innot.de
// or visit http://www.innot.de/presdec


ICON "icn1000.asc"
VERSION ID 1 "0.2.1"


ALERT ID 1000
HELPID 1001
INFORMATION
BEGIN
  TITLE       "Bummer!"
  MESSAGE     "Them there Menu items don't do nothin."
  BUTTONS     "Ok" "Continue" 
END


FORM ID 1000 AT (20 2 136 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest 1 (LABEL)"
      LABEL       "Font 0\251" ID 9999 AT (51 20) 
      LABEL       "Font 1" ID 9998 AT (103 32) FONT 1 
      LABEL       "Font 2" ID 9997 AT (50 44) FONT 2 
      LABEL       "\001\002\003\004\005\006" ID 9996 AT (42 59) FONT 3 
      LABEL       "\001\002\003\004\005\006" ID 9995 AT (43 70) FONT 4 
      LABEL       "\001\002\003\004\005\006" ID 9994 AT (41 82) FONT 5 
      LABEL       "123456" ID 9993 AT (41 91) FONT 6 
      LABEL       "Nonusable should be hidden" ID 2003 AT (12 111) NONUSABLE 
      LABEL       "Font0" ID 9992 AT (10 123) 
      LABEL       "Font1" ID 9991 AT (34 123) FONT 1 
      LABEL       "Font2" ID 9990 AT (64 123) FONT 2 
      BUTTON      "Ok" ID 100 AT (56 140 24 12) 
END


STRING ID 1000  "This is a test form for PilRC.\n"\
              "by Wes Cherry\n"\
              "wesc@ricochet.net"


MENU ID 1000
BEGIN
      PULLDOWN "File"
      BEGIN
              MENUITEM "Open\205" ID 5000 "O"
              MENUITEM SEPARATOR
              MENUITEM "Close" ID 5002 
      END
      PULLDOWN "Edit"
      BEGIN
              MENUITEM "Undo" ID 6000 "U"
              MENUITEM "Cut" ID 6001 "X"
              MENUITEM "Copy" ID 6002 "C"
              MENUITEM "Paste" ID 6003 "P"
              MENUITEM SEPARATOR
              MENUITEM "Keyboard" ID 6004 "K"
      END
END


FORM ID 1001 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (BUTTON)"
      BUTTON      "FrameButton1" ID 2000 AT (42 20 71 12) 
      BUTTON      "NoFrameButton1" ID 2001 AT (37 34 82 12) NOFRAME 
      BUTTON      "BoldFrameButton1" ID 2002 AT (34 48 88 12) BOLDFRAME 
      BUTTON      "LeftAnchor" ID 2003 AT (10 62 100 12) LEFTANCHOR 
      BUTTON      "RightAnchor" ID 2004 AT (10 75 100 12) 
      BUTTON      "Disabled" ID 2005 AT (10 88 100 12) DISABLED 
      BUTTON      "NonUsable should be hidden" ID 2006 AT (16 101 124 12) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


STRING ID 1001  "Yes, there's nothing hooked up to the menu commands!"


FORM ID 1002 AT (2 2 156 156)
NOFRAME
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (PUSHBUTTON)"
      PUSHBUTTON  "aGroup 1" ID 2000 AT (56 20 43 12) GROUP 1 
      PUSHBUTTON  "bGroup 1" ID 2001 AT (56 34 43 12) GROUP 1 
      PUSHBUTTON  "cGroup 1" ID 2002 AT (57 48 42 12) GROUP 1 
      PUSHBUTTON  "dGroup 1 Disabled" ID 2003 AT (38 61 79 12) DISABLED GROUP 1 
      PUSHBUTTON  "aLeftAnchor" ID 2004 AT (10 75 100 12) LEFTANCHOR GROUP 2 
      PUSHBUTTON  "bRightAnchor" ID 2005 AT (10 88 100 12) GROUP 2 
      PUSHBUTTON  "cNonUsable should be hidden" ID 2006 AT (17 101 122 12) NONUSABLE GROUP 2 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1003 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (CHECKBOX)"
      CHECKBOX    "Checkbox" ID 2007 AT (49 15 58 12) GROUP 0 
      CHECKBOX    "Checkbox Checked" ID 2008 AT (31 29 94 12) GROUP 0 CHECKED 
      CHECKBOX    "Disabled Check" ID 2009 AT (39 43 78 12) DISABLED GROUP 0 
      CHECKBOX    "Checkbox Group1" ID 2010 AT (33 57 90 12) GROUP 1 
      CHECKBOX    "CheckboxGroup1" ID 2011 AT (34 71 88 12) GROUP 1 
      CHECKBOX    "Checkbox Group2" ID 2012 AT (33 86 90 12) GROUP 2 
      CHECKBOX    "Checkbox Group2" ID 2013 AT (33 100 90 12) GROUP 2 
      CHECKBOX    "LeftAnchor" ID 2014 AT (10 114 100 12) LEFTANCHOR GROUP 0 
      CHECKBOX    "RightAnchor" ID 2015 AT (10 127 100 12) GROUP 0 
      CHECKBOX    "NonUsable should be hidden" ID 2016 AT (13 140 130 12) NONUSABLE GROUP 0 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1004 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (POPUPTRIGGER)"
      LABEL       "POPUPTRIGGER" ID 500 AT (10 20) 
      POPUPTRIGGER "Item1" ID 1000 AT (76 20 62 12) LEFTANCHOR 
      POPUPLIST   ID 1000 2000
      LIST        "Item1" "Item2" "Item3" "Item4" ID 2000 AT (76 20 52 44) NONUSABLE 
      LABEL       "POPUPTRIGGER" ID 500 AT (10 84) 
      POPUPTRIGGER "Item1" ID 3000 AT (76 84 62 12) LEFTANCHOR 
      POPUPLIST   ID 3000 4000
      LIST        "Item1" "Item2" "Item3" "Item4" "Item5" "Item6" ID 4000 AT (76 84 52 44) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1005 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (LIST)"
      LIST        "Item1" "Item2" "Item3" "Item4" ID 4000 AT (10 20 52 44) 
      LIST        "Item1" "Item2" "Item3" "Item4" "Item5" "Item6" ID 4001 AT (72 20 52 44) 
      LIST        "Disabled" "Item2" "Item3" "Item4" "Item5" "Item6" ID 4002 AT (10 74 52 44) DISABLED 
      LIST        "Unusable" "Item2" "Item3" "Item4" "Item5" "Item6" ID 4003 AT (72 74 52 44) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1006 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (SELECTORTRIGGER)"
      SELECTORTRIGGER "SelectorTrigger" ID 2000 AT (42 20 71 12) 
      SELECTORTRIGGER "LeftAnchor" ID 2001 AT (10 34 100 12) LEFTANCHOR 
      SELECTORTRIGGER "RightAnchor" ID 2002 AT (10 47 100 12) 
      SELECTORTRIGGER "Disabled" ID 2003 AT (10 60 100 12) DISABLED 
      SELECTORTRIGGER "NONUSABLE" ID 2004 AT (10 73 100 12) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1007 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (REPEATBUTTON)"
      REPEATBUTTON "\001" ID 1000 AT (66 15 23 9) NOFRAME FONT 5 
      REPEATBUTTON "\002" ID 1001 AT (66 23 23 9) NOFRAME FONT 5 
      REPEATBUTTON "\001" ID 1010 AT (66 35 23 9) FONT 5 
      REPEATBUTTON "\002" ID 1011 AT (66 45 23 9) FONT 5 
      REPEATBUTTON "\001" ID 1020 AT (66 57 23 9) BOLDFRAME FONT 5 
      REPEATBUTTON "\002" ID 1021 AT (66 68 23 9) BOLDFRAME FONT 5 
      REPEATBUTTON "Disabled" ID 1030 AT (55 80 46 12) DISABLED 
      REPEATBUTTON "Disabled" ID 1031 AT (55 93 46 12) DISABLED 
      REPEATBUTTON "Nonusable" ID 1040 AT (51 108 54 12) NONUSABLE 
      REPEATBUTTON "Nonusable" ID 1041 AT (51 121 54 12) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


FORM ID 1008 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (FIELD)"
      FIELD       ID 1000 AT (10 15 140 20) UNDERLINED MAXCHARS 20 
      FIELD       ID 1001 AT (10 36 140 20) RIGHTALIGN UNDERLINED AUTOSHIFT MAXCHARS 40 
      FIELD       ID 1002 AT (10 57 140 20) NONUSABLE UNDERLINED MAXCHARS 40 
      FIELD       ID 1003 AT (10 78 140 20) NUMERIC MAXCHARS 40 
      FIELD       ID 1004 AT (10 100 130 40) MULTIPLELINES UNDERLINED FONT 2 MAXCHARS 200 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
      GRAFFITISTATEINDICATOR AT (130 150)
END


FORM ID 1009 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (FORMBITMAP)"
      FORMBITMAP  AT (10 15) BITMAP 1000 
      FORMBITMAP  AT (100 15) BITMAP 1000 NONUSABLE 
      FORMBITMAP  AT (10 65) BITMAP 1001 
      FORMBITMAP  AT (100 65) BITMAP 1002 
      FORMBITMAP  AT (10 115) BITMAP 1003 
      FORMBITMAP  AT (100 115) BITMAP 1004 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END


BITMAP ID 1000 "bmp1000.asc" 

BITMAP ID 1001 "bmp1001.asc" 

BITMAP ID 1002 "bmp1002.asc" 

BITMAP ID 1003 "bmp1003.asc" COMPRESS

BITMAP ID 1004 "bmp1004.asc" COMPRESS


FORM ID 1010 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (GADGET)"
      GADGET      ID 1000 AT (10 15 140 50) 
      GADGET      ID 1001 AT (10 55 140 50) NONUSABLE 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END

FORM ID 1011 AT (2 2 156 156)
MODAL
HELPID 1000
MENUID 1000
BEGIN
      TITLE       "PilrcTest (TABLE)"
      TABLE       ID 1000 AT (10 15 140 100) ROWS 10 COLUMNS 5 COLUMNWIDTHS 50 30 30 40 20 
      BUTTON      "Ok" ID 100 AT (66 140 24 12) 
END

    

Now lets take a look at the Bitmaps. Actually the Bitmap files bmp1000.asc up to bmp1004.asc are all identical. This is not the fault of Presdec, they were saved like that in the original file.

innot$ cat bmp1000.asc

# CREATOR: presdec v1.0 (30-sep-98), extracted from a PalmPilot Resource file
Size 48x48
+------------------------------------------------+
|                      ****                      |
|                 **************                 |
|              ********************              |
|            ************************            |
|           **************************           |
|         ******************************         |
|        ********************************        |
|       **********************************       |
|      ************************************      |
|     **************************************     |
|    ***************************************     |
|    ****************************************    |
|   ******************************************   |
|   ******************************************   |
|  ********************************************  |
|  *******     ******  ******     ******    ***  |
|  ****** ***** *****  ***** ***** **** *** **** |
| ****** ** *** **** * **** ** *** *** ***** *** |
| ****** ** *** **** * **** ** *** *** ***** *** |
| ***** *** *** **** * *** *** *** ** *** ** *** |
| ***** *** *** *  * * *** *** *** ** *** * **** |
| ***** ** **** ****  **** ** **** ** **** ******|
|***** ***  *** ****  *** ***  ** *** ***********|
|***** *** *   ** ** **** ***    **** ***********|
|***** *** ****** ** **** ***  ***** ************|
|***** *** *****  *  **** ***  ***** ************|
| **** ** ****** ** ***** ** * ***** ************|
| *** *** ****** *  ** * *** * *** ** **** ***** |
| *** ** ******* *  ** * ** ** ** *** **** ***** |
| *** ** ******* *  ** * ** *** * *** *** ****** |
| ****  ********  **  ***  ***** *****   ******* |
|  ********************************************* |
|  ********************************************  |
|  ********************************************  |
|   ******************************************   |
|   ******************************************   |
|    ****************************************    |
|     **************************************     |
|     **************************************     |
|      ************************************      |
|       **********************************       |
|        ********************************        |
|         ******************************         |
|           **************************           |
|            ************************            |
|              ********************              |
|                 **************                 |
|                      ****                      |
+------------------------------------------------+


    


The icon looks very similar:

innot$ cat icn1000.asc

# CREATOR: presdec v1.0 (30-sep-98), extracted from a PalmPilot Resource file
Size 32x32
+--------------------------------+
|             *******            |
|           ***********          |
|          *************         |
|        *****************       |
|        ****    *****   *       |
|       ****  ** **** *** *      |
|      **** * *** *** *** **     |
|      **** * *** ** **** **     |
|     **** ** *** ** **  ****    |
|     **** ** ** ** *********    |
|     **** **    ** *********    |
|     **** **  **** *********    |
|     *** ** * **** *********    |
|     *** ** * **** *********    |
|      ** ** * * ** *** ****     |
|      ** * ** * *** ** ****     |
|       ** **** *****  ****      |
|       *******************      |
|        *****************       |
|          *************         |
|           ***********          |
|             *******            |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
+--------------------------------+




(c) 2000 Thomas Holland, thomas@innot.de

Last modified: April 19, 2000 18:55