A presenter show in fullscreen

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

A presenter show in fullscreen

Sebastián Sastre
Hi there,

 I wonder if anyone has tried sometime to show a presenter in
fullscreen.

 I need to make this to make a mode in wich the user can be capturing
images and video from a video source. For production pruposes the
fullscreen mode is desirable and I mentioned a presenter because I need
freedom to compose any view in that mode. Not only the video preview
but posibly combo boxes, buttons and other controls.

  Anyone?

  regards,

Sebastian


Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

Esteban A. Maringolo
Sebastián escribió:
> Hi there,
>
>  I wonder if anyone has tried sometime to show a presenter in
> fullscreen.


Take a look at Udo's screensaver, it runs fullscreen.
<http://udos.users.dolphinmap.net/apps/doItBestdolphinScreensaver.html>

Best regards,

--
Esteban.


Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

James Foster-3
In reply to this post by Sebastián Sastre
Were you planning to place the presenter in a ShellView? If so, then you can
send #showMaximized to the ShellView.

James Foster

"Sebastián" <[hidden email]> wrote in message
news:[hidden email]...

> Hi there,
>
> I wonder if anyone has tried sometime to show a presenter in
> fullscreen.
>
> I need to make this to make a mode in wich the user can be capturing
> images and video from a video source. For production pruposes the
> fullscreen mode is desirable and I mentioned a presenter because I need
> freedom to compose any view in that mode. Not only the video preview
> but posibly combo boxes, buttons and other controls.
>
>  Anyone?
>
>  regards,
>
> Sebastian
>


Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

Udo Schneider
In reply to this post by Esteban A. Maringolo
Esteban A. Maringolo wrote:
> Take a look at Udo's screensaver, it runs fullscreen.
> <http://udos.users.dolphinmap.net/apps/doItBestdolphinScreensaver.html>
You basically need two things

