Skip to content

Commit

Permalink
empty functions for the web port
Browse files Browse the repository at this point in the history
  • Loading branch information
coolwanglu committed Apr 7, 2015
1 parent 740010a commit 235ab6e
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.o
3 changes: 2 additions & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
* Define all of those you want supported in your binary.
* Some combinations make no sense. See the installation document.
*/
#define TTY_GRAPHICS /* good old tty based graphics */
#define WEB_GRAPHICS
/* #define TTY_GRAPHICS */ /* good old tty based graphics */
/* #define X11_GRAPHICS */ /* X11 interface */
/* #define QT_GRAPHICS */ /* Qt interface */
/* #define GNOME_GRAPHICS */ /* Gnome interface */
Expand Down
2 changes: 1 addition & 1 deletion include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ typedef xchar boolean; /* 0 or 1 */
# define EXIT_FAILURE 1
#endif

#if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) || defined(MSWIN_GRAPHICS)
#if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) || defined(MSWIN_GRAPHICS) || defined(WEB_GRAPHICS)
# ifndef USE_TILES
# define USE_TILES /* glyph2tile[] will be available */
# endif
Expand Down
6 changes: 3 additions & 3 deletions include/unixconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@


/* define any of the following that are appropriate */
#define SVR4 /* use in addition to SYSV for System V Release 4 */
/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */
/* including Solaris 2+ */
#define NETWORK /* if running on a networked system */
/* #define NETWORK */ /* if running on a networked system */
/* e.g. Suns sharing a playground through NFS */
/* #define SUNOS4 */ /* SunOS 4.x */
/* #define LINUX */ /* Another Unix clone */
#define LINUX /* Another Unix clone */
/* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
/* #define GENIX */ /* Yet Another Unix Clone */
/* #define HISX */ /* Bull Unix for XPS Machines */
Expand Down
6 changes: 6 additions & 0 deletions src/windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifdef TTY_GRAPHICS
#include "wintty.h"
#endif
#ifdef WEB_GRAPHICS
extern struct window_procs Web_procs;
#endif
#ifdef X11_GRAPHICS
/* cannot just blindly include winX.h without including all of X11 stuff */
/* and must get the order of include files right. Don't bother */
Expand Down Expand Up @@ -53,6 +56,9 @@ struct win_choices {
#ifdef TTY_GRAPHICS
{ &tty_procs, win_tty_init },
#endif
#ifdef WEB_GRAPHICS
{ &Web_procs, 0 },
#endif
#ifdef X11_GRAPHICS
{ &X11_procs, win_X11_init },
#endif
Expand Down
17 changes: 14 additions & 3 deletions sys/unix/Makefile.src
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ CXX=g++
WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \
../win/tty/wintty.c
WINTTYOBJ = getline.o termcap.o topl.o wintty.o

WINWEBSRC = ../win/web/web.c tile.c
WINWEBOBJ = web.o tile.o

#
# files for an X11 port
# (tile.c is a generated source file)
Expand Down Expand Up @@ -214,8 +218,8 @@ WINBEOBJ =

#
#
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINSRC = $(WINWEBSRC)
WINOBJ = $(WINWEBOBJ)

# on some systems the termcap library is in -ltermcap or -lcurses
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
Expand All @@ -232,6 +236,9 @@ WINOBJ = $(WINTTYOBJ)
# WINTTYLIB = -lcurses16
# WINTTYLIB = -lncurses
WINTTYLIB = -ltermlib

WINWEBLIB =

#
# libraries for X11
# If USE_XPM is defined in config.h, you will also need -lXpm here.
Expand All @@ -255,7 +262,8 @@ WINGEMLIB = -le_gem -lgem
# libraries for BeOS
WINBELIB = -lbe

WINLIB = $(WINTTYLIB)
#WINLIB = $(WINTTYLIB)
WINLIB = $(WINWEBLIB)

# any other strange libraries your system needs (for Sysunix only -- the more
# specialized targets should already be right)
Expand Down Expand Up @@ -605,6 +613,9 @@ topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h \
../include/patchlevel.h ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/wintty.c
web.o: ../win/web/web.c $(HACK_H) ../include/dlb.h \
../include/patchlevel.h
$(CC) $(CFLAGS) -c ../win/web/web.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H)
$(CC) $(CFLAGS) -c ../win/X11/Window.c
Expand Down
3 changes: 3 additions & 0 deletions util/makedefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ static const char *window_opts[] = {
#ifdef TTY_GRAPHICS
"traditional tty-based graphics",
#endif
#ifdef WEB_GRAPHICS
"Web",
#endif
#ifdef X11_GRAPHICS
"X11",
#endif
Expand Down
160 changes: 160 additions & 0 deletions win/web/web.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#include "hack.h"

void Web_init_nhwindows(int * argcp, char ** argv)
{ }
void Web_player_selection()
{ }
void Web_askname()
{ }
void Web_get_nh_event()
{ }
void Web_exit_nhwindows(const char * str)
{
// print str
}
void Web_suspend_nhwindows(const char * str)
{ }
void Web_resume_nhwindows()
{ }
winid Web_create_nhwindow(int type)
{ }
void Web_clear_nhwindow(winid window)
{ }
void Web_display_nhwindow(winid window, BOOLEAN_P blocking)
{ }
void Web_destroy_nhwindow(winid window)
{ }
void Web_curs(winid window, int x, int y)
{ }
void Web_putstr(winid window, int attr, const char* str)
{ }
void Web_display_file(const char * str, BOOLEAN_P complain)
{ }
void Web_start_menu(winid window)
{ }
void Web_add_menu(winid window,
int glyph,
const ANY_P * identifier,
CHAR_P accelerator,
CHAR_P groupacc,
int attr,
const char * str,
BOOLEAN_P preselected)
{ }
void Web_end_menu(winid window, const char * prompt)
{ }
int Web_select_menu(winid window, int how, MENU_ITEM_P ** selected)
{ }
char Web_message_menu(CHAR_P let, int how, const char *mesg)
{ }
void Web_update_inventory()
{ }
void Web_mark_synch()
{ }
void Web_wait_synch()
{ }
#ifdef CLIPPING
void Web_cliparound(int x, int y)
{ }
#endif
#ifdef POSITIONBAR
void Web_update_positionbar(char * features)
{ }
#endif
void Web_print_glyph(winid window, XCHAR_P x, XCHAR_P y, int glyph)
{ }
void Web_raw_print(const char * str)
{ }
void Web_raw_print_bold(const char * str)
{ }
int Web_nhgetch()
{ }
int Web_nh_poskey(int * x, int * y, int * mod)
{ }
void Web_nhbell()
{ }
int Web_doprev_message()
{ }
char Web_yn_function(const char * ques, const char * choices, CHAR_P def)
{ }
void Web_getlin(const char * ques, char * input)
{ }
int Web_get_ext_cmd()
{ }
void Web_number_pad(int state)
{ }
void Web_delay_output()
{ }
#ifdef CHANGE_COLOR
void Web_change_color(int _1, long _2, int _3) { }
#ifdef MAC
void Web_change_background(int _) { }
short Web_set_font_name(winid _1, char * _2) { return 0; }
#endif
char * Web_get_color_string() { return ""; }
#endif
void Web_start_screen() { }
void Web_end_screen() { }
void Web_outrip(winid window, int how)
{ }
void Web_preference_update(const char * preference)
{ }

struct window_procs Web_procs = {
"Web",
0L, // wincap1
0L, // wincap2
Web_init_nhwindows,
Web_player_selection,
Web_askname,
Web_get_nh_event,
Web_exit_nhwindows,
Web_suspend_nhwindows,
Web_resume_nhwindows,
Web_create_nhwindow,
Web_clear_nhwindow,
Web_display_nhwindow,
Web_destroy_nhwindow,
Web_curs,
Web_putstr,
Web_display_file,
Web_start_menu,
Web_add_menu,
Web_end_menu,
Web_select_menu,
Web_message_menu,
Web_update_inventory,
Web_mark_synch,
Web_wait_synch,
#ifdef CLIPPING
Web_cliparound,
#endif
#ifdef POSITIONBAR
Web_update_positionbar,
#endif
Web_print_glyph,
Web_raw_print,
Web_raw_print_bold,
Web_nhgetch,
Web_nh_poskey,
Web_nhbell,
Web_doprev_message,
Web_yn_function,
Web_getlin,
Web_get_ext_cmd,
Web_number_pad,
Web_delay_output,
#ifdef CHANGE_COLOR
Web_change_color,
#ifdef MAC
Web_change_background,
Web_set_font_name,
#endif
Web_get_color_string,
#endif
Web_start_screen,
Web_end_screen,
Web_outrip,
Web_preference_update
};

0 comments on commit 235ab6e

Please sign in to comment.