Author: hbelusca
Date: Mon May 15 19:41:18 2017
New Revision: 74554
URL:
http://svn.reactos.org/svn/reactos?rev=74554&view=rev
Log:
[USETUP]: Similarly to what was done for GenLists, factor out the UI code from the
partition list code. This will allow to reuse it for the 1st-stage GUI setup too, while
using another UI representation.
- Add also two partition iterator functions: GetNextPartition and GetPrevPartition.
Modified:
branches/setup_improvements/base/setup/usetup/interface/usetup.c
branches/setup_improvements/base/setup/usetup/partlist.c
branches/setup_improvements/base/setup/usetup/partlist.h
Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c [iso-8859-1]
(original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c [iso-8859-1] Mon May
15 19:41:18 2017
@@ -789,38 +789,15 @@
static PAGE_NUMBER
SetupStartPage(PINPUT_RECORD Ir)
{
- //SYSTEM_DEVICE_INFORMATION Sdi;
NTSTATUS Status;
WCHAR FileNameBuffer[MAX_PATH];
INFCONTEXT Context;
PWCHAR Value;
UINT ErrorLine;
- //ULONG ReturnSize;
PGENERIC_LIST_ENTRY ListEntry;
INT IntValue;
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
-
-#if 0
- /* Check whether a harddisk is available */
- Status = NtQuerySystemInformation(SystemDeviceInformation,
- &Sdi,
- sizeof(SYSTEM_DEVICE_INFORMATION),
- &ReturnSize);
-
- if (!NT_SUCCESS(Status))
- {
- CONSOLE_PrintTextXY(6, 15, "NtQuerySystemInformation() failed (Status
0x%08lx)", Status);
- MUIDisplayError(ERROR_DRIVE_INFORMATION, Ir, POPUP_WAIT_ENTER);
- return QUIT_PAGE;
- }
-
- if (Sdi.NumberOfDisks == 0)
- {
- MUIDisplayError(ERROR_NO_HDD, Ir, POPUP_WAIT_ENTER);
- return QUIT_PAGE;
- }
-#endif
/* Get the source path and source root path */
Status = GetSourcePaths(&SourcePath,
@@ -895,7 +872,7 @@
RequiredPartitionDiskSpace = (ULONG)IntValue;
- /* Start PnP thread */
+ /* Start the PnP thread */
if (hPnpThread != INVALID_HANDLE_VALUE)
{
NtResumeThread(hPnpThread, NULL);
@@ -906,8 +883,7 @@
if (IsUnattendedSetup)
{
- //TODO
- //read options from inf
+ // TODO: Read options from inf
ComputerList = CreateComputerTypeList(SetupInf);
DisplayList = CreateDisplayDriverList(SetupInf);
KeyboardList = CreateKeyboardDriverList(SetupInf);
@@ -992,7 +968,7 @@
{
return REPAIR_INTRO_PAGE;
}
- else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'L') /* R */
+ else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'L') /* L */
{
return LICENSE_PAGE;
}
@@ -1532,19 +1508,18 @@
static PAGE_NUMBER
SelectPartitionPage(PINPUT_RECORD Ir)
{
+ PARTLIST_UI ListUi;
ULONG Error;
MUIDisplayPage(SELECT_PARTITION_PAGE);
if (PartitionList == NULL)
{
- PartitionList = CreatePartitionList(2,
- 23,
- xScreen - 3,
- yScreen - 3);
+ PartitionList = CreatePartitionList();
if (PartitionList == NULL)
{
/* FIXME: show an error dialog */
+ MUIDisplayError(ERROR_DRIVE_INFORMATION, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}
else if (IsListEmpty(&PartitionList->DiskListHead))
@@ -1554,7 +1529,12 @@
}
}
- DrawPartitionList(PartitionList);
+ InitPartitionListUi(&ListUi, PartitionList,
+ 2,
+ 23,
+ xScreen - 3,
+ yScreen - 3);
+ DrawPartitionList(&ListUi);
if (IsUnattendedSetup)
{
@@ -1575,6 +1555,7 @@
TRUE);
}
+// FIXME?? Aren't we going to enter an infinite loop, if this test fails??
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir,
POPUP_WAIT_ANY_KEY,
@@ -1589,6 +1570,9 @@
}
else
{
+ DrawPartitionList(&ListUi);
+
+// FIXME?? Aren't we going to enter an infinite loop, if this test fails??
if (!IsDiskSizeValid(PartitionList->CurrentPartition))
{
MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir,
POPUP_WAIT_ANY_KEY,
@@ -1656,14 +1640,12 @@
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
- if (ScrollDownPartitionList(PartitionList))
- DrawPartitionList(PartitionList);
+ ScrollDownPartitionList(&ListUi);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
- if (ScrollUpPartitionList(PartitionList))
- DrawPartitionList(PartitionList);
+ ScrollUpPartitionList(&ListUi);
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
{
Modified: branches/setup_improvements/base/setup/usetup/partlist.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/partlist.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/partlist.c [iso-8859-1] Mon May 15
19:41:18 2017
@@ -1418,11 +1418,7 @@
PPARTLIST
-CreatePartitionList(
- SHORT Left,
- SHORT Top,
- SHORT Right,
- SHORT Bottom)
+CreatePartitionList(VOID)
{
PPARTLIST List;
OBJECT_ATTRIBUTES ObjectAttributes;
@@ -1441,14 +1437,6 @@
if (List == NULL)
return NULL;
- List->Left = Left;
- List->Top = Top;
- List->Right = Right;
- List->Bottom = Bottom;
-
- List->Line = 0;
- List->Offset = 0;
-
List->CurrentDisk = NULL;
List->CurrentPartition = NULL;
@@ -1465,10 +1453,11 @@
Status = NtQuerySystemInformation(SystemDeviceInformation,
&Sdi,
- sizeof(SYSTEM_DEVICE_INFORMATION),
+ sizeof(Sdi),
&ReturnSize);
if (!NT_SUCCESS(Status))
{
+ DPRINT1("NtQuerySystemInformation() failed, Status 0x%08lx", Status);
RtlFreeHeap(ProcessHeap, 0, List);
return NULL;
}
@@ -1592,23 +1581,47 @@
}
+VOID
+InitPartitionListUi(
+ IN OUT PPARTLIST_UI ListUi,
+ IN PPARTLIST List,
+ IN SHORT Left,
+ IN SHORT Top,
+ IN SHORT Right,
+ IN SHORT Bottom)
+{
+ ListUi->List = List;
+ // ListUi->FirstShown = NULL;
+ // ListUi->LastShown = NULL;
+
+ ListUi->Left = Left;
+ ListUi->Top = Top;
+ ListUi->Right = Right;
+ ListUi->Bottom = Bottom;
+
+ ListUi->Line = 0;
+ ListUi->Offset = 0;
+
+ // ListUi->Redraw = TRUE;
+}
+
static
VOID
PrintEmptyLine(
- IN PPARTLIST List)
+ IN PPARTLIST_UI ListUi)
{
COORD coPos;
ULONG Written;
USHORT Width;
USHORT Height;
- Width = List->Right - List->Left - 1;
- Height = List->Bottom - List->Top - 2;
-
- coPos.X = List->Left + 1;
- coPos.Y = List->Top + 1 + List->Line;
-
- if (List->Line >= 0 && List->Line <= Height)
+ Width = ListUi->Right - ListUi->Left - 1;
+ Height = ListUi->Bottom - ListUi->Top - 2;
+
+ coPos.X = ListUi->Left + 1;
+ coPos.Y = ListUi->Top + 1 + ListUi->Line;
+
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
FillConsoleOutputAttribute(StdOutput,
FOREGROUND_WHITE | BACKGROUND_BLUE,
@@ -1623,17 +1636,18 @@
&Written);
}
- List->Line++;
+ ListUi->Line++;
}
static
VOID
PrintPartitionData(
- IN PPARTLIST List,
+ IN PPARTLIST_UI ListUi,
IN PDISKENTRY DiskEntry,
IN PPARTENTRY PartEntry)
{
+ PPARTLIST List = ListUi->List;
CHAR LineBuffer[128];
COORD coPos;
ULONG Written;
@@ -1643,14 +1657,13 @@
PCHAR Unit;
UCHAR Attribute;
CHAR PartTypeString[32];
- PCHAR PartType;
- PartType = PartTypeString;
-
- Width = List->Right - List->Left - 1;
- Height = List->Bottom - List->Top - 2;
-
- coPos.X = List->Left + 1;
- coPos.Y = List->Top + 1 + List->Line;
+ PCHAR PartType = PartTypeString;
+
+ Width = ListUi->Right - ListUi->Left - 1;
+ Height = ListUi->Bottom - ListUi->Top - 2;
+
+ coPos.X = ListUi->Left + 1;
+ coPos.Y = ListUi->Top + 1 + ListUi->Line;
if (PartEntry->IsPartitioned == FALSE)
{
@@ -1750,7 +1763,7 @@
FOREGROUND_BLUE | BACKGROUND_WHITE :
FOREGROUND_WHITE | BACKGROUND_BLUE;
- if (List->Line >= 0 && List->Line <= Height)
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
FillConsoleOutputCharacterA(StdOutput,
' ',
@@ -1760,7 +1773,7 @@
}
coPos.X += 4;
Width -= 8;
- if (List->Line >= 0 && List->Line <= Height)
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
FillConsoleOutputAttribute(StdOutput,
Attribute,
@@ -1770,7 +1783,7 @@
}
coPos.X++;
Width -= 2;
- if (List->Line >= 0 && List->Line <= Height)
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
WriteConsoleOutputCharacterA(StdOutput,
LineBuffer,
@@ -1779,16 +1792,17 @@
&Written);
}
- List->Line++;
+ ListUi->Line++;
}
static
VOID
PrintDiskData(
- IN PPARTLIST List,
+ IN PPARTLIST_UI ListUi,
IN PDISKENTRY DiskEntry)
{
+ // PPARTLIST List = ListUi->List;
PPARTENTRY PrimaryPartEntry, LogicalPartEntry;
PLIST_ENTRY PrimaryEntry, LogicalEntry;
CHAR LineBuffer[128];
@@ -1799,11 +1813,11 @@
ULARGE_INTEGER DiskSize;
PCHAR Unit;
- Width = List->Right - List->Left - 1;
- Height = List->Bottom - List->Top - 2;
-
- coPos.X = List->Left + 1;
- coPos.Y = List->Top + 1 + List->Line;
+ Width = ListUi->Right - ListUi->Left - 1;
+ Height = ListUi->Bottom - ListUi->Top - 2;
+
+ coPos.X = ListUi->Left + 1;
+ coPos.Y = ListUi->Top + 1 + ListUi->Line;
DiskSize.QuadPart = DiskEntry->SectorCount.QuadPart *
DiskEntry->BytesPerSector;
if (DiskSize.QuadPart >= 10737418240) /* 10 GB */
@@ -1843,7 +1857,7 @@
DiskEntry->Id);
}
- if (List->Line >= 0 && List->Line <= Height)
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
FillConsoleOutputAttribute(StdOutput,
FOREGROUND_WHITE | BACKGROUND_BLUE,
@@ -1859,7 +1873,7 @@
}
coPos.X++;
- if (List->Line >= 0 && List->Line <= Height)
+ if (ListUi->Line >= 0 && ListUi->Line <= Height)
{
WriteConsoleOutputCharacterA(StdOutput,
LineBuffer,
@@ -1868,10 +1882,10 @@
&Written);
}
- List->Line++;
+ ListUi->Line++;
/* Print separator line */
- PrintEmptyLine(List);
+ PrintEmptyLine(ListUi);
/* Print partition lines */
PrimaryEntry = DiskEntry->PrimaryPartListHead.Flink;
@@ -1879,7 +1893,7 @@
{
PrimaryPartEntry = CONTAINING_RECORD(PrimaryEntry, PARTENTRY, ListEntry);
- PrintPartitionData(List,
+ PrintPartitionData(ListUi,
DiskEntry,
PrimaryPartEntry);
@@ -1890,7 +1904,7 @@
{
LogicalPartEntry = CONTAINING_RECORD(LogicalEntry, PARTENTRY,
ListEntry);
- PrintPartitionData(List,
+ PrintPartitionData(ListUi,
DiskEntry,
LogicalPartEntry);
@@ -1902,14 +1916,15 @@
}
/* Print separator line */
- PrintEmptyLine(List);
+ PrintEmptyLine(ListUi);
}
VOID
DrawPartitionList(
- IN PPARTLIST List)
-{
+ IN PPARTLIST_UI ListUi)
+{
+ PPARTLIST List = ListUi->List;
PLIST_ENTRY Entry, Entry2;
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry = NULL;
@@ -2000,37 +2015,37 @@
}
/* If it possible, make the disk name visible */
- if (CurrentPartLine < List->Offset)
- {
- List->Offset = CurrentPartLine;
- }
- else if (CurrentPartLine - List->Offset > List->Bottom - List->Top - 2)
- {
- List->Offset = CurrentPartLine - (List->Bottom - List->Top - 2);
- }
-
- if (CurrentDiskLine < List->Offset && CurrentPartLine - CurrentDiskLine
< List->Bottom - List->Top - 2)
- {
- List->Offset = CurrentDiskLine;
- }
-
- /* draw upper left corner */
- coPos.X = List->Left;
- coPos.Y = List->Top;
+ if (CurrentPartLine < ListUi->Offset)
+ {
+ ListUi->Offset = CurrentPartLine;
+ }
+ else if (CurrentPartLine - ListUi->Offset > ListUi->Bottom - ListUi->Top
- 2)
+ {
+ ListUi->Offset = CurrentPartLine - (ListUi->Bottom - ListUi->Top - 2);
+ }
+
+ if (CurrentDiskLine < ListUi->Offset && CurrentPartLine -
CurrentDiskLine < ListUi->Bottom - ListUi->Top - 2)
+ {
+ ListUi->Offset = CurrentDiskLine;
+ }
+
+ /* Draw upper left corner */
+ coPos.X = ListUi->Left;
+ coPos.Y = ListUi->Top;
FillConsoleOutputCharacterA(StdOutput,
0xDA, // '+',
1,
coPos,
&Written);
- /* draw upper edge */
- coPos.X = List->Left + 1;
- coPos.Y = List->Top;
- if (List->Offset == 0)
+ /* Draw upper edge */
+ coPos.X = ListUi->Left + 1;
+ coPos.Y = ListUi->Top;
+ if (ListUi->Offset == 0)
{
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
- List->Right - List->Left - 1,
+ ListUi->Right - ListUi->Left - 1,
coPos,
&Written);
}
@@ -2038,16 +2053,16 @@
{
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
- List->Right - List->Left - 5,
+ ListUi->Right - ListUi->Left - 5,
coPos,
&Written);
- coPos.X = List->Right - 5;
+ coPos.X = ListUi->Right - 5;
WriteConsoleOutputCharacterA(StdOutput,
"(\x18)", // "(up)"
3,
coPos,
&Written);
- coPos.X = List->Right - 2;
+ coPos.X = ListUi->Right - 2;
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
2,
@@ -2055,19 +2070,19 @@
&Written);
}
- /* draw upper right corner */
- coPos.X = List->Right;
- coPos.Y = List->Top;
+ /* Draw upper right corner */
+ coPos.X = ListUi->Right;
+ coPos.Y = ListUi->Top;
FillConsoleOutputCharacterA(StdOutput,
0xBF, // '+',
1,
coPos,
&Written);
- /* draw left and right edge */
- for (i = List->Top + 1; i < List->Bottom; i++)
- {
- coPos.X = List->Left;
+ /* Draw left and right edge */
+ for (i = ListUi->Top + 1; i < ListUi->Bottom; i++)
+ {
+ coPos.X = ListUi->Left;
coPos.Y = i;
FillConsoleOutputCharacterA(StdOutput,
0xB3, // '|',
@@ -2075,7 +2090,7 @@
coPos,
&Written);
- coPos.X = List->Right;
+ coPos.X = ListUi->Right;
FillConsoleOutputCharacterA(StdOutput,
0xB3, //'|',
1,
@@ -2083,23 +2098,23 @@
&Written);
}
- /* draw lower left corner */
- coPos.X = List->Left;
- coPos.Y = List->Bottom;
+ /* Draw lower left corner */
+ coPos.X = ListUi->Left;
+ coPos.Y = ListUi->Bottom;
FillConsoleOutputCharacterA(StdOutput,
0xC0, // '+',
1,
coPos,
&Written);
- /* draw lower edge */
- coPos.X = List->Left + 1;
- coPos.Y = List->Bottom;
- if (LastLine - List->Offset <= List->Bottom - List->Top - 2)
+ /* Draw lower edge */
+ coPos.X = ListUi->Left + 1;
+ coPos.Y = ListUi->Bottom;
+ if (LastLine - ListUi->Offset <= ListUi->Bottom - ListUi->Top - 2)
{
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
- List->Right - List->Left - 1,
+ ListUi->Right - ListUi->Left - 1,
coPos,
&Written);
}
@@ -2107,16 +2122,16 @@
{
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
- List->Right - List->Left - 5,
+ ListUi->Right - ListUi->Left - 5,
coPos,
&Written);
- coPos.X = List->Right - 5;
+ coPos.X = ListUi->Right - 5;
WriteConsoleOutputCharacterA(StdOutput,
"(\x19)", // "(down)"
3,
coPos,
&Written);
- coPos.X = List->Right - 2;
+ coPos.X = ListUi->Right - 2;
FillConsoleOutputCharacterA(StdOutput,
0xC4, // '-',
2,
@@ -2124,9 +2139,9 @@
&Written);
}
- /* draw lower right corner */
- coPos.X = List->Right;
- coPos.Y = List->Bottom;
+ /* Draw lower right corner */
+ coPos.X = ListUi->Right;
+ coPos.Y = ListUi->Bottom;
FillConsoleOutputCharacterA(StdOutput,
0xD9, // '+',
1,
@@ -2134,7 +2149,7 @@
&Written);
/* print list entries */
- List->Line = - List->Offset;
+ ListUi->Line = - ListUi->Offset;
Entry = List->DiskListHead.Flink;
while (Entry != &List->DiskListHead)
@@ -2142,8 +2157,7 @@
DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
/* Print disk entry */
- PrintDiskData(List,
- DiskEntry);
+ PrintDiskData(ListUi, DiskEntry);
Entry = Entry->Flink;
}
@@ -2158,8 +2172,7 @@
{
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
- PLIST_ENTRY Entry1;
- PLIST_ENTRY Entry2;
+ PLIST_ENTRY Entry1, Entry2;
/* Check for empty disks */
if (IsListEmpty(&List->DiskListHead))
@@ -2180,10 +2193,9 @@
if (PartEntry->PartitionNumber == PartitionNumber)
{
- List->CurrentDisk = DiskEntry;
- List->CurrentPartition = PartEntry;
- DrawPartitionList(List);
- return TRUE;
+ List->CurrentDisk = DiskEntry;
+ List->CurrentPartition = PartEntry;
+ return TRUE;
}
Entry2 = Entry2->Flink;
@@ -2199,8 +2211,8 @@
}
-BOOL
-ScrollDownPartitionList(
+PPARTENTRY
+GetNextPartition(
IN PPARTLIST List)
{
PLIST_ENTRY DiskListEntry;
@@ -2210,7 +2222,7 @@
/* Fail, if no disks are available */
if (IsListEmpty(&List->DiskListHead))
- return FALSE;
+ return NULL;
/* Check for next usable entry on current disk */
if (List->CurrentPartition != NULL)
@@ -2226,7 +2238,7 @@
PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry);
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
else
{
@@ -2236,7 +2248,7 @@
PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry);
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
}
}
@@ -2254,7 +2266,7 @@
PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry);
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
}
else
@@ -2266,7 +2278,7 @@
PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry);
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
}
}
@@ -2285,18 +2297,17 @@
List->CurrentDisk = DiskEntry;
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
DiskListEntry = DiskListEntry->Flink;
}
- return FALSE;
-}
-
-
-BOOL
-ScrollUpPartitionList(
+ return NULL;
+}
+
+PPARTENTRY
+GetPrevPartition(
IN PPARTLIST List)
{
PLIST_ENTRY DiskListEntry;
@@ -2306,7 +2317,7 @@
/* Fail, if no disks are available */
if (IsListEmpty(&List->DiskListHead))
- return FALSE;
+ return NULL;
/* Check for previous usable entry on current disk */
if (List->CurrentPartition != NULL)
@@ -2322,12 +2333,12 @@
}
else
{
- /* Extended partition*/
+ /* Extended partition */
PartEntry = List->CurrentDisk->ExtendedPartition;
}
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
else
{
@@ -2346,9 +2357,8 @@
}
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
-
}
}
@@ -2373,21 +2383,39 @@
List->CurrentDisk = DiskEntry;
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
}
else
{
List->CurrentDisk = DiskEntry;
List->CurrentPartition = PartEntry;
- return TRUE;
+ return List->CurrentPartition;
}
}
DiskListEntry = DiskListEntry->Blink;
}
- return FALSE;
+ return NULL;
+}
+
+
+
+VOID
+ScrollDownPartitionList(
+ IN PPARTLIST_UI ListUi)
+{
+ if (GetNextPartition(ListUi->List))
+ DrawPartitionList(ListUi);
+}
+
+VOID
+ScrollUpPartitionList(
+ IN PPARTLIST_UI ListUi)
+{
+ if (GetPrevPartition(ListUi->List))
+ DrawPartitionList(ListUi);
}
Modified: branches/setup_improvements/base/setup/usetup/partlist.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/partlist.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/partlist.h [iso-8859-1] Mon May 15
19:41:18 2017
@@ -152,16 +152,9 @@
typedef struct _PARTLIST
{
- /* UI stuff */
- SHORT Left;
- SHORT Top;
- SHORT Right;
- SHORT Bottom;
-
- SHORT Line;
- SHORT Offset;
-
/*
+ * Disk & Partition iterators.
+ *
* NOTE that when CurrentPartition != NULL, then CurrentPartition->DiskEntry
* must be the same as CurrentDisk. We should however keep the two members
* separated as we can have a current (selected) disk without any current
@@ -239,18 +232,10 @@
IN ULONG cchPartType);
PPARTLIST
-CreatePartitionList(
- SHORT Left,
- SHORT Top,
- SHORT Right,
- SHORT Bottom);
+CreatePartitionList(VOID);
VOID
DestroyPartitionList(
- IN PPARTLIST List);
-
-VOID
-DrawPartitionList(
IN PPARTLIST List);
ULONG
@@ -259,12 +244,12 @@
IN ULONG DiskNumber,
IN ULONG PartitionNumber);
-BOOL
-ScrollDownPartitionList(
- IN PPARTLIST List);
-
-BOOL
-ScrollUpPartitionList(
+PPARTENTRY
+GetNextPartition(
+ IN PPARTLIST List);
+
+PPARTENTRY
+GetPrevPartition(
IN PPARTLIST List);
VOID
@@ -330,4 +315,47 @@
OUT PDISKENTRY *pDiskEntry OPTIONAL,
OUT PPARTENTRY *pPartEntry);
+
+
+
+
+typedef struct _PARTLIST_UI
+{
+ PPARTLIST List;
+
+ // PLIST_ENTRY FirstShown;
+ // PLIST_ENTRY LastShown;
+
+ SHORT Left;
+ SHORT Top;
+ SHORT Right;
+ SHORT Bottom;
+
+ SHORT Line;
+ SHORT Offset;
+
+ // BOOL Redraw;
+} PARTLIST_UI, *PPARTLIST_UI;
+
+VOID
+InitPartitionListUi(
+ IN OUT PPARTLIST_UI ListUi,
+ IN PPARTLIST List,
+ IN SHORT Left,
+ IN SHORT Top,
+ IN SHORT Right,
+ IN SHORT Bottom);
+
+VOID
+ScrollDownPartitionList(
+ IN PPARTLIST_UI ListUi);
+
+VOID
+ScrollUpPartitionList(
+ IN PPARTLIST_UI ListUi);
+
+VOID
+DrawPartitionList(
+ IN PPARTLIST_UI ListUi);
+
/* EOF */