[ros-diffs] [janderwald] 31173: - move some hardcoded strings to header en-US.h - move PAGE_NUMBER to usetup.h - start multiple language input support for usetup

janderwald at svn.reactos.org janderwald at svn.reactos.org
Wed Dec 12 01:05:02 CET 2007


Author: janderwald
Date: Wed Dec 12 03:05:00 2007
New Revision: 31173

URL: http://svn.reactos.org/svn/reactos?rev=31173&view=rev
Log:
- move some hardcoded strings to header en-US.h
- move PAGE_NUMBER to usetup.h
- start multiple language input support for usetup

Added:
    trunk/reactos/base/setup/usetup/lang/
    trunk/reactos/base/setup/usetup/lang/en-US.h   (with props)
    trunk/reactos/base/setup/usetup/mui.c   (with props)
    trunk/reactos/base/setup/usetup/mui.h   (with props)
Modified:
    trunk/reactos/base/setup/usetup/interface/usetup.c
    trunk/reactos/base/setup/usetup/usetup.h
    trunk/reactos/base/setup/usetup/usetup.rbuild

Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interface/usetup.c?rev=31173&r1=31172&r2=31173&view=diff
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c Wed Dec 12 03:05:00 2007
@@ -31,45 +31,6 @@
 #define NDEBUG
 #include <debug.h>
 
-typedef enum _PAGE_NUMBER
-{
-  START_PAGE,
-  INTRO_PAGE,
-  LICENSE_PAGE,
-  INSTALL_INTRO_PAGE,
-
-//  SCSI_CONTROLLER_PAGE,
-
-  DEVICE_SETTINGS_PAGE,
-  COMPUTER_SETTINGS_PAGE,
-  DISPLAY_SETTINGS_PAGE,
-  KEYBOARD_SETTINGS_PAGE,
-  LAYOUT_SETTINGS_PAGE,
-
-  SELECT_PARTITION_PAGE,
-  CREATE_PARTITION_PAGE,
-  DELETE_PARTITION_PAGE,
-
-  SELECT_FILE_SYSTEM_PAGE,
-  FORMAT_PARTITION_PAGE,
-  CHECK_FILE_SYSTEM_PAGE,
-
-  PREPARE_COPY_PAGE,
-  INSTALL_DIRECTORY_PAGE,
-  FILE_COPY_PAGE,
-  REGISTRY_PAGE,
-  BOOT_LOADER_PAGE,
-  BOOT_LOADER_FLOPPY_PAGE,
-  BOOT_LOADER_HARDDISK_PAGE,
-
-  REPAIR_INTRO_PAGE,
-
-  SUCCESS_PAGE,
-  QUIT_PAGE,
-  FLUSH_PAGE,
-  REBOOT_PAGE,			/* virtual page */
-} PAGE_NUMBER, *PPAGE_NUMBER;
-
 /* GLOBALS ******************************************************************/
 
 HANDLE ProcessHeap;
@@ -137,10 +98,6 @@
 }
 
 
-#define POPUP_WAIT_NONE    0
-#define POPUP_WAIT_ANY_KEY 1
-#define POPUP_WAIT_ENTER   2
-
 static VOID
 DrawBox(
 	IN SHORT xLeft,
@@ -240,7 +197,7 @@
 		&Written);
 }
 
