Evt_scr_rotate | developer.brewmp.com Evt_scr_rotate | developer.brewmp.com

Developer

Evt_scr_rotate

Forums:

Hi,

I am working on LG Ax260 that has a side slide.

Whenever we do a slide, the application receives a EVT_SCR_ROTATE event. I went through few forums that suggested to handle EVT_SCR_ROTATE for screen orientation.

How is screen orientation handled,does the application needs to do orientation?

However, I tried couple of things. On EVT_SCR_ROTATE, I call

IDISPLAY_SetPrefs(pMe->m_pIDisplay,"r:90" ,4);
IDISPLAY_Update(pMe->m_pIDisplay);

This way the display is not proper,its highly distorted. But I could see the screen orintation is changed . In the SDK, I dont see the 'r' value to be set in IDISPLAY_SetPrefs for screen rotation, however a pdf presentation in Qualcomm site said to set the degrees.
I use SDK 3.1.5. I modified my mif to have the privlege level required for IDISPLAY_SetPrefs and this succeeds.

How to set the app respond to QWERTY keys. Looks like though the screen is rotated with lots of distortion, the app still does not respond to the QWERTY, also the softkeys are not mapped to the keys in the AEE_SO_LANDSCAPE mode. Is there any other procedure to be done for handling different orientation?

Any suggestions or pointers to docs will be of great use as I dont see much in sdk docs regarding orintation.

Thanks.

I just tested with a sample application with thte handle events like below:
case EVT_APP_START:
result = IDISPLAY_DrawText(pMe->a.m_pIDisplay,
AEE_FONT_BOLD,
szText,
-1,
0,
0,
NULL,
IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IDISPLAY_Update (pMe->a.m_pIDisplay);
return(TRUE);
case EVT_SCR_ROTATE:
if(wParam == AEE_SO_PORTRAIT)
{
ret = IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,"r:0" ,3);
}
else
{
ret = IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,"r:90" ,4);
}
DBGPRINTF("%d",ret);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
The screen is not gettting updated, also the soft keys are not mapped to the landscape mode soft keys. How should we change the key mappings to work with QWERTY key board?
Also, Iam using 3.1.5 version and Iam not finding AEEBitmapRot.h file in my SDK :confused:

I just tested with a sample application with thte handle events like below:
case EVT_APP_START:
result = IDISPLAY_DrawText(pMe->a.m_pIDisplay,
AEE_FONT_BOLD,
szText,
-1,
0,
0,
NULL,
IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IDISPLAY_Update (pMe->a.m_pIDisplay);
return(TRUE);
case EVT_SCR_ROTATE:
if(wParam == AEE_SO_PORTRAIT)
{
ret = IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,"r:0" ,3);
}
else
{
ret = IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,"r:90" ,4);
}
DBGPRINTF("%d",ret);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
The screen is not gettting updated, also the soft keys are not mapped to the landscape mode soft keys. How should we change the key mappings to work with QWERTY key board?
Also, Iam using 3.1.5 version and Iam not finding AEEBitmapRot.h file in my SDK :confused:

sri, what privilege do you need to add to the mif for IDISPLAY_SetPrefs() to work? I keep getting EPRIVLEVEL when i try to change screen orientation.

sri, what privilege do you need to add to the mif for IDISPLAY_SetPrefs() to work? I keep getting EPRIVLEVEL when i try to change screen orientation.

Hi Sri,
I am also stuck in same situation where I am able to trace the event and can get the which orientation screen is containing that time (portrait or landscape)??
But further i also don't find any clarification could not able to show properly the screen rotation. !!
About the AEEBitmapRot.h you need to download latest dec 2007 rel Brew ver 3.1.5.145 installation.
Please update me if u find any success .. thanx a lot ! Or any one who have any idea about this.?
- Neha

Hi Sri,
I am also stuck in same situation where I am able to trace the event and can get the which orientation screen is containing that time (portrait or landscape)??
But further i also don't find any clarification could not able to show properly the screen rotation. !!
About the AEEBitmapRot.h you need to download latest dec 2007 rel Brew ver 3.1.5.145 installation.
Please update me if u find any success .. thanx a lot ! Or any one who have any idea about this.?
- Neha

Hi Neha,
This article may helpful to you.
Good Luck...!
http://www.developer.com/ws/brew/article.php/3732816

Hi Neha,
This article may helpful to you.
Good Luck...!
http://www.developer.com/ws/brew/article.php/3732816

