Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2756 A script to generate resource.h file

Not Scheduled
open
nobody
None
5
2013-03-02
2008-12-22
Kimmo Varis
No

The Src/resource.h file is a bit problematic one. It only lists resource ID numbers as C define lines. It doesn't have any other content. But synchronizing and altering those IDs quite a pain when altering resources. Basically every ID should be unique etc.

The file is better handled by just generating it from resources we have. If we re-generate the file when we update resources we don't need to do any painful merging and synchronizing.

Attached is a work-in-progress script that parses resource IDs from resource file (Src/Merge.rc) and outputs resource.h file from those IDs.

There are still many things to do before this script can be really taken into development use. For example:
- parse more than one file
- format lines in resource.h properly
- add VS APSTUDIO defines for resource editor
- group IDs so that menuids have own number area, control IDs own number area etc
- group string IDs so that they match grouping in RC file
- handle IDs with two defined names

Discussion

  • Kimmo Varis
    Kimmo Varis
    2008-12-22

    Script for generating resource.h file

     
    Attachments
  • Kimmo Varis
    Kimmo Varis
    2008-12-28

    Updated script v2

     
    Attachments
  • Kimmo Varis
    Kimmo Varis
    2008-12-28

    Update of the script (v2) - still work in progress:
    - now handles several files
    - now handles all resource types

    File Added: generate_ids_v2.py

     
  • Kimmo Varis
    Kimmo Varis
    2009-01-08

    Updated script v3

     
    Attachments
  • Kimmo Varis
    Kimmo Varis
    2009-01-08

    Next update (v3):
    - group string IDs based on string groups in RC file
    - don't add IDC_STATIC items
    - improve and make more strict parsing of several resource line types

    File Added: generate_ids_v3.py

     
  • Christian List
    Christian List
    2013-03-02

    • milestone: Trunk --> Not Scheduled