Wrapper classes for the emwin library
Dependents: app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin
EwFunctionPointer.cpp@1:0b16165ada7c, 2014-04-14 (annotated)
- Committer:
- embeddedartists
- Date:
- Mon Apr 14 08:38:33 2014 +0000
- Revision:
- 1:0b16165ada7c
- Parent:
- 0:316c181e9b65
Initialize uninitialized touchState in EwGui
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:316c181e9b65 | 1 | /* mbed Microcontroller Library |
embeddedartists | 0:316c181e9b65 | 2 | * Copyright (c) 2006-2013 ARM Limited |
embeddedartists | 0:316c181e9b65 | 3 | * |
embeddedartists | 0:316c181e9b65 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 0:316c181e9b65 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 0:316c181e9b65 | 6 | * You may obtain a copy of the License at |
embeddedartists | 0:316c181e9b65 | 7 | * |
embeddedartists | 0:316c181e9b65 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 0:316c181e9b65 | 9 | * |
embeddedartists | 0:316c181e9b65 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 0:316c181e9b65 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 0:316c181e9b65 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 0:316c181e9b65 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 0:316c181e9b65 | 14 | * limitations under the License. |
embeddedartists | 0:316c181e9b65 | 15 | */ |
embeddedartists | 0:316c181e9b65 | 16 | #include "EwFunctionPointer.h" |
embeddedartists | 0:316c181e9b65 | 17 | |
embeddedartists | 0:316c181e9b65 | 18 | |
embeddedartists | 0:316c181e9b65 | 19 | |
embeddedartists | 0:316c181e9b65 | 20 | EwFunctionPointer::EwFunctionPointer(void (*function)(EwWindow* w)) { |
embeddedartists | 0:316c181e9b65 | 21 | attach(function); |
embeddedartists | 0:316c181e9b65 | 22 | } |
embeddedartists | 0:316c181e9b65 | 23 | |
embeddedartists | 0:316c181e9b65 | 24 | void EwFunctionPointer::attach(void (*function)(EwWindow* w)) { |
embeddedartists | 0:316c181e9b65 | 25 | _function = function; |
embeddedartists | 0:316c181e9b65 | 26 | _object = 0; |
embeddedartists | 0:316c181e9b65 | 27 | } |
embeddedartists | 0:316c181e9b65 | 28 | |
embeddedartists | 0:316c181e9b65 | 29 | void EwFunctionPointer::call(EwWindow* w) { |
embeddedartists | 0:316c181e9b65 | 30 | if (_function) { |
embeddedartists | 0:316c181e9b65 | 31 | _function(w); |
embeddedartists | 0:316c181e9b65 | 32 | } else if (_object) { |
embeddedartists | 0:316c181e9b65 | 33 | _membercaller(_object, _member, w); |
embeddedartists | 0:316c181e9b65 | 34 | } |
embeddedartists | 0:316c181e9b65 | 35 | } |
embeddedartists | 0:316c181e9b65 | 36 | |
embeddedartists | 0:316c181e9b65 | 37 | |
embeddedartists | 0:316c181e9b65 | 38 |