From cb9c3e9cede30851ba29be2e955fb8cfcecef7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Sun, 6 Mar 2011 19:04:59 +0000 Subject: [PATCH] Support added to the resource compiler and resource definition files (.rdef) for application name catalog reference. Please review. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40852 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskcalc/DeskCalc.rdef | 2 ++ src/apps/deskcalc/Jamfile | 5 ----- src/bin/rc/parser.y | 22 ++++++++++++++++++++++ src/bin/rc/tests/builtin.rdef | 6 ++++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/apps/deskcalc/DeskCalc.rdef b/src/apps/deskcalc/DeskCalc.rdef index ff21ac528f..ef25feaa23 100644 --- a/src/apps/deskcalc/DeskCalc.rdef +++ b/src/apps/deskcalc/DeskCalc.rdef @@ -1,6 +1,8 @@ resource app_signature "application/x-vnd.Haiku-DeskCalc"; +resource app_name_catalog_entry "x-vnd.Haiku-DeskCalc:Window:DeskCalc"; + resource app_version { major = 2, middle = 1, diff --git a/src/apps/deskcalc/Jamfile b/src/apps/deskcalc/Jamfile index 81d3e06d72..83145211ab 100644 --- a/src/apps/deskcalc/Jamfile +++ b/src/apps/deskcalc/Jamfile @@ -24,8 +24,3 @@ DoCatalogs DeskCalc : CalcView.cpp CalcWindow.cpp ; - -AddCatalogEntryAttribute DeskCalc - : - "x-vnd.Haiku-DeskCalc:Window:DeskCalc" -; diff --git a/src/bin/rc/parser.y b/src/bin/rc/parser.y index 153ecf3c38..639c8931a1 100644 --- a/src/bin/rc/parser.y +++ b/src/bin/rc/parser.y @@ -1506,6 +1506,27 @@ add_app_signature_type() } +static void +add_app_name_catalog_entry() +{ + field_t* fields = (field_t*)alloc_mem(1 * sizeof(field_t)); + fields[0].type = get_type("string"); + fields[0].name = "catalog_entry"; + fields[0].resize = 0; + fields[0].data = make_default(fields[0].type); + + type_t type; + type.code = B_STRING_TYPE; + type.name = "app_name_catalog_entry"; + type.fields = fields; + type.count = 1; + type.def_id = 1; + type.def_name = "SYS:NAME"; + + type_table.insert(make_pair(type.name, type)); +} + + static void add_app_flags() { @@ -1718,6 +1739,7 @@ init_parser() add_rect_type(); add_rgb_color_type(); add_app_signature_type(); + add_app_name_catalog_entry(); add_app_flags(); add_app_version(); add_large_icon(); diff --git a/src/bin/rc/tests/builtin.rdef b/src/bin/rc/tests/builtin.rdef index 898996d422..0d6e63e2e0 100644 --- a/src/bin/rc/tests/builtin.rdef +++ b/src/bin/rc/tests/builtin.rdef @@ -33,6 +33,12 @@ type(1, "BEOS:APP_SIG") #'MIMS' app_signature string signature // max 240 bytes (including null) }; +/* Application name catalog entry. */ +type(1, "SYS:NAME") #B_STRING_TYPE app_name_catalog_entry +{ + string catalog_entry +}; + /* Application launch flags */ type(1, "BEOS:APP_FLAGS") #'APPF' app_flags {