-static VOID
+VOID
 PopupError(PCHAR Text,
 	   PCHAR Status,
 	   PINPUT_RECORD Ir,
@@ -722,20 +679,7 @@
 static PAGE_NUMBER
 IntroPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetHighlightedTextXY(6, 8, "Welcome to ReactOS Setup");
-
-  CONSOLE_SetTextXY(6, 11, "This part of the setup copies the ReactOS Operating System to your");
-  CONSOLE_SetTextXY(6, 12, "computer and prepares the second part of the setup.");
-
-  CONSOLE_SetTextXY(8, 15, "\x07  Press ENTER to install ReactOS.");
-  CONSOLE_SetTextXY(8, 17, "\x07  Press R to repair ReactOS.");
-  CONSOLE_SetTextXY(8, 19, "\x07  Press L to view the ReactOS Licensing Terms and Conditions");
-  CONSOLE_SetTextXY(8, 21, "\x07  Press F3 to quit without installing ReactOS.");
-
-  CONSOLE_SetTextXY(6, 23, "For more information on ReactOS, please visit:");
-  CONSOLE_SetHighlightedTextXY(6, 24, "http://www.reactos.org");
-
-  CONSOLE_SetStatusText("   ENTER = Continue  R = Repair F3 = Quit");
+  MUIDisplayPage(INTRO_PAGE);
 
   if (IsUnattendedSetup)
     {
@@ -787,32 +731,9 @@
 static PAGE_NUMBER
 LicensePage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetHighlightedTextXY(6, 6, "Licensing:");
-
-  CONSOLE_SetTextXY(8, 8, "The ReactOS System is licensed under the terms of the");
-  CONSOLE_SetTextXY(8, 9, "GNU GPL with parts containing code from other compatible");
-  CONSOLE_SetTextXY(8, 10, "licenses such as the X11 or BSD and GNU LGPL licenses.");
-  CONSOLE_SetTextXY(8, 11, "All software that is part of the ReactOS system is");
-  CONSOLE_SetTextXY(8, 12, "therefore released under the GNU GPL as well as maintaining");
-  CONSOLE_SetTextXY(8, 13, "the original license.");
-
-  CONSOLE_SetTextXY(8, 15, "This software comes with NO WARRANTY or restrictions on usage");
-  CONSOLE_SetTextXY(8, 16, "save applicable local and international law. The licensing of");
-  CONSOLE_SetTextXY(8, 17, "ReactOS only covers distribution to third parties.");
-
-  CONSOLE_SetTextXY(8, 18, "If for some reason you did not receive a copy of the");
-  CONSOLE_SetTextXY(8, 19, "GNU General Public License with ReactOS please visit");
-  CONSOLE_SetHighlightedTextXY(8, 20, "http://www.gnu.org/licenses/licenses.html");
-
-  CONSOLE_SetHighlightedTextXY(6, 22, "Warranty:");
-
-  CONSOLE_SetTextXY(8, 24, "This is free software; see the source for copying conditions.");
-  CONSOLE_SetTextXY(8, 25, "There is NO warranty; not even for MERCHANTABILITY or");
-  CONSOLE_SetTextXY(8, 26, "FITNESS FOR A PARTICULAR PURPOSE");
-
-  CONSOLE_SetStatusText("   ENTER = Return");
-
-  while (TRUE)
+   MUIDisplayPage(LICENSE_PAGE);
+    
+    while (TRUE)
     {
       CONSOLE_ConInKey(Ir);
 
@@ -829,20 +750,7 @@
 static PAGE_NUMBER
 RepairIntroPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
-  CONSOLE_SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
-
-  CONSOLE_SetTextXY(6, 12, "The repair functions are not implemented yet.");
-
-  CONSOLE_SetTextXY(8, 15, "\x07  Press U for Updating OS.");
-
-  CONSOLE_SetTextXY(8, 17, "\x07  Press R for the Recovery Console.");
-
-  CONSOLE_SetTextXY(8, 19, "\x07  Press ESC to return to the main page.");
-
-  CONSOLE_SetTextXY(8, 21, "\x07  Press ENTER to reboot your computer.");
-
-  CONSOLE_SetStatusText("   ESC = Main page  ENTER = Reboot");
+  MUIDisplayPage(REPAIR_INTRO_PAGE);
 
   while(TRUE)
     {
@@ -875,27 +783,7 @@
 static PAGE_NUMBER
 InstallIntroPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetUnderlinedTextXY(4, 3, " ReactOS " KERNEL_VERSION_STR " Setup ");
-
-  CONSOLE_SetTextXY(6, 8, "ReactOS Setup is in an early development phase. It does not yet");
-  CONSOLE_SetTextXY(6, 9, "support all the functions of a fully usable setup application.");
-
-  CONSOLE_SetTextXY(6, 12, "The following limitations apply:");
-  CONSOLE_SetTextXY(8, 13, "- Setup can not handle more than one primary partition per disk.");
-  CONSOLE_SetTextXY(8, 14, "- Setup can not delete a primary partition from a disk");
-  CONSOLE_SetTextXY(8, 15, "  as long as extended partitions exist on this disk.");
-  CONSOLE_SetTextXY(8, 16, "- Setup can not delete the first extended partition from a disk");
-  CONSOLE_SetTextXY(8, 17, "  as long as other extended partitions exist on this disk.");
-  CONSOLE_SetTextXY(8, 18, "- Setup supports FAT file systems only.");
-  CONSOLE_SetTextXY(8, 19, "- File system checks are not implemented yet.");
-
-
-  CONSOLE_SetTextXY(8, 23, "\x07  Press ENTER to install ReactOS.");
-
-  CONSOLE_SetTextXY(8, 25, "\x07  Press F3 to quit without installing ReactOS.");
-
-
-  CONSOLE_SetStatusText("   ENTER = Continue   F3 = Quit");
+  MUIDisplayPage(INTRO_PAGE);
 
   if (RepairUpdateFlag)
     {
@@ -970,6 +858,7 @@
 DeviceSettingsPage(PINPUT_RECORD Ir)
 {
   static ULONG Line = 16;
+  MUIDisplayPage(DEVICE_SETTINGS_PAGE);
 
   /* Initialize the computer settings list */
   if (ComputerList == NULL)
@@ -1024,34 +913,17 @@
 	}
     }
 
-  CONSOLE_SetTextXY(6, 8, "The list below shows the current device settings.");
-
-  CONSOLE_SetTextXY(8, 11, "       Computer:");
-  CONSOLE_SetTextXY(8, 12, "        Display:");
-  CONSOLE_SetTextXY(8, 13, "       Keyboard:");
-  CONSOLE_SetTextXY(8, 14, "Keyboard layout:");
-
-  CONSOLE_SetTextXY(8, 16, "         Accept:");
+  MUIDisplayPage(DEVICE_SETTINGS_PAGE);
+
 
   CONSOLE_SetTextXY(25, 11, GetGenericListEntry(ComputerList)->Text);
   CONSOLE_SetTextXY(25, 12, GetGenericListEntry(DisplayList)->Text);
   CONSOLE_SetTextXY(25, 13, GetGenericListEntry(KeyboardList)->Text);
   CONSOLE_SetTextXY(25, 14, GetGenericListEntry(LayoutList)->Text);
 
-  CONSOLE_SetTextXY(25, 16, "Accept these device settings");
   CONSOLE_InvertTextXY (24, Line, 48, 1);
 
-
-  CONSOLE_SetTextXY(6, 19, "You can change the hardware settings by pressing the UP or DOWN keys");
-  CONSOLE_SetTextXY(6, 20, "to select an entry. Then press the ENTER key to select alternative");
-  CONSOLE_SetTextXY(6, 21, "settings.");
-
-  CONSOLE_SetTextXY(6, 23, "When all settings are correct, select \"Accept these device settings\"");
-  CONSOLE_SetTextXY(6, 24, "and press ENTER.");
-
-  CONSOLE_SetStatusText("   ENTER = Continue   F3 = Quit");
-
-  if (RepairUpdateFlag)
+  if (RepairUpdateFlag) 
     {
       return SELECT_PARTITION_PAGE;
     }
@@ -1113,13 +985,7 @@
 static PAGE_NUMBER
 ComputerSettingsPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(6, 8, "You want to change the type of computer to be installed.");
-
-  CONSOLE_SetTextXY(8, 10, "\x07  Press the UP or DOWN key to select the desired computer type.");
-  CONSOLE_SetTextXY(8, 11, "   Then press ENTER.");
-
-  CONSOLE_SetTextXY(8, 13, "\x07  Press the ESC key to return to the previous page without changing");
-  CONSOLE_SetTextXY(8, 14, "   the computer type.");
+  MUIDisplayPage(COMPUTER_SETTINGS_PAGE);
 
   DrawGenericList(ComputerList,
 		  2,
@@ -1127,8 +993,6 @@
 		  xScreen - 3,
 		  yScreen - 3);
 
-  CONSOLE_SetStatusText("   ENTER = Continue   ESC = Cancel   F3 = Quit");
-
   SaveGenericListState(ComputerList);
 
   while(TRUE)
@@ -1171,21 +1035,13 @@
 static PAGE_NUMBER
 DisplaySettingsPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(6, 8, "You want to change the type of display to be installed.");
-
-  CONSOLE_SetTextXY(8, 10, "\x07  Press the UP or DOWN key to select the desired display type.");
-  CONSOLE_SetTextXY(8, 11, "   Then press ENTER.");
-
-  CONSOLE_SetTextXY(8, 13, "\x07  Press the ESC key to return to the previous page without changing");
-  CONSOLE_SetTextXY(8, 14, "   the display type.");
+  MUIDisplayPage(DISPLAY_SETTINGS_PAGE);
 
   DrawGenericList(DisplayList,
 		  2,
 		  18,
 		  xScreen - 3,
 		  yScreen - 3);
-
-  CONSOLE_SetStatusText("   ENTER = Continue   ESC = Cancel   F3 = Quit");
 
   SaveGenericListState(DisplayList);
 
@@ -3441,14 +3297,8 @@
 {
   NTSTATUS Status;
 
-  CONSOLE_SetTextXY(6, 8, "Setup cannot install the bootloader on your computers");
-  CONSOLE_SetTextXY(6, 9, "harddisk");
-
-  CONSOLE_SetTextXY(6, 13, "Please insert a formatted floppy disk in drive A: and");
-  CONSOLE_SetTextXY(6, 14, "press ENTER.");
-
-
-  CONSOLE_SetStatusText("   ENTER = Continue   F3 = Quit");
+  MUIDisplayPage(BOOT_LOADER_FLOPPY_PAGE);
+
 //  SetStatusText("   Please wait...");
 
   while(TRUE)
@@ -3531,14 +3381,7 @@
 static PAGE_NUMBER
 QuitPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(10, 6, "ReactOS is not completely installed");
-
-  CONSOLE_SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
-  CONSOLE_SetTextXY(10, 9, "all CD-ROMs from CD-Drives.");
-
-  CONSOLE_SetTextXY(10, 11, "Press ENTER to reboot your computer.");
-
-  CONSOLE_SetStatusText("   Please wait ...");
+  MUIDisplayPage(QUIT_PAGE);
 
   /* Destroy partition list */
   if (PartitionList != NULL)
@@ -3599,14 +3442,7 @@
 static PAGE_NUMBER
 SuccessPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(10, 6, "The basic components of ReactOS have been installed successfully.");
-
-  CONSOLE_SetTextXY(10, 8, "Remove floppy disk from Drive A: and");
-  CONSOLE_SetTextXY(10, 9, "all CD-ROMs from CD-Drive.");
-
-  CONSOLE_SetTextXY(10, 11, "Press ENTER to reboot your computer.");
-
-  CONSOLE_SetStatusText("   ENTER = Reboot computer");
+  MUIDisplayPage(SUCCESS_PAGE);
 
   if (IsUnattendedSetup)
     {
@@ -3628,13 +3464,7 @@
 static PAGE_NUMBER
 FlushPage(PINPUT_RECORD Ir)
 {
-  CONSOLE_SetTextXY(10, 6, "The system is now making sure all data is stored on your disk");
-
-  CONSOLE_SetTextXY(10, 8, "This may take a minute");
-  CONSOLE_SetTextXY(10, 9, "When finished, your computer will reboot automatically");
-
-  CONSOLE_SetStatusText("   Flushing cache");
-
+  MUIDisplayPage(FLUSH_PAGE);
   return REBOOT_PAGE;
 }
 

Added: trunk/reactos/base/setup/usetup/lang/en-US.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/en-US.h?rev=31173&view=auto
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/en-US.h (added)
+++ trunk/reactos/base/setup/usetup/lang/en-US.h Wed Dec 12 03:05:00 2007
@@ -1,0 +1,728 @@
+#ifndef LANG_EN_US_H__
+#define LANG_EN_US_H__
+
+static MUI_ENTRY WelcomePageEntries[] =
+{
+    {
+        6,
+        8,
+        "Welcome to ReactOS Setup",
+        TEXT_HIGHLIGHT
+    },
+    {
+        6,
+        11,
+        "This part of the setup copies the ReactOS Operating System to your",
+        TEXT_NORMAL
+    },
+    {
+        6,
+        12,
+        "computer and prepares the second part of the setup.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        15,
+        "\x07  Press ENTER to install ReactOS.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        17,
+        "\x07  Press R to repair ReactOS.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        19,
+        "\x07  Press L to view the ReactOS Licensing Terms and Conditions",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        21,
+        "\x07  Press F3 to quit without installing ReactOS.",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        23,
+        "For more information on ReactOS, please visit:",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        24, 
+        "http://www.reactos.org",
+        TEXT_HIGHLIGHT
+    },
+    {
+        0,
+        0,
+        "   ENTER = Continue  R = Repair F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY IntroPageEntries[] =
+{
+    {
+        4, 
+        3,
+        " ReactOS " KERNEL_VERSION_STR " Setup ",
+        TEXT_UNDERLINE
+    },
+    {
+        6, 
+        8, 
+        "ReactOS Setup is in an early development phase. It does not yet",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        9,
+        "support all the functions of a fully usable setup application.",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        12,
+        "The following limitations apply:",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        13,
+        "- Setup can not handle more than one primary partition per disk.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        14,
+        "- Setup can not delete a primary partition from a disk",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        15,
+        "  as long as extended partitions exist on this disk.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        16,
+        "- Setup can not delete the first extended partition from a disk",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        17,
+        "  as long as other extended partitions exist on this disk.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        18, 
+        "- Setup supports FAT file systems only.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        19,
+        "- File system checks are not implemented yet.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        23, 
+        "\x07  Press ENTER to install ReactOS.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        25, 
+        "\x07  Press F3 to quit without installing ReactOS.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0, 
+        "   ENTER = Continue   F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY LicensePageEntries[] =
+{
+    {
+        6,
+        6,
+        "Licensing:",
+        TEXT_HIGHLIGHT
+    },
+    {
+        8,
+        8,
+        "The ReactOS System is licensed under the terms of the",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        9,
+        "GNU GPL with parts containing code from other compatible",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        10,
+        "licenses such as the X11 or BSD and GNU LGPL licenses.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        11,
+        "All software that is part of the ReactOS system is",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        12,
+        "therefore released under the GNU GPL as well as maintaining",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        13,
+        "the original license.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        15,
+        "This software comes with NO WARRANTY or restrictions on usage",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        16,
+        "save applicable local and international law. The licensing of",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        17,
+        "ReactOS only covers distribution to third parties.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        18,
+        "If for some reason you did not receive a copy of the",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        19,
+        "GNU General Public License with ReactOS please visit",
+        TEXT_NORMAL
+    },
+    {           
+        8,
+        20,
+        "http://www.gnu.org/licenses/licenses.html",
+        TEXT_HIGHLIGHT
+    },
+    {           
+        8,
+        22,
+        "Warranty:",
+        TEXT_HIGHLIGHT
+    },
+    {           
+        8,
+        24,
+        "This is free software; see the source for copying conditions.",
+        TEXT_NORMAL
+    },
+    {           
+        8,
+        25,
+        "There is NO warranty; not even for MERCHANTABILITY or",
+        TEXT_NORMAL
+    },
+    {           
+        8,
+        26,
+        "FITNESS FOR A PARTICULAR PURPOSE",
+        TEXT_NORMAL
+    },
+    {           
+        0,
+        0,
+        "   ENTER = Return",
+        TEXT_STATUS
+    },
+    {           
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY DevicePageEntries[] =
+{
+    {
+        6, 
+        8,
+        "The list below shows the current device settings.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        11,
+        "       Computer:",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        12,
+        "        Display:",
+        TEXT_NORMAL,
+    },
+    {
+        8,
+        13,
+        "       Keyboard:",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        14,
+        "Keyboard layout:",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        16,
+        "         Accept:",
+        TEXT_NORMAL
+    },
+    {
+        25, 
+        16, "Accept these device settings",
+        TEXT_NORMAL
+    },
+    {
+        6,
+        19,
+        "You can change the hardware settings by pressing the UP or DOWN keys",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        20, 
+        "to select an entry. Then press the ENTER key to select alternative",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        21,
+        "settings.",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        23, 
+        "When all settings are correct, select \"Accept these device settings\"",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        24,
+        "and press ENTER.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   ENTER = Continue   F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY RepairPageEntries[] =
+{
+    {
+        6, 
+        8,
+        "ReactOS Setup is in an early development phase. It does not yet",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        9,
+        "support all the functions of a fully usable setup application.",
+        TEXT_NORMAL
+    },
+    {
+        6, 
+        12,
+        "The repair functions are not implemented yet.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        15,
+        "\x07  Press U for Updating OS.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        17,
+        "\x07  Press R for the Recovery Console.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        19,
+        "\x07  Press ESC to return to the main page.",
+        TEXT_NORMAL
+    },
+    {
+        8, 
+        21,
+        "\x07  Press ENTER to reboot your computer.",
+        TEXT_NORMAL
+    },
+    {
+        0, 
+        0,
+        "   ESC = Main page  ENTER = Reboot",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+static MUI_ENTRY ComputerPageEntries[] =
+{
+    {
+        6,
+        8,
+        "You want to change the type of computer to be installed.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        10,
+        "\x07  Press the UP or DOWN key to select the desired computer type.",
+        TEXT_NORMAL
+    },    
+    {
+        8,
+        11,
+        "   Then press ENTER.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        13,
+        "\x07  Press the ESC key to return to the previous page without changing",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        14,
+        "   the computer type.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   ENTER = Continue   ESC = Cancel   F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY FlushPageEntries[] =
+{
+    {
+        10,
+        6,
+        "The system is now making sure all data is stored on your disk",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        8,
+        "This may take a minute",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        9,
+        "When finished, your computer will reboot automatically",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   Flushing cache",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY QuitPageEntries[] =
+{
+    {
+        10,
+        6,
+        "ReactOS is not completely installed",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        8,
+        "Remove floppy disk from Drive A: and",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        9,
+        "all CD-ROMs from CD-Drives.",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        11,
+        "Press ENTER to reboot your computer.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   Please wait ...",
+        TEXT_STATUS,
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY DisplayPageEntries[] =
+{
+    {
+        6,
+        8,
+        "You want to change the type of display to be installed.",
+        TEXT_NORMAL
+    },
+    {   8,
+        10,
+         "\x07  Press the UP or DOWN key to select the desired display type.",
+         TEXT_NORMAL
+    },
+    {
+        8,
+        11,
+        "   Then press ENTER.",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        13,
+        "\x07  Press the ESC key to return to the previous page without changing",
+        TEXT_NORMAL
+    },
+    {
+        8,
+        14,
+        "   the display type.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   ENTER = Continue   ESC = Cancel   F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY SuccessPageEntries[] =
+{
+    {
+        10,
+        6,
+        "The basic components of ReactOS have been installed successfully.",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        8,
+        "Remove floppy disk from Drive A: and",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        9,
+        "all CD-ROMs from CD-Drive.",
+        TEXT_NORMAL
+    },
+    {
+        10,
+        11,
+        "Press ENTER to reboot your computer.",
+        TEXT_NORMAL
+    },
+    {
+        0,
+        0,
+        "   ENTER = Reboot computer",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+};
+
+static MUI_ENTRY BootPageEntries[] =
+{
+    {
+        6,
+        8,
+        "Setup cannot install the bootloader on your computers",
+        TEXT_NORMAL
+    },
+    {
+        6,
+        9,
+        "hardisk",
+        TEXT_NORMAL
+    },
+    {
+        6,
+        13,
+        "Please insert a formatted floppy disk in drive A: and",
+        TEXT_NORMAL
+    },
+    {
+        6,
+        14,
+        "press ENTER.",
+        TEXT_NORMAL,
+    },
+    {
+        0,
+        0,
+        "   ENTER = Continue   F3 = Quit",
+        TEXT_STATUS
+    },
+    {
+        0,
+        0,
+        NULL,
+        0
+    }
+
+};
+
+MUI_PAGE enUSPages[] =
+{
+    {
+       START_PAGE,
+       WelcomePageEntries
+    },
+    {
+        INTRO_PAGE,
+        IntroPageEntries
+    },
+    {
+        LICENSE_PAGE,
+        LicensePageEntries
+    },
+    {
+        DEVICE_SETTINGS_PAGE,
+        DevicePageEntries
+    },
+    {
+        REPAIR_INTRO_PAGE,
+        RepairPageEntries
+    },
+    {
+        COMPUTER_SETTINGS_PAGE,
+        ComputerPageEntries
+    },
+    {
+        DISPLAY_SETTINGS_PAGE,
+        DisplayPageEntries
+    },
+    {
+        FLUSH_PAGE,
+        FlushPageEntries
+    },
+    {
+        QUIT_PAGE,
+        QuitPageEntries
+    },
+    {
+        SUCCESS_PAGE,
+        SuccessPageEntries
+    },
+    {
+        BOOT_LOADER_FLOPPY_PAGE,
+        BootPageEntries
+    },
+    {
+        -1,
+        NULL
+    }
+};
+
+#endif

Propchange: trunk/reactos/base/setup/usetup/lang/en-US.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/base/setup/usetup/mui.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/mui.c?rev=31173&view=auto
==============================================================================
--- trunk/reactos/base/setup/usetup/mui.c (added)
+++ trunk/reactos/base/setup/usetup/mui.c Wed Dec 12 03:05:00 2007
@@ -1,0 +1,83 @@
+#include "usetup.h"
+#include "mui.h"
+
+#include "lang/en-US.h"
+
+static MUI_LANGUAGE lang[] =
+{
+    {
+        "English (USA)",
+        enUSPages
+    },
+    {
+        NULL,
+        NULL
+    }
+};
+
+static unsigned sel_lang = 0;
+
+extern
+VOID
+PopupError(PCHAR Text,
+	   PCHAR Status,
+	   PINPUT_RECORD Ir,
+	   ULONG WaitEvent);
+
+
+static
+MUI_ENTRY *
+findMUIEntriesOfPage(int pg, MUI_PAGE * pages)
+{
+    int index = 0;
+    do
+    {
+        if (pages[index].Number == pg)
+        {
+            return pages[index].MuiEntry;
+        }
+        index++;
+    }while(pages[index].MuiEntry != NULL);
+    return NULL;
+}
+
+void MUIDisplayPage(int pg)
+{
+    MUI_ENTRY * entry;
+    int index;
+    int flags;
+
+    entry = findMUIEntriesOfPage(pg, lang[sel_lang].MuiPages);
+    if (!entry)
+    {
+        PopupError("Error: Failed to find translated page",
+                   NULL,
+                   NULL,
+                   POPUP_WAIT_NONE);
+        return;        
+    }
+
+    index = 0;
+    do
+    {
+        flags = entry[index].Flags;
+        switch(flags)
+        {
+            case TEXT_NORMAL:
+                CONSOLE_SetTextXY(entry[index].X, entry[index].Y, entry[index].Buffer);
+                break;
+            case TEXT_HIGHLIGHT:
+                CONSOLE_SetHighlightedTextXY(entry[index].X, entry[index].Y, entry[index].Buffer);
+                break;
+            case TEXT_UNDERLINE:
+                CONSOLE_SetUnderlinedTextXY(entry[index].X, entry[index].Y, entry[index].Buffer);
+                break;
+            case TEXT_STATUS:
+                  CONSOLE_SetStatusText(entry[index].Buffer);
+                  break;
+            default:
+                break;
+        }
+        index++;
+    }while(entry[index].Buffer != NULL);
+}

Propchange: trunk/reactos/base/setup/usetup/mui.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/base/setup/usetup/mui.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/mui.h?rev=31173&view=auto
==============================================================================
--- trunk/reactos/base/setup/usetup/mui.h (added)
+++ trunk/reactos/base/setup/usetup/mui.h Wed Dec 12 03:05:00 2007
@@ -1,0 +1,34 @@
+#ifndef MUI_H__
+#define MUI_H__
+
+typedef struct
+{
+   BYTE X;
+   BYTE Y;
+   CHAR * Buffer;
+   BYTE Flags;
+}MUI_ENTRY, *PMUI_ENTRY;
+
+typedef struct
+{
+    long Number;
+    MUI_ENTRY * MuiEntry;
+}MUI_PAGE;
+
+typedef struct
+{
+    CHAR * LanguageDescriptor;
+    MUI_PAGE * MuiPages;
+}MUI_LANGUAGE;
+
+
+#define TEXT_NORMAL 0
+#define TEXT_HIGHLIGHT 1
+#define TEXT_UNDERLINE 2
+#define TEXT_STATUS 4
+
+
+void MUIDisplayPage(int pg);
+
+
+#endif

Propchange: trunk/reactos/base/setup/usetup/mui.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/base/setup/usetup/usetup.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h?rev=31173&r1=31172&r2=31173&view=diff
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h (original)
+++ trunk/reactos/base/setup/usetup/usetup.h Wed Dec 12 03:05:00 2007
@@ -71,6 +71,8 @@
 #include "genlist.h"
 #include "settings.h"
 #include "host.h"
+#include "mui.h"
+
 
 extern HANDLE ProcessHeap;
 extern UNICODE_STRING SourceRootPath;
@@ -78,6 +80,50 @@
 extern UNICODE_STRING SourcePath;
 extern BOOLEAN IsUnattendedSetup;
 
+typedef enum _PAGE_NUMBER
+{
+  START_PAGE = 0,
+  INTRO_PAGE,
+  LICENSE_PAGE,
+  INSTALL_INTRO_PAGE,
+
+//  SCSI_CONTROLLER_PAGE,
+
+  DEVICE_SETTINGS_PAGE,
+  COMPUTER_SETTINGS_PAGE,
+  DISPLAY_SETTINGS_PAGE,
+  KEYBOARD_SETTINGS_PAGE,
+  LAYOUT_SETTINGS_PAGE,
+
+  SELECT_PARTITION_PAGE,
+  CREATE_PARTITION_PAGE,
+  DELETE_PARTITION_PAGE,
+
+  SELECT_FILE_SYSTEM_PAGE,
+  FORMAT_PARTITION_PAGE,
+  CHECK_FILE_SYSTEM_PAGE,
+
+  PREPARE_COPY_PAGE,
+  INSTALL_DIRECTORY_PAGE,
+  FILE_COPY_PAGE,
+  REGISTRY_PAGE,
+  BOOT_LOADER_PAGE,
+  BOOT_LOADER_FLOPPY_PAGE,
+  BOOT_LOADER_HARDDISK_PAGE,
+
+  REPAIR_INTRO_PAGE,
+
+  SUCCESS_PAGE,
+  QUIT_PAGE,
+  FLUSH_PAGE,
+  REBOOT_PAGE,			/* virtual page */
+} PAGE_NUMBER, *PPAGE_NUMBER;
+
+#define POPUP_WAIT_NONE    0
+#define POPUP_WAIT_ANY_KEY 1
+#define POPUP_WAIT_ENTER   2
+
+
 #endif /* __USETUP_H__*/
 
 /* EOF */

Modified: trunk/reactos/base/setup/usetup/usetup.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.rbuild?rev=31173&r1=31172&r2=31173&view=diff
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.rbuild (original)
+++ trunk/reactos/base/setup/usetup/usetup.rbuild Wed Dec 12 03:05:00 2007
@@ -43,4 +43,5 @@
 	<file>registry.c</file>
 	<file>settings.c</file>
 	<file>usetup.rc</file>
+	<file>mui.c</file>
 </module>




More information about the Ros-diffs mailing list