I was not able to...I did see some change in the screen orientation, as i said it was highly distorted and the keys were not mapped. Though I change the display screen to 'landscape', keys were mapped to 'portait'

I was not able to...I did see some change in the screen orientation, as i said it was highly distorted and the keys were not mapped. Though I change the display screen to 'landscape', keys were mapped to 'portait'

I'm having the same problem as well. I can rotate it from portrait to landscape but the width of the landscape is still portrait. I tried changing the width but still not luck. Any help would be great.
Thanks.
sri wrote:Hi,
I am working on LG Ax260 that has a side slide.
Whenever we do a slide, the application receives a EVT_SCR_ROTATE event. I went through few forums that suggested to handle EVT_SCR_ROTATE for screen orientation.
How is screen orientation handled,does the application needs to do orientation?
However, I tried couple of things. On EVT_SCR_ROTATE, I call
IDISPLAY_SetPrefs(pMe->m_pIDisplay,"r:90" ,4);
IDISPLAY_Update(pMe->m_pIDisplay);
This way the display is not proper,its highly distorted. But I could see the screen orintation is changed . In the SDK, I dont see the 'r' value to be set in IDISPLAY_SetPrefs for screen rotation, however a pdf presentation in Qualcomm site said to set the degrees.
I use SDK 3.1.5. I modified my mif to have the privlege level required for IDISPLAY_SetPrefs and this succeeds.
How to set the app respond to QWERTY keys. Looks like though the screen is rotated with lots of distortion, the app still does not respond to the QWERTY, also the softkeys are not mapped to the keys in the AEE_SO_LANDSCAPE mode. Is there any other procedure to be done for handling different orientation?
Any suggestions or pointers to docs will be of great use as I dont see much in sdk docs regarding orintation.
Thanks.

I'm having the same problem as well. I can rotate it from portrait to landscape but the width of the landscape is still portrait. I tried changing the width but still not luck. Any help would be great.
Thanks.
sri wrote:Hi,
I am working on LG Ax260 that has a side slide.
Whenever we do a slide, the application receives a EVT_SCR_ROTATE event. I went through few forums that suggested to handle EVT_SCR_ROTATE for screen orientation.
How is screen orientation handled,does the application needs to do orientation?
However, I tried couple of things. On EVT_SCR_ROTATE, I call
IDISPLAY_SetPrefs(pMe->m_pIDisplay,"r:90" ,4);
IDISPLAY_Update(pMe->m_pIDisplay);
This way the display is not proper,its highly distorted. But I could see the screen orintation is changed . In the SDK, I dont see the 'r' value to be set in IDISPLAY_SetPrefs for screen rotation, however a pdf presentation in Qualcomm site said to set the degrees.
I use SDK 3.1.5. I modified my mif to have the privlege level required for IDISPLAY_SetPrefs and this succeeds.
How to set the app respond to QWERTY keys. Looks like though the screen is rotated with lots of distortion, the app still does not respond to the QWERTY, also the softkeys are not mapped to the keys in the AEE_SO_LANDSCAPE mode. Is there any other procedure to be done for handling different orientation?
Any suggestions or pointers to docs will be of great use as I dont see much in sdk docs regarding orintation.
Thanks.

So, after you rotate with IDISPLAY_SetPrefs(), you will need to do ISHELL_GetDeviceInfo() and get the new screen dimensions from that and use them to set the screen dimensions in your app.

So, after you rotate with IDISPLAY_SetPrefs(), you will need to do ISHELL_GetDeviceInfo() and get the new screen dimensions from that and use them to set the screen dimensions in your app.

I did do that. Here is the code I did. I get the rotation but the softkeys are gone and the width can not exceed the previouse width in portrait mode.
ISHELL_GetDeviceInfoEx( pMe->pIShell, AEE_DEVICESTATE_SCR_ORIENTATION, &retval, &size );
AEERect aeer;
IDISPLAY_GetClipRect(pMe->pIDisplay, &aeer);
int result = IDISPLAY_SetPrefs(pMe->pIDisplay, "r:90",4);
ISHELL_GetDeviceInfo(pMe->pIShell, &di);
SETAEERECT(&aeer, 0, 0, di.cxScreen, di.cyScreen);
IDISPLAY_SetClipRect(pMe->pIDisplay, &aeer);
IDISPLAY_Update(pMe->pIDisplay);
Am I missing something?
jherriott wrote:So, after you rotate with IDISPLAY_SetPrefs(), you will need to do ISHELL_GetDeviceInfo() and get the new screen dimensions from that and use them to set the screen dimensions in your app.

