Update the Windows Resource compiler (windres) to support the OWNERDRAW and BITMAP...
authorNick Clifton <nickc@redhat.com>
Thu, 9 Jul 2020 12:45:01 +0000 (13:45 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 9 Jul 2020 12:45:01 +0000 (13:45 +0100)
binutils* rclex.c: Add OWNERDRAW keyword.
* rcparse.y: Add OWNERDRAW token.
(menuitem_flag) Add BITMAP and OWNERDRAW entries.
* resrc.c (write_rc_menuitems): Add support for OWNERDRAW and
BITMAP flags.
* windres.c (extended_menuitems): Likewise.
* testsuite/binutils-all/windres/menuitem_flags.rc: New test.

binutils/ChangeLog
binutils/rclex.c
binutils/rcparse.y
binutils/resrc.c
binutils/testsuite/binutils-all/windres/menuitem_flags.rc [new file with mode: 0644]
binutils/windres.c

index a5d6fad92cbeb17f62069bae8c97fcdc6932056e..9f6be43f0cfaa5e56a5e8fd6be911cd17c13b1d8 100644 (file)
@@ -1,3 +1,13 @@
+2020-07-09  Nick Clifton  <nickc@redhat.com>
+
+       * rclex.c: Add OWNERDRAW keyword.
+       * rcparse.y: Add OWNERDRAW token.
+       (menuitem_flag) Add BITMAP and OWNERDRAW entries.
+       * resrc.c (write_rc_menuitems): Add support for OWNERDRAW and
+       BITMAP flags.
+       * windres.c (extended_menuitems): Likewise.
+       * testsuite/binutils-all/windres/menuitem_flags.rc: New test.
+
 2020-07-09  Alan Modra  <amodra@gmail.com>
 
        * readelf (slurp_hppa_unwind_table): Set table_len before use
index d6a0f91c7d16cd9ae0312687dd0c9532529954f1..fac74b0491bd0e7135d34b8ae1ed19c6436814fd 100644 (file)
@@ -94,7 +94,7 @@ static const struct rclex_keywords keywds[] =
   K(LANGUAGE), K(LISTBOX), K(LOADONCALL), K(LTEXT),
   K(MANIFEST), K(MENU), K(MENUBARBREAK), K(MENUBREAK),
   K(MENUEX), K(MENUITEM), K(MESSAGETABLE), K(MOVEABLE),
-  K(NOINVERT), K(NOT),
+  K(NOINVERT), K(NOT), K(OWNERDRAW),
   K(PLUGPLAY), K(POPUP), K(PRELOAD), K(PRODUCTVERSION),
   K(PURE), K(PUSHBOX), K(PUSHBUTTON),
   K(RADIOBUTTON), K(RCDATA), K(RTEXT),
index 78ce917e233c5efdba82c409e2d913c949bba531..c0ed338ed0a2acfd7f3eae538e3bbc81a993ece0 100644 (file)
@@ -124,7 +124,7 @@ static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}};
 %token ICON
 %token ANICURSOR ANIICON DLGINCLUDE DLGINIT FONTDIR HTML MANIFEST PLUGPLAY VXD TOOLBAR BUTTON
 %token LANGUAGE CHARACTERISTICS VERSIONK
-%token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE
+%token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE OWNERDRAW
 %token MENUBARBREAK MENUBREAK
 %token MESSAGETABLE
 %token RCDATA
@@ -1088,6 +1088,14 @@ menuitem_flag:
          {
            $$ = MENUITEM_MENUBREAK;
          }
+       | BITMAP
+         {
+           $$ = MENUITEM_BITMAP;
+         }
+       | OWNERDRAW
+         {
+           $$ = MENUITEM_OWNERDRAW;
+         }
        ;
 
 /* Menuex resources.  */
index a875c3a4ac5bb47b0959d843d085904c99111179..5a6336ee6c0f8cf366c85b6fdd1f08cccd911ff2 100644 (file)
@@ -2841,6 +2841,10 @@ write_rc_menuitems (FILE *e, const rc_menuitem *menuitems, int menuex,
            fprintf (e, ", MENUBARBREAK");
          if ((mi->type & MENUITEM_MENUBREAK) != 0)
            fprintf (e, ", MENUBREAK");
+         if ((mi->type & MENUITEM_OWNERDRAW) != 0)
+           fprintf (e, ", OWNERDRAW");
+         if ((mi->type & MENUITEM_BITMAP) != 0)
+           fprintf (e, ", BITMAP");
        }
       else
        {
diff --git a/binutils/testsuite/binutils-all/windres/menuitem_flags.rc b/binutils/testsuite/binutils-all/windres/menuitem_flags.rc
new file mode 100644 (file)
index 0000000..cbd59e4
--- /dev/null
@@ -0,0 +1,16 @@
+// parse-only
+
+1 MENU
+{
+    POPUP "&File"
+    {
+        MENUITEM "This is a test #1", 100, BITMAP
+        MENUITEM "This is a test #2", 101, OWNERDRAW
+        MENUITEM "This is a test #3", 102, CHECKED
+        MENUITEM "This is a test #4", 103, GRAYED
+        MENUITEM "This is a test #5", 104, HELP
+        MENUITEM "This is a test #6", 105, INACTIVE
+        MENUITEM "This is a test #7", 106, MENUBARBREAK
+        MENUITEM "This is a test #8", 107, MENUBREAK
+    }
+}
index 427e9823ce784edc6cd852cf3141b6cd998af2e5..5c83dab8fc0dd5ba3a085b87aa9f5139a8a54a4b 100644 (file)
@@ -527,6 +527,8 @@ extended_menuitems (const rc_menuitem *menuitems)
                | MENUITEM_HELP
                | MENUITEM_INACTIVE
                | MENUITEM_MENUBARBREAK
+               | MENUITEM_BITMAP
+               | MENUITEM_OWNERDRAW
                | MENUITEM_MENUBREAK))
          != 0)
        return 1;
This page took 0.048196 seconds and 4 git commands to generate.