1 /* 2 * %CopyrightBegin% 3 * 4 * Copyright Ericsson AB 2008-2016. All Rights Reserved. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * %CopyrightEnd% 19 */ 20 21 #ifndef __WXE_EVENT_H__ 22 #define __WXE_EVENT_H__ 23 24 // #include "wxe_nif.h" 25 26 bool sendevent(wxEvent * event, wxeMemEnv *env); 27 28 typedef struct { 29 int ev_type; 30 int class_id; 31 const char * ev_name; 32 const char* ev_class; 33 const char* ev_rec; 34 } wxe_evInfo; 35 36 class wxeEtype 37 { 38 public: wxeEtype(ErlNifEnv * env,wxe_evInfo * info)39 wxeEtype (ErlNifEnv *env, wxe_evInfo* info) 40 { 41 cID = info->class_id; 42 evName = enif_make_atom(env, info->ev_name); 43 evClass = enif_make_atom(env, info->ev_class); 44 evRecord = enif_make_atom(env, info->ev_rec); 45 } ; 46 int cID; 47 ERL_NIF_TERM evName; 48 ERL_NIF_TERM evClass; 49 ERL_NIF_TERM evRecord; 50 }; 51 52 void initEventTable(); 53 int wxeEventTypeFromAtom(ERL_NIF_TERM atom); 54 55 #endif 56