| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2007 The Android Open Source Project | 
 | 3 |  * | 
 | 4 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 5 |  * you may not use this file except in compliance with the License. | 
 | 6 |  * You may obtain a copy of the License at | 
 | 7 |  * | 
 | 8 |  *      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 9 |  * | 
 | 10 |  * Unless required by applicable law or agreed to in writing, software | 
 | 11 |  * distributed under the License is distributed on an "AS IS" BASIS, | 
 | 12 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 13 |  * See the License for the specific language governing permissions and | 
 | 14 |  * limitations under the License. | 
 | 15 |  */ | 
 | 16 |  | 
 | 17 | #ifndef ANDROID_ISURFACE_FLINGER_CLIENT_H | 
 | 18 | #define ANDROID_ISURFACE_FLINGER_CLIENT_H | 
 | 19 |  | 
 | 20 | #include <stdint.h> | 
 | 21 | #include <sys/types.h> | 
 | 22 |  | 
 | 23 | #include <utils/Errors.h> | 
| Mathias Agopian | 0795272 | 2009-05-19 19:08:10 -0700 | [diff] [blame] | 24 | #include <binder/IInterface.h> | 
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | #include <utils/RefBase.h> | 
 | 26 |  | 
 | 27 | #include <ui/ISurface.h> | 
 | 28 |  | 
 | 29 | #include <ui/PixelFormat.h> | 
 | 30 |    | 
 | 31 | namespace android { | 
 | 32 |  | 
 | 33 | // ---------------------------------------------------------------------------- | 
 | 34 |  | 
 | 35 | class Rect; | 
 | 36 | class Point; | 
 | 37 | class IMemory; | 
 | 38 | class ISurface; | 
 | 39 |  | 
 | 40 | typedef int32_t    ClientID; | 
 | 41 | typedef int32_t    DisplayID; | 
 | 42 |  | 
 | 43 | // ---------------------------------------------------------------------------- | 
 | 44 |  | 
 | 45 | class layer_state_t; | 
 | 46 |  | 
 | 47 | class ISurfaceFlingerClient : public IInterface | 
 | 48 | { | 
 | 49 | public:  | 
 | 50 |     DECLARE_META_INTERFACE(SurfaceFlingerClient); | 
 | 51 |  | 
 | 52 |     struct surface_data_t { | 
 | 53 |         int32_t             token; | 
 | 54 |         int32_t             identity; | 
 | 55 |         sp<IMemoryHeap>     heap[2]; | 
 | 56 |         status_t readFromParcel(const Parcel& parcel); | 
 | 57 |         status_t writeToParcel(Parcel* parcel) const; | 
 | 58 |     }; | 
 | 59 |      | 
 | 60 |     virtual void getControlBlocks(sp<IMemory>* ctl) const = 0; | 
 | 61 |  | 
 | 62 |     virtual sp<ISurface> createSurface( surface_data_t* data, | 
 | 63 |                                         int pid,  | 
 | 64 |                                         DisplayID display, | 
 | 65 |                                         uint32_t w, | 
 | 66 |                                         uint32_t h, | 
 | 67 |                                         PixelFormat format, | 
 | 68 |                                         uint32_t flags) = 0; | 
 | 69 |                                      | 
 | 70 |     virtual status_t    destroySurface(SurfaceID sid) = 0; | 
 | 71 |  | 
 | 72 |     virtual status_t    setState(int32_t count, const layer_state_t* states) = 0; | 
 | 73 | }; | 
 | 74 |  | 
 | 75 | // ---------------------------------------------------------------------------- | 
 | 76 |  | 
 | 77 | class BnSurfaceFlingerClient : public BnInterface<ISurfaceFlingerClient> | 
 | 78 | { | 
 | 79 | public: | 
 | 80 |     virtual status_t    onTransact( uint32_t code, | 
 | 81 |                                     const Parcel& data, | 
 | 82 |                                     Parcel* reply, | 
 | 83 |                                     uint32_t flags = 0); | 
 | 84 | }; | 
 | 85 |  | 
 | 86 | // ---------------------------------------------------------------------------- | 
 | 87 |  | 
 | 88 | }; // namespace android | 
 | 89 |  | 
 | 90 | #endif // ANDROID_ISURFACE_FLINGER_CLIENT_H |