Skip to content

Commit

Permalink
rename iphone_* UI interface functions to use iosif_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
spathiwa committed Jun 6, 2015
1 parent 833abed commit 2cf3271
Show file tree
Hide file tree
Showing 33 changed files with 378 additions and 378 deletions.
6 changes: 3 additions & 3 deletions git/git_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ glkunix_argumentlist_t glkunix_arguments[] =

void fatalError (const char * s)
{
iphone_puts("*** fatal error: ");
iphone_puts((char*)s);
iphone_puts(" ***\n");
iosif_puts("*** fatal error: ");
iosif_puts((char*)s);
iosif_puts(" ***\n");
finished = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions git/glkop.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static void parse_glk_args(dispatch_splot_t *splot, char **proto, int depth,
opref = classes_get(*cx-'a', thisval);
if (!opref) {
if (*cx=='b' || *cx=='c') /// stream; hack to make autorestore of saved game with active transcript (bug) not fatal
iphone_win_puts(0, "[Reference to nonexistent Glk stream or file.]\n");
iosif_win_puts(0, "[Reference to nonexistent Glk stream or file.]\n");
else
fatalError("Reference to nonexistent Glk object.");
}
Expand Down Expand Up @@ -1637,7 +1637,7 @@ git_sint32 restoreClassesChunk(strid_t file, git_uint32 chunkSize) {
free(objects);
return status;
} else {
iphone_win_puts(0, "\n[Can't restore autosave - unknown Glk Class Save version number]\n");
iosif_win_puts(0, "\n[Can't restore autosave - unknown Glk Class Save version number]\n");
return FALSE;
}
}
2 changes: 1 addition & 1 deletion git/terp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void startProgram (size_t cacheSize, enum IOMode ioMode)
} else
gli_delete_fileref(fref);
if (rstatus) {
iphone_win_puts(0, "Autorestore failed.\n");
iosif_win_puts(0, "Autorestore failed.\n");
finished = 1;
}
}
Expand Down
32 changes: 16 additions & 16 deletions glkios/glkautosave.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void saveWin(window_t *win, struct glk_window_autosave *s) {
s->style = win->style;
s->size = win->size;
if (win->type == wintype_Graphics)
iphone_save_glk_win_graphics_img(wingfxcount++, win->iphone_glkViewNum);
iosif_save_glk_win_graphics_img(wingfxcount++, win->iosif_glkViewNum);
//s->size = (win->type == wintype_TextGrid) ? ((window_textgrid_t*)win->data)->linessize : win->size;
s->method = win->method;
s->splitwin = win->splitwin;
Expand Down Expand Up @@ -625,7 +625,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
foundwin->type == wintype_TextBuffer ? "textbuffer" :
foundwin->type == wintype_TextGrid ? "textgrid" :
foundwin->type == wintype_Blank ? "blank" : "graphics", (long)cur->id);
iphone_win_puts(0, errbuf);
iosif_win_puts(0, errbuf);
return FALSE;
}
winid[winct-1].win = win;
Expand Down Expand Up @@ -655,9 +655,9 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
wtb->inecho = win->echo_line_input;
}
if (win->mouse_request && (win->type == wintype_Graphics || win->type == wintype_TextGrid))
iphone_enable_tap(win->iphone_glkViewNum);
iosif_enable_tap(win->iosif_glkViewNum);
if (win->hyper_request && (win->type == wintype_TextGrid || win->type == wintype_TextBuffer))
iphone_enable_tap(win->iphone_glkViewNum);
iosif_enable_tap(win->iosif_glkViewNum);
}
if (foundwin->inbuf) {
window_textbuffer_t *wtb = (window_textbuffer_t*)win->data;
Expand All @@ -673,7 +673,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,

if (cur->type != gidisp_Class_Stream) {
sprintf(errbuf, "\nUnexpected window stream type %d. Aborting restore.\n", cur->type);
iphone_win_puts(0, errbuf);
iosif_win_puts(0, errbuf);
return FALSE;
} else {
foundstr = &cur->obj.str;
Expand Down Expand Up @@ -709,12 +709,12 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,

if (cur->type != type_Style) {
sprintf(errbuf, "\nUnexpected stream type %d. Aborting restore.\n", cur->type);
iphone_win_puts(0, errbuf);
iosif_win_puts(0, errbuf);
return FALSE;
} else {
gli_window_set_stylehints(win, (GLK_STYLE_HINTS *)&cur->obj.style);
}
iphone_set_glk_default_colors(win->iphone_glkViewNum);
iosif_set_glk_default_colors(win->iosif_glkViewNum);
} else if (found && win->type == wintype_Graphics) {
if (i+1 < objects_count && objects[i+1].type == type_Graphics) {
i++;
Expand All @@ -723,8 +723,8 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
wgp->width = cur->obj.gfx.width;
wgp->height = cur->obj.gfx.height;
wgp->backcolor = cur->obj.gfx.backcolor;
iphone_set_background_color(win->iphone_glkViewNum, wgp->backcolor);
iphone_restore_glk_win_graphics_img(wingfxcount++, win->iphone_glkViewNum);
iosif_set_background_color(win->iosif_glkViewNum, wgp->backcolor);
iosif_restore_glk_win_graphics_img(wingfxcount++, win->iosif_glkViewNum);
}
} else if (found && win->type == wintype_Pair) {
// this will never happen
Expand Down Expand Up @@ -778,7 +778,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
}
if (winct != winct2) {
sprintf(errbuf, "\n[Autorestore warning: window count mismatch %d!=%d]\n", winct, winct2);
iphone_win_puts(0, errbuf);
iosif_win_puts(0, errbuf);
}

// freakin' great, so let's re-iterate, simultaneously doing an iteration and compare
Expand All @@ -802,7 +802,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
}
//break; // This incorrect break was in cellardoor impl --
} else {
iphone_win_puts(0, "\nCould not restore saved state. Sorry. Aborting restore.\n");
iosif_win_puts(0, "\nCould not restore saved state. Sorry. Aborting restore.\n");
return FALSE;
}
// restore RECT
Expand All @@ -813,7 +813,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
i++;
cur = objects + i;
if (cur->type != gidisp_Class_Stream) {
iphone_win_puts(0, "\nMissing stream. Aborting restore.\n");
iosif_win_puts(0, "\nMissing stream. Aborting restore.\n");
return FALSE;
} else {
foundstr = &cur->obj.str;
Expand All @@ -832,7 +832,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
cur = objects + i;
if (cur->type != type_Style) {
// style chunk is not where it should be
iphone_win_puts(0, "\nMissing style chunk. Aborting restore.\n");
iosif_win_puts(0, "\nMissing style chunk. Aborting restore.\n");
return FALSE;
}
} else if (win->type == wintype_Pair) {
Expand All @@ -841,7 +841,7 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
cur = objects + i;

if (cur->type != type_Pair) {
iphone_win_puts(0, "\nCorrupt win pair. Aborting restore.\n");
iosif_win_puts(0, "\nCorrupt win pair. Aborting restore.\n");
return FALSE;
} else {
struct glk_winpair_autosave *foundpair = &cur->obj.pair;
Expand Down Expand Up @@ -907,11 +907,11 @@ static glsi32 classes_restore(glk_object_save_t *objects, glui32 objects_count,
(cur->type == strtype_File) ? "strtype_File" :
(cur->type == strtype_Window) ? "strtype_Window" :
(cur->type == strtype_Memory) ? "strtype_Memory" : "UNKNOWN", (int)cur->id);
iphone_win_puts(0, errbuf);
iosif_win_puts(0, errbuf);
}
#endif
} else if (cur->type == gidisp_Class_Fileref) {
// iphone_win_puts(0, "\n[Autorestore warning: missing file stream]\n");
// iosif_win_puts(0, "\n[Autorestore warning: missing file stream]\n");
if (*cur->obj.fref.filename && strcmp(cur->obj.fref.filename, kFrotzAutoSaveFile)!=0) {
glui32 usage = (cur->obj.fref.textmode ? fileusage_TextMode : 0)
| (cur->obj.fref.filetype & fileusage_TypeMask);
Expand Down
2 changes: 1 addition & 1 deletion glkios/glkios.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct glk_window_struct {
intptr_t splitwin;
int store;

int iphone_glkViewNum;
int iosif_glkViewNum;

gidispatch_rock_t disprock;
window_t *next, *prev; /* in the big linked list of windows */
Expand Down
6 changes: 3 additions & 3 deletions glkios/ipevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ void glk_select(event_t *event)
gli_input_guess_focus();

if (gli_focuswin && gli_focuswin->char_request)
iphone_enable_single_key_input();
iosif_enable_single_key_input();
else
iphone_enable_input();
iosif_enable_input();

while (curevent->type == evtype_None && !finished) {
wint_t key;
Expand Down Expand Up @@ -144,7 +144,7 @@ void glk_select(event_t *event)
}

if (curevent->type != evtype_Timer)
iphone_disable_input();
iosif_disable_input();

/* An event has occurred; glk_select() is over. */
gli_windows_trim_buffers();
Expand Down
4 changes: 2 additions & 2 deletions glkios/ipfref.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ frefid_t glk_fileref_create_temp(glui32 usage, glui32 rock)
/* This is a pretty good way to do this on Unix systems. On Macs,
it's pretty bad, but this library won't be used on the Mac
-- I hope. I have no idea about the DOS/Windows world. */
filename = iphone_get_temp_filename();
filename = iosif_get_temp_filename();
if (filename) {
fref = gli_new_fileref(filename, usage, rock);
free(filename);
Expand Down Expand Up @@ -252,7 +252,7 @@ frefid_t glk_fileref_create_by_prompt(glui32 usage, glui32 fmode,

sprintf(newbuf, "%s %s: ", prompt, prompt2);

ix = iphone_prompt_file_name(buf, "", ipflag);
ix = iosif_prompt_file_name(buf, "", ipflag);

if (!ix) {
/* The player cancelled input. */
Expand Down
2 changes: 1 addition & 1 deletion glkios/ipinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ int gli_get_key(glui32 *key, glui32 timeout)
wint_t keycode;
int status;

keycode = iphone_getchar(timeout ? timeout : -1);
keycode = iosif_getchar(timeout ? timeout : -1);
if (keycode == ZC_AUTOSAVE) {
do_autosave = 1;
status = -1;
Expand Down
6 changes: 3 additions & 3 deletions glkios/ipstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,13 +905,13 @@ static void gli_set_style(stream_t *str, glui32 val)
istyle |= kFTCentered;
else if (just == stylehint_just_RightFlush)
istyle |= kFTRightJust;
iphone_set_text_attribs(str->win->iphone_glkViewNum, istyle, -1, TRUE);
iosif_set_text_attribs(str->win->iosif_glkViewNum, istyle, -1, TRUE);

unsigned int textColor = gli_stylehint_get(str->win, val, stylehint_TextColor);
unsigned int bgColor = gli_stylehint_get(str->win, val, stylehint_BackColor);

iphone_glk_set_text_colors(str->win->iphone_glkViewNum, textColor, bgColor);
//printf("stc v %d style %d text %x bg %x\n", str->win->iphone_glkViewNum, val, textColor, bgColor);
iosif_glk_set_text_colors(str->win->iosif_glkViewNum, textColor, bgColor);
//printf("stc v %d style %d text %x bg %x\n", str->win->iosif_glkViewNum, val, textColor, bgColor);
}
if (str->win->echostr && str->win->echostr != str)
gli_set_style(str->win->echostr, val);
Expand Down
2 changes: 1 addition & 1 deletion glkios/ipstyle.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ glui32 glk_style_measure(window_t *win, glui32 styl, glui32 hint,
*result = stylehint_just_LeftFlush;
return TRUE;
case stylehint_Size:
*result = iphone_fixed_font_height;
*result = iosif_fixed_font_height;
return TRUE;
case stylehint_Weight:
*result = 0; //bcs ((styleattrs[styl] & A_BOLD) != 0);
Expand Down
16 changes: 8 additions & 8 deletions glkios/ipw_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void win_textbuffer_update(window_t *win)

void win_textbuffer_putchar(window_t *win, wchar_t ch)
{
if (win->iphone_glkViewNum != -1)
iphone_win_putchar(win->iphone_glkViewNum, ch);
if (win->iosif_glkViewNum != -1)
iosif_win_putchar(win->iosif_glkViewNum, ch);
#if 0
window_textbuffer_t *dwin = win->data;
long lx;
Expand Down Expand Up @@ -156,7 +156,7 @@ void win_textbuffer_clear(window_t *win)
window_textbuffer_t *dwin = win->data;
dwin->numchars = 0;

iphone_erase_win(win->iphone_glkViewNum);
iosif_erase_win(win->iosif_glkViewNum);
}

void win_textbuffer_trim_buffer(window_t *win)
Expand Down Expand Up @@ -388,7 +388,7 @@ void win_textbuffer_cancel_line(window_t *win, event_t *ev)

if (len > inmax)
len = inmax;
len = iphone_peek_inputline(&dwin->chars[dwin->infence], len);
len = iosif_peek_inputline(&dwin->chars[dwin->infence], len);

export_input_line(inbuf, inunicode, len, &dwin->chars[dwin->infence]);

Expand Down Expand Up @@ -424,8 +424,8 @@ static void import_input_line(window_textbuffer_t *dwin, void *buf,
/* len will be nonzero. */

if (unicode) {
if (dwin->owner->iphone_glkViewNum != -1)
iphone_set_input_line(buf, len);
if (dwin->owner->iosif_glkViewNum != -1)
iosif_set_input_line(buf, len);
//put_text(dwin, buf, len, dwin->incurs, 0);
}
else {
Expand All @@ -435,8 +435,8 @@ static void import_input_line(window_textbuffer_t *dwin, void *buf,
cx[ix] = UCS(((char *)buf)[ix]);
}
cx[ix] = 0;
if (dwin->owner->iphone_glkViewNum != -1)
iphone_set_input_line(cx, len);
if (dwin->owner->iosif_glkViewNum != -1)
iosif_set_input_line(cx, len);
//put_text(dwin, cx, len, dwin->incurs, 0);
free(cx);
}
Expand Down
24 changes: 12 additions & 12 deletions glkios/ipw_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,30 @@ void win_graphics_redraw(window_t *win)
}

void win_graphics_update(window_t *win) {
iphone_glk_window_graphics_update(win->iphone_glkViewNum);
iosif_glk_window_graphics_update(win->iosif_glkViewNum);
}

#ifdef GLK_MODULE_IMAGE

glui32 glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2) {
if (!win || win->iphone_glkViewNum < 0
if (!win || win->iosif_glkViewNum < 0
|| (win->type != wintype_Graphics && win->type != wintype_TextBuffer))
return FALSE;

return iphone_glk_image_draw(win->iphone_glkViewNum, image, val1, val2, 0, 0);
return iosif_glk_image_draw(win->iosif_glkViewNum, image, val1, val2, 0, 0);
}

glui32 glk_image_draw_scaled(winid_t win, glui32 image, glsi32 val1, glsi32 val2, glui32 width, glui32 height) {
if (!win || win->iphone_glkViewNum < 0
if (!win || win->iosif_glkViewNum < 0
|| (win->type != wintype_Graphics && win->type != wintype_TextBuffer))
return FALSE;

return iphone_glk_image_draw(win->iphone_glkViewNum, image, val1, val2, width, height);
return iosif_glk_image_draw(win->iosif_glkViewNum, image, val1, val2, width, height);
}

glui32 glk_image_get_info(glui32 image, glui32 *width, glui32 *height)
{
return iphone_glk_image_get_info(image, width, height);
return iosif_glk_image_get_info(image, width, height);
}

void glk_window_flow_break(winid_t win)
Expand All @@ -78,26 +78,26 @@ void glk_window_flow_break(winid_t win)
void glk_window_erase_rect(winid_t win,
glsi32 left, glsi32 top, glui32 width, glui32 height)
{
if (!win || win->iphone_glkViewNum < 0 || win->type != wintype_Graphics)
if (!win || win->iosif_glkViewNum < 0 || win->type != wintype_Graphics)
return;
iphone_glk_window_erase_rect(win->iphone_glkViewNum, left, top, width, height);
iosif_glk_window_erase_rect(win->iosif_glkViewNum, left, top, width, height);
}

void glk_window_fill_rect(winid_t win, glui32 color,
glsi32 left, glsi32 top, glui32 width, glui32 height)
{
if (!win || win->iphone_glkViewNum < 0 || win->type != wintype_Graphics)
if (!win || win->iosif_glkViewNum < 0 || win->type != wintype_Graphics)
return;
iphone_glk_window_fill_rect(win->iphone_glkViewNum, color, left, top, width, height);
iosif_glk_window_fill_rect(win->iosif_glkViewNum, color, left, top, width, height);
}

void glk_window_set_background_color(winid_t win, glui32 color)
{
if (!win || win->iphone_glkViewNum < 0 || win->type != wintype_Graphics)
if (!win || win->iosif_glkViewNum < 0 || win->type != wintype_Graphics)
return;
window_graphics_t *wgp = (window_graphics_t*)win->data;
wgp->backcolor = color;
iphone_set_background_color(win->iphone_glkViewNum, color);
iosif_set_background_color(win->iosif_glkViewNum, color);
}

#endif /* GLK_MODULE_IMAGE */
Expand Down
Loading

0 comments on commit 2cf3271

Please sign in to comment.