1) A ShellView w/o borders (see attached ScreenSaverShellView for an
exmaple).
2) A method to scale a view to fullscreen taking the Virtual Screensize
into account. (see method View class>>#showFullscreen in the package).


Regards,

udp

| package |
package := Package name: 'US View Extensions'.
package paxVersion: 1;
        basicComment: ''.

package basicPackageVersion: '0.008'.


package methodNames
        add: #DesktopView -> #freezeDuring:;
        add: #Dialog -> #showModalTo:;
        add: #ShellView -> #maximize;
        add: #UserLibrary -> #printWindow:hdcBlt:nFlags:;
        add: #View -> #captureBitmap;
        add: #View -> #coverParent;
        add: #View -> #isChild;
        add: #View -> #isChild:;
        add: #View -> #parentViewOrDesktop;
        add: #View -> #printWindow;
        add: #View -> #topShellView;
        add: 'Dialog class' -> #showModalOn:to:;
        add: 'Dialog class' -> #showModalTo:;
        add: 'View class' -> #showFullscreen;
        yourself.

package binaryGlobalNames: (Set new
        yourself).

package globalAliases: (Set new
        yourself).

package setPrerequisites: (IdentitySet new
        add: '..\..\Object Arts\Dolphin\Base\Dolphin';
        add: '..\..\Object Arts\Dolphin\MVP\Presenters\Image\Dolphin Image Presenter';
        add: '..\..\Object Arts\Dolphin\MVP\Base\Dolphin MVP Base';
        yourself).

package!

"Class Definitions"!


"Global Aliases"!


"Loose Methods"!

!DesktopView methodsFor!

freezeDuring: aBlock
        | imageView return bitmap |

        bitmap := View desktop captureBitmap.
        (imageView := View desktop addSubView: ImageView new)
                coverParent;
                model: bitmap asValue;
                show;
                beTopMost.
        return := aBlock value.
        imageView close.
        ^return! !
!DesktopView categoriesFor: #freezeDuring:!public! !

!Dialog methodsFor!

showModalTo: aView
        self view showModalTo: aView.^self answer! !
!Dialog categoriesFor: #showModalTo:!public!realizing/unrealizing! !

!Dialog class methodsFor!

showModalOn: aModel to: aView
        "Creates a default instance of the receiver with a default view and displays it modal
        to the current active window.
        Answers the result of the dialog if confirmed or nil otherwise"

        ^(self createOn: aModel) showModalTo: aView!

showModalTo: aView
        "Creates a default instance of the receiver with a default view and displays it modal
        to the current active window.
        Answers the result of the dialog if confirmed or nil otherwise"

        ^self create showModalTo: aView! !
!Dialog class categoriesFor: #showModalOn:to:!instance creation!public! !
!Dialog class categoriesFor: #showModalTo:!instance creation!public! !

!ShellView methodsFor!

maximize
        "Show the receiver in a maximized state"

        self showWithStyle: SW_MAXIMIZE! !
!ShellView categoriesFor: #maximize!operations!public! !

!UserLibrary methodsFor!

printWindow: hwnd hdcBlt: hdcBlt nFlags: nFlags
        "The PrintWindow function copies a visual window into the specified device context (DC), typically a printer DC.
                BOOL PrintWindow(
                        HWND hwnd,               // Window to copy
                        HDC  hdcBlt,             // HDC to print into
                        UINT nFlags              // Optional flags
                );"

        <stdcall: bool PrintWindow handle handle dword>
        ^self invalidCall! !
!UserLibrary categoriesFor: #printWindow:hdcBlt:nFlags:!public! !

!View methodsFor!

captureBitmap
        | extent bitmap dcGraphics dcView |
        extent := self extent.
        bitmap := Bitmap compatible: self canvas extent: extent.
        dcGraphics := bitmap canvas handle.
        dcView := self getWindowDC.
        GDILibrary default
                bitBlt: dcGraphics
                nXDest: 0
                nYDest: 0
                nWidth: extent x
                nHeight: extent y
                hdcSrc: dcView
                nXSrc: 0
                nYSrc: 0
                dwRop: SRCCOPY.^bitmap!

coverParent
self position: 0 @ 0;
                                extent: self parentViewOrDesktop extent.
        !

isChild ^self baseStyleAllMask: WS_CHILD!

isChild: aBoolean
        self
                baseStyleMask: WS_CHILD
                set: aBoolean
                recreateIfChanged: true!

parentViewOrDesktop
        ^self parentView ifNil: [^DesktopView  current ]!

printWindow
        | bitmap |
        bitmap := Bitmap compatible: self canvas extent: self extent.
        UserLibrary default
                printWindow: self asParameter
                hdcBlt: bitmap canvas asParameter
                nFlags: 0.
        ^bitmap!

topShellView

| topMost topMostShellView |
        topMost := topMostShellView := self.


[topMost isTopView] whileFalse: [(topMost isKindOf: ShellView) ifTrue: [ topMostShellView := topMost].
topMost := topMost parentView].
^topMostShellView! !
!View categoriesFor: #captureBitmap!public! !
!View categoriesFor: #coverParent!public! !
!View categoriesFor: #isChild!accessing-styles!public!testing! !
!View categoriesFor: #isChild:!accessing-styles!public! !
!View categoriesFor: #parentViewOrDesktop!public! !
!View categoriesFor: #printWindow!public! !
!View categoriesFor: #topShellView!public! !

!View class methodsFor!

showFullscreen
        ^self show rectangle: (0@0 extent: SystemMetrics current virtualScreenExtent)! !
!View class categoriesFor: #showFullscreen!public! !

"End of package definition"!

"Source Globals"!

"Classes"!

"Binary Globals"!


"Filed out from Dolphin Smalltalk X6"!

ShellView subclass: #ScreensaverShellView
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        classInstanceVariableNames: ''!
ScreensaverShellView guid: (GUID fromString: '{545C96F8-1A24-4C15-967C-562403713431}')!
ScreensaverShellView comment: ''!
!ScreensaverShellView categoriesForClass!MVP-Views! !
!ScreensaverShellView methodsFor!

defaultWindowExStyle


        ^super defaultWindowExStyle bitOr: WS_EX_TOOLWINDOW!

defaultWindowStyle
        "Private - Answer the default basic window creation style"

        ^##(WS_POPUP )!

onCreated: anEvent
        Cursor hide.

        ^super onCreated: anEvent!

onDestroyed
        Cursor show.

        ^super onDestroyed!

onEraseRequired: aColorEvent
        ^true! !
!ScreensaverShellView categoriesFor: #defaultWindowExStyle!constants!private! !
!ScreensaverShellView categoriesFor: #defaultWindowStyle!constants!private! !
!ScreensaverShellView categoriesFor: #onCreated:!public! !
!ScreensaverShellView categoriesFor: #onDestroyed!public! !
!ScreensaverShellView categoriesFor: #onEraseRequired:!public! !

Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

Udo Schneider
Udo Schneider wrote:
> Regards,
>
> udp
Seems to be really late over here :-)

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

