[haiku-commits] r40852 - in haiku/trunk/src: apps/deskcalc bin/rc bin/rc/tests

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 6 Mar 2011 20:04:59 +0100 (CET)

Author: kirilla
Date: 2011-03-06 20:04:59 +0100 (Sun, 06 Mar 2011)
New Revision: 40852
Changeset: http://dev.haiku-os.org/changeset/40852

Modified:
   haiku/trunk/src/apps/deskcalc/DeskCalc.rdef
   haiku/trunk/src/apps/deskcalc/Jamfile
   haiku/trunk/src/bin/rc/parser.y
   haiku/trunk/src/bin/rc/tests/builtin.rdef
Log:
Support added to the resource compiler and resource definition files (.rdef) 
for application name catalog reference. Please review.

Modified: haiku/trunk/src/apps/deskcalc/DeskCalc.rdef
===================================================================
--- haiku/trunk/src/apps/deskcalc/DeskCalc.rdef 2011-03-06 18:30:16 UTC (rev 
40851)
+++ haiku/trunk/src/apps/deskcalc/DeskCalc.rdef 2011-03-06 19:04:59 UTC (rev 
40852)
@@ -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,

Modified: haiku/trunk/src/apps/deskcalc/Jamfile
===================================================================
--- haiku/trunk/src/apps/deskcalc/Jamfile       2011-03-06 18:30:16 UTC (rev 
40851)
+++ haiku/trunk/src/apps/deskcalc/Jamfile       2011-03-06 19:04:59 UTC (rev 
40852)
@@ -24,8 +24,3 @@
        CalcView.cpp
        CalcWindow.cpp
 ;
-
-AddCatalogEntryAttribute DeskCalc
-       :
-       "x-vnd.Haiku-DeskCalc:Window:DeskCalc"
-;

Modified: haiku/trunk/src/bin/rc/parser.y
===================================================================
--- haiku/trunk/src/bin/rc/parser.y     2011-03-06 18:30:16 UTC (rev 40851)
+++ haiku/trunk/src/bin/rc/parser.y     2011-03-06 19:04:59 UTC (rev 40852)
@@ -1507,6 +1507,27 @@
 
 
 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()
 {
        field_t* fields  = (field_t*)alloc_mem(1 * sizeof(field_t));
@@ -1718,6 +1739,7 @@
        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();

Modified: haiku/trunk/src/bin/rc/tests/builtin.rdef
===================================================================
--- haiku/trunk/src/bin/rc/tests/builtin.rdef   2011-03-06 18:30:16 UTC (rev 
40851)
+++ haiku/trunk/src/bin/rc/tests/builtin.rdef   2011-03-06 19:04:59 UTC (rev 
40852)
@@ -33,6 +33,12 @@
        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
 {


Other related posts: