Experimental support for Symbian S60 3rd edition

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3064 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2008-08-31 00:34:29 +00:00
parent 7310148db6
commit 50664a6f71
24 changed files with 939 additions and 60 deletions
+2
View File
@@ -7,6 +7,8 @@
* If you want anything else than the defaults, you'll have to edit
* that file manually. */
# include "msvc++/config.h"
#elif defined(__SYMBIAN32__)
# include "symbian/config.h"
#elif defined (__MINGW32__) || defined (__CYGWIN__)
/* If we're compiling on MS Windows using build.sh, use
* config_win.h, generated from src/config_win.h.in. */
+1
View File
@@ -24,6 +24,7 @@
// Compilation related
#ifdef _MSC_VER
# define inline __inline
#elif defined(__SYMBIAN32__)
#else
# define inline __inline__
# ifdef __MINGW32__
+42 -12
View File
@@ -19,6 +19,8 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
/*
32bit Zoomer with optional anti-aliasing by bilinear interpolation.
@@ -54,12 +56,22 @@ int zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int smooth)
/*
* Allocate memory for row increments
*/
if ((sax = (int *) alloca((dst->w + 1) * sizeof(Uint32))) == NULL) {
return (-1);
}
if ((say = (int *) alloca((dst->h + 1) * sizeof(Uint32))) == NULL) {
return (-1);
}
#ifndef __SYMBIAN32__
if ((sax = (int *) alloca((dst->w + 1) * sizeof(Uint32))) == NULL)
return (-1);
if ((say = (int *) alloca((dst->h + 1) * sizeof(Uint32))) == NULL)
return (-1);
#else
if ((sax = (int *) HMalloc((dst->w + 1) * sizeof(Uint32))) == NULL)
return (-1);
if ((say = (int *) HMalloc((dst->h + 1) * sizeof(Uint32))) == NULL)
{
HFree(sax);
return (-1);
}
#endif
/*
* Precalculate row increments
@@ -196,6 +208,11 @@ int zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int smooth)
}
#ifdef __SYMBIAN32__
HFree(sax);
HFree(say);
#endif
return (0);
}
@@ -223,12 +240,20 @@ int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
/*
* Allocate memory for row increments
*/
if ((sax = (Uint32 *) alloca(dst->w * sizeof(Uint32))) == NULL) {
return (-1);
}
if ((say = (Uint32 *) alloca(dst->h * sizeof(Uint32))) == NULL) {
return (-1);
}
#ifndef __SYMBIAN32__
if ((sax = (Uint32 *) alloca(dst->w * sizeof(Uint32))) == NULL)
return (-1);
if ((say = (Uint32 *) alloca(dst->h * sizeof(Uint32))) == NULL)
return (-1);
#else
if ((sax = (Uint32 *) HMalloc(dst->w * sizeof(Uint32))) == NULL)
return (-1);
if ((say = (Uint32 *) HMalloc(dst->h * sizeof(Uint32))) == NULL)
{
HFree(sax);
return (-1);
}
#endif
/*
* Precalculate row increments
@@ -303,6 +328,11 @@ int zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst)
dp += dgap;
}
#ifdef __SYMBIAN32__
HFree(sax);
HFree(say);
#endif
return (0);
}
@@ -260,7 +260,11 @@ moda_InitModule (int flags, const TFB_DecoderFormats* fmts)
else if (flags & audio_QUALITY_LOW)
{
md_mode = DMODE_SOFT_MUSIC|DMODE_STEREO|DMODE_16BITS;
#ifdef __SYMBIAN32__
md_mixfreq = 11025;
#else
md_mixfreq = 22050;
#endif
md_reverb = 0;
}
else
@@ -119,7 +119,7 @@ mixSDL_Init (audio_Driver *driver, sint32 flags)
return -1;
}
log_add (log_Info, "SDL audio subsystem initialized.");
if (flags & audio_QUALITY_HIGH)
{
quality = MIX_QUALITY_HIGH;
@@ -129,8 +129,13 @@ mixSDL_Init (audio_Driver *driver, sint32 flags)
else if (flags & audio_QUALITY_LOW)
{
quality = MIX_QUALITY_LOW;
#ifdef __SYMBIAN32__
desired.freq = 11025;
desired.samples = 4096;
#else
desired.freq = 22050;
desired.samples = 2048;
#endif
}
else
{
@@ -208,12 +213,12 @@ mixSDL_Init (audio_Driver *driver, sint32 flags)
SetSFXVolume (sfxVolumeScale);
SetSpeechVolume (speechVolumeScale);
SetMusicVolume ((COUNT)musicVolume);
StreamDecoderTask = AssignTask (StreamDecoderTaskFunc, 1024,
"audio stream decoder");
SDL_PauseAudio (0);
return 0;
}
+8
View File
@@ -1455,7 +1455,11 @@ TopoScale4x (BYTE *pDstTopo, BYTE *pSrcTopo, int num_faults, int fault_var)
},
};
#ifndef __SYMBIAN32__
prevrow = (int *) alloca ((MAP_WIDTH * 4 + 1) * sizeof(prevrow[0]));
#else
prevrow = (int *) HMalloc ((MAP_WIDTH * 4 + 1) * sizeof(prevrow[0]));
#endif
var_allow = (num_faults << SCALE_SHIFT) / AVG_VARIANCE;
var_min = fault_var << SCALE_SHIFT;
@@ -1592,6 +1596,10 @@ TopoScale4x (BYTE *pDstTopo, BYTE *pSrcTopo, int num_faults, int fault_var)
// save last row point
prow[0] = elev[4][4];
}
#ifdef __SYMBIAN32__
HFree(prevrow);
#endif
}
+6 -6
View File
@@ -235,17 +235,17 @@ main (int argc, char *argv[])
}
if (res_HasKey ("config.scaler"))
{
const char *optarg = res_GetString ("config.scaler");
const char *arg = res_GetString ("config.scaler");
if (!strcmp (optarg, "bilinear"))
if (!strcmp (arg, "bilinear"))
options.gfxFlags |= TFB_GFXFLAGS_SCALE_BILINEAR;
else if (!strcmp (optarg, "biadapt"))
else if (!strcmp (arg, "biadapt"))
options.gfxFlags |= TFB_GFXFLAGS_SCALE_BIADAPT;
else if (!strcmp (optarg, "biadv"))
else if (!strcmp (arg, "biadv"))
options.gfxFlags |= TFB_GFXFLAGS_SCALE_BIADAPTADV;
else if (!strcmp (optarg, "triscan"))
else if (!strcmp (arg, "triscan"))
options.gfxFlags |= TFB_GFXFLAGS_SCALE_TRISCAN;
else if (!strcmp (optarg, "hq"))
else if (!strcmp (arg, "hq"))
options.gfxFlags |= TFB_GFXFLAGS_SCALE_HQXX;
}
if (res_HasKey ("config.scanlines") && res_GetBoolean ("config.scanlines"))
+9
View File
@@ -0,0 +1,9 @@
PRJ_PLATFORMS
PRJ_EXPORTS
PRJ_MMPFILES
gnumakefile icons_scalable_dc.mk
uqm.mmp
+57
View File
@@ -0,0 +1,57 @@
/* This file contains some compile-time configuration options for Symbian
*/
#ifndef _CONFIG_H
#define _CONFIG_H
/* Directory where the UQM game data is located */
#define CONTENTDIR "content"
/* Directory where game data will be stored */
#define USERDIR "userdata"
/* Directory where config files will be stored */
#define CONFIGDIR USERDIR
/* Directory where supermelee teams will be stored */
#define MELEEDIR "userdata\\teams\\"
/* Directory where save games will be stored */
#define SAVEDIR "userdata\\save\\"
/* Define if words are stored with the most significant byte first */
#undef WORDS_BIGENDIAN
/* Defined if your system has readdir_r of its own */
#undef HAVE_READDIR_R
/* Defined if your system has setenv of its own */
#define HAVE_SETENV
/* Defined if your system has strupr of its own */
#undef HAVE_STRUPR
/* Defined if your system has strcasecmp of its own */
#define HAVE_STRCASECMP_UQM
// Not using "HAVE_STRCASECMP" as that conflicts with SDL.
/* Defined if your system has stricmp of its own */
#undef HAVE_STRICMP
/* Defined if your system has getopt_long */
#undef HAVE_GETOPT_LONG
/* Defined if your system has iswgraph of its own*/
#define HAVE_ISWGRAPH
/* Defined if your system has wchar_t of its own */
#define HAVE_WCHAR_T
/* Defined if your system has wint_t of its own */
#define HAVE_WINT_T
#define HAVE__BOOL
#define PATH_MAX _POSIX_PATH_MAX
#endif /* _CONFIG_H */
+37
View File
@@ -0,0 +1,37 @@
ifeq (WINS,$(findstring WINS, $(PLATFORM)))
ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
else
ZDIR=$(EPOCROOT)epoc32\data\z
endif
TARGETDIR=$(ZDIR)\resource\apps
ICONTARGETFILENAME=$(TARGETDIR)\uqm_icon.mif
ICONDIR=
do_nothing :
@rem do_nothing
MAKMAKE : do_nothing
BLD : do_nothing
CLEAN : do_nothing
LIB : do_nothing
CLEANLIB : do_nothing
RESOURCE :
mifconv $(ICONTARGETFILENAME) \
/c32 uqm.svg
FREEZE : do_nothing
SAVESPACE : do_nothing
RELEASABLES :
@echo $(ICONTARGETFILENAME)
FINAL : do_nothing
+26
View File
@@ -0,0 +1,26 @@
config.textmenu = yes
config.alwaysgl = no
config.sfxvol = 20
config.iconicscan = no
config.pulseshield = no
config.3domusic = no
config.smoothmelee = no
config.positionalsfx = no
config.resheight = 240
config.musicvol = 20
config.textgradients = yes
config.reswidth = 320
config.scaler = no
config.audiodriver = mixsdl
config.fullscreen = no
config.usegl = no
config.player2control = 3
config.player1control = 0
config.subtitles = yes
config.3domovies = yes
config.scanlines = no
config.showfps = no
config.speechvol = 0
config.remixmusic = no
config.smoothscroll = no
config.audioquality = low
+43
View File
@@ -0,0 +1,43 @@
TARGET uqm.exe
TARGETTYPE exe
UID 0 0xA000A0C3
EPOCHEAPSIZE 1000000 50000000
EPOCSTACKSIZE 0x13500
SYSTEMINCLUDE \epoc32\include \epoc32\include\stdapis
SOURCEPATH .
SOURCE uqmapp.cpp
START RESOURCE uqm.rss
HEADER
TARGETPATH resource\apps
LANG SC
END // RESOURCE
START RESOURCE uqm_reg.rss
#ifdef WINSCW
TARGETPATH \private\10003a3f\apps
#else
TARGETPATH \private\10003a3f\import\apps
#endif
END
OPTION_REPLACE ARMCC --cpu ARM926EJ-S -O3 -Otime
ALWAYS_BUILD_AS_ARM
LIBRARY avkon.lib
LIBRARY apparc.lib
LIBRARY cone.lib
LIBRARY eikcore.lib
LIBRARY ws32.lib
LIBRARY bafl.lib
LIBRARY euser.lib
LIBRARY sdl.lib
LIBRARY libc.lib
LIBRARY libm.lib
LIBRARY libz.lib
LIBRARY libpthread.lib
STATICLIBRARY SDL_image.lib
STATICLIBRARY uqm.lib
+26
View File
@@ -0,0 +1,26 @@
;Language - standard language definitions
&EN
; standard SIS file header
#{"Ur-Quan Masters"},(0xA000A0C3),1,0,0
;Localised Vendor name
%{"Interstellar Frungy League"}
;Unique Vendor name
:"Interstellar Frungy League"
;Supports Series 60 v 3.0
[0x101F7961], 0, 0, 0, {"Series60ProductID"}
*"uqm.key", "uqm.cer"
;Files to install
;<source> <destination>
"\Epoc32\release\Armv5\urel\uqm.exe" - "!:\sys\bin\uqm.exe"
"\Epoc32\data\z\resource\apps\uqm.rsc" - "!:\resource\apps\uqm.rsc"
"\Epoc32\data\z\resource\apps\uqm_icon.mif" - "!:\resource\apps\uqm_icon.mif"
"\Epoc32\data\z\private\10003a3f\import\apps\uqm_reg.rsc" - "!:\private\10003a3f\import\apps\uqm_reg.rsc"
"uqm.cfg" - "c:\private\A000A0C3\userdata\uqm.cfg"
"..\..\content\version" - "c:\private\A000A0C3\content\version"
"..\..\content.uqm" - "c:\private\A000A0C3\content\packages\content.uqm"
+26
View File
@@ -0,0 +1,26 @@
NAME UQM
#include <eikon.rh>
#include <avkon.rh>
#include <avkon.rsg>
#include <avkon.hrh>
#include <appinfo.rh>
RESOURCE RSS_SIGNATURE { }
RESOURCE TBUF { buf="UQM"; }
RESOURCE EIK_APP_INFO
{
}
RESOURCE LOCALISABLE_APP_INFO r_uqm_localisable_app_info
{
short_caption = "UQM";
caption_and_icon = CAPTION_AND_ICON_INFO
{
caption = "UrQuanMasters";
number_of_icons = 1;
icon_file = "\\resource\\apps\\uqm_icon.mif";
};
}
+70
View File
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve">
<g>
<g>
<path fill="#5B5F54" d="M15,5c1.44,0.56,2.44,1.56,3,3c-0.81,0.19-0.997,1.003-2,1c-0.333,0-0.667,0-1,0
c0.184-0.851-0.39-0.943-1-1C13.718,6.385,14.945,6.278,15,5z"/>
<path fill="#5B5F54" d="M13,15c-0.586,3.511,4.727,3.289,2,6c-2.323,2.416-2.677-1.562-5-2c0-0.667,0-1.333,0-2
C10.437,15.77,11.28,14.946,13,15z"/>
<path fill="#B43905" d="M5,29c0.333,0,0.667,0,1,0c0.19,0.811,1.003,0.997,1,2c1.563,3.771,4.23,6.438,8,8
c0.89,0.443,1.789,0.878,2,2c-4.236,0.236-5.083-2.917-8-4c0.184-0.852-0.39-0.943-1-1C7.549,33.118,4.461,32.872,5,29z"/>
<path fill="#03D002" d="M9,31c5.35-2.9,9.348,4.807,9,8c-4.555-0.779-5.266-5.4-9-7C9,31.667,9,31.333,9,31z"/>
<path fill="#5B5F54" d="M27,30c0.902,1.764,2.236,3.098,4,4c-0.238,1.428-1.646,1.688-2,3c-0.333,0-0.667,0-1,0
c-0.902-1.764-2.236-3.098-4-4c0.239-1.428,1.646-1.688,2-3C26.333,30,26.667,30,27,30z"/>
<path opacity="0" fill="#EAECE6" d="M4,14c3.582-4.418,7.582-8.418,12-12C12.418,6.418,8.418,10.418,4,14z"/>
<path opacity="0" fill="#FFFFFF" d="M48,0c0,16,0,32,0,48c-16,0-32,0-48,0C0,32,0,16,0,0C16,0,32,0,48,0z M4,14
c-0.634,3.699-2.713,5.953-2,11c4.654,0.943,6.093-6.516,10-3c-1.412,2.588-3.231,4.77-8,4c-0.664,5.33,0.582,8.751,4,10
c0.61,0.057,1.184,0.148,1,1c0,0.333,0,0.667,0,1c2.853,1.813,4.086,5.247,10,4c0.792-3.339,2.546-9.477,7-6
c-0.854,3.275-7.298,4.725-5,8c13.313,1.313,15.825-8.175,23-13c0.253-3.586-3.003-3.664-3-7C52.211,11.655,34.152-2.889,21,6
c-1.286-1.714-2.068-3.932-5-4C11.582,5.582,7.582,9.582,4,14z"/>
<path fill="#21351B" d="M4,14c4.418-3.582,8.418-7.582,12-12c2.932,0.068,3.714,2.286,5,4c13.152-8.889,31.211,5.655,20,18
c-0.003,3.336,3.253,3.414,3,7c-7.175,4.825-9.688,14.313-23,13c-2.298-3.275,4.146-4.725,5-8c-4.454-3.477-6.208,2.661-7,6
c-5.914,1.247-7.147-2.188-10-4c0-0.333,0-0.667,0-1c2.917,1.083,3.764,4.236,8,4c0.333,0,0.667,0,1,0
c2.208-0.125,0.425-4.242,1-6c0.89,0.615,1.789,1.208,2,0c1.313-0.354,1.573-1.762,3-2c1.764,0.902,3.098,2.236,4,4
c-0.797,1.072-7.094,4.348-2,5c6.992-0.341,10.803-3.863,13-9c-0.354-1.313-1.762-1.572-2-3c-3.512-0.178-3.289,3.378-6,4
c-1.764-0.902-3.098-2.236-4-4c1.241-2.092,2.908-3.759,5-5c-1.436,2.951-5.811,4.049-2,7c2.748-1.131,12.85-8.146,3-7
c1.807-3.096,3.063-0.534,7-1c3.793-2.643,2.902-15.629-2-16c-0.529-0.804-1.043-1.624-1-3c-4.564,0.435-11.012-1.011-14,1
c3.873,11.531-9.844,12.351-12,21c-2,0-4,0-6,0c0,0.667,0,1.333,0,2c-0.539,3.872,2.549,4.118,3,7c-3.418-1.249-4.664-4.67-4-10
c4.769,0.77,6.588-1.412,8-4c-3.907-3.516-5.346,3.943-10,3C1.287,19.953,3.366,17.699,4,14z M18,8c1.278,0.055,1.385,1.282,3,1
c1.074-3.808-3.845-6.732-6-4c-0.055,1.278-1.282,1.385-1,3C8.369,11.035,3.757,15.09,3,23c2.951,2.451,4.049-3.356,7-4
c2.323,0.438,2.677,4.416,5,2c2.727-2.711-2.586-2.489-2-6c2.039-0.294,1.961-2.706,4-3c0.043-1.376-0.471-2.196-1-3
C17.003,9.003,17.19,8.19,18,8z M21,9c-1.546,2.867-8.463,4.297-5,9C19.536,17.498,24.081,12.798,21,9z M37,28
c3.384-0.384,1.572,4.428,6,3C42.991,27.918,38.283,23.799,37,28z"/>
<path fill="#65C11B" d="M34,6c1.725,3.276,5.275,4.724,7,8c-2.754-1.913-5.088-4.246-7-7c-1.758,0.575-5.875-1.208-6,1
C22.684,5.654,30.9,5.834,34,6z"/>
<path fill="#65C11B" d="M31,8c4.893,2.441,6.87,7.797,10,12c-4.051,1.688-3.527-9.783-9-10C31.811,9.19,30.997,9.003,31,8z"/>
<path fill="#03D002" d="M16,9c0.529,0.804,1.043,1.624,1,3c-2.039,0.294-1.961,2.706-4,3c-1.72-0.054-2.563,0.77-3,2
c-2.168,1.499-2.329,5.004-6,5c1.383-6.617,7.15-8.85,11-13C15.333,9,15.667,9,16,9z"/>
<path fill="#038C01" d="M15,9c-3.85,4.15-9.617,6.383-11,13c3.671,0.004,3.832-3.501,6-5c0,0.667,0,1.333,0,2
c-2.951,0.644-4.049,6.451-7,4c0.757-7.91,5.369-11.965,11-15C14.61,8.057,15.184,8.149,15,9z"/>
<path opacity="0" fill="#FFFFFF" d="M16,18c-3.463-4.703,3.454-6.133,5-9C24.081,12.798,19.536,17.498,16,18z"/>
<path fill="#03D002" d="M38,8c4.902,0.371,5.793,13.357,2,16c-3.938,0.466-5.193-2.096-7,1c-0.333,0-0.667,0-1,0
c-2.092,1.241-3.759,2.908-5,5c-0.333,0-0.667,0-1,0c-0.354,1.313-1.761,1.572-2,3c-1.427,0.238-1.687,1.646-3,2
c-0.333,0-0.667,0-1,0c-2.573-1.762-4.318-4.35-7-6c1.167-1.834,2.614-3.387,4-5c3.401,1.891-1.712,3.506-1,6
c3.094-1.236,5.508-3.184,8,0c-1.317-2.684,0.114-8.114-5-7c2.849-4.484,8.209-6.458,9-13c1.333,0,2.667,0,4,0
c5.473,0.217,4.949,11.688,9,10c0-2,0-4,0-6c-1.725-3.276-5.275-4.724-7-8C35.764,5.714,37.098,10.709,38,8z"/>
<path fill="#038C01" d="M17,24c-1.386,1.613-2.833,3.166-4,5c2.682,1.65,4.427,4.238,7,6c0.333,0,0.667,0,1,0
c-0.211,1.208-1.11,0.615-2,0c-0.575,1.758,1.208,5.875-1,6c0-0.667,0-1.333,0-2c0.348-3.193-3.65-10.9-9-8
c-1.313-0.354-1.573-1.762-3-2c-0.333,0-0.667,0-1,0c0-0.667,0-1.333,0-2c2,0,4,0,6,0c2.156-8.649,15.873-9.469,12-21
c2.988-2.011,9.436-0.565,14-1c-0.043,1.376,0.471,2.196,1,3c-0.902,2.709-2.236-2.286-4-2c-3.1-0.166-11.316-0.346-6,2
c1,0,2,0,3,0c-0.003,1.003,0.811,1.19,1,2c-1.333,0-2.667,0-4,0c-0.791,6.542-6.151,8.516-9,13c-1.313-0.354-1.573-1.761-3-2
C15.718,22.615,16.945,22.722,17,24z"/>
<path fill="#E6C626" d="M19,23c5.114-1.114,3.683,4.316,5,7c-2.492-3.184-4.906-1.236-8,0c-0.712-2.494,4.401-4.109,1-6
c-0.055-1.278-1.282-1.385-1-3C17.427,21.239,17.687,22.646,19,23z"/>
<path opacity="0" fill="#FFFFFF" d="M33,25c9.85-1.146-0.252,5.869-3,7c-3.811-2.951,0.564-4.049,2-7C32.333,25,32.667,25,33,25z"
/>
<path fill="#B43905" d="M43,31c-4.428,1.428-2.616-3.384-6-3C38.283,23.799,42.991,27.918,43,31z"/>
<path fill="#E6C626" d="M7,31c3.086,2.247,5.753,4.913,8,8C11.23,37.438,8.563,34.771,7,31z"/>
<path fill="#65C11B" d="M15,39c-2.247-3.087-4.914-5.753-8-8c0.003-1.003-0.81-1.189-1-2c1.427,0.238,1.687,1.646,3,2
c0,0.333,0,0.667,0,1c3.734,1.6,4.445,6.221,9,7c0,0.667,0,1.333,0,2c-0.333,0-0.667,0-1,0C16.789,39.878,15.89,39.443,15,39z"/>
<path fill="#038C01" d="M31,34c2.711-0.622,2.488-4.178,6-4c0.238,1.428,1.646,1.688,2,3c-4.995-1.393-9.604,5.531-13,9
c-5.094-0.652,1.203-3.928,2-5c0.333,0,0.667,0,1,0C29.354,35.688,30.762,35.428,31,34z"/>
<path fill="#03D002" d="M39,33c-2.197,5.137-6.008,8.659-13,9C29.396,38.531,34.005,31.607,39,33z"/>
<path fill="#B43905" d="M15,5c2.155-2.732,7.074,0.192,6,4c-1.615,0.282-1.722-0.945-3-1C17.44,6.56,16.44,5.56,15,5z"/>
<path fill="#E6C626" d="M41,14c0,2,0,4,0,6c-3.13-4.203-5.107-9.559-10-12c-1,0-2,0-3,0c0.125-2.208,4.242-0.425,6-1
C35.912,9.754,38.246,12.087,41,14z"/>
</g>
</g>
</svg>
+12
View File
@@ -0,0 +1,12 @@
#include <appinfo.rh>
#include <uqm.rsg>
UID2 KUidAppRegistrationResourceFile
UID3 0xA000A0C3
RESOURCE APP_REGISTRATION_INFO
{
app_file = "uqm";
localisable_resource_file = "\\resource\\apps\\uqm";
localisable_resource_id = R_UQM_LOCALISABLE_APP_INFO;
}
+260
View File
@@ -0,0 +1,260 @@
#include <coecntrl.h>
#include <aknappui.h>
#include <aknapp.h>
#include <akndoc.h>
#include <sdlepocapi.h>
#include <aknnotewrappers.h>
#include <eikstart.h>
#include <badesca.h>
#include <stdio.h>
const TUid KUidSdlApp={ 0xA000A0C3 };
class CSDLObserver : public CBase, public MSDLObserver
{
public:
TInt SdlEvent(TInt aEvent, TInt aParam);
TInt SdlThreadEvent(TInt aEvent, TInt aParam);
};
class MExitWait
{
public:
virtual void DoExit(TInt aErr) = 0;
};
class CExitWait : public CActive
{
public:
CExitWait(MExitWait& aWait);
void Start();
~CExitWait();
private:
void RunL();
void DoCancel();
private:
MExitWait& iWait;
TRequestStatus* iStatusPtr;
};
class CSDLWin : public CCoeControl
{
public:
void ConstructL(const TRect& aRect);
RWindow& GetWindow() const;
void SetNoDraw();
private:
void Draw(const TRect& aRect) const;
};
class CSdlApplication : public CAknApplication
{
private:
// from CApaApplication
CApaDocument* CreateDocumentL();
TUid AppDllUid() const;
};
class CSdlAppDocument : public CAknDocument
{
public:
CSdlAppDocument(CEikApplication& aApp): CAknDocument(aApp) { }
private:
CEikAppUi* CreateAppUiL();
};
class CSdlAppUi : public CAknAppUi, public MExitWait
{
public:
void ConstructL();
~CSdlAppUi();
private:
void HandleCommandL(TInt aCommand);
void DoExit(TInt aErr);
void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
void HandleResourceChangeL(TInt aType);
private:
CExitWait* iWait;
CSDLWin* iSDLWin;
CSDL* iSdl;
CSDLObserver* iSdlObserver;
TBool iExit;
};
CExitWait::CExitWait(MExitWait& aWait) : CActive(CActive::EPriorityStandard), iWait(aWait)
{
CActiveScheduler::Add(this);
}
CExitWait::~CExitWait()
{
Cancel();
}
void CExitWait::RunL()
{
if(iStatusPtr != NULL )
iWait.DoExit(iStatus.Int());
}
void CExitWait::DoCancel()
{
if(iStatusPtr != NULL )
User::RequestComplete(iStatusPtr , KErrCancel);
}
void CExitWait::Start()
{
SetActive();
iStatusPtr = &iStatus;
}
void CSDLWin:: ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
ActivateL();
}
RWindow& CSDLWin::GetWindow() const
{
return Window();
}
void CSDLWin::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.SetPenStyle(CGraphicsContext::ESolidPen);
gc.SetPenColor(KRgbBlack);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.SetBrushColor(0x000000);
gc.DrawRect(Rect());
}
void CSdlAppUi::ConstructL()
{
BaseConstructL(ENoScreenFurniture | EAppOrientationLandscape);
iSDLWin = new (ELeave) CSDLWin;
iSDLWin->ConstructL(ApplicationRect());
iWait = new (ELeave) CExitWait(*this);
iSdl = CSDL::NewL(CSDL::ENoFlags);
iSdlObserver = new (ELeave) CSDLObserver;
iSdl->SetContainerWindowL(
iSDLWin->GetWindow(),
iEikonEnv->WsSession(),
*iEikonEnv->ScreenDevice());
iSdl->SetObserver(iSdlObserver);
CDesC8ArrayFlat* args = new (ELeave)CDesC8ArrayFlat(10);
iSdl->CallMainL(iWait->iStatus, *args, 75000);
delete args;
iWait->Start();
}
void CSdlAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EAknCmdExit:
case EAknSoftkeyExit:
case EEikCmdExit:
iExit = ETrue;
if(iWait == NULL || !iWait->IsActive())
Exit();
break;
default:
break;
}
}
void CSdlAppUi::DoExit(TInt aErr)
{
delete iSdl;
iSdl = NULL;
if(iExit)
Exit();
}
void CSdlAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
{
if(iSdl != NULL)
iSdl->AppendWsEvent(aEvent);
CAknAppUi::HandleWsEventL(aEvent, aDestination);
}
void CSdlAppUi::HandleResourceChangeL(TInt aType)
{
CAknAppUi::HandleResourceChangeL(aType);
if(aType == KEikDynamicLayoutVariantSwitch)
{
iSDLWin->SetRect(ApplicationRect());
if (iSdl)
{
iSdl->SetContainerWindowL(
iSDLWin->GetWindow(),
iEikonEnv->WsSession(),
*iEikonEnv->ScreenDevice());
}
}
}
CSdlAppUi::~CSdlAppUi()
{
if(iWait != NULL)
iWait->Cancel();
delete iSdl;
delete iWait;
delete iSDLWin;
delete iSdlObserver;
}
CEikAppUi* CSdlAppDocument::CreateAppUiL()
{
return new(ELeave) CSdlAppUi();
}
TUid CSdlApplication::AppDllUid() const
{
return KUidSdlApp;
}
CApaDocument* CSdlApplication::CreateDocumentL()
{
CSdlAppDocument* document = new (ELeave) CSdlAppDocument(*this);
return document;
}
LOCAL_C CApaApplication* NewApplication()
{
return new CSdlApplication;
}
GLDEF_C TInt E32Main()
{
return EikStart::RunApplication(NewApplication);
}
TInt CSDLObserver::SdlEvent(TInt aEvent, TInt aParam)
{
return 0;
}
TInt CSDLObserver::SdlThreadEvent(TInt aEvent, TInt aParam)
{
return 0;
}