Sebastián Sastre
Dear Udo,

  first of all, thank you very much for the pack. I cames to me in the
right time and oriented me in the right direction to do what I need.

  Here I've shared a little modified version of your extension pack so
all (I hope) presenters can receive the message #fullscreen. Every
presenter I've tested until now are fullscreening OK.

 Esteban muchas gracias obrigado pela dica,

  regards,

Sebastian
---------------------------------
| package |
package := Package name: 'US View Extensions'.
package paxVersion: 1;
        basicComment: ''.

package basicPackageVersion: '0.008'.


package classNames
        add: #UndecoratedDialogView;
        add: #UndecoratedShellView;
        yourself.

package methodNames
        add: #DesktopView -> #freezeDuring:;
        add: #Dialog -> #showModalTo:;
        add: #Presenter -> #fullscreen;
        add: #ShellView -> #maximize;
        add: #UserLibrary -> #printWindow:hdcBlt:nFlags:;
        add: #View -> #captureBitmap;
        add: #View -> #coverParent;
        add: #View -> #fullscreen;
        add: #View -> #isChild;
        add: #View -> #isChild:;
        add: #View -> #parentViewOrDesktop;
        add: #View -> #printWindow;
        add: #View -> #topShellView;
        add: 'Dialog class' -> #resource_Fullscreen;
        add: 'Dialog class' -> #showModalOn:to:;
        add: 'Dialog class' -> #showModalTo:;
        add: 'Shell class' -> #resource_Fullscreen;
        add: 'View class' -> #showFullscreen;
        yourself.

package binaryGlobalNames: (Set new
        yourself).

package globalAliases: (Set new
        yourself).

package setPrerequisites: (IdentitySet new
        add: '..\..\Object Arts\Dolphin\Base\Dolphin';
        add: '..\..\Object Arts\Dolphin\MVP\Presenters\Image\Dolphin Image
Presenter';
        add: '..\..\Object Arts\Dolphin\MVP\Base\Dolphin MVP Base';
        yourself).

package!

"Class Definitions"!

ShellView subclass: #UndecoratedShellView
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        classInstanceVariableNames: ''!
DialogView subclass: #UndecoratedDialogView
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        classInstanceVariableNames: ''!

"Global Aliases"!


"Loose Methods"!

!DesktopView methodsFor!

freezeDuring: aBlock
        | imageView return bitmap |

        bitmap := View desktop captureBitmap.
        (imageView := View desktop addSubView: ImageView new)
                coverParent;
                model: bitmap asValue;
                show;
                beTopMost.
        return := aBlock value.
        imageView close.
        ^return! !
!DesktopView categoriesFor: #freezeDuring:!public! !

!Dialog methodsFor!

showModalTo: aView
        self view showModalTo: aView.^self answer! !
!Dialog categoriesFor: #showModalTo:!public!realizing/unrealizing! !

!Dialog class methodsFor!

resource_Fullscreen
        "Answer the literal data from which the 'Fullscreen' resource can be
