Merge pull request #1445 from shinovon/11

Symbian: Improve dialog implementation
This commit is contained in:
UnknownShadow200 2025-10-07 06:53:56 +11:00 committed by GitHub
commit ad1623243c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 85 additions and 31 deletions

View File

@ -1,5 +1,9 @@
TARGET ClassiCube_s60v3.exe
MACRO CC_BUILD_SYMBIAN_S60V3
MACRO CC_GFX_BACKEND=CC_GFX_BACKEND_GL1
MACRO CC_DISABLE_ANIMATIONS
ARMFPU softvfp
LIBRARY libgles_cm.lib

View File

@ -1,6 +1,8 @@
TARGET ClassiCube_s60v5.exe
MACRO CC_BUILD_SYMBIAN_S60V5
MACRO CC_GFX_BACKEND=CC_GFX_BACKEND_GL1
MACRO CC_DISABLE_ANIMATIONS
ARMFPU softvfp

View File

@ -1,7 +1,16 @@
TARGET ClassiCube.exe
MACRO CC_BUILD_SYMBIAN_3
MACRO CC_BUILD_SYMBIAN_LIBGLESV2
#if !defined(WINS)
MACRO CC_GFX_BACKEND=CC_GFX_BACKEND_GL2
LIBRARY libglesv2.lib
LIBRARY libegl.lib
#else
MACRO CC_GFX_BACKEND=CC_GFX_BACKEND_GL1
LIBRARY libgles_cm.lib
#endif
ARMFPU vfpv2
@ -9,7 +18,4 @@ ARMFPU vfpv2
ALWAYS_BUILD_AS_ARM
#endif
LIBRARY libglesv2.lib
LIBRARY libegl.lib
#include "ClassiCube.mmh"

View File

@ -24,3 +24,29 @@ RESOURCE LOCALISABLE_APP_INFO r_ClassiCube_localisable_app_info
icon_file = "\\resource\\apps\\classicube_icon.mif";
};
}
RESOURCE DIALOG r_query_dialog
{
flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
items =
{
DLG_LINE
{
type = EAknCtPopupHeadingPane;
id = EAknMessageQueryHeaderId;
itemflags = EEikDlgItemNonFocusing;
control = AVKON_HEADING
{
};
},
DLG_LINE
{
type = EAknCtMessageQuery;
id = EAknMessageQueryContentId;
control = AVKON_MESSAGE_QUERY
{
};
}
};
}

View File

@ -12,8 +12,7 @@ SYSTEMINCLUDE /epoc32/include/stdapis
SYSTEMINCLUDE .
USERINCLUDE ../../third_party/bearssl/inc
USERINCLUDE ../../third_party/bearssl/src
USERINCLUDE ../../third_party/bearssl
#ifdef ARMCC
OPTION ARMCC -Otime --diag_suppress 1296 --diag_suppress 1293 --diag_suppress 66
@ -24,7 +23,9 @@ OPTION_REPLACE ARMCC -O2 -O3
#endif
#endif
OPTION CW -lang c99 -relax_pointers
DEBUGGABLE_UDEBONLY
#ifdef _DEBUG
SRCDBG
#endif
#endif

View File

@ -652,13 +652,7 @@ typedef cc_uint8 cc_bool;
#define CC_NOMAIN
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
#if defined CC_BUILD_SYMBIAN_LIBGLESV2
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL2
#else
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
#define CC_DISABLE_ANIMATIONS
#endif
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
#elif defined _WIN32_WCE
#define CC_BUILD_WINCE
#define CC_BUILD_NOMUSIC

View File

