ReactOS 0.4.15-dev-8080-g044f181
genlist.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _GENERIC_LIST_UI
 

Typedefs

typedef NTSTATUS(NTAPIPGET_ENTRY_DESCRIPTION) (IN PGENERIC_LIST_ENTRY Entry, OUT PSTR Buffer, IN SIZE_T cchBufferSize)
 
typedef struct _GENERIC_LIST_UI GENERIC_LIST_UI
 
typedef struct _GENERIC_LIST_UIPGENERIC_LIST_UI
 

Functions

VOID InitGenericListUi (IN OUT PGENERIC_LIST_UI ListUi, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
 
VOID RestoreGenericListUiState (IN PGENERIC_LIST_UI ListUi)
 
VOID DrawGenericList (IN PGENERIC_LIST_UI ListUi, IN SHORT Left, IN SHORT Top, IN SHORT Right, IN SHORT Bottom)
 
VOID DrawGenericListCurrentItem (IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc, IN SHORT Left, IN SHORT Top)
 
VOID ScrollDownGenericList (IN PGENERIC_LIST_UI ListUi)
 
VOID ScrollUpGenericList (IN PGENERIC_LIST_UI ListUi)
 
VOID ScrollPageDownGenericList (IN PGENERIC_LIST_UI ListUi)
 
VOID ScrollPageUpGenericList (IN PGENERIC_LIST_UI ListUi)
 
VOID ScrollToPositionGenericList (IN PGENERIC_LIST_UI ListUi, IN ULONG uIndex)
 
VOID RedrawGenericList (IN PGENERIC_LIST_UI ListUi)
 
VOID GenericListKeyPress (IN PGENERIC_LIST_UI ListUi, IN CHAR AsciiChar)
 

Typedef Documentation

◆ GENERIC_LIST_UI

◆ PGENERIC_LIST_UI

◆ PGET_ENTRY_DESCRIPTION

typedef NTSTATUS(NTAPI * PGET_ENTRY_DESCRIPTION) (IN PGENERIC_LIST_ENTRY Entry, OUT PSTR Buffer, IN SIZE_T cchBufferSize)

Definition at line 31 of file genlist.h.

Function Documentation

◆ DrawGenericList()

VOID DrawGenericList ( IN PGENERIC_LIST_UI  ListUi,
IN SHORT  Left,
IN SHORT  Top,
IN SHORT  Right,
IN SHORT  Bottom 
)

Definition at line 326 of file genlist.c.

332{
333 PGENERIC_LIST List = ListUi->List;
334
335 ListUi->FirstShown = List->ListHead.Flink;
336 ListUi->Left = Left;
337 ListUi->Top = Top;
338 ListUi->Right = Right;
339 ListUi->Bottom = Bottom;
340
341 DrawListFrame(ListUi);
342
343 if (IsListEmpty(&List->ListHead))
344 return;
345
346 CenterCurrentListItem(ListUi);
347
348 DrawListEntries(ListUi);
350}
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
LIST_ENTRY ListHead
Definition: genlist.h:20
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static VOID DrawListFrame(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:70
static VOID DrawScrollBarGenericList(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:229
static VOID CenterCurrentListItem(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:277
static VOID DrawListEntries(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:153
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by ComputerSettingsPage(), DisplaySettingsPage(), KeyboardSettingsPage(), LanguagePage(), LayoutSettingsPage(), and UpgradeRepairPage().

◆ DrawGenericListCurrentItem()

VOID DrawGenericListCurrentItem ( IN PGENERIC_LIST  List,
IN PGET_ENTRY_DESCRIPTION  GetEntryDescriptionProc,
IN SHORT  Left,
IN SHORT  Top 
)

Definition at line 353 of file genlist.c.

358{
359 CHAR CurrentItemText[256];
360
361 if (GetEntryDescriptionProc &&
363 {
364 GetEntryDescriptionProc(GetCurrentListEntry(List),
365 CurrentItemText,
366 ARRAYSIZE(CurrentItemText));
367 CONSOLE_SetTextXY(Left, Top, CurrentItemText);
368 }
369 else
370 {
371 CONSOLE_SetTextXY(Left, Top, "");
372 }
373}
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:320
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
PGENERIC_LIST_ENTRY GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:97
ULONG GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:140
char CHAR
Definition: xmlstorage.h:175

Referenced by DeviceSettingsPage().

◆ GenericListKeyPress()

VOID GenericListKeyPress ( IN PGENERIC_LIST_UI  ListUi,
IN CHAR  AsciiChar 
)

Definition at line 525 of file genlist.c.

528{
529 PGENERIC_LIST List = ListUi->List;
530 PGENERIC_LIST_ENTRY ListEntry;
531 PGENERIC_LIST_ENTRY OldListEntry;
533
534 ListEntry = List->CurrentEntry;
535 OldListEntry = List->CurrentEntry;
536
537 ListUi->Redraw = FALSE;
538
539 ListUi->CurrentItemText[0] = ANSI_NULL;
540 if (ListUi->GetEntryDescriptionProc)
541 {
542 ListUi->GetEntryDescriptionProc(ListEntry,
543 ListUi->CurrentItemText,
544 ARRAYSIZE(ListUi->CurrentItemText));
545 }
546
547 if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar) &&
548 (List->CurrentEntry->Entry.Flink != &List->ListHead))
549 {
550 ScrollDownGenericList(ListUi);
551 ListEntry = List->CurrentEntry;
552
553 ListUi->CurrentItemText[0] = ANSI_NULL;
554 if (ListUi->GetEntryDescriptionProc)
555 {
556 ListUi->GetEntryDescriptionProc(ListEntry,
557 ListUi->CurrentItemText,
558 ARRAYSIZE(ListUi->CurrentItemText));
559 }
560
561 if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar))
562 goto End;
563 }
564
565 while (List->CurrentEntry->Entry.Blink != &List->ListHead)
566 ScrollUpGenericList(ListUi);
567
568 ListEntry = List->CurrentEntry;
569
570 for (;;)
571 {
572 ListUi->CurrentItemText[0] = ANSI_NULL;
573 if (ListUi->GetEntryDescriptionProc)
574 {
575 ListUi->GetEntryDescriptionProc(ListEntry,
576 ListUi->CurrentItemText,
577 ARRAYSIZE(ListUi->CurrentItemText));
578 }
579
580 if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar))
581 {
582 Flag = TRUE;
583 break;
584 }
585
586 if (List->CurrentEntry->Entry.Flink == &List->ListHead)
587 break;
588
589 ScrollDownGenericList(ListUi);
590 ListEntry = List->CurrentEntry;
591 }
592
593 if (!Flag)
594 {
595 while (List->CurrentEntry->Entry.Blink != &List->ListHead)
596 {
597 if (List->CurrentEntry != OldListEntry)
598 ScrollUpGenericList(ListUi);
599 else
600 break;
601 }
602 }
603
604End:
605 DrawListEntries(ListUi);
607
608 ListUi->Redraw = TRUE;
609}
unsigned char BOOLEAN
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int tolower(int c)
Definition: utclib.c:902
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ANSI_NULL
Definition: xml2sdb.h:80
Definition: genlist.h:11
VOID ScrollUpGenericList(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:404
VOID ScrollDownGenericList(IN PGENERIC_LIST_UI ListUi)
Definition: genlist.c:376

Referenced by HandleGenericList(), LanguagePage(), and UpgradeRepairPage().

◆ InitGenericListUi()

VOID InitGenericListUi ( IN OUT PGENERIC_LIST_UI  ListUi,
IN PGENERIC_LIST  List,
IN PGET_ENTRY_DESCRIPTION  GetEntryDescriptionProc 
)

Definition at line 37 of file genlist.c.

41{
42 ListUi->List = List;
43 ListUi->FirstShown = NULL;
44 ListUi->LastShown = NULL;
45 ListUi->BackupEntry = NULL;
46
47 ListUi->GetEntryDescriptionProc = GetEntryDescriptionProc;
48
49 ListUi->Left = 0;
50 ListUi->Top = 0;
51 ListUi->Right = 0;
52 ListUi->Bottom = 0;
53 ListUi->Redraw = TRUE;
54
55 ListUi->CurrentItemText[0] = ANSI_NULL;
56
57 /* SaveGenericListUiState(ListUi); */
58 ListUi->BackupEntry = ListUi->List->CurrentEntry;
59}
#define NULL
Definition: types.h:112

Referenced by ComputerSettingsPage(), DisplaySettingsPage(), KeyboardSettingsPage(), LanguagePage(), LayoutSettingsPage(), and UpgradeRepairPage().

◆ RedrawGenericList()

VOID RedrawGenericList ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 511 of file genlist.c.

513{
514 if (ListUi->List->CurrentEntry == NULL)
515 return;
516
517 if (ListUi->Redraw)
518 {
519 DrawListEntries(ListUi);
521 }
522}

Referenced by HandleGenericList(), LanguagePage(), and UpgradeRepairPage().

◆ RestoreGenericListUiState()

VOID RestoreGenericListUiState ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 62 of file genlist.c.

64{
65 ListUi->List->CurrentEntry = ListUi->BackupEntry;
66}

Referenced by HandleGenericList(), and UpgradeRepairPage().

◆ ScrollDownGenericList()

VOID ScrollDownGenericList ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 376 of file genlist.c.

378{
379 PGENERIC_LIST List = ListUi->List;
381
382 if (List->CurrentEntry == NULL)
383 return;
384
385 if (List->CurrentEntry->Entry.Flink != &List->ListHead)
386 {
387 Entry = List->CurrentEntry->Entry.Flink;
388 if (ListUi->LastShown == &List->CurrentEntry->Entry)
389 {
390 ListUi->FirstShown = ListUi->FirstShown->Flink;
391 ListUi->LastShown = ListUi->LastShown->Flink;
392 }
394
395 if (ListUi->Redraw)
396 {
397 DrawListEntries(ListUi);
399 }
400 }
401}
base of all file and directory entries
Definition: entries.h:83
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by GenericListKeyPress(), HandleGenericList(), LanguagePage(), ScrollPageDownGenericList(), and UpgradeRepairPage().

◆ ScrollPageDownGenericList()

VOID ScrollPageDownGenericList ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 432 of file genlist.c.

434{
435 SHORT i;
436
437 /* Suspend auto-redraw */
438 ListUi->Redraw = FALSE;
439
440 for (i = ListUi->Top + 1; i < ListUi->Bottom - 1; i++)
441 {
442 ScrollDownGenericList(ListUi);
443 }
444
445 /* Update user interface */
446 DrawListEntries(ListUi);
448
449 /* Re enable auto-redraw */
450 ListUi->Redraw = TRUE;
451}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
short SHORT
Definition: pedump.c:59

Referenced by HandleGenericList(), LanguagePage(), and UpgradeRepairPage().

◆ ScrollPageUpGenericList()

VOID ScrollPageUpGenericList ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 454 of file genlist.c.

456{
457 SHORT i;
458
459 /* Suspend auto-redraw */
460 ListUi->Redraw = FALSE;
461
462 for (i = ListUi->Bottom - 1; i > ListUi->Top + 1; i--)
463 {
464 ScrollUpGenericList(ListUi);
465 }
466
467 /* Update user interface */
468 DrawListEntries(ListUi);
470
471 /* Re enable auto-redraw */
472 ListUi->Redraw = TRUE;
473}

Referenced by HandleGenericList(), LanguagePage(), and UpgradeRepairPage().

◆ ScrollToPositionGenericList()

VOID ScrollToPositionGenericList ( IN PGENERIC_LIST_UI  ListUi,
IN ULONG  uIndex 
)

Definition at line 476 of file genlist.c.

479{
480 PGENERIC_LIST List = ListUi->List;
482 ULONG uCount = 0;
483
484 if (List->CurrentEntry == NULL || uIndex == 0)
485 return;
486
487 do
488 {
489 if (List->CurrentEntry->Entry.Flink != &List->ListHead)
490 {
491 Entry = List->CurrentEntry->Entry.Flink;
492 if (ListUi->LastShown == &List->CurrentEntry->Entry)
493 {
494 ListUi->FirstShown = ListUi->FirstShown->Flink;
495 ListUi->LastShown = ListUi->LastShown->Flink;
496 }
498 }
499 uCount++;
500 }
501 while (uIndex != uCount);
502
503 if (ListUi->Redraw)
504 {
505 DrawListEntries(ListUi);
507 }
508}
uint32_t ULONG
Definition: typedefs.h:59

Referenced by LanguagePage().

◆ ScrollUpGenericList()

VOID ScrollUpGenericList ( IN PGENERIC_LIST_UI  ListUi)

Definition at line 404 of file genlist.c.

406{
407 PGENERIC_LIST List = ListUi->List;
409
410 if (List->CurrentEntry == NULL)
411 return;
412
413 if (List->CurrentEntry->Entry.Blink != &List->ListHead)
414 {
415 Entry = List->CurrentEntry->Entry.Blink;
416 if (ListUi->FirstShown == &List->CurrentEntry->Entry)
417 {
418 ListUi->FirstShown = ListUi->FirstShown->Blink;
419 ListUi->LastShown = ListUi->LastShown->Blink;
420 }
422
423 if (ListUi->Redraw)
424 {
425 DrawListEntries(ListUi);
427 }
428 }
429}

Referenced by GenericListKeyPress(), HandleGenericList(), LanguagePage(), ScrollPageUpGenericList(), and UpgradeRepairPage().