ReactOS  0.4.14-dev-49-gfb4591c
gui.c File Reference
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
#include "winetest.h"
Include dependency graph for gui.c:

Go to the source code of this file.

Functions

static int MBdefault (int uType)
 
static int textStatus (va_list ap)
 
static int guiStatus (va_list ap)
 
static int textProgress (va_list ap)
 
static int guiProgress (va_list ap)
 
static int textStep (va_list ap)
 
static int guiStep (va_list ap)
 
static int textDelta (va_list ap)
 
static int guiDelta (va_list ap)
 
static int textTag (va_list ap)
 
static int guiTag (va_list ap)
 
static int textDir (va_list ap)
 
static int guiDir (va_list ap)
 
static int textOut (va_list ap)
 
static int guiOut (va_list ap)
 
static int textWarning (va_list ap)
 
static int guiWarning (va_list ap)
 
static int textError (va_list ap)
 
static int guiError (va_list ap)
 
static int textFatal (va_list ap)
 
static int guiFatal (va_list ap)
 
static int textAsk (va_list ap)
 
static int guiAsk (va_list ap)
 
static BOOL CALLBACK EditTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK AskTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
int guiAskTag (void)
 
static int qNoOp (va_list ap)
 
static int qFatal (va_list ap)
 
static int qAsk (va_list ap)
 
static INT_PTR CALLBACK AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI DlgThreadProc (LPVOID param)
 
int report (enum report_type t,...)
 

Variables

static HANDLE initEvent
 
static HWND dialog
 
static unsigned int progressMax
 
static unsigned int progressCurr
 
static double progressScale
 
static int progressGroup
 
static WNDPROC DefEditProc
 

Function Documentation

◆ AboutProc()

static INT_PTR CALLBACK AboutProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 380 of file gui.c.

