Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
abs_dispatcher.h
Go to the documentation of this file.
1 /* Libmacro - A multi-platform, extendable macro and hotkey C library
2  Copyright (C) 2013 Jonathan Pelletier, New Paradigm Software
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
23 #ifndef MCR_BASE_ABS_DISPATCHER_H_
24 #define MCR_BASE_ABS_DISPATCHER_H_
25 
26 #include "mcr/base/idispatcher.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
40  struct {
41  struct mcr_DispatchReceiver *receivers;
42  size_t receiver_count;
43  };
48  struct {
49  struct mcr_ReceiverMapElement *signal_receivers;
50  size_t signal_receiver_count;
51  };
52 };
53 
59 MCR_API void mcr_AbsDispatcher_ctor(struct mcr_AbsDispatcher *genericDispatcherPt, struct mcr_context *ctx, void (*deinit)(struct mcr_IDispatcher *), mcr_IDispatcher_add_fnc add, void (*clear)(struct mcr_IDispatcher *), mcr_IDispatcher_modify_fnc modifier, mcr_IDispatcher_remove_fnc remove, void (*trim)(struct mcr_IDispatcher *));
60 
62 MCR_API bool mcr_AbsDispatcher_dispatch(struct mcr_IDispatcher *dispPt, struct mcr_Signal *sigPt, unsigned int mods);
63 
68 MCR_API void mcr_AbsDispatcher_set_receivers(struct mcr_AbsDispatcher *genDispPt, struct mcr_DispatchReceiver *receiverList, size_t receiverCount);
75 MCR_API void mcr_AbsDispatcher_set_signal_receivers(struct mcr_AbsDispatcher *genDispPt, struct mcr_ReceiverMapElement *sortedReferenceReceiverList, size_t referenceReceiverCount);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif
void(* mcr_IDispatcher_remove_fnc)(struct mcr_IDispatcher *idispPt, void *remReceiver)
Definition: idispatcher.h:66
void(* mcr_IDispatcher_modify_fnc)(struct mcr_IDispatcher *idispPt, struct mcr_Signal *sigPt, unsigned int *modsPt)
Definition: idispatcher.h:83
mcr_IDispatcher - Blocking dispatcher, intercept signals before sending.
int(* mcr_IDispatcher_add_fnc)(struct mcr_IDispatcher *idispPt, struct mcr_Signal *sigPt, void *receiver, mcr_dispatch_receive_fnc receiverFnc)
Definition: idispatcher.h:57
struct mcr_IDispatcher idispatcher