@ -259,8 +259,9 @@ static void CheckSkin_Unchecked(struct Entity* e) {
static void Entity_SetSkinAll(struct Entity* source, cc_bool reset) {
struct Entity* e;
cc_string skin, eSkin;
skin = String_FromRawArray(source->SkinRaw);
int i;
skin = String_FromRawArray(source->SkinRaw);
for (i = 0; i < ENTITIES_MAX_COUNT; i++)
{

View File

@ -19,6 +19,8 @@
#include <avkon.hrh>
#include <AknUtils.h>
#include <eikstart.h>
#include <aknmessagequerydialog.h>
#include <classicube.rsg>
extern "C" {
#include <stdapis/string.h>
#include <gles/egl.h>
@ -225,7 +227,7 @@ TInt E32Main() {
// CCAppUi implementation
void CCAppUi::ConstructL() {
BaseConstructL();
BaseConstructL(CAknAppUi::EAknEnableSkin);
iAppContainer = new (ELeave) CCContainer;
iAppContainer->SetMopParent(this);
iAppContainer->ConstructL(ClientRect(), this);
@ -495,9 +497,9 @@ TInt CCContainer::LoopCallBack(TAny*) {
if (run) {
run = false;
gameRunning = true;
ProcessProgramArgs(0, 0);
Game_Setup();
gameRunning = true;
container->RestartTimerL(100);
}
@ -652,10 +654,12 @@ CCoeControl* CCContainer::ComponentControl(TInt) const {
}
void CCContainer::Draw(const TRect& aRect) const {
if (iBitmap && launcherMode) {
#if CC_GFX_BACKEND_IS_GL()
if (!launcherMode) return;
#endif
if (iBitmap) {
SystemGc().BitBlt(TPoint(0, 0), iBitmap);
}
// do nothing in 3d mode
}
void CCContainer::DrawFramebuffer(Rect2D r, struct Bitmap* bmp) {
@ -738,16 +742,22 @@ CEikAppUi* CCDocument::CreateAppUiL() {
static void ConvertToUnicode(TDes& dst, const char* src, size_t length) {
if (!src) return;
cc_unichar* uni = reinterpret_cast<cc_unichar*>(const_cast <TUint16*> (dst.Ptr()));
for (int i = 0; i < length; i++) {
*uni++ = Convert_CP437ToUnicode(src[i]);
}
*uni = '\0';
wchar_t* uni = reinterpret_cast<wchar_t*>(const_cast <TUint16*> (dst.Ptr()));
mbstowcs(uni, src, length);
dst.SetLength(length);
}
static CC_INLINE void ConvertToUnicode(TDes& dst, const cc_string* src) {
ConvertToUnicode(dst, src->buffer, (size_t)src->length);
if (!src->buffer) return;
size_t length = (size_t)src->length;
cc_unichar* uni = reinterpret_cast<cc_unichar*>(const_cast <TUint16*> (dst.Ptr()));
for (int i = 0; i < length; i++) {
*uni++ = Convert_CP437ToUnicode(src->buffer[i]);
}
*uni = '\0';
dst.SetLength(length);
}
static cc_result OpenBrowserL(const cc_string* url) {
@ -757,7 +767,7 @@ static cc_result OpenBrowserL(const cc_string* url) {
if (task.Exists()) {
task.BringToForeground();
task.SendMessage(TUid::Uid(0), TPtrC8((TUint8 *) url->buffer, (TInt) url->length));
task.SendMessage(TUid::Uid(0), TPtrC8((TUint8*) url->buffer, (TInt) url->length));
} else {
RApaLsSession ls;
if (!ls.Handle()) {
@ -774,11 +784,17 @@ static cc_result OpenBrowserL(const cc_string* url) {
}
static void ShowDialogL(const char* title, const char* msg) {
// TODO: use text box or something instead to fix line breaks
CAknInformationNote* note = new (ELeave) CAknInformationNote(true);
TBuf<512> msgBuf;
ConvertToUnicode(msgBuf, msg, String_Length(msg));
note->ExecuteLD(msgBuf);
CAknMessageQueryDialog* dialog = CAknMessageQueryDialog::NewL(msgBuf);
dialog->PrepareLC(R_QUERY_DIALOG);
TBuf<100> titleBuf;
ConvertToUnicode(titleBuf, title, String_Length(title));
dialog->SetHeaderTextL(titleBuf);
dialog->RunLD();
}
// Window implementation
@ -813,9 +829,13 @@ void Window_Destroy(void) { }
void Window_SetTitle(const cc_string* title) { }
void Clipboard_GetText(cc_string* value) { }
void Clipboard_GetText(cc_string* value) {
// TODO
}
void Clipboard_SetText(const cc_string* value) { }
void Clipboard_SetText(const cc_string* value) {
// TODO
}
int Window_GetWindowState(void) {
return WINDOW_STATE_FULLSCREEN;