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);
|
extern "C" FILE *OpenOverwrite(const char *inName);
|
||||||
namespace lime {
|
namespace lime {
|
||||||
#else
|
#else
|
||||||
|
#ifdef TIZEN
|
||||||
|
extern int gFixedOrientation;
|
||||||
|
#endif
|
||||||
#define OpenRead(x) fopen(x,"rb")
|
#define OpenRead(x) fopen(x,"rb")
|
||||||
#define OpenOverwrite(x) fopen(x,"wb") // [ddc]
|
#define OpenOverwrite(x) fopen(x,"wb") // [ddc]
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1027,7 +1027,7 @@ DEFINE_PRIM(lime_clear_user_preference,1);
|
|||||||
|
|
||||||
value lime_stage_set_fixed_orientation(value inValue)
|
value lime_stage_set_fixed_orientation(value inValue)
|
||||||
{
|
{
|
||||||
#ifdef IPHONE
|
#if defined(IPHONE) || defined(TIZEN)
|
||||||
gFixedOrientation = val_int(inValue);
|
gFixedOrientation = val_int(inValue);
|
||||||
#endif
|
#endif
|
||||||
return alloc_null();
|
return alloc_null();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using namespace Tizen::Graphics::Opengl;
|
|||||||
namespace lime {
|
namespace lime {
|
||||||
|
|
||||||
|
|
||||||
|
int gFixedOrientation = -1;
|
||||||
FrameCreationCallback sgCallback;
|
FrameCreationCallback sgCallback;
|
||||||
unsigned int sgFlags;
|
unsigned int sgFlags;
|
||||||
int sgHeight;
|
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);
|
Tizen::Base::Collection::ArrayList args (Tizen::Base::Collection::SingleObjectDeleter);
|
||||||
args.Construct ();
|
args.Construct ();
|
||||||
result r = Tizen::App::Application::Execute (TizenApplication::CreateInstance, &args);
|
result r = Tizen::App::Application::Execute (TizenApplication::CreateInstance, &args);
|
||||||
@@ -100,6 +111,13 @@ namespace lime {
|
|||||||
|
|
||||||
mForm = new (std::nothrow) TizenForm (this);
|
mForm = new (std::nothrow) TizenForm (this);
|
||||||
mForm->Construct (Tizen::Ui::Controls::FORM_STYLE_NORMAL);
|
mForm->Construct (Tizen::Ui::Controls::FORM_STYLE_NORMAL);
|
||||||
|
|
||||||
|
if (gFixedOrientation == 3 || gFixedOrientation == 4) {
|
||||||
|
|
||||||
|
mForm->SetOrientation (Tizen::Ui::ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
GetAppFrame ()->GetFrame ()->AddControl (mForm);
|
GetAppFrame ()->GetFrame ()->AddControl (mForm);
|
||||||
|
|
||||||
mForm->AddKeyEventListener (*this);
|
mForm->AddKeyEventListener (*this);
|
||||||
|
|||||||
Reference in New Issue
Block a user