ReactOS  0.4.14-dev-342-gdc047f9
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 13 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 */
214  Popup->OldContents = ConsoleAllocHeap(HEAP_ZERO_MEMORY,
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 */
233  DrawBox(Buffer,
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 }
#define TRUE
Definition: types.h:120
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
#define TEXTMODE_BUFFER
Definition: pccons.c:21
#define InsertTailList(ListHead, Entry)
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
INT GetType(BOOL bLocal, LPOSVERSIONINFOEX osvi, LPSERVER_INFO_102 pBuf102)
Definition: gettype.c:129
Definition: console.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
CConsole Console
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
HANDLE ScreenBuffer
Definition: notevil.c:37
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER

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 TRUE
Definition: types.h:120
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
smooth NULL
Definition: ftsmooth.c:416
Definition: console.h:35
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15

Referenced by LineInputKeyDown().