Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
standard.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 
33 #ifndef MCR_STANDARD_STANDARD_H_
34 #define MCR_STANDARD_STANDARD_H_
35 
36 #include "mcr/base/base.h"
37 #include "mcr/standard/hid_echo.h"
38 #include "mcr/standard/key.h"
39 #include "mcr/standard/modifier.h"
41 #include "mcr/standard/noop.h"
42 #include "mcr/standard/scroll.h"
43 #include "mcr/standard/action.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
55 struct mcr_standard {
56  /* Trigger types */
57  struct mcr_ITrigger iaction;
58  /* Signal types */
59  struct mcr_ISignal ihid_echo;
60  struct mcr_ISignal ikey;
61  struct mcr_ISignal imodifier;
62  struct mcr_ISignal imove_cursor;
63  struct mcr_ISignal inoop;
64  struct mcr_ISignal iscroll;
65 
67  struct {
68  const struct mcr_MapElement *key_modifiers;
69  size_t key_modifier_count;
70  };
72  struct {
73  const struct mcr_MapElement *modifier_keys;
74  size_t modifier_key_count;
75  };
76 
79 };
80 
82 extern MCR_API const struct mcr_MapElement *const mcr_key_modifier_defaults;
84 extern MCR_API const size_t mcr_key_modifier_default_count;
86 extern MCR_API const struct mcr_MapElement *const mcr_modifier_key_defaults;
88 extern MCR_API const size_t mcr_modifier_key_default_count;
89 
90 MCR_API int mcr_modifier_key(struct mcr_context *ctx, unsigned int modifiers);
91 MCR_API unsigned int mcr_key_modifier(struct mcr_context *ctx, int key);
92 
93 /* Some extra, possibly useful, utilities */
97 MCR_API bool mcr_resembles_justified(const mcr_Dimensions first,
98  const mcr_Dimensions second);
102 MCR_API bool mcr_resembles_absolute(const mcr_Dimensions first,
103  const mcr_Dimensions second, const unsigned int measurementError);
104 
105 /* Platform signal */
106 struct mcr_HidEcho;
107 struct mcr_Key;
108 struct mcr_MoveCursor;
109 struct mcr_Scroll;
110 MCR_API int mcr_HidEcho_send_member(struct mcr_HidEcho *dataPt, struct mcr_context *ctx);
111 MCR_API int mcr_Key_send_member(struct mcr_Key *dataPt, struct mcr_context *ctx);
112 MCR_API int mcr_MoveCursor_send_member(struct mcr_MoveCursor *dataPt, struct mcr_context *ctx);
113 MCR_API int mcr_Scroll_send_member(struct mcr_Scroll *dataPt, struct mcr_context *ctx);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif
mcr_Scroll - Scroll visible area.
MCR_API const struct mcr_MapElement *const mcr_key_modifier_defaults
MCR_API bool mcr_resembles_absolute(const mcr_Dimensions first, const mcr_Dimensions second, const unsigned int measurementError)
mcr_SpacePosition mcr_Dimensions
Definition: types.h:178
MCR_API const size_t mcr_key_modifier_default_count
Definition: key.h:38
mcr_HidEcho - Simulate human interface with spatial coordinates.
mcr_Modifier - Signal to modify internal modifiers
MCR_API int mcr_Key_send_member(struct mcr_Key *dataPt, struct mcr_context *ctx)
mcr_Action - Conditional trigger from intercepted modifiers
MCR_API int mcr_MoveCursor_send_member(struct mcr_MoveCursor *mcPt, struct mcr_context *ctx)
MCR_API int mcr_HidEcho_send_member(struct mcr_HidEcho *dataPt, struct mcr_context *ctx)
struct mcr_standard_platform * platform_pt
Definition: standard.h:78
MCR_API const size_t mcr_modifier_key_default_count
mcr_NoOp - Pause execution in seconds and milliseconds.
Base module implements mcr_base - Libmacro first module.
MCR_API int mcr_Scroll_send_member(struct mcr_Scroll *dataPt, struct mcr_context *ctx)
mcr_MoveCursor - Change spatial coordinates of cursor.
MCR_API bool mcr_resembles_justified(const mcr_Dimensions first, const mcr_Dimensions second)
mcr_Key - Simulate keyboard keys.
MCR_API const struct mcr_MapElement *const mcr_modifier_key_defaults