Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10
Accepted Solution

Cascade and dual display

Hi,

 

I'm trying to write an app that will display real time information on a "small" foreign window, and I would like to be able to have this tiny windows in full screen to the second screen when the bb is linked to hdmi. I succeeded to implement this when I'm not using cascade thanks to the quite complicated sample here :https://developer.blackberry.com/native/reference/com.qnx.doc.screen.lib_ref/topic/cscreen_displays_..., but when I try to do the same with my cascade app, it doesn't work. Any idea how to achieve this.

 

in my native code, I simply use a pixmap that I copy on buffer created on the 2 display with different scale. When I'll be able to do that in my cascade app, I think i'll be close to my goal.

 

What I have in my cascade app is always the same screen on both displays.

 

Thanks for any idea, input, or solution you can provide.

 

Cheers,

 

Fred

 

 

Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

Hi,

 

I found a few more information here:

https://developer.blackberry.com/cascades/reference/bb__device__displayinfo.html

 

I deduced from there that cascade is aware of multiple display, can retrieve their informations. What can I do with it now?

 

I still found no way to write on the second display or no explanatino why this is not working.

 

I was thinking of maybe a new foreignwindow, but in this case, i need to tell cascade on wich display will be draw a page, and I want to have multiple page displayed in the same time on different displays, here again, I'm stuck.

 

My development is dead now, this is a functionnality I need to continue what I'm trying to achieve. I could rewrite everything in full native, but it will be a pain to do that (and cascade UI is beautiful, so I don't really want to lose it).

 

cheers

Developer
nicklas
Posts: 150
Registered: ‎02-01-2009
My Device: Torch, PlayBook and Dev Alpha

Re: Cascade and dual display

Info on this subject ?

 

Nicolas

 

Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

nothing new,

 

I'm still trying a few things to work this out, but without success till now...

Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

Good news, at least for me! Doing a short program, I succeeded to have it working, I'll post an example as soon as I'll have finished my implementation. My first app on AppWorld soon.

 

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: Cascade and dual display

glad to hear you found a solution - are you still thinking of sharing a sample?

--
Rob is no longer associated with BlackBerry.
Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

Will do for sure, but a bit in a hurry now (after I published my karaoke app, I got requests for more).

 

Cheers

 

Fred

Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

As a starter, here is the function that initialize the external display.

 

void PlayerApp::initExternalDisplay()
{
int rect[4] =
{
0, 0,0,0
};

screen_get_context_property_iv(mScreenCtx, SCREEN_PROPERTY_DISPLAY_COUNT, &miDispNb);

if ( miDispNb > 1 )
{
screen_display_t *screen_dpy = (screen_display_t *)calloc(miDispNb, sizeof(screen_display_t));
screen_get_context_property_pv(mScreenCtx, SCREEN_PROPERTY_DISPLAYS, (void **) screen_dpy);

int active = 0;
screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_ATTACHED, &active);
screen_create_context(&mScreenCtx2, SCREEN_APPLICATION_CONTEXT);

screen_get_context_property_pv(mScreenCtx2, SCREEN_PROPERTY_DISPLAYS, (void **) screen_dpy);

screen_create_window(&mScreenWindow2, mScreenCtx2);
screen_set_window_property_pv(mScreenWindow2, SCREEN_PROPERTY_DISPLAY, (void **) &screen_dpy[1]);

int usage = SCREEN_USAGE_NATIVE;
screen_set_window_property_iv(mScreenWindow2, SCREEN_PROPERTY_USAGE, &usage);

screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_SIZE, rect + 2);
screen_set_window_property_iv(mScreenWindow2, SCREEN_PROPERTY_BUFFER_SIZE, rect + 2);
screen_create_window_buffers(mScreenWindow2, 2);

screen_buffer_t screen_buf[2];
screen_get_window_property_pv(mScreenWindow2, SCREEN_PROPERTY_RENDER_BUFFERS, (void **) screen_buf);
screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_SIZE, rect + 2);

int bg[] =
{
SCREEN_BLIT_COLOR, 0xff0000ff, SCREEN_BLIT_END
};
screen_fill(mScreenCtx2, screen_buf[0], bg);

screen_post_window(mScreenWindow2, screen_buf[0], 1, rect, 0);

free(screen_dpy);
}
}

 

Fred

New Contributor
agoncharov
Posts: 6
Registered: ‎07-25-2013
My Device: Z10

Re: Cascade and dual display

Hi. So can you share some more complete example. I'm now struggling with the same problem.

Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10

Re: Cascade and dual display

What are you trying to achieve exactly? 

 

The example shows how to initialize the display, and how to fill the display buffer. I'd be happy to help, but what do you need ?

 

Cheers,

 

Fred