Skip to content

Commit

Permalink
SDL_ScreenKeyboard compatibility for SDL2, updated mxml and jpeg libr…
Browse files Browse the repository at this point in the history
…aries
  • Loading branch information
pelya committed Oct 29, 2012
1 parent 8297a9e commit a5c6258
Show file tree
Hide file tree
Showing 20 changed files with 1,293 additions and 424 deletions.
5 changes: 5 additions & 0 deletions project/java/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ public void hideScreenKeyboard()
mGLView.requestFocus();
};

public boolean isScreenKeyboardShown()
{
return _screenKeyboard != null;
};

final static int ADVERTISEMENT_POSITION_RIGHT = -1;
final static int ADVERTISEMENT_POSITION_BOTTOM = -1;
final static int ADVERTISEMENT_POSITION_CENTER = -2;
Expand Down
20 changes: 20 additions & 0 deletions project/java/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,26 @@ public void run()
context.runOnUiThread(cb);
}

public void hideScreenKeyboard() // Called from native code
{
class Callback implements Runnable
{
public MainActivity parent;
public void run()
{
parent.hideScreenKeyboard();
}
}
Callback cb = new Callback();
cb.parent = context;
context.runOnUiThread(cb);
}

public int isScreenKeyboardShown() // Called from native code
{
return context.isScreenKeyboardShown() ? 1 : 0;
}

public void exitApp()
{
nativeDone();
Expand Down
8 changes: 8 additions & 0 deletions project/jni/jpeg/include/jpeglib.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#ifndef JPEGLIB_H
#define JPEGLIB_H

#ifdef __cplusplus
extern "C" {
#endif

/*
* First we include the configuration files that record how this
* installation of the JPEG library is set up. jconfig.h can be
Expand Down Expand Up @@ -1097,4 +1101,8 @@ struct jpeg_color_quantizer { long dummy; };
#include "jerror.h" /* fetch error codes too */
#endif

#ifdef __cplusplus
}
#endif

#endif /* JPEGLIB_H */
61 changes: 41 additions & 20 deletions project/jni/mxml/include/mxml.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* "$Id: mxml.h 385 2009-03-19 05:38:52Z mike $"
* "$Id: mxml.h 427 2011-01-03 02:03:29Z mike $"
*
* Header file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2009 by Michael Sweet.
* Copyright 2003-2011 by Michael R Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.minixml.org/
*/

/*
Expand Down Expand Up @@ -98,32 +96,32 @@ typedef void (*mxml_custom_destroy_cb_t)(void *);
typedef void (*mxml_error_cb_t)(const char *);
/**** Error callback function ****/

typedef struct mxml_attr_s /**** An XML element attribute value. ****/
typedef struct mxml_attr_s /**** An XML element attribute value. @private@ ****/
{
char *name; /* Attribute name */
char *value; /* Attribute value */
} mxml_attr_t;

typedef struct mxml_element_s /**** An XML element value. ****/
typedef struct mxml_element_s /**** An XML element value. @private@ ****/
{
char *name; /* Name of element */
int num_attrs; /* Number of attributes */
mxml_attr_t *attrs; /* Attributes */
} mxml_element_t;

typedef struct mxml_text_s /**** An XML text value. ****/
typedef struct mxml_text_s /**** An XML text value. @private@ ****/
{
int whitespace; /* Leading whitespace? */
char *string; /* Fragment string */
} mxml_text_t;

typedef struct mxml_custom_s /**** An XML custom value. @since Mini-XML 2.1@ ****/
typedef struct mxml_custom_s /**** An XML custom value. @private@ ****/
{
void *data; /* Pointer to (allocated) custom data */
mxml_custom_destroy_cb_t destroy; /* Pointer to destructor function */
} mxml_custom_t;

typedef union mxml_value_u /**** An XML node value. ****/
typedef union mxml_value_u /**** An XML node value. @private@ ****/
{
mxml_element_t element; /* Element */
int integer; /* Integer number */
Expand All @@ -133,7 +131,7 @@ typedef union mxml_value_u /**** An XML node value. ****/
mxml_custom_t custom; /* Custom data @since Mini-XML 2.1@ */
} mxml_value_t;

typedef struct mxml_node_s /**** An XML node. ****/
struct mxml_node_s /**** An XML node. @private@ ****/
{
mxml_type_t type; /* Node type */
struct mxml_node_s *next; /* Next node under same parent */
Expand All @@ -144,16 +142,21 @@ typedef struct mxml_node_s /**** An XML node. ****/
mxml_value_t value; /* Node value */
int ref_count; /* Use count */
void *user_data; /* User data */
} mxml_node_t;
};

typedef struct mxml_index_s /**** An XML node index. ****/
typedef struct mxml_node_s mxml_node_t; /**** An XML node. ****/

struct mxml_index_s /**** An XML node index. @private@ ****/
{
char *attr; /* Attribute used for indexing or NULL */
int num_nodes; /* Number of nodes in index */
int alloc_nodes; /* Allocated nodes in index */
int cur_node; /* Current node */
mxml_node_t **nodes; /* Node array */
} mxml_index_t;
};

typedef struct mxml_index_s mxml_index_t;
/**** An XML node index. ****/

