Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A ton of work...slouching towards basic startup functionality.
- Loading branch information
Showing
8 changed files
with
379 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "../gui.h" | ||
#include <ctype.h> | ||
|
||
static uint8 MojoGui_stdio_priority(MojoGui_rev1 *gui) | ||
{ | ||
return MOJOGUI_PRIORITY_TRY_LAST; | ||
} | ||
|
||
static boolean MojoGui_stdio_init(MojoGui_rev1 *gui) | ||
{ | ||
return true; | ||
} | ||
|
||
static void MojoGui_stdio_deinit(MojoGui_rev1 *gui) | ||
{ | ||
} | ||
|
||
static void MojoGui_stdio_msgbox(MojoGui_rev1 *gui, const char *title, const char *text) | ||
{ | ||
printf("NOTICE: %s\n[hit enter]", text); | ||
fflush(stdout); | ||
if (!feof(stdin)) | ||
getchar(); | ||
} | ||
|
||
static boolean MojoGui_stdio_promptyn(MojoGui_rev1 *gui, const char *title, const char *text) | ||
{ | ||
if (feof(stdin)) | ||
return 0; | ||
|
||
while (1) | ||
{ | ||
int c; | ||
printf("%s\n[y/n]", text); | ||
fflush(stdout); | ||
c = toupper(getchar()); | ||
if (c == 'N') | ||
return 0; | ||
else if (c == 'Y') | ||
return 1; | ||
} /* while */ | ||
|
||
return 0; | ||
} | ||
|
||
CREATE_MOJOGUI_ENTRY_POINT(stdio) | ||
|
||
/* gui_stdio.c ... */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.