381 {
382  switch (msg) {
383  case WM_COMMAND:
384  switch (LOWORD (wParam)) {
385  case IDCANCEL:
387  return TRUE;
388  }
389  }
390  return FALSE;
391 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define WM_COMMAND
Definition: winuser.h:1722
#define msg(x)
Definition: auth_time.c:54
#define IDCANCEL
Definition: winuser.h:825
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DlgProc().

◆ AskTagProc()

static INT_PTR CALLBACK AskTagProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 327 of file gui.c.

328 {
329  int len;
330 
331  switch (msg) {
332  case WM_INITDIALOG:
335  return TRUE;
336  case WM_COMMAND:
337  switch (LOWORD (wParam)) {
338  case IDOK:
340  tag = xmalloc (len+1);
342  EndDialog (hwnd, IDOK);
343  return TRUE;
344  case IDABORT:
346  return TRUE;
347  }
348  }
349  return FALSE;
350 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LONG_PTR
Definition: treelist.c:79
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDABORT
Definition: winuser.h:826
Definition: ecma_167.h:138
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static WNDPROC DefEditProc
Definition: gui.c:44
void * xmalloc(int size)
Definition: uimain.c:747
#define IDC_TAG
Definition: resource.h:38
int WINAPI GetWindowTextLengthA(_In_ HWND)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
GLenum GLsizei len
Definition: glext.h:6722
#define WM_COMMAND
Definition: winuser.h:1722
#define GWLP_WNDPROC
Definition: treelist.c:66
UINT WINAPI GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
Definition: dialog.c:2190
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define msg(x)
Definition: auth_time.c:54
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82
static BOOL CALLBACK EditTagProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: gui.c:314

Referenced by guiAskTag().

◆ DlgProc()

static INT_PTR CALLBACK DlgProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 394 of file gui.c.

395 {
396  switch (msg) {
397  case WM_INITDIALOG:
398  SendMessage (hwnd, WM_SETICON, ICON_SMALL,
401  SendMessage (hwnd, WM_SETICON, ICON_BIG,
404  dialog = hwnd;
405  if (!SetEvent (initEvent)) {
406  report (R_STATUS, "Can't signal main thread: %d",
407  GetLastError ());
408  EndDialog (hwnd, 2);
409  }
410  return TRUE;
411  case WM_CLOSE:
412  EndDialog (hwnd, 3);
413  return TRUE;
414  case WM_COMMAND:
415  switch (LOWORD (wParam)) {
416  case IDHELP:
419  return TRUE;
420  case IDABORT:
421  report (R_WARNING, "Not implemented");
422  return TRUE;
423  }
424  }
425  return FALSE;
426 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define IDABORT
Definition: winuser.h:826
int report(enum report_type t,...)
Definition: gui.c:454
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static HANDLE initEvent
Definition: gui.c:29
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define IDHELP
Definition: resource_2.h:8
#define ICON_SMALL
Definition: tnclass.cpp:48
#define DialogBox
Definition: winuser.h:5662
static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: gui.c:380
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_COMMAND
Definition: winuser.h:1722
#define GetModuleHandle
Definition: winbase.h:3644
#define IDD_ABOUT
Definition: shresdef.h:298
static HWND dialog
Definition: gui.c:33
#define msg(x)
Definition: auth_time.c:54
#define SendMessage
Definition: winuser.h:5744
#define LoadIcon
Definition: winuser.h:5714
#define IDI_WINE
Definition: resource.h:21
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by DlgThreadProc().

◆ DlgThreadProc()

static DWORD WINAPI DlgThreadProc ( LPVOID  param)
static

Definition at line 429 of file gui.c.

430 {
431  int ret;
432 
436  NULL, DlgProc);
437  switch (ret) {
438  case 0:
439  report (R_WARNING, "Invalid parent handle");
440  break;
441  case 1:
442  report (R_WARNING, "DialogBox failed: %d",
443  GetLastError ());
444  break;
445  case 3:
446  exit (0);
447  default:
448  report (R_STATUS, "Dialog exited: %d", ret);
449  }
450  return 0;
451 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
int report(enum report_type t,...)
Definition: gui.c:454
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define DialogBox
Definition: winuser.h:5662
smooth NULL
Definition: ftsmooth.c:416
int ret
#define GetModuleHandle
Definition: winbase.h:3644
static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: gui.c:394
#define IDD_STATUS
Definition: resource.h:22
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
void exit(int exitcode)
Definition: _exit.c:33

Referenced by report().

◆ EditTagProc()

static BOOL CALLBACK EditTagProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 314 of file gui.c.

315 {
316  switch (msg) {
317  case WM_CHAR:
318  if (wParam == 8) break; /* backspace is OK */
320  !goodtagchar (wParam)) return TRUE;
321  break;
322  }
324 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define WM_CHAR
Definition: winuser.h:1699
int goodtagchar(char c)
Definition: util.c:115
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static WNDPROC DefEditProc
Definition: gui.c:44
#define MAXTAGLEN
Definition: winetest.h:62
int WINAPI GetWindowTextLengthA(_In_ HWND)
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by AskTagProc().

◆ guiAsk()

static int guiAsk ( va_list  ap)
static

Definition at line 302 of file gui.c.

303 {
304  int uType = va_arg (ap, int);
305  char *str = vstrmake (NULL, ap);
306  int ret = MessageBox (dialog, str, "Question",
307  MB_ICONQUESTION | uType);
308 
309  free (str);
310  return ret;
311 }
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
int ret
#define MessageBox
Definition: winuser.h:5723
#define va_arg(ap, T)
Definition: acmsvcex.h:89
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiAskTag()

int guiAskTag ( void  )

Definition at line 353 of file gui.c.

354 {
355  return DialogBox (GetModuleHandle (NULL),
357  dialog, AskTagProc);
358 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5662
smooth NULL
Definition: ftsmooth.c:416
#define IDD_TAG
Definition: resource.h:25
#define GetModuleHandle
Definition: winbase.h:3644
static INT_PTR CALLBACK AskTagProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: gui.c:327
static HWND dialog
Definition: gui.c:33

Referenced by WinMain().

◆ guiDelta()

static int guiDelta ( va_list  ap)
static

Definition at line 157 of file gui.c.

158 {
159  const int inc = va_arg (ap, int);
160  const int pgID = IDC_ST0 + progressGroup * 2;
161  char *str = vstrmake (NULL, ap);
162 
163  progressCurr += inc;
164  SetDlgItemText (dialog, pgID, str);
167  free (str);
168  return 0;
169 }
static double progressScale
Definition: gui.c:38
#define free
Definition: debug_ros.c:5
#define PBM_SETPOS
Definition: commctrl.h:2156
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static int progressGroup
Definition: gui.c:42
#define SetDlgItemText
Definition: winuser.h:5750
#define va_arg(ap, T)
Definition: acmsvcex.h:89
static unsigned int progressCurr
Definition: gui.c:37
static HWND dialog
Definition: gui.c:33
#define IDC_ST0
Definition: resource.h:29
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiDir()

static int guiDir ( va_list  ap)
static

Definition at line 202 of file gui.c.

203 {
204  char *str = vstrmake (NULL, ap);
205 
207  free (str);
208  return 0;
209 }
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define SetDlgItemText
Definition: winuser.h:5750
#define IDC_DIR
Definition: resource.h:36
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiError()

static int guiError ( va_list  ap)
static

Definition at line 263 of file gui.c.

264 {
265  char *str = vstrmake (NULL, ap);
266 
267  MessageBox (dialog, str, "Error", MB_ICONERROR | MB_OK);
268  free (str);
269  return 0;
270 }
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5723
#define MB_OK
Definition: winuser.h:784
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by guiFatal(), and report().

◆ guiFatal()

static int guiFatal ( va_list  ap)
static

Definition at line 281 of file gui.c.

282 {
283  guiError (ap);
284  exit (1);
285 }
static int guiError(va_list ap)
Definition: gui.c:263
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
void exit(int exitcode)
Definition: _exit.c:33

Referenced by report().

◆ guiOut()

static int guiOut ( va_list  ap)
static

Definition at line 225 of file gui.c.

226 {
227  char *str = vstrmake (NULL, ap);
228 
230  free (str);
231  return 0;
232 }
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define IDC_OUT
Definition: resource.h:37
#define SetDlgItemText
Definition: winuser.h:5750
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiProgress()

static int guiProgress ( va_list  ap)
static

Definition at line 96 of file gui.c.

97 {
98  unsigned int max;
99  HWND pb;
100 
101  progressGroup = va_arg (ap, int);
102  progressMax = max = va_arg (ap, int);
103  progressCurr = 0;
104  if (max > 0xffff) {
105  progressScale = (double)0xffff / max;
106  max = 0xffff;
107  }
108  else progressScale = 1;
109  pb = GetDlgItem (dialog, IDC_PB0 + progressGroup * 2);
110  SendMessage (pb, PBM_SETRANGE, 0, MAKELPARAM (0, max));
111  SendMessage (pb, PBM_SETSTEP, (WPARAM)1, 0);
112  return 0;
113 }
static unsigned int progressMax
Definition: gui.c:37
#define max(a, b)
Definition: svc.c:63
static double progressScale
Definition: gui.c:38
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
UINT_PTR WPARAM
Definition: windef.h:207
#define PBM_SETRANGE
Definition: commctrl.h:2155
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
#define PBM_SETSTEP
Definition: commctrl.h:2158
static int progressGroup
Definition: gui.c:42
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define va_arg(ap, T)
Definition: acmsvcex.h:89
static unsigned int progressCurr
Definition: gui.c:37
#define IDC_PB0
Definition: resource.h:30
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
#define SendMessage
Definition: winuser.h:5744

Referenced by report().

◆ guiStatus()

static int guiStatus ( va_list  ap)
static

Definition at line 74 of file gui.c.

75 {
76  size_t len;
77  char *str = vstrmake (&len, ap);
78 
79  if (len > 128) str[129] = 0;
81  free (str);
82  return 0;
83 }
#define free
Definition: debug_ros.c:5
#define IDC_SB
Definition: resource.h:40
const WCHAR * str
#define SetDlgItemText
Definition: winuser.h:5750
GLenum GLsizei len
Definition: glext.h:6722
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiStep()

static int guiStep ( va_list  ap)
static

Definition at line 129 of file gui.c.

130 {
131  const int pgID = IDC_ST0 + progressGroup * 2;
132  char *str = vstrmake (NULL, ap);
133 
134  progressCurr++;
135  SetDlgItemText (dialog, pgID, str);
138  free (str);
139  return 0;
140 }
static double progressScale
Definition: gui.c:38
#define free
Definition: debug_ros.c:5
#define PBM_SETPOS
Definition: commctrl.h:2156
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static int progressGroup
Definition: gui.c:42
#define SetDlgItemText
Definition: winuser.h:5750
static unsigned int progressCurr
Definition: gui.c:37
static HWND dialog
Definition: gui.c:33
#define IDC_ST0
Definition: resource.h:29
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ guiTag()

static int guiTag ( va_list  ap)
static

Definition at line 182 of file gui.c.

183 {
185  return 0;
186 }
Definition: ecma_167.h:138
#define IDC_TAG
Definition: resource.h:38
#define SetDlgItemText
Definition: winuser.h:5750
static HWND dialog
Definition: gui.c:33

Referenced by report().

◆ guiWarning()

static int guiWarning ( va_list  ap)
static

Definition at line 244 of file gui.c.

245 {
246  char *str = vstrmake (NULL, ap);
247 
248  MessageBox (dialog, str, "Warning", MB_ICONWARNING | MB_OK);
249  free (str);
250  return 0;
251 }
#define free
Definition: debug_ros.c:5
#define MB_ICONWARNING
Definition: winuser.h:780
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define MessageBox
Definition: winuser.h:5723
#define MB_OK
Definition: winuser.h:784
static HWND dialog
Definition: gui.c:33
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ MBdefault()

static int MBdefault ( int  uType)
static

Definition at line 47 of file gui.c.

48 {
49  static const int matrix[][4] = {{IDOK, 0, 0, 0},
50  {IDOK, IDCANCEL, 0, 0},
51  {IDABORT, IDRETRY, IDIGNORE, 0},
52  {IDYES, IDNO, IDCANCEL, 0},
53  {IDYES, IDNO, 0, 0},
54  {IDRETRY, IDCANCEL, 0, 0}};
55  int type = uType & MB_TYPEMASK;
56  int def = (uType & MB_DEFMASK) / MB_DEFBUTTON2;
57 
58  return matrix[type][def];
59 }
#define IDOK
Definition: winuser.h:824
#define IDABORT
Definition: winuser.h:826
#define IDYES
Definition: winuser.h:829
GLuint GLenum matrix
Definition: glext.h:9407
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define MB_TYPEMASK
Definition: winuser.h:818
#define MB_DEFMASK
Definition: winuser.h:814
#define IDRETRY
Definition: winuser.h:827
#define MB_DEFBUTTON2
Definition: winuser.h:793
#define IDNO
Definition: winuser.h:830
#define IDCANCEL
Definition: winuser.h:825
#define IDIGNORE
Definition: winuser.h:828

Referenced by qAsk(), and textAsk().

◆ qAsk()

static int qAsk ( va_list  ap)
static

Definition at line 374 of file gui.c.

375 {
376  return MBdefault (va_arg (ap, int));
377 }
static int MBdefault(int uType)
Definition: gui.c:47
#define va_arg(ap, T)
Definition: acmsvcex.h:89
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

Referenced by report().

◆ qFatal()

static int qFatal ( va_list  ap)
static

Definition at line 368 of file gui.c.

369 {
370  exit (1);
371 }
void exit(int exitcode)
Definition: _exit.c:33

Referenced by report().

◆ qNoOp()

static int qNoOp ( va_list  ap)
static

Definition at line 362 of file gui.c.

363 {
364  return 0;
365 }

Referenced by report().

◆ report()

int report ( enum report_type  t,
  ... 
)

Definition at line 454 of file gui.c.

455 {
456  typedef int r_fun_t (va_list);
457 
458  va_list ap;
459  int ret = 0;
460  static r_fun_t * const text_funcs[] =
464  static r_fun_t * const GUI_funcs[] =
466  guiTag, guiDir, guiOut,
468  static r_fun_t * const quiet_funcs[] =
469  {qNoOp, qNoOp, qNoOp, qNoOp,
470  qNoOp, qNoOp, qNoOp,
471  qNoOp, qNoOp, qFatal, qAsk};
472  static r_fun_t * const * funcs = NULL;
473 
474  switch (t) {
475  case R_TEXTMODE:
476  funcs = text_funcs;
477  return 0;
478  case R_QUIET:
479  funcs = quiet_funcs;
480  return 0;
481  default:
482  break;
483  }
484 
485  if (!funcs) {
486  HANDLE DlgThread;
487  DWORD DlgThreadID;
488 
489  funcs = text_funcs;
491  if (!initEvent)
492  report (R_STATUS, "Can't create event object: %d",
493  GetLastError ());
494  else {
495  DlgThread = CreateThread (NULL, 0, DlgThreadProc,
496  NULL, 0, &DlgThreadID);
497  if (!DlgThread)
498  report (R_STATUS, "Can't create GUI thread: %d",
499  GetLastError ());
500  else {
502  switch (ret) {
503  case WAIT_OBJECT_0:
504  funcs = GUI_funcs;
505  break;
506  case WAIT_TIMEOUT:
507  report (R_STATUS, "GUI creation timed out");
508  break;
509  case WAIT_FAILED:
510  report (R_STATUS, "Wait for GUI failed: %d",
511  GetLastError ());
512  break;
513  default:
514  report (R_STATUS, "Wait returned %d",
515  ret);
516  break;
517  }
518  }
519  }
520  }
521 
522  va_start (ap, t);
523  if (t < sizeof text_funcs / sizeof text_funcs[0] &&
524  t < sizeof GUI_funcs / sizeof GUI_funcs[0]) ret = funcs[t](ap);
525  else report (R_WARNING, "unimplemented report type: %d", t);
526  va_end (ap);
527  return ret;
528 }
#define CreateEvent
Definition: winbase.h:3565
static int guiStatus(va_list ap)
Definition: gui.c:74
static int textFatal(va_list ap)
Definition: gui.c:274
static int qAsk(va_list ap)
Definition: gui.c:374
static int guiOut(va_list ap)
Definition: gui.c:225
static int textWarning(va_list ap)
Definition: gui.c:236
static int guiDir(va_list ap)
Definition: gui.c:202
int report(enum report_type t,...)
Definition: gui.c:454
static int guiWarning(va_list ap)
Definition: gui.c:244
GLdouble GLdouble t
Definition: gl.h:2047
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static int guiError(va_list ap)
Definition: gui.c:263
static HANDLE initEvent
Definition: gui.c:29
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define va_end(ap)
Definition: acmsvcex.h:90
static int textOut(va_list ap)
Definition: gui.c:213
static int qFatal(va_list ap)
Definition: gui.c:368
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
static int guiFatal(va_list ap)
Definition: gui.c:281
static int textDir(va_list ap)
Definition: gui.c:190
static int guiAsk(va_list ap)
Definition: gui.c:302
static int guiProgress(va_list ap)
Definition: gui.c:96
#define WAIT_OBJECT_0
Definition: winbase.h:387
static int textProgress(va_list ap)
Definition: gui.c:87
static struct __wine_debug_functions funcs
Definition: debug.c:59
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_FAILED
Definition: winbase.h:394
static int textDelta(va_list ap)
Definition: gui.c:144
#define WAIT_TIMEOUT
Definition: dderror.h:14
int ret
static int textStatus(va_list ap)
Definition: gui.c:63
static int textTag(va_list ap)
Definition: gui.c:173
static int textAsk(va_list ap)
Definition: gui.c:289
static int guiDelta(va_list ap)
Definition: gui.c:157
#define va_start(ap, A)
Definition: acmsvcex.h:91
static int textStep(va_list ap)
Definition: gui.c:117
static int guiTag(va_list ap)
Definition: gui.c:182
static int guiStep(va_list ap)
Definition: gui.c:129
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
static int qNoOp(va_list ap)
Definition: gui.c:362
static DWORD WINAPI DlgThreadProc(LPVOID param)
Definition: gui.c:429
#define INFINITE
Definition: serial.h:102
static int textError(va_list ap)
Definition: gui.c:255

Referenced by DlgProc(), DlgThreadProc(), and report().

◆ textAsk()

static int textAsk ( va_list  ap)
static

Definition at line 289 of file gui.c.

290 {
291  int uType = va_arg (ap, int);
292  int ret = MBdefault (uType);
293  char *str = vstrmake (NULL, ap);
294 
295  fprintf (stderr, "Question of type %d: %s\n"
296  "Returning default: %d\n", uType, str, ret);
297  free (str);
298  return ret;
299 }
#define free
Definition: debug_ros.c:5
static int MBdefault(int uType)
Definition: gui.c:47
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int ret
#define va_arg(ap, T)
Definition: acmsvcex.h:89
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ textDelta()

static int textDelta ( va_list  ap)
static

Definition at line 144 of file gui.c.

145 {
146  const int inc = va_arg (ap, int);
147  char *str = vstrmake (NULL, ap);
148 
149  progressCurr += inc;
150  fputs (str, stderr);
151  fprintf (stderr, " (%d of %d)\n", progressCurr, progressMax);
152  free (str);
153  return 0;
154 }
static unsigned int progressMax
Definition: gui.c:37
#define free
Definition: debug_ros.c:5
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define va_arg(ap, T)
Definition: acmsvcex.h:89
static unsigned int progressCurr
Definition: gui.c:37
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ textDir()

static int textDir ( va_list  ap)
static

Definition at line 190 of file gui.c.

191 {
192  char *str = vstrmake (NULL, ap);
193 
194  fputs ("Temporary directory: ", stderr);
195  fputs (str, stderr);
196  fputc ('\n', stderr);
197  free (str);
198  return 0;
199 }
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ textError()

static int textError ( va_list  ap)
static

Definition at line 255 of file gui.c.

256 {
257  fputs ("Error: ", stderr);
258  textStatus (ap);
259  return 0;
260 }
static int textStatus(va_list ap)
Definition: gui.c:63
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)

Referenced by report(), and textFatal().

◆ textFatal()

static int textFatal ( va_list  ap)
static

Definition at line 274 of file gui.c.

275 {
276  textError (ap);
277  exit (1);
278 }
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
void exit(int exitcode)
Definition: _exit.c:33
static int textError(va_list ap)
Definition: gui.c:255

Referenced by report().

◆ textOut()

static int textOut ( va_list  ap)
static

Definition at line 213 of file gui.c.

214 {
215  char *str = vstrmake (NULL, ap);
216 
217  fputs ("Log file: ", stderr);
218  fputs (str, stderr);
219  fputc ('\n', stderr);
220  free (str);
221  return 0;
222 }
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ textProgress()

static int textProgress ( va_list  ap)
static

Definition at line 87 of file gui.c.

88 {
89  progressGroup = va_arg (ap, int);
90  progressMax = va_arg (ap, int);
91  progressCurr = 0;
92  return 0;
93 }
static unsigned int progressMax
Definition: gui.c:37
static int progressGroup
Definition: gui.c:42
#define va_arg(ap, T)
Definition: acmsvcex.h:89
static unsigned int progressCurr
Definition: gui.c:37
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

Referenced by report().

◆ textStatus()

static int textStatus ( va_list  ap)
static

Definition at line 63 of file gui.c.

64 {
65  char *str = vstrmake (NULL, ap);
66 
67  fputs (str, stderr);
68  fputc ('\n', stderr);
69  free (str);
70  return 0;
71 }
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
#define free
Definition: debug_ros.c:5
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report(), textError(), and textWarning().

◆ textStep()

static int textStep ( va_list  ap)
static

Definition at line 117 of file gui.c.

118 {
119  char *str = vstrmake (NULL, ap);
120 
121  progressCurr++;
122  fputs (str, stderr);
123  fprintf (stderr, " (%d of %d)\n", progressCurr, progressMax);
124  free (str);
125  return 0;
126 }
static unsigned int progressMax
Definition: gui.c:37
#define free
Definition: debug_ros.c:5
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static unsigned int progressCurr
Definition: gui.c:37
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
char * vstrmake(size_t *lenp, va_list ap)
Definition: util.c:74

Referenced by report().

◆ textTag()

static int textTag ( va_list  ap)
static

Definition at line 173 of file gui.c.

174 {
175  fputs ("Tag: ", stderr);
176  fputs (tag, stderr);
177  fputc ('\n', stderr);
178  return 0;
179 }
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
Definition: ecma_167.h:138
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)

Referenced by report().

◆ textWarning()

static int textWarning ( va_list  ap)
static

Definition at line 236 of file gui.c.

237 {
238  fputs ("Warning: ", stderr);
239  textStatus (ap);
240  return 0;
241 }
static int textStatus(va_list ap)
Definition: gui.c:63
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)

Referenced by report().

Variable Documentation

◆ DefEditProc

WNDPROC DefEditProc
static

Definition at line 44 of file gui.c.

Referenced by AskTagProc(), and EditTagProc().

◆ dialog

HWND dialog
static

Definition at line 33 of file gui.c.

Referenced by ACTION_DialogBox(), ACTION_ShowDialog(), assign_action(), ConfigureDevicesDlgProc(), destroy_data(), destroy_dialog_owner_proc(), dialog_create(), dialog_create_window(), dialog_display_only(), dialog_do_preview(), dialog_event_handler(), dialog_handle_event(), dialog_map_events(), dialog_run_message_loop(), dialog_setfocus(), DlgProc(), event_add_local(), event_add_source(), event_cleanup_subscriptions(), event_directory_list_up(), event_do_action(), event_do_dialog(), event_end_dialog(), event_new_dialog(), event_reinstall(), event_reinstall_mode(), event_remove(), event_reset(), event_set_install_level(), event_set_target_path(), event_spawn_dialog(), event_subscribe(), event_validate_product_id(), fill_device_object_list(), get_cur_device(), get_cur_lpdiaf(), guiAsk(), guiAskTag(), guiDelta(), guiDir(), guiError(), guiOut(), guiProgress(), guiStatus(), guiStep(), guiTag(), guiWarning(), HTMLWindow2_showModalDialog(), IEHTMLWindow2_showModalDialog(), init_devices(), init_listview_columns(), internal_ui_handler(), lv_get_cur_item(), lv_get_item_data(), lv_set_action(), msi_dialog_add_control(), msi_dialog_add_font(), msi_dialog_adjust_dialog_pos(), msi_dialog_bitmap_control(), msi_dialog_build_font_list(), msi_dialog_button_control(), msi_dialog_button_handler(), msi_dialog_checkbox_control(), msi_dialog_checkbox_handler(), msi_dialog_checkbox_sync_state(), msi_dialog_combo_control(), msi_dialog_combobox_update(), msi_dialog_control_event(), msi_dialog_create_controls(), msi_dialog_create_radiobutton(), msi_dialog_destroy(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_directorylist_up(), msi_dialog_dirlist_handler(), msi_dialog_dup_property(), msi_dialog_edit_control(), msi_dialog_edit_handler(), msi_dialog_end_dialog(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_find_control(), msi_dialog_find_control_by_hwnd(), msi_dialog_find_control_by_type(), msi_dialog_find_font(), msi_dialog_get_checkbox_state(), msi_dialog_get_uitext(), msi_dialog_group_box(), msi_dialog_hyperlink(), msi_dialog_icon_control(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_maskedit_control(), msi_dialog_oncommand(), msi_dialog_oncreate(), msi_dialog_onkillfocus(), msi_dialog_onnotify(), msi_dialog_pathedit_control(), msi_dialog_progress_bar(), msi_dialog_radiogroup_control(), msi_dialog_radiogroup_handler(), msi_dialog_reset(), msi_dialog_scale_unit(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_seltree_handler(), msi_dialog_send_event(), msi_dialog_set_checkbox_state(), msi_dialog_set_control_condition(), msi_dialog_set_font(), msi_dialog_set_property_event(), msi_dialog_set_tab_order(), msi_dialog_text_control(), msi_dialog_update_all_controls(), msi_dialog_update_controls(), msi_dialog_update_directory_combo(), msi_dialog_update_directory_list(), msi_dialog_update_pathedit(), msi_dialog_vcl_add_columns(), msi_dialog_vcl_add_drives(), msi_dialog_volsel_handler(), msi_dialog_volumecost_list(), msi_dialog_volumeselect_combo(), msi_get_checkbox_value(), msi_get_dialog_record(), MSI_PreviewDialogW(), msi_vcl_get_cost(), MSIDialog_WndProc(), MSIHiddenWindowProc(), pending_event_end_dialog(), pending_event_new_dialog(), pending_event_spawn_dialog(), post_quit_dialog_owner_proc(), reparent_dialog_owner_proc(), reset_actions(), select_combo_item(), show_suitable_actions(), test_dialog_parent(), test_enddialog_seq(), and test_enddialog_seq2().

◆ initEvent

HANDLE initEvent
static

Definition at line 29 of file gui.c.

Referenced by DlgProc(), and report().

◆ progressCurr

unsigned int progressCurr
static

Definition at line 37 of file gui.c.

Referenced by guiDelta(), guiProgress(), guiStep(), textDelta(), textProgress(), and textStep().

◆ progressGroup

int progressGroup
static

Definition at line 42 of file gui.c.

Referenced by guiDelta(), guiProgress(), guiStep(), and textProgress().

◆ progressMax

unsigned int progressMax
static

Definition at line 37 of file gui.c.

Referenced by guiProgress(), textDelta(), textProgress(), and textStep().

◆ progressScale

double progressScale
static

Definition at line 38 of file gui.c.

Referenced by guiDelta(), guiProgress(), and guiStep().