Menu

[b84aab]: / src / platform / tizen / application.cpp  Maximize  Restore  History

Download this file

127 lines (108 with data), 2.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// This file is part of SmallBASIC
//
// Copyright(C) 2001-2013 Chris Warren-Smith.
//
// This program is distributed under the terms of the GPL v2.0 or later
// Download the GNU Public License (GPL) from www.gnu.org
//
#include "config.h"
#include "platform/tizen/form.h"
#include "platform/tizen/application.h"
#include "platform/common/utils.h"
Application *TizenApp::createInstance() {
logEntered();
return new TizenApp();
}
TizenApp::TizenApp() : _appForm(NULL) {
logEntered();
}
TizenApp::~TizenApp() {
logEntered();
}
bool TizenApp::OnAppInitialized(void) {
logEntered();
return true;
}
bool TizenApp::OnAppInitializing(AppRegistry &appRegistry) {
logEntered();
bool result = false;
Frame *appFrame = new (std::nothrow) Frame();
if (appFrame && appFrame->Construct() == E_SUCCESS &&
AddFrame(*appFrame) == E_SUCCESS) {
Rectangle rc = appFrame->GetBounds();
_appForm = new (std::nothrow) AppForm();
if (_appForm &&
_appForm->Construct(rc.width, rc.height) == E_SUCCESS &&
appFrame->AddControl(_appForm) == E_SUCCESS &&
appFrame->SetCurrentForm(_appForm) == E_SUCCESS) {
result = true;
}
}
if (!result) {
AppLog("Application startup failed");
delete _appForm;
_appForm = NULL;
} else {
appFrame->Invalidate(true);
}
return result;
}
bool TizenApp::OnAppTerminating(AppRegistry &appRegistry, bool forcedTermination) {
logEntered();
return true;
}
bool TizenApp::OnAppWillTerminate(void) {
logEntered();
return true;
}
void TizenApp::OnBackground(void) {
logEntered();
pauseRuntime(true);
}
void TizenApp::OnBatteryLevelChanged(BatteryLevel batteryLevel) {
logEntered();
}
void TizenApp::OnForeground(void) {
logEntered();
pauseRuntime(false);
}
void TizenApp::OnLowMemory(void) {
logEntered();
}
void TizenApp::OnScreenBrightnessChanged(int brightness) {
logEntered();
}
void TizenApp::OnScreenOff(void) {
logEntered();
}
void TizenApp::OnScreenOn(void) {
logEntered();
}
void TizenApp::OnUserEventReceivedN(RequestId requestId, IList *args) {
logEntered();
switch (requestId) {
case MSG_ID_REDRAW:
_appForm->redraw();
break;
case USER_MESSAGE_EXIT:
Terminate();
break;
case MSG_ID_SHOW_KEYPAD:
_appForm->showKeypad();
break;
case MSG_ID_SHOW_MENU:
_appForm->showMenu((ArrayList *)args);
args->RemoveAll(true);
delete args;
break;
case MSG_ID_SHOW_ALERT:
_appForm->showAlert((ArrayList *)args);
args->RemoveAll(true);
delete args;
break;
}
}
void TizenApp::pauseRuntime(bool pause) {
if (_appForm) {
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.