From 4d8f736888937041c339ebf5ad84a787f66719b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 18 Aug 2004 15:40:08 +0000 Subject: [PATCH] Change to shared command constants git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8601 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Input.cpp | 21 ++++++------- src/kits/interface/InterfaceDefs.cpp | 44 +++++++++++++++------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/kits/interface/Input.cpp b/src/kits/interface/Input.cpp index 3d1c6a78b0..f48f8f2250 100644 --- a/src/kits/interface/Input.cpp +++ b/src/kits/interface/Input.cpp @@ -35,6 +35,7 @@ #include // Project Includes ------------------------------------------------------------ +#include "InputServerTypes.h" // Local Includes -------------------------------------------------------------- @@ -77,7 +78,7 @@ void PrintDevices() //------------------------------------------------------------------------------ BInputDevice *find_input_device(const char *name) { - BMessage command('Ifdv'); + BMessage command(IS_FIND_DEVICES); BMessage reply; command.AddString("device", name); @@ -104,7 +105,7 @@ status_t get_input_devices(BList *list) { list->MakeEmpty(); - BMessage command('Ifdv'); + BMessage command(IS_FIND_DEVICES); BMessage reply; status_t err = _control_input_server_(&command, &reply); @@ -132,7 +133,7 @@ status_t get_input_devices(BList *list) //------------------------------------------------------------------------------ status_t watch_input_devices(BMessenger target, bool start) { - BMessage command('Iwdv'); + BMessage command(IS_WATCH_DEVICES); BMessage reply; command.AddMessenger("target", target); @@ -162,7 +163,7 @@ bool BInputDevice::IsRunning() const if (!fName) return false; - BMessage command('Idvr'); + BMessage command(IS_IS_DEVICE_RUNNING); BMessage reply; command.AddString("device", fName); @@ -175,7 +176,7 @@ status_t BInputDevice::Start() if (!fName) return B_ERROR; - BMessage command('Istd'); + BMessage command(IS_START_DEVICE); BMessage reply; command.AddString("device", fName); @@ -188,7 +189,7 @@ status_t BInputDevice::Stop() if (!fName) return B_ERROR; - BMessage command('Ispd'); + BMessage command(IS_STOP_DEVICE); BMessage reply; command.AddString("device", fName); @@ -201,7 +202,7 @@ status_t BInputDevice::Control(uint32 code, BMessage *message) if (!fName) return B_ERROR; - BMessage command('Icnd'); + BMessage command(IS_CONTROL_DEVICES); BMessage reply; command.AddString("device", fName); @@ -220,7 +221,7 @@ status_t BInputDevice::Control(uint32 code, BMessage *message) //------------------------------------------------------------------------------ status_t BInputDevice::Start(input_device_type type) { - BMessage command('Istd'); + BMessage command(IS_START_DEVICE); BMessage reply; command.AddInt32("type", type); @@ -230,7 +231,7 @@ status_t BInputDevice::Start(input_device_type type) //------------------------------------------------------------------------------ status_t BInputDevice::Stop(input_device_type type) { - BMessage command('Ispd'); + BMessage command(IS_STOP_DEVICE); BMessage reply; command.AddInt32("type", type); @@ -241,7 +242,7 @@ status_t BInputDevice::Stop(input_device_type type) status_t BInputDevice::Control(input_device_type type, uint32 code, BMessage *message) { - BMessage command('Icnd'); + BMessage command(IS_CONTROL_DEVICES); BMessage reply; command.AddInt32("type", type); diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp index 7a7544a2e0..7622be5bd0 100644 --- a/src/kits/interface/InterfaceDefs.cpp +++ b/src/kits/interface/InterfaceDefs.cpp @@ -43,6 +43,8 @@ // Private definitions not placed in public headers extern "C" void _init_global_fonts(); extern "C" status_t _fini_interface_kit_(); + +#include "InputServerTypes.h" extern status_t _control_input_server_(BMessage *command, BMessage *reply); using namespace BPrivate; @@ -106,7 +108,7 @@ set_scroll_bar_info(scroll_bar_info *info) _IMPEXP_BE status_t get_mouse_type(int32 *type) { - BMessage command('Igmt'); + BMessage command(IS_GET_MOUSE_TYPE); BMessage reply; _control_input_server_(&command, &reply); @@ -121,7 +123,7 @@ get_mouse_type(int32 *type) _IMPEXP_BE status_t set_mouse_type(int32 type) { - BMessage command('Ismt'); + BMessage command(IS_SET_MOUSE_TYPE); BMessage reply; command.AddInt32("mouse_type", type); @@ -132,7 +134,7 @@ set_mouse_type(int32 type) _IMPEXP_BE status_t get_mouse_map(mouse_map *map) { - BMessage command('Igmm'); + BMessage command(IS_GET_MOUSE_MAP); BMessage reply; const void *data = 0; int32 count; @@ -151,7 +153,7 @@ get_mouse_map(mouse_map *map) _IMPEXP_BE status_t set_mouse_map(mouse_map *map) { - BMessage command('Ismm'); + BMessage command(IS_SET_MOUSE_MAP); BMessage reply; command.AddData("mousemap", B_ANY_TYPE, map, sizeof(mouse_map)); @@ -161,7 +163,7 @@ set_mouse_map(mouse_map *map) _IMPEXP_BE status_t get_click_speed(bigtime_t *speed) { - BMessage command('Igcs'); + BMessage command(IS_GET_CLICK_SPEED); BMessage reply; _control_input_server_(&command, &reply); @@ -176,7 +178,7 @@ get_click_speed(bigtime_t *speed) _IMPEXP_BE status_t set_click_speed(bigtime_t speed) { - BMessage command('Iscs'); + BMessage command(IS_SET_CLICK_SPEED); BMessage reply; command.AddInt64("speed", speed); return _control_input_server_(&command, &reply) == B_OK; @@ -186,7 +188,7 @@ set_click_speed(bigtime_t speed) _IMPEXP_BE status_t get_mouse_speed(int32 *speed) { - BMessage command('Igms'); + BMessage command(IS_GET_MOUSE_SPEED); BMessage reply; _control_input_server_(&command, &reply); @@ -201,7 +203,7 @@ get_mouse_speed(int32 *speed) _IMPEXP_BE status_t set_mouse_speed(int32 speed) { - BMessage command('Isms'); + BMessage command(IS_SET_MOUSE_SPEED); BMessage reply; command.AddInt32("speed", speed); return _control_input_server_(&command, &reply) == B_OK; @@ -211,7 +213,7 @@ set_mouse_speed(int32 speed) _IMPEXP_BE status_t get_mouse_acceleration(int32 *speed) { - BMessage command('Igma'); + BMessage command(IS_GET_MOUSE_ACCELERATION); BMessage reply; _control_input_server_(&command, &reply); @@ -226,7 +228,7 @@ get_mouse_acceleration(int32 *speed) _IMPEXP_BE status_t set_mouse_acceleration(int32 speed) { - BMessage command('Isma'); + BMessage command(IS_SET_MOUSE_ACCELERATION); BMessage reply; command.AddInt32("speed", speed); return _control_input_server_(&command, &reply) == B_OK; @@ -236,7 +238,7 @@ set_mouse_acceleration(int32 speed) _IMPEXP_BE status_t get_key_repeat_rate(int32 *rate) { - BMessage command('Igrr'); + BMessage command(IS_GET_KEY_REPEAT_RATE); BMessage reply; _control_input_server_(&command, &reply); @@ -251,7 +253,7 @@ get_key_repeat_rate(int32 *rate) _IMPEXP_BE status_t set_key_repeat_rate(int32 rate) { - BMessage command('Isrr'); + BMessage command(IS_SET_KEY_REPEAT_RATE); BMessage reply; command.AddInt32("rate", rate); return _control_input_server_(&command, &reply) == B_OK; @@ -261,7 +263,7 @@ set_key_repeat_rate(int32 rate) _IMPEXP_BE status_t get_key_repeat_delay(bigtime_t *delay) { - BMessage command('Igrd'); + BMessage command(IS_GET_KEY_REPEAT_DELAY); BMessage reply; _control_input_server_(&command, &reply); @@ -276,7 +278,7 @@ get_key_repeat_delay(bigtime_t *delay) _IMPEXP_BE status_t set_key_repeat_delay(bigtime_t delay) { - BMessage command('Isrd'); + BMessage command(IS_SET_KEY_REPEAT_DELAY); BMessage reply; command.AddInt64("delay", delay); return _control_input_server_(&command, &reply) == B_OK; @@ -286,7 +288,7 @@ set_key_repeat_delay(bigtime_t delay) _IMPEXP_BE uint32 modifiers() { - BMessage command('Igmd'); + BMessage command(IS_GET_MODIFIERS); BMessage reply; int32 err, modifier; @@ -305,7 +307,7 @@ modifiers() _IMPEXP_BE status_t get_key_info(key_info *info) { - BMessage command('Igki'); + BMessage command(IS_GET_KEY_INFO); BMessage reply; const void *data = 0; int32 count, err; @@ -326,7 +328,7 @@ get_key_info(key_info *info) _IMPEXP_BE void get_key_map(key_map **map, char **key_buffer) { - BMessage command('Igkm'); + BMessage command(IS_GET_KEY_MAP); BMessage reply; int32 map_count, key_count; const void *map_array = 0, *key_array = 0; @@ -355,7 +357,7 @@ get_key_map(key_map **map, char **key_buffer) _IMPEXP_BE status_t get_keyboard_id(uint16 *id) { - BMessage command('Igid'); + BMessage command(IS_GET_KEYBOARD_ID); BMessage reply; uint16 kid; @@ -371,7 +373,7 @@ get_keyboard_id(uint16 *id) _IMPEXP_BE void set_modifier_key(uint32 modifier, uint32 key) { - BMessage command('Ismk'); + BMessage command(IS_SET_MODIFIER_KEY); BMessage reply; command.AddInt32("modifier", modifier); @@ -383,7 +385,7 @@ set_modifier_key(uint32 modifier, uint32 key) _IMPEXP_BE void set_keyboard_locks(uint32 modifiers) { - BMessage command('Iskl'); + BMessage command(IS_SET_KEYBOARD_LOCKS); BMessage reply; command.AddInt32("locks", modifiers); @@ -639,7 +641,7 @@ void __set_window_decor(int32 theme) _IMPEXP_BE status_t _restore_key_map_() { - BMessage message('Iskm'); + BMessage message(IS_RESTORE_KEY_MAP); BMessage reply; return _control_input_server_(&message, &reply);