I did do that. Here is the code I did. I get the rotation but the softkeys are gone and the width can not exceed the previouse width in portrait mode.
ISHELL_GetDeviceInfoEx( pMe->pIShell, AEE_DEVICESTATE_SCR_ORIENTATION, &retval, &size );
AEERect aeer;
IDISPLAY_GetClipRect(pMe->pIDisplay, &aeer);
int result = IDISPLAY_SetPrefs(pMe->pIDisplay, "r:90",4);
ISHELL_GetDeviceInfo(pMe->pIShell, &di);
SETAEERECT(&aeer, 0, 0, di.cxScreen, di.cyScreen);
IDISPLAY_SetClipRect(pMe->pIDisplay, &aeer);
IDISPLAY_Update(pMe->pIDisplay);
Am I missing something?
jherriott wrote:So, after you rotate with IDISPLAY_SetPrefs(), you will need to do ISHELL_GetDeviceInfo() and get the new screen dimensions from that and use them to set the screen dimensions in your app.

I'm assuming you need to make changes to the rect that you use to display everything. The rec you provided is only local, but what about if you were displaying a menu control? You'd have to set the rect for the menu control again, right?

I'm assuming you need to make changes to the rect that you use to display everything. The rec you provided is only local, but what about if you were displaying a menu control? You'd have to set the rect for the menu control again, right?

Hi All ,
I am able to rotate the screen and i am getting diff screen X/Y. But for able to see correct rotation we need to re-draw our current page with taking care of new screen X/Y.
Following is the CODE ::::
AEEScrOrientation retval = AEE_SO_PORTRAIT;
int size = sizeof(retval);
AEEDeviceInfo di;
AEERect rect;
ISHELL_GetDeviceInfoEx( m_pIShell, AEE_DEVICESTATE_SCR_ORIENTATION,(void*)&retval, &size );
switch (retval)
{
case 1: //landscape
STRCPY(buf, "r:90");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf)); break;
case 0: //portrait
STRCPY(buf, "r:0");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf));
break;
default:
STRCPY(buf, "r:0");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf));
break;
}
ISHELL_GetDeviceInfo(m_pIShell, &di);
//Set ur screen x/y if u using any constant
screen_x = di.cxScreen;
screen_y = di.cyScreen;
SETAEERECT(&rect,0,0,screen_x,screen_y);
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_GetClipRect(m_pIDisplay, &rect);
//Redraw your current page and u need to take care of ur drawing object x,y ...
Repaint();
IDISPLAY_Update(m_pIDisplay);
I hope it help u ..! !
- Neha

Hi All ,
I am able to rotate the screen and i am getting diff screen X/Y. But for able to see correct rotation we need to re-draw our current page with taking care of new screen X/Y.
Following is the CODE ::::
AEEScrOrientation retval = AEE_SO_PORTRAIT;
int size = sizeof(retval);
AEEDeviceInfo di;
AEERect rect;
ISHELL_GetDeviceInfoEx( m_pIShell, AEE_DEVICESTATE_SCR_ORIENTATION,(void*)&retval, &size );
switch (retval)
{
case 1: //landscape
STRCPY(buf, "r:90");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf)); break;
case 0: //portrait
STRCPY(buf, "r:0");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf));
break;
default:
STRCPY(buf, "r:0");
IDISPLAY_SetPrefs(m_pIDisplay, buf, STRLEN(buf));
break;
}
ISHELL_GetDeviceInfo(m_pIShell, &di);
//Set ur screen x/y if u using any constant
screen_x = di.cxScreen;
screen_y = di.cyScreen;
SETAEERECT(&rect,0,0,screen_x,screen_y);
IDISPLAY_SetClipRect(m_pIDisplay, &rect);
IDISPLAY_GetClipRect(m_pIDisplay, &rect);
//Redraw your current page and u need to take care of ur drawing object x,y ...
Repaint();
IDISPLAY_Update(m_pIDisplay);
I hope it help u ..! !
- Neha

