/* * Copyright (C) 2017 Mentor Graphics Development (Deutschland) GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AFBCLIENT_H #define AFBCLIENT_H #include class AFBClient { AFBClient(); ~AFBClient(); AFBClient(const AFBClient &) = delete; AFBClient &operator=(const AFBClient &) = delete; public: using handler_fun = std::function; enum EventType { Event_Active = 1, Event_Inactive, Event_Visible, Event_Invisible, Event_SyncDraw, Event_FlushDraw, }; static AFBClient &instance(); int init(int port, char const *token); int dispatch(); // WM API int requestSurface(const char *label); int activateSurface(const char *label); int deactivateSurface(const char *label); int endDraw(const char *label); void set_event_handler(enum EventType et, handler_fun f); struct Impl; private: Impl *const d; }; #endif // AFBCLIENT_H