Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AppImplMswScreenSaver.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012, The Cinder Project, All rights reserved.
3 
4  This code is intended for use with the Cinder C++ library: http://libcinder.org
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
7  the following conditions are met:
8 
9  * Redistributions of source code must retain the above copyright notice, this list of conditions and
10  the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12  the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
15  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
16  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
18  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21  POSSIBILITY OF SUCH DAMAGE.
22 */
23 
24 #pragma once
25 
27 #include "cinder/app/AppImplMsw.h"
29 #include <windows.h>
30 #undef min
31 #undef max
32 
33 namespace cinder { namespace app {
34 
35 class WindowImplMswScreenSaver;
36 
38  public:
41 
42  void init( HWND aWnd );
43  void run();
44  void quit() {} // we can't really force a quit
45 
46  LRESULT eventHandler( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
47 
48  virtual WindowRef getWindow() const;
50  virtual size_t getNumWindows() const;
52  virtual WindowRef getWindowIndex( size_t index ) const;
53 
54  bool isPreview() const;
55 
56  // ignore
57  virtual void closeWindow( class WindowImplMsw *windowImpl ) {}
58  // ignore
60 
61  protected:
63  bool mPreview;
64  bool mDebugMode;
65  std::list<WindowImplMswScreenSaver*> mWindows;
66  std::list<BlankingWindowRef> mBlankingWindows;
67 };
68 
70  public:
71  WindowImplMswScreenSaver( HWND hwnd, RendererRef renderer, RendererRef sharedRenderer, AppImplMswScreenSaver *appImpl )
72  : WindowImplMsw( hwnd, renderer, sharedRenderer, appImpl ) {}
73 
74  // no-op
75  virtual void setFullScreen( bool fullScreen, const app::FullScreenOptions &options );
76 
77  protected:
79 };
80 
81 
82 } } // namespace cinder::app
Definition: AppImplMswScreenSaver.h:37
class AppScreenSaver * mApp
Definition: AppImplMswScreenSaver.h:62
virtual ~AppImplMswScreenSaver()
Definition: AppImplMswScreenSaver.h:40
Options passed when entering fullscreen.
Definition: Window.h:110
bool mDebugMode
Definition: AppImplMswScreenSaver.h:64
GLuint index
Definition: GLee.h:2259
friend AppImplMswScreenSaver
Definition: AppImplMswScreenSaver.h:78
std::list< WindowImplMswScreenSaver * > mWindows
Definition: AppImplMswScreenSaver.h:65
Definition: AppImplMswScreenSaver.h:69
virtual WindowRef getWindow() const
Definition: AppImplMswScreenSaver.cpp:100
virtual void closeWindow(class WindowImplMsw *windowImpl)
Definition: AppImplMswScreenSaver.h:57
LRESULT eventHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: AppImplMswScreenSaver.cpp:125
std::shared_ptr< Window > WindowRef
Definition: Event.h:49
bool mPreview
Definition: AppImplMswScreenSaver.h:63
Definition: AppImplMsw.h:103
void run()
Definition: AppImplMswScreenSaver.cpp:89
void quit()
Definition: AppImplMswScreenSaver.h:44
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
AppImplMswScreenSaver(class AppScreenSaver *aApp)
Definition: AppImplMswScreenSaver.cpp:34
Window window
Definition: GLee.h:17134
bool isPreview() const
Definition: AppImplMswScreenSaver.cpp:120
WindowImplMswScreenSaver(HWND hwnd, RendererRef renderer, RendererRef sharedRenderer, AppImplMswScreenSaver *appImpl)
Definition: AppImplMswScreenSaver.h:71
std::list< BlankingWindowRef > mBlankingWindows
Definition: AppImplMswScreenSaver.h:66
Definition: AppScreenSaver.h:49
virtual WindowRef getWindowIndex(size_t index) const
Gets a Window by index, in the range [0, getNumWindows()).
Definition: AppImplMswScreenSaver.cpp:110
virtual void setFullScreen(bool fullScreen, const app::FullScreenOptions &options)
Definition: AppImplMswScreenSaver.cpp:162
virtual void setForegroundWindow(WindowRef window)
Definition: AppImplMswScreenSaver.h:59
Definition: AppImplMsw.h:63
void init(HWND aWnd)
Definition: AppImplMswScreenSaver.cpp:39
virtual size_t getNumWindows() const
Returns the number of Windows the app has open.
Definition: AppImplMswScreenSaver.cpp:105