reconstituted.
        DO NOT EDIT OR RECATEGORIZE THIS METHOD.

        If you wish to modify this resource evaluate:
        ViewComposer openOn: (ResourceIdentifier class: self selector:
#resource_Fullscreen)
        "

        ^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8
##(Smalltalk.UndecoratedDialogView)  98 30 0 0 98 2 8 2148007936 131073
416 0 524550 ##(Smalltalk.ColorRef)  8 4278190080 0 167 0 0 0 416
788230 ##(Smalltalk.BorderLayout)  1 1 0 0 0 0 0 234 256 98 0 0 0 0 0 0
3 0 0 0 0 1 0 0 590598 ##(Smalltalk.Semaphore)  0 0 1 32 8 2010375503
983302 ##(Smalltalk.MessageSequence)  202 208 98 2 721670
##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 328198
##(Smalltalk.Point)  2559 21 786 521 591 416 722 8 #updateMenuBar 592
416 983302 ##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 0 0 0 0
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 4 0
0 10 0 0 0 3 6 0 0 49 1 0 0] 98 0 786 193 193 0 27 )!

showModalOn: aModel to: aView
        "Creates a default instance of the receiver with a default view
   and displays it modal
        to the current active window.
        Answers the result of the dialog if confirmed or nil otherwise"

        ^(self createOn: aModel) showModalTo: aView!

showModalTo: aView
        "Creates a default instance of the receiver with a default view
   and displays it modal
        to the current active window.
        Answers the result of the dialog if confirmed or nil otherwise"

        ^self create showModalTo: aView! !
!Dialog class categoriesFor:
#resource_Fullscreen!public!resources-views! !
!Dialog class categoriesFor: #showModalOn:to:!instance creation!public!
!
!Dialog class categoriesFor: #showModalTo:!instance creation!public! !

!Presenter methodsFor!

fullscreen

        ^ self view fullscreen! !
!Presenter categoriesFor: #fullscreen!public! !

!Shell class methodsFor!

resource_Fullscreen
        "Answer the literal data from which the 'Fullscreen' resource can be
reconstituted.
        DO NOT EDIT OR RECATEGORIZE THIS METHOD.

        If you wish to modify this resource evaluate:
        ViewComposer openOn: (ResourceIdentifier class: self selector:
#resource_Fullscreen)
        "

        ^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8
##(Smalltalk.ScreensaverShellView)  98 27 0 0 98 2 8 2147483648
268566529 416 0 524550 ##(Smalltalk.ColorRef)  8 4278190080 0 551 0 0 0
416 788230 ##(Smalltalk.BorderLayout)  1 1 0 0 0 0 0 234 256 98 0 0 0 0
0 0 1 0 0 0 0 1 0 0 983302 ##(Smalltalk.MessageSequence)  202 208 98 2
721670 ##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 328198
##(Smalltalk.Point)  2559 21 738 1201 801 416 674 8 #updateMenuBar 592
416 983302 ##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 0 0 0 0
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 4 0
0 10 0 0 0 87 7 0 0 154 1 0 0] 98 0 738 193 193 0 27 )! !
!Shell class categoriesFor:
#resource_Fullscreen!public!resources-views! !

!ShellView methodsFor!

maximize
        "Show the receiver in a maximized state"

        self showWithStyle: SW_MAXIMIZE! !
!ShellView categoriesFor: #maximize!operations!public! !

!UserLibrary methodsFor!

printWindow: hwnd hdcBlt: hdcBlt nFlags: nFlags
        "The PrintWindow function copies a visual window into the
specified device context (DC), typically a printer DC.
                BOOL PrintWindow(
                        HWND hwnd,               // Window to copy
                        HDC  hdcBlt,             // HDC to print into
                        UINT nFlags              // Optional flags
                );"

        <stdcall: bool PrintWindow handle handle dword>
        ^self invalidCall! !
!UserLibrary categoriesFor: #printWindow:hdcBlt:nFlags:!public! !

!View methodsFor!

captureBitmap
        | extent bitmap dcGraphics dcView |
        extent := self extent.
        bitmap := Bitmap compatible: self canvas extent: extent.
        dcGraphics := bitmap canvas handle.
        dcView := self getWindowDC.
        GDILibrary default
                bitBlt: dcGraphics
                nXDest: 0
                nYDest: 0
                nWidth: extent x
                nHeight: extent y
                hdcSrc: dcView
                nXSrc: 0
                nYSrc: 0
                dwRop: SRCCOPY.^bitmap!

coverParent
self    position: 0 @ 0;
                                extent: self parentViewOrDesktop
extent.
        !

