Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
dispatch.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 
25 #ifndef MCR_BASE_DISPATCH_H_
26 #define MCR_BASE_DISPATCH_H_
27 
28 #include "mcr/base/types.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
39 MCR_API int mcr_dispatch_lock(struct mcr_context *ctx);
45 MCR_API int mcr_dispatch_unlock(struct mcr_context *ctx);
46 
55 MCR_API bool mcr_dispatch(struct mcr_context *ctx, struct mcr_Signal *sigPt);
56 
61 MCR_API int mcr_dispatch_set_dispatchers(struct mcr_context *ctx, struct mcr_IDispatcher **dispatchers, size_t count);
63 MCR_API void mcr_dispatch_set_generic_dispatcher(struct mcr_context *ctx, struct mcr_IDispatcher *dispatcherPt);
64 
69 MCR_API size_t mcr_dispatch_count(struct mcr_context *ctx);
75 MCR_API bool mcr_dispatch_enabled(struct mcr_context *ctx,
76  struct mcr_ISignal *isigPt);
83 MCR_API void mcr_dispatch_set_enabled(struct mcr_context *ctx,
84  struct mcr_ISignal *typePt, bool enableFlag);
90 MCR_API void mcr_dispatch_set_enabled_all(struct mcr_context *ctx,
91  bool enableFlag);
104 MCR_API int mcr_dispatch_add(struct mcr_context *ctx,
105  struct mcr_Signal *interceptPt, void *receiver,
106  mcr_dispatch_receive_fnc receiveFnc);
120 MCR_API int mcr_dispatch_add_generic(struct mcr_context *ctx,
121  struct mcr_Signal *interceptPt, void *receiver,
122  mcr_dispatch_receive_fnc receiveFnc);
128 MCR_API void mcr_dispatch_clear(struct mcr_context *ctx,
129  struct mcr_ISignal *isigPt);
134 MCR_API void mcr_dispatch_clear_all(struct mcr_context *ctx);
143 MCR_API void mcr_dispatch_modify(struct mcr_context *ctx,
144  struct mcr_Signal *sigPt,
145  unsigned int *modifiersPt);
152 MCR_API void mcr_dispatch_remove(struct mcr_context *ctx,
153  struct mcr_ISignal *typePt, void *remReceiver);
159 MCR_API void mcr_dispatch_remove_all(struct mcr_context *ctx,
160  void *remReceiver);
166 MCR_API void mcr_dispatch_trim(struct mcr_context *ctx,
167  struct mcr_ISignal *isigPt);
172 MCR_API void mcr_dispatch_trim_all(struct mcr_context *ctx);
173 
174 #ifdef __cplusplus
175 }
176 #endif
177 
178 #endif
MCR_API void mcr_dispatch_modify(struct mcr_context *ctx, struct mcr_Signal *sigPt, unsigned int *modifiersPt)
Modify modifiers without dispatching.
Forward declaration of types.
bool(* mcr_dispatch_receive_fnc)(struct mcr_DispatchReceiver *dispatchReceiver, struct mcr_Signal *dispatchSignal, unsigned int mods)
Definition: types.h:50
MCR_API void mcr_dispatch_set_enabled(struct mcr_context *ctx, struct mcr_ISignal *typePt, bool enableFlag)
MCR_API void mcr_dispatch_remove_all(struct mcr_context *ctx, void *remReceiver)
MCR_API void mcr_dispatch_set_generic_dispatcher(struct mcr_context *ctx, struct mcr_IDispatcher *dispatcherPt)
MCR_API void mcr_dispatch_trim(struct mcr_context *ctx, struct mcr_ISignal *isigPt)
MCR_API void mcr_dispatch_set_enabled_all(struct mcr_context *ctx, bool enableFlag)
MCR_API void mcr_dispatch_clear(struct mcr_context *ctx, struct mcr_ISignal *isigPt)
MCR_API int mcr_dispatch_unlock(struct mcr_context *ctx)
MCR_API size_t mcr_dispatch_count(struct mcr_context *ctx)
MCR_API bool mcr_dispatch(struct mcr_context *ctx, struct mcr_Signal *sigPt)
Blocking signal intercept.
MCR_API int mcr_dispatch_add(struct mcr_context *ctx, struct mcr_Signal *interceptPt, void *receiver, mcr_dispatch_receive_fnc receiveFnc)
MCR_API int mcr_dispatch_lock(struct mcr_context *ctx)
MCR_API void mcr_dispatch_clear_all(struct mcr_context *ctx)
MCR_API bool mcr_dispatch_enabled(struct mcr_context *ctx, struct mcr_ISignal *isigPt)
MCR_API void mcr_dispatch_remove(struct mcr_context *ctx, struct mcr_ISignal *typePt, void *remReceiver)
MCR_API int mcr_dispatch_set_dispatchers(struct mcr_context *ctx, struct mcr_IDispatcher **dispatchers, size_t count)
MCR_API void mcr_dispatch_trim_all(struct mcr_context *ctx)
MCR_API int mcr_dispatch_add_generic(struct mcr_context *ctx, struct mcr_Signal *interceptPt, void *receiver, mcr_dispatch_receive_fnc receiveFnc)