Hi , i want to make a sample application for lg_9100; in that the screen sud rotate from protrait to landscape mode when the flip is opened. i went throug the forum
found some code and implemented but the screen still doesnt rotate. i have added the code help. pls help me in solving the problem. let me knkow where i m doing the mistake.
///////////////code//////////////////////////
AECHAR str_txt[] = L"this is the test string";
uint16 retval = 0;//AEE_SO_PORTRAIT;
int size = sizeof(retval);
char buf[30];
int val_return = 9999;
retval = ISHELL_GetDeviceInfoEx(pMe->pIShell, AEE_DEVICESTATE_SCR_ORIENTATION,(void*)&retval, &size );
DBGPRINTF("retval = %d",retval);
switch (retval)
{
case 1: //landscape
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
SUCCESS
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("landscape");
break;
case 0: //portrait
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("portrait");
break;
default:
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("default");
break;
}
ISHELL_GetDeviceInfo(pMe->pIShell,&pMe->post_rot_di);
DBGPRINTF("post_rot_di width = %d , height = %d",pMe->post_rot_di.cxScreen,pMe->post_rot_di.cyScreen);
IDISPLAY_ClearScreen(pMe->pIDisplay);
pMe->rect.x = 0;
pMe->rect.y = 0;
pMe->rect.dx = pMe->post_rot_di.cxScreen;
pMe->rect.dy = pMe->post_rot_di.cyScreen;
IDISPLAY_SetClipRect(pMe->pIDisplay, &pMe->rect);
IDISPLAY_GetClipRect(pMe->pIDisplay, &pMe->rect);
IDISPLAY_DrawText(pMe->pIDisplay,AEE_FONT_NORMAL,str_txt,-1,0,20,&pMe->rect,IDF_ALIGN_CENTER);
IDISPLAY_Update(pMe->pIDisplay);
////////////////////////////////////////////////
in the loger i checked
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
for case 0: (when the slider is opened)
val_return = 21 ( #define EPRIVLEVEL 21 // Security violation )
i also have added the id ( #define AEECLSID_TOUCH_SCREEN 0x01030810 )
in the dependency tab of mif file.
i am using brew 3.1.5

Hi , i want to make a sample application for lg_9100; in that the screen sud rotate from protrait to landscape mode when the flip is opened. i went throug the forum
found some code and implemented but the screen still doesnt rotate. i have added the code help. pls help me in solving the problem. let me knkow where i m doing the mistake.
///////////////code//////////////////////////
AECHAR str_txt[] = L"this is the test string";
uint16 retval = 0;//AEE_SO_PORTRAIT;
int size = sizeof(retval);
char buf[30];
int val_return = 9999;
retval = ISHELL_GetDeviceInfoEx(pMe->pIShell, AEE_DEVICESTATE_SCR_ORIENTATION,(void*)&retval, &size );
DBGPRINTF("retval = %d",retval);
switch (retval)
{
case 1: //landscape
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
SUCCESS
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("landscape");
break;
case 0: //portrait
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("portrait");
break;
default:
STRCPY(buf, "h:176,w:206,r:90");
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
DBGPRINTF("val_return = %d",val_return);
DBGPRINTF("default");
break;
}
ISHELL_GetDeviceInfo(pMe->pIShell,&pMe->post_rot_di);
DBGPRINTF("post_rot_di width = %d , height = %d",pMe->post_rot_di.cxScreen,pMe->post_rot_di.cyScreen);
IDISPLAY_ClearScreen(pMe->pIDisplay);
pMe->rect.x = 0;
pMe->rect.y = 0;
pMe->rect.dx = pMe->post_rot_di.cxScreen;
pMe->rect.dy = pMe->post_rot_di.cyScreen;
IDISPLAY_SetClipRect(pMe->pIDisplay, &pMe->rect);
IDISPLAY_GetClipRect(pMe->pIDisplay, &pMe->rect);
IDISPLAY_DrawText(pMe->pIDisplay,AEE_FONT_NORMAL,str_txt,-1,0,20,&pMe->rect,IDF_ALIGN_CENTER);
IDISPLAY_Update(pMe->pIDisplay);
////////////////////////////////////////////////
in the loger i checked
val_return= IDISPLAY_SetPrefs(pMe->pIDisplay, buf, STRLEN(buf));
for case 0: (when the slider is opened)
val_return = 21 ( #define EPRIVLEVEL 21 // Security violation )
i also have added the id ( #define AEECLSID_TOUCH_SCREEN 0x01030810 )
in the dependency tab of mif file.
i am using brew 3.1.5