Add Tizen support for landscape mode
This commit is contained in:
@@ -193,6 +193,9 @@ extern "C" bool GetBundleFilename(const char *inName, char *outBuffer,int inBufS
|
||||
extern "C" FILE *OpenOverwrite(const char *inName);
|
||||
namespace lime {
|
||||
#else
|
||||
#ifdef TIZEN
|
||||
extern int gFixedOrientation;
|
||||
#endif
|
||||
#define OpenRead(x) fopen(x,"rb")
|
||||
#define OpenOverwrite(x) fopen(x,"wb") // [ddc]
|
||||
#endif
|
||||
|
||||
@@ -1027,7 +1027,7 @@ DEFINE_PRIM(lime_clear_user_preference,1);
|
||||
|
||||
value lime_stage_set_fixed_orientation(value inValue)
|
||||
{
|
||||
#ifdef IPHONE
|
||||
#if defined(IPHONE) || defined(TIZEN)
|
||||
gFixedOrientation = val_int(inValue);
|
||||
#endif
|
||||
return alloc_null();
|
||||
|
||||
@@ -7,6 +7,7 @@ using namespace Tizen::Graphics::Opengl;
|
||||
namespace lime {
|
||||
|
||||
|
||||
int gFixedOrientation = -1;
|
||||
FrameCreationCallback sgCallback;
|
||||
unsigned int sgFlags;
|
||||
int sgHeight;
|
||||
@@ -32,6 +33,16 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
// For now, swap the width/height for proper EGL initialization, when landscape
|
||||
|
||||
if (gFixedOrientation == 3 || gFixedOrientation == 4) {
|
||||
|
||||
int temp = sgWidth;
|
||||
sgWidth = sgHeight;
|
||||
sgHeight = temp;
|
||||
|
||||
}
|
||||
|
||||
Tizen::Base::Collection::ArrayList args (Tizen::Base::Collection::SingleObjectDeleter);
|
||||
args.Construct ();
|
||||
result r = Tizen::App::Application::Execute (TizenApplication::CreateInstance, &args);
|
||||
@@ -100,6 +111,13 @@ namespace lime {
|
||||
|
||||
mForm = new (std::nothrow) TizenForm (this);
|
||||
mForm->Construct (Tizen::Ui::Controls::FORM_STYLE_NORMAL);
|
||||
|
||||
if (gFixedOrientation == 3 || gFixedOrientation == 4) {
|
||||
|
||||
mForm->SetOrientation (Tizen::Ui::ORIENTATION_LANDSCAPE);
|
||||
|
||||
}
|
||||
|
||||
GetAppFrame ()->GetFrame ()->AddControl (mForm);
|
||||
|
||||
mForm->AddKeyEventListener (*this);
|
||||
|
||||
Reference in New Issue
Block a user