typedef int (*mxml_custom_load_cb_t)(mxml_node_t *, const char *);
/**** Custom data load callback function ****/
Expand Down Expand Up @@ -207,11 +210,28 @@ extern void mxmlEntityRemoveCallback(mxml_entity_cb_t cb);
extern mxml_node_t *mxmlFindElement(mxml_node_t *node, mxml_node_t *top,
const char *name, const char *attr,
const char *value, int descend);
extern mxml_node_t *mxmlFindPath(mxml_node_t *node, const char *path);
extern const char *mxmlGetCDATA(mxml_node_t *node);
extern const void *mxmlGetCustom(mxml_node_t *node);
extern const char *mxmlGetElement(mxml_node_t *node);
extern mxml_node_t *mxmlGetFirstChild(mxml_node_t *node);
extern int mxmlGetInteger(mxml_node_t *node);
extern mxml_node_t *mxmlGetLastChild(mxml_node_t *node);
extern mxml_node_t *mxmlGetNextSibling(mxml_node_t *node);
extern const char *mxmlGetOpaque(mxml_node_t *node);
extern mxml_node_t *mxmlGetParent(mxml_node_t *node);
extern mxml_node_t *mxmlGetPrevSibling(mxml_node_t *node);
extern double mxmlGetReal(mxml_node_t *node);
extern int mxmlGetRefCount(mxml_node_t *node);
extern const char *mxmlGetText(mxml_node_t *node, int *whitespace);
extern mxml_type_t mxmlGetType(mxml_node_t *node);
extern void *mxmlGetUserData(mxml_node_t *node);
extern void mxmlIndexDelete(mxml_index_t *ind);
extern mxml_node_t *mxmlIndexEnum(mxml_index_t *ind);
extern mxml_node_t *mxmlIndexFind(mxml_index_t *ind,
const char *element,
const char *value);
extern int mxmlIndexGetCount(mxml_index_t *ind);
extern mxml_index_t *mxmlIndexNew(mxml_node_t *node, const char *element,
const char *attr);
extern mxml_node_t *mxmlIndexReset(mxml_index_t *ind);
Expand Down Expand Up @@ -275,6 +295,7 @@ extern int mxmlSetTextf(mxml_node_t *node, int whitespace,
__attribute__ ((__format__ (__printf__, 3, 4)))
# endif /* __GNUC__ */
;
extern int mxmlSetUserData(mxml_node_t *node, void *data);
extern void mxmlSetWrapMargin(int column);
extern mxml_node_t *mxmlWalkNext(mxml_node_t *node, mxml_node_t *top,
int descend);
Expand Down Expand Up @@ -304,5 +325,5 @@ extern mxml_type_t mxml_real_cb(mxml_node_t *node);


/*
* End of "$Id: mxml.h 385 2009-03-19 05:38:52Z mike $".
* End of "$Id: mxml.h 427 2011-01-03 02:03:29Z mike $".
*/
25 changes: 12 additions & 13 deletions project/jni/mxml/src/config.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/* config.h. Generated from config.h.in by configure. */
/*
* "$Id: config.h.in 387 2009-04-18 17:05:52Z mike $"
* "$Id: config.h.in 408 2010-09-19 05:26:46Z mike $"
*
* Configuration file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2009 by Michael Sweet.
* Copyright 2003-2010 by Michael R Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.minixml.org/
*/

/*
Expand All @@ -31,14 +30,14 @@
* Version number...
*/

#define MXML_VERSION "2.6"
#define MXML_VERSION "Mini-XML v2.7"


/*
* Inline function support...
*/

/* #define inline */
#define inline


/*
Expand Down Expand Up @@ -93,5 +92,5 @@ extern int _mxml_vsnprintf(char *, size_t, const char *, va_list);
# endif /* !HAVE_VSNPRINTF */

/*
* End of "$Id: config.h.in 387 2009-04-18 17:05:52Z mike $".
* End of "$Id: config.h.in 408 2010-09-19 05:26:46Z mike $".
*/
20 changes: 9 additions & 11 deletions project/jni/mxml/src/mxml-attr.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* "$Id: mxml-attr.c 308 2007-09-15 20:04:56Z mike $"
* "$Id: mxml-attr.c 408 2010-09-19 05:26:46Z mike $"
*
* Attribute support code for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2007 by Michael Sweet.
* Copyright 2003-2010 by Michael R Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.minixml.org/
*
* Contents:
*
Expand Down Expand Up @@ -317,5 +315,5 @@ mxml_set_attr(mxml_node_t *node, /* I - Element node */


/*
* End of "$Id: mxml-attr.c 308 2007-09-15 20:04:56Z mike $".
* End of "$Id: mxml-attr.c 408 2010-09-19 05:26:46Z mike $".
*/
20 changes: 9 additions & 11 deletions project/jni/mxml/src/mxml-entity.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* "$Id: mxml-entity.c 385 2009-03-19 05:38:52Z mike $"
* "$Id: mxml-entity.c 408 2010-09-19 05:26:46Z mike $"
*
* Character entity support code for Mini-XML, a small XML-like
* file parsing library.
*
* Copyright 2003-2009 by Michael Sweet.
* Copyright 2003-2010 by Michael R Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* http://www.minixml.org/
*
* Contents:
*
Expand Down Expand Up @@ -458,5 +456,5 @@ _mxml_entity_cb(const char *name) /* I - Entity name */


/*
* End of "$Id: mxml-entity.c 385 2009-03-19 05:38:52Z mike $".
* End of "$Id: mxml-entity.c 408 2010-09-19 05:26:46Z mike $".
*/
Loading

0 comments on commit a5c6258

Please sign in to comment.