fullscreen

        creationStyle := Array
                                        with: WS_POPUP
                                        with:(self defaultWindowExStyle bitOr: WS_EX_TOOLWINDOW)
                                        yourself.
        self rectangle: (0@0 extent: SystemMetrics current
virtualScreenExtent).
        self recreate!

isChild ^self baseStyleAllMask: WS_CHILD!

isChild: aBoolean
        self
                baseStyleMask: WS_CHILD
                set: aBoolean
                recreateIfChanged: true!

parentViewOrDesktop
        ^self parentView ifNil: [^DesktopView  current ]!

printWindow
        | bitmap |
        bitmap := Bitmap compatible: self canvas extent: self extent.
        UserLibrary default
                printWindow: self asParameter
                hdcBlt: bitmap canvas asParameter
                nFlags: 0.
        ^bitmap!

topShellView

| topMost topMostShellView |
        topMost := topMostShellView := self.

[topMost isTopView] whileFalse: [(topMost isKindOf: ShellView) ifTrue:
[ topMostShellView := topMost].
topMost := topMost parentView].
^topMostShellView! !
!View categoriesFor: #captureBitmap!public! !
!View categoriesFor: #coverParent!public! !
!View categoriesFor: #fullscreen!public! !
!View categoriesFor: #isChild!accessing-styles!public!testing! !
!View categoriesFor: #isChild:!accessing-styles!public! !
!View categoriesFor: #parentViewOrDesktop!public! !
!View categoriesFor: #printWindow!public! !
!View categoriesFor: #topShellView!public! !

!View class methodsFor!

showFullscreen
        ^self show rectangle: (0@0 extent: SystemMetrics current
virtualScreenExtent)! !
!View class categoriesFor: #showFullscreen!public! !

"End of package definition"!

"Source Globals"!

"Classes"!

UndecoratedShellView guid: (GUID fromString:
'{545C96F8-1A24-4C15-967C-562403713431}')!
UndecoratedShellView comment: ''!
!UndecoratedShellView categoriesForClass!MVP-Views! !
!UndecoratedShellView methodsFor!

defaultWindowExStyle

        ^super defaultWindowExStyle bitOr: WS_EX_TOOLWINDOW!

defaultWindowStyle
        "Private - Answer the default basic window creation style"

        ^##(WS_POPUP )!

onCreated: anEvent
"        Cursor hide."

        ^super onCreated: anEvent!

onDestroyed
"        Cursor show."

        ^super onDestroyed!

onEraseRequired: aColorEvent
        ^true! !
!UndecoratedShellView categoriesFor:
#defaultWindowExStyle!constants!private! !
!UndecoratedShellView categoriesFor:
#defaultWindowStyle!constants!private! !
!UndecoratedShellView categoriesFor: #onCreated:!public! !
!UndecoratedShellView categoriesFor: #onDestroyed!public! !
!UndecoratedShellView categoriesFor: #onEraseRequired:!public! !

UndecoratedDialogView guid: (GUID fromString:
'{60ADA481-B361-448F-921F-F5827D92EA30}')!
UndecoratedDialogView comment: ''!
!UndecoratedDialogView categoriesForClass!MVP-Views! !
!UndecoratedDialogView methodsFor!

defaultWindowExStyle

        ^super defaultWindowExStyle bitOr: WS_EX_TOOLWINDOW!

defaultWindowStyle
        "Private - Answer the default basic window creation style"

        ^##(WS_POPUP )! !
!UndecoratedDialogView categoriesFor:
#defaultWindowExStyle!constants!private! !
!UndecoratedDialogView categoriesFor:
#defaultWindowStyle!constants!private! !

"Binary Globals"!


Reply | Threaded
Open this post in threaded view
|

Re: A presenter show in fullscreen

Udo Schneider
Sebastián wrote:
>   first of all, thank you very much for the pack. I cames to me in the
> right time and oriented me in the right direction to do what I need.
>
>   Here I've shared a little modified version of your extension pack so
> all (I hope) presenters can receive the message #fullscreen. Every
> presenter I've tested until now are fullscreening OK.
I'm glad I could help.

CU,

Udo