Skip to content

Commit

Permalink
A bunch of stubbed GUI entry points we'll need later. Probably will n…
Browse files Browse the repository at this point in the history
…eed a few

 tweaks in the pump functions...
  • Loading branch information
icculus committed Apr 22, 2007
1 parent 0c39812 commit c18f7dd
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gui.h
Expand Up @@ -58,6 +58,12 @@ struct MojoGui
char * (*destination)(const char **recommendations, int reccount,
boolean can_go_back, boolean can_go_forward);
boolean (*insertmedia)(const char *medianame);
void (*startdownload)(void);
void (*pumpdownload)(void);
void (*enddownload)(void);
void (*startinstall)(void);
void (*pumpinstall)(void);
void (*endinstall)(void);
};

typedef const MojoGui* (*MojoGuiEntryPoint)(int revision,
Expand Down Expand Up @@ -95,6 +101,12 @@ static boolean MojoGui_##module##_options(MojoGuiSetupOptions *opts, \
static char *MojoGui_##module##_destination(const char **r, int reccount, \
boolean can_go_back, boolean can_go_forward); \
static boolean MojoGui_##module##_insertmedia(const char *medianame); \
static void MojoGui_##module##_startdownload(void); \
static void MojoGui_##module##_pumpdownload(void); \
static void MojoGui_##module##_enddownload(void); \
static void MojoGui_##module##_startinstall(void); \
static void MojoGui_##module##_pumpinstall(void); \
static void MojoGui_##module##_endinstall(void); \
const MojoGui *MojoGuiPlugin_##module(int rev, const MojoSetupEntryPoints *e) \
{ \
if (rev == MOJOGUI_INTERFACE_REVISION) { \
Expand All @@ -111,6 +123,12 @@ const MojoGui *MojoGuiPlugin_##module(int rev, const MojoSetupEntryPoints *e) \
MojoGui_##module##_options, \
MojoGui_##module##_destination, \
MojoGui_##module##_insertmedia, \
MojoGui_##module##_startdownload, \
MojoGui_##module##_pumpdownload, \
MojoGui_##module##_enddownload, \
MojoGui_##module##_startinstall, \
MojoGui_##module##_pumpinstall, \
MojoGui_##module##_endinstall, \
}; \
entry = e; \
return &retval; \
Expand Down
33 changes: 33 additions & 0 deletions gui/gui_macosx.c
Expand Up @@ -169,5 +169,38 @@ static boolean MojoGui_macosx_insertmedia(const char *medianame)
entry->_("OK"), entry->_("Cancel"));
} // MojoGui_macosx_insertmedia


static void MojoGui_macosx_startdownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_startdownload
static void MojoGui_macosx_pumpdownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_pumpdownload
static void MojoGui_macosx_enddownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_enddownload

static void MojoGui_macosx_startinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_startinstall
static void MojoGui_macosx_pumpinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_pumpinstall
static void MojoGui_macosx_endinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_macosx_endinstall

// end of gui_macosx.c ...

34 changes: 34 additions & 0 deletions gui/gui_stdio.c
Expand Up @@ -316,5 +316,39 @@ static boolean MojoGui_stdio_insertmedia(const char *medianame)
return readstr(NULL, buf, sizeof (buf), false, true) > 0;
} // MojoGui_stdio_insertmedia


static void MojoGui_stdio_startdownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_startdownload
static void MojoGui_stdio_pumpdownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_pumpdownload
static void MojoGui_stdio_enddownload(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_enddownload

static void MojoGui_stdio_startinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_startinstall
static void MojoGui_stdio_pumpinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_pumpinstall
static void MojoGui_stdio_endinstall(void)
{
// !!! FIXME: write me.
STUBBED(__FUNCTION__)
} // MojoGui_stdio_endinstall


// end of gui_stdio.c ...

48 changes: 48 additions & 0 deletions lua_glue.c
Expand Up @@ -855,6 +855,48 @@ static int luahook_gui_insertmedia(lua_State *L)
} // luahook_gui_insertmedia


static int luahook_gui_startdownload(lua_State *L)
{
GGui->startdownload();
return 0;
} // luahook_gui_startdownload


static int luahook_gui_pumpdownload(lua_State *L)
{
GGui->pumpdownload();
return 0;
} // luahook_gui_pumpdownload


static int luahook_gui_enddownload(lua_State *L)
{
GGui->enddownload();
return 0;
} // luahook_gui_enddownload


static int luahook_gui_startinstall(lua_State *L)
{
GGui->startinstall();
return 0;
} // luahook_gui_startinstall


static int luahook_gui_pumpinstall(lua_State *L)
{
GGui->pumpinstall();
return 0;
} // luahook_gui_pumpinstall


static int luahook_gui_endinstall(lua_State *L)
{
GGui->endinstall();
return 0;
} // luahook_gui_endinstall


// Sets t[sym]=f, where t is on the top of the Lua stack.
static inline void set_cfunc(lua_State *L, lua_CFunction f, const char *sym)
{
Expand Down Expand Up @@ -972,6 +1014,12 @@ boolean MojoLua_initLua(void)
set_cfunc(luaState, luahook_gui_destination, "destination");
set_cfunc(luaState, luahook_gui_stop, "stop");
set_cfunc(luaState, luahook_gui_insertmedia, "insertmedia");
set_cfunc(luaState, luahook_gui_startdownload, "startdownload");
set_cfunc(luaState, luahook_gui_pumpdownload, "pumpdownload");
set_cfunc(luaState, luahook_gui_enddownload, "enddownload");
set_cfunc(luaState, luahook_gui_startinstall, "startinstall");
set_cfunc(luaState, luahook_gui_pumpinstall, "pumpinstall");
set_cfunc(luaState, luahook_gui_endinstall, "endinstall");
lua_setfield(luaState, -2, "gui");
lua_setglobal(luaState, MOJOSETUP_NAMESPACE);

Expand Down

0 comments on commit c18f7dd

Please sign in to comment.