ReactOS 0.4.15-dev-8096-ga0eec98
popup.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _POPUP_WINDOW
 

Typedefs

typedef VOID(NTAPIPPOPUP_INPUT_ROUTINE) (VOID)
 
typedef struct _POPUP_WINDOW POPUP_WINDOW
 
typedef struct _POPUP_WINDOWPPOPUP_WINDOW
 

Functions

PPOPUP_WINDOW CreatePopupWindow (IN PCONSRV_CONSOLE Console, IN PCONSOLE_SCREEN_BUFFER ScreenBuffer, IN SHORT xLeft, IN SHORT yTop, IN SHORT Width, IN SHORT Height)
 
VOID DestroyPopupWindow (IN PPOPUP_WINDOW Popup)
 

Typedef Documentation

◆ POPUP_WINDOW

◆ PPOPUP_INPUT_ROUTINE

typedef VOID(NTAPI * PPOPUP_INPUT_ROUTINE) (VOID)

Definition at line 12 of file popup.h.

◆ PPOPUP_WINDOW

Function Documentation

◆ CreatePopupWindow()

PPOPUP_WINDOW CreatePopupWindow ( IN PCONSRV_CONSOLE  Console,
IN PCONSOLE_SCREEN_BUFFER  ScreenBuffer,
IN SHORT  xLeft,
IN SHORT  yTop,
IN SHORT  Width,
IN SHORT  Height 
)

Definition at line 184 of file popup.c.

191{
195
196 ASSERT((PCONSOLE)Console == ScreenBuffer->Header.Console);
197
199 return NULL;
200
202
203 /* Create the popup window */
205 if (Popup == NULL) return NULL;
206
207 Popup->ScreenBuffer = Buffer;
208 Popup->Origin.X = xLeft;
209 Popup->Origin.Y = yTop;
210 Popup->Size.X = Width;
211 Popup->Size.Y = Height;
212
213 /* Save old contents */
215 Popup->Size.X * Popup->Size.Y *
216 sizeof(*Popup->OldContents));
217 if (Popup->OldContents == NULL)
218 {
220 return NULL;
221 }
222 Region.Left = Popup->Origin.X;
223 Region.Top = Popup->Origin.Y;
224 Region.Right = Popup->Origin.X + Popup->Size.X - 1;
225 Region.Bottom = Popup->Origin.Y + Popup->Size.Y - 1;
226 ConDrvReadConsoleOutput(Buffer->Header.Console,
227 Buffer,
228 TRUE,
229 Popup->OldContents,
230 &Region);
231
232 /* Draw it */
234 xLeft, yTop,
235 Width, Height);
236
237 /* Add it into the list of popups */
238 InsertTailList(&Console->PopupWindows, &Popup->ListEntry);
239
240 return Popup;
241}
CConsole Console
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
@ Popup
Definition: console.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define InsertTailList(ListHead, Entry)
#define ASSERT(a)
Definition: mode.c:44
HANDLE ScreenBuffer
Definition: notevil.c:37
#define TEXTMODE_BUFFER
Definition: pccons.c:21
NTSTATUS NTAPI ConDrvReadConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, OUT PCHAR_INFO CharInfo, IN OUT PSMALL_RECT ReadRegion)
Definition: text.c:569
static VOID DrawBox(PTEXTMODE_SCREEN_BUFFER Buffer, IN SHORT xLeft, IN SHORT yTop, IN SHORT Width, IN SHORT Height)
Definition: popup.c:49
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER
#define GetType(This)
Definition: conio.h:54

Referenced by HistoryDisplayCurrentHistory().

◆ DestroyPopupWindow()

VOID DestroyPopupWindow ( IN PPOPUP_WINDOW  Popup)

Definition at line 244 of file popup.c.

246{
248
249 if (Popup == NULL) return;
250
251 /* Remove it from the list of popups */
252 RemoveEntryList(&Popup->ListEntry);
253
254 /* Restore the old screen-buffer contents */
255 Region.Left = Popup->Origin.X;
256 Region.Top = Popup->Origin.Y;
257 Region.Right = Popup->Origin.X + Popup->Size.X - 1;
258 Region.Bottom = Popup->Origin.Y + Popup->Size.Y - 1;
259 ConDrvWriteConsoleOutput(Popup->ScreenBuffer->Header.Console,
260 Popup->ScreenBuffer,
261 TRUE,
262 Popup->OldContents,
263 &Region);
264
265 /* Free memory */
266 ConsoleFreeHeap(Popup->OldContents);
268}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
NTSTATUS NTAPI ConDrvWriteConsoleOutput(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, IN BOOLEAN Unicode, IN PCHAR_INFO CharInfo, IN OUT PSMALL_RECT WriteRegion)
Definition: text.c:638

Referenced by LineInputKeyDown().