fix to build with CURSES_ONLY flag

This commit is contained in:
Eric House 2016-12-22 08:57:54 -08:00
parent 432b738257
commit 92029b2443
7 changed files with 18 additions and 1 deletions

View file

@ -1,5 +1,6 @@
/core.*
obj_linux_memdbg
obj_linux_memdbg_curses
*.xwg
obj_linux_rel
log_*_*.txt

View file

@ -246,6 +246,9 @@ ifneq (,$(findstring DPLATFORM_GTK,$(DEFINES)))
POINTER_SUPPORT = -DPOINTER_SUPPORT
endif
CFLAGS += `pkg-config --cflags glib-2.0`
LIBS += `pkg-config --libs glib-2.0`
CFLAGS += $(POINTER_SUPPORT)
ifneq (,$(findstring DPLATFORM_NCURSES,$(DEFINES)))

View file

@ -170,6 +170,7 @@ writeToDB( XWStreamCtxt* stream, void* closure )
(*cGlobals->onSave)( cGlobals->onSaveClosure, selRow, newGame );
}
#ifdef PLATFORM_GTK
static void
addSnapshot( CommonGlobals* cGlobals )
{
@ -191,6 +192,9 @@ addSnapshot( CommonGlobals* cGlobals )
LOG_RETURN_VOID();
}
#else
# define addSnapshot( cGlobals )
#endif
void
summarize( CommonGlobals* cGlobals )
@ -330,6 +334,7 @@ getGameInfo( sqlite3* pDb, sqlite3_int64 rowid, GameInfo* gib )
gib->lastMoveTime = sqlite3_column_int( ppStmt, 10 );
snprintf( gib->name, sizeof(gib->name), "Game %lld", rowid );
#ifdef PLATFORM_GTK
/* Load the snapshot */
GdkPixbuf* snap = NULL;
const XP_U8* ptr = sqlite3_column_blob( ppStmt, 11 );
@ -342,6 +347,7 @@ getGameInfo( sqlite3* pDb, sqlite3_int64 rowid, GameInfo* gib )
g_object_unref( istr );
}
gib->snap = snap;
#endif
}
sqlite3_finalize( ppStmt );

View file

@ -31,7 +31,9 @@ typedef struct _GameInfo {
XP_UCHAR name[128];
XP_UCHAR room[128];
XP_UCHAR conn[128];
#ifdef PLATFORM_GTK
GdkPixbuf* snap;
#endif
XP_U32 gameID;
XP_S16 nMoves;
XP_Bool gameOver;

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef PLATFORM_GTK
#ifndef _GTKDRAW_H_
#define _GTKDRAW_H_
@ -31,3 +33,4 @@ void removeSurface( GtkDrawCtx* dctx );
void getImage( GtkDrawCtx* dctx, XWStreamCtxt* stream );
#endif
#endif

View file

@ -240,6 +240,7 @@ typedef struct _SourceData {
void* procClosure;
} SourceData;
#ifdef PLATFORM_GTK
typedef struct _GtkAppGlobals {
GArray* selRows;
LaunchParams* params;
@ -253,5 +254,6 @@ typedef struct _GtkAppGlobals {
/* save window position */
GdkEventConfigure lastConfigure;
} GtkAppGlobals;
#endif
#endif

View file

@ -28,8 +28,8 @@
#include <unistd.h>
#include <netinet/in.h>
#include <glib.h>
#ifdef PLATFORM_GTK
# include <glib.h>
# include <gdk/gdk.h>
# include <gtk/gtk.h>
#endif