- Add specific properties to the keyboardlayout module type. They will assist us...
[reactos.git] / reactos / tools / rbuild / module.cpp
index d852224..b2b4958 100644 (file)
@@ -466,6 +466,32 @@ Module::Module ( const Project& project,
                }
        }
 
+       att = moduleNode.GetAttribute ( "description", false );
+       if (att != NULL )
+       {
+               description = project.ResolveProperties(att->value);
+       }
+       else
+               description = "";
+
+       att = moduleNode.GetAttribute ( "lcid", false );
+       if (type == KeyboardLayout && att != NULL )
+               lcid = att->value;
+       else
+               lcid = "";
+
+       att = moduleNode.GetAttribute ( "layoutid", false );
+       if (type == KeyboardLayout && att != NULL )
+               layoutId = att->value;
+       else
+               layoutId = "";
+
+       att = moduleNode.GetAttribute ( "layoutnameresid", false );
+       if (type == KeyboardLayout && att != NULL )
+               layoutNameResId = att->value;
+       else
+               layoutNameResId = "";
+
        SetImportLibrary ( NULL );
 }
 
@@ -899,6 +925,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
                return NativeDLL;
        if ( attribute.value == "nativecui" )
                return NativeCUI;
+       if ( attribute.value == "keyboardlayout" )
+               return KeyboardLayout;
        if ( attribute.value == "win32dll" )
                return Win32DLL;
        if ( attribute.value == "win32ocx" )
@@ -939,6 +967,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
                return EmbeddedTypeLib;
        if ( attribute.value == "elfexecutable" )
                return ElfExecutable;
+       if ( attribute.value == "cabinet" )
+               return Cabinet;
        throw InvalidAttributeValueException ( location,
                                               attribute.name,
                                               attribute.value );
@@ -951,6 +981,7 @@ Module::GetTargetDirectoryTree () const
        {
                case Kernel:
                case KernelModeDLL:
+               case KeyboardLayout:
                case NativeDLL:
                case Win32DLL:
                case Win32OCX:
@@ -968,9 +999,10 @@ Module::GetTargetDirectoryTree () const
                case LiveIso:
                case IsoRegTest:
                case LiveIsoRegTest:
-               case EmbeddedTypeLib:
                case ElfExecutable:
+               case Cabinet:
                        return OutputDirectory;
+               case EmbeddedTypeLib:
                case StaticLibrary:
                case HostStaticLibrary:
                case ObjectLibrary:
@@ -1012,6 +1044,7 @@ Module::GetDefaultModuleExtension () const
 
                case KernelModeDLL:
                case NativeDLL:
+               case KeyboardLayout:
                case Win32DLL:
                        return ".dll";
                case Win32OCX:
@@ -1019,6 +1052,8 @@ Module::GetDefaultModuleExtension () const
                case KernelModeDriver:
                case BootLoader:
                        return ".sys";
+               case Cabinet:
+                       return ".cab";
                case BootSector:
                        return ".o";
                case Iso:
@@ -1052,6 +1087,7 @@ Module::GetDefaultModuleEntrypoint () const
        {
                case Kernel:
                        return "KiSystemStartup";
+               case KeyboardLayout:
                case KernelModeDLL:
                case KernelModeDriver:
                        return "DriverEntry@8";
@@ -1092,6 +1128,7 @@ Module::GetDefaultModuleEntrypoint () const
                case IdlHeader:
                case ElfExecutable:
                case EmbeddedTypeLib:
+               case Cabinet:
                        return "";
                case TypeDontCare:
                        break;
@@ -1118,6 +1155,7 @@ Module::GetDefaultModuleBaseaddress () const
                case Win32SCR:
                case Win32GUI:
                        return "0x00400000";
+               case KeyboardLayout:
                case KernelModeDLL:
                case KernelModeDriver:
                        return "0x00010000";
@@ -1140,6 +1178,7 @@ Module::GetDefaultModuleBaseaddress () const
                case BootProgram:
                case IdlHeader:
                case EmbeddedTypeLib:
+               case Cabinet:
                        return "";
                case TypeDontCare:
                        break;
@@ -1162,6 +1201,7 @@ Module::IsDLL () const
                case Kernel:
                case KernelModeDLL:
                case NativeDLL:
+               case KeyboardLayout:
                case Win32DLL:
                case Win32OCX:
                case KernelModeDriver:
@@ -1189,6 +1229,7 @@ Module::IsDLL () const
                case IdlHeader:
                case EmbeddedTypeLib:
                case ElfExecutable:
+               case Cabinet:
                        return false;
                case TypeDontCare:
                        break;
@@ -1697,6 +1738,25 @@ Property::Property ( const XMLElement& node_,
        att = node_.GetAttribute ( "value", true );
        assert(att);
        value = att->value;
+
+       att = node_.GetAttribute ( "internal", false );
+       if ( att != NULL )
+       {
+               const char* p = att->value.c_str();
+               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
+                       isInternal = true;
+               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
+                       isInternal = false;
+               else
+               {
+                       throw InvalidAttributeValueException (
+                               node_.location,
+                               "internal",
+                               att->value );
+               }
+       }
+       else
+               isInternal = false;
 }
 
 Property::Property ( const Project& project_,