stlab.adobe.com Adobe Systems Incorporated

key_handler_concept.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2006-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_KEY_HANDLER_HPP
00010 #define ADOBE_KEY_HANDLER_HPP
00011 
00012 /*************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <adobe/any_regular.hpp>
00017 #include <adobe/future/platform_primitives.hpp>
00018 #include <adobe/widget_attributes.hpp>
00019 
00020 #include <boost/concept_check.hpp>
00021 
00022 /*************************************************************************************************/
00023 
00024 namespace adobe {
00025 
00026 /*************************************************************************************************/
00027 
00028 template <class H> // H models KeyHandler
00029 inline bool handle_key(H& handler, key_type key, bool pressed, modifiers_t modifiers)
00030 { return handler.handle_key(key, pressed, modifiers); }
00031 
00032 /*************************************************************************************************/
00033 
00034 template <class H> // H models KeyHandler
00035 inline any_regular_t underlying_handler(H& handler)
00036 { return handler.underlying_handler(); }
00037 
00038 /*************************************************************************************************/
00039 
00040     template <class Handler>
00041     struct KeyHandlerConcept
00042     {
00043         void constraints() {
00044             handle_key(handler, key, pressed, modifiers);
00045             underlying_handler(handler);
00046         }
00047         Handler handler;
00048         key_type key;
00049         bool pressed;
00050         modifiers_t modifiers;
00051     };
00052 
00053 /*************************************************************************************************/
00054 
00055 } //namespace adobe
00056 
00057 /*************************************************************************************************/
00058 
00059 #endif

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google