summaryrefslogtreecommitdiff
path: root/src/communications.c
AgeCommit message (Collapse)Author
2013-02-06make TEXT atoms global variablesJérémie Courrèges-Anglas
* (events.c) extract xa_compound_text from selection_request(), make it a global * introduce xa_string (same as XA_STRING) and rename utf8_string to xa_utf8_string, for consistency
2009-07-15silence warnings about signed/unsigned char mismatchBernhard R. Link
2006-03-16remove tabs and trailing whitespace.sabetts
2005-01-15* src/globals.h (RET_SUCCESS): set to 1sabetts
(RET_FAILURE): set to 0 * src/communications.c (receive_command_result) (receive_command_result): fix error deciding when to print to stderr.
2005-01-15 * src/actions.c (ARG_STRING): new definesabetts
(ARG): likewise (set_vars): change to a list_head. (add_set_var): new function (init_set_vars): likewise (user_commands): change to a list_head. Move command definitions to init_user_commands. (add_command): new function (init_user_commands): likewise (cmdret_new): likewise (cmdret_new_printf): likewise (cmdret_free): likewise (read_string): likewise (read_keymap): likewise (read_keydesc): likewise (read_command): likewise (read_shellcmd): likewise (read_frame): likewise (read_window): likewise (read_gravity): likewise (read_group): likewise (read_hook): likewise (read_variable): likewise (hook_completions): likewise (read_number): likewise (read_arg): likewise (parsed_input_to_args): likewise (fill_in_missing_args): likewise (parse_args): likewise (arg_array): likewise (arg_free): likewise (command): use parse_args, parsed_input_to_args, fill_in_missing_args to parse arguments and pass to command functions. (command): return cmdret* structure. prototype updated. (cmd_abort): second arg is an array of struct cmdarg*. Return cmdret*. Updated to use new parsed arguments. (cmd_addhook): likewise (cmd_alias): likewise (cmd_banish): likewise (cmd_bind): likewise (cmd_chdir): likewise (cmd_clrunmanaged): likewise (cmd_colon): likewise (cmd_curframe): likewise (cmd_delete): likewise (cmd_echo): likewise (cmd_escape): likewise (cmd_exec): likewise (cmd_fdump): likewise (cmd_focusdown): likewise (cmd_focuslast): likewise (cmd_focusleft): likewise (cmd_focusright): likewise (cmd_focusup): likewise (cmd_frestore): likewise (cmd_fselect): likewise (cmd_gdelete): likewise (cmd_getenv): likewise (cmd_gmerge): likewise (cmd_gmove): likewise (cmd_gnew): likewise (cmd_gnewbg): likewise (cmd_gnext): likewise (cmd_gprev): likewise (cmd_gravity): likewise (cmd_groups): likewise (cmd_gselect): likewise (cmd_h_split): likewise (cmd_help): likewise (cmd_info): likewise (cmd_kill): likewise (cmd_last): likewise (cmd_lastmsg): likewise (cmd_license): likewise (cmd_link): likewise (cmd_listhook): likewise (cmd_meta): likewise (cmd_msgwait): likewise (cmd_newwm): likewise (cmd_next): likewise (cmd_next_frame): likewise (cmd_nextscreen): likewise (cmd_number): likewise (cmd_only): likewise (cmd_other): likewise (cmd_prev): likewise (cmd_prev_frame): likewise (cmd_prevscreen): likewise (cmd_quit): likewise (cmd_redisplay): likewise (cmd_remhook): likewise (cmd_remove): likewise (cmd_rename): likewise (cmd_resize): likewise (cmd_restart): likewise (cmd_rudeness): likewise (cmd_select): likewise (cmd_setenv): likewise (cmd_shrink): likewise (cmd_source): likewise (cmd_startup_message): likewise (cmd_time): likewise (cmd_tmpwm): likewise (cmd_unalias): likewise (cmd_unbind): likewise (cmd_unimplemented): likewise (cmd_unmanage): likewise (cmd_unsetenv): likewise (cmd_v_split): likewise (cmd_verbexec): likewise (cmd_version): likewise (cmd_warp): likewise (cmd_windows): likewise (cmd_readkey): likewise (cmd_newkmap): likewise (cmd_delkmap): likewise (cmd_definekey): likewise (cmd_undefinekey): likewise (cmd_set): likewise (cmd_sselect): likewise (cmd_ratwarp): likewise (cmd_ratclick): likewise (cmd_ratrelwarp): likewise (cmd_rathold): likewise (cmd_cnext): likewise (cmd_cother): likewise (cmd_cprev): likewise (cmd_dedicate): likewise (cmd_describekey): likewise (cmd_inext): likewise (cmd_iother): likewise (cmd_iprev): likewise (cmd_prompt): likewise (cmd_sdump): likewise (cmd_sfdump): likewise (cmd_undo): likewise (cmd_putsel): likewise (cmd_getsel): likewise (set_resizeunit): arg is an array of struct cmdarg*. Return cmdret*. Updated to use new parsed arguments. (set_wingravity): likewise (set_transgravity): likewise (set_maxsizegravity): likewise (set_bargravity): likewise (set_font): likewise (set_padding): likewise (set_border): likewise (set_barborder): likewise (set_inputwidth): likewise (set_waitcursor): likewise (set_winfmt): likewise (set_winname): likewise (set_fgcolor): likewise (set_bgcolor): likewise (set_barpadding): likewise (set_winliststyle): likewise (set_framesels): likewise (set_maxundos): likewise * src/actions.h: include ratpoison.h (argtype): add arg_FRAME, arg_WINDOW, arg_COMMAND, arg_SHELLCMD, arg_KEYMAP, arg_KEY, arg_GRAVITY, arg_GROUP, arg_HOOK, arg_VARIABLE. (union arg_union): new union (struct cmdarg): new struct (struct argspec): likewise (struct cmdret): likewise (user_command): change func to reflect new command function args. add num_args, ni_required_args, i_required_args. (RP_CMD): new macro for prototyping command functions. all command function prototypes updated to use this macro. (init_user_commands): new prototype (cmdret_free): likewise * src/main.c (read_rc_file): handle cmdret* returned by command. (main): call init_user_commands * src/linkedlist.h (list_size): new prototype * src/linkedlist.c (list_size): new function * src/globals.h (RET_SUCCESS): new define (RET_FAILURE): new define * src/events.c (handle_key): handle the cmdret structure returned by command. (execute_remote_command): return cmdret*. (receive_command): mark the command return string as error or output before sending. * src/data.h (struct rp_action): change data element type to char* * src/communications.c (receive_command_result): print command output to stderr if marked as an error.
2004-12-04update copyright.sabetts
2004-12-02Updated copyright notices.sabetts
2004-11-18* src/window.c (unhide_transient_for): add a newline to debuggingsabetts
output. (hide_transient_for_between): likewise. * src/manage.c (get_wmname): typecast name when passing to xstrdup. * src/main.c (main): typecast command[i] when passing to send_command. * src/events.c (execute_remote_command): typecast req[1] when passing to command. (receive_command): typecast result when passing to XChangeProperty. * src/editor.c (editor_history_previous): Add newline to debugging output. (editor_history_next): likewise. (paste_primary_selection): typecast data when passing to editor_insert. * src/communications.c (receive_command_result): typecast result when passing to strlen. (send_command): typecast cmd when passing the XChangeProperty. * src/actions.c (user_commands): add focusprev (cmd_prev): clean up (cmd_next): likewise (cmd_prev_frame): call find_frame_prev instead of find_frame_next. (cmd_frestore): grab the frame's number first when processing the frames.
2004-10-05* src/screen.h (is_a_root_window): new prototypesabetts
* src/screen.c (is_a_root_window): new function * src/events.c (property_notify): check for ratpoison commands on every root window, not just the default root window. * src/communications.c (send_command): store the root window in a variable, root. and use it whenever the root window is needed.
2003-11-29* src/communications.c (receive_command_result): Rename fromrcyeske
recieve_command_result. From paxed. * src/events.c (handle_signals): s/recieve/receive.
2003-11-18* contrib/rpshowall.sh: store ratpoison binary location insabetts
RATPOISON env var. * src/ratpoison.h (FD_CLOEXEC): new define (set_close_on_exec): new prototype * src/main.c (ratpoison_longopts): add "interactive" option. (ratpoison_opts): likewise (print_help): print a help line for interactive option. (set_close_on_exec): new function (read_startup_files): call set_close_on_exec on file pointer (main): parse interactive command line option and pass it to send_command. * src/events.c (execute_remote_command): pass the interactive bit to command. * src/communications.c (send_command): send an interactive bit at the beginning of the message. Take an interactive argument. All callers updated. Prototype updated. * src/actions.c (cmd_source): call set_close_on_exec on file pointer.
2003-05-25* src/window.c: do not include ctype.hsabetts
* src/ratpoison.h (str_comp): new prototype * src/messages.h (MESSAGE_PROMPT_SWITCH_TO_GROUP): new define * src/main.c: include ctype.h (str_comp): moved from window.c * src/group.h (groups_find_group_by_name): new prototype. (groups_find_group_by_number): likewise. (groups_merge): likewise (group_move_window): likewise * src/group.c: include string.h (group_new): new argument, name. All callers updated. prototype updated. (init_groups): create the first group with DEFAULT_GROUP_NAME as its name. (group_new): new argument, name. All callers updated. Prototype updated. (group_free): free the group's name. (group_add_new_group): new argument, name. All callers updated. Prototype updated. (groups_find_group_by_name): new function (groups_find_group_by_number): likewise (group_move_window): likewise (groups_merge): likewise * src/conf.h (DEFAULT_GROUP_NAME): new define * src/actions.h (cmd_gselect): new prototype (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise (cmd_gnewbg): likewise * src/actions.c (user_commands): new commands gselect, groups, gmove, gmerge, gnewbg. (cmd_gnewbg): new function (find_group): likewise (cmd_gselect): likewise (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise
2003-04-14* src/main.c (main): if the screen was specified on thesabetts
command-line, send the command to the correct screen. * src/communications.c (send_command): new argument, screen_num. Get the root window for the specified screen. prototype updated.
2003-02-27* src/main.c (free_screen): new functionsabetts
(clean_up): call free_screen on each screen. free the screen array. free defaults.window_fmt. * src/number.h (free_numbers): new prototype * src/number.c (free_numbers): new function * src/manage.c (get_wmname): use XGetWindowProperty to get the window name. (unmanaged_window): free wname after using it. * src/main.c (wm_name): new global (main): internalize WM_NAME atom. (clean_up): free data structures for keybindings, aliases, the bar, window numbers, and input history. * src/input.h (free_history): new prototype * src/input.c (free_history): new function * src/events.c (execute_remote_command): free properties returned by XGetWindowProperty(). * src/data.h (wm_name): new extern * src/communications.c (recieve_command_result): free properties returned by XGetWindowProperty(). * src/bar.h (free_bar): new prototype * src/bar.c (update_window_names): bar_buffer is not static. (update_window_names): free bar_buffer after using it. (marked_message): free the GC after using it. (free_bar): new function. * src/actions.h (free_keybindings): new prototype (free_aliases): likewise * src/actions.c (free_keybindings): new function (free_aliases): likewise (cmd_tmpwm): unmap the key window before calling the new wm, and remap it afterwards.
2002-02-20* src/split.c: include string.hsabetts
* src/sbuf.c: likewise * src/events.c: likewise * src/communications.c: likewise
2001-09-21* src/split.h (find_frame_up): new prototypesabetts
(find_frame_down): likewise (find_frame_left): likewise (find_frame_right): likewise * src/split.c (find_frame_up): new function (find_frame_down): likewise (find_frame_left): likewise (find_frame_right): likewise * src/manage.c (move_window): use x11 gravity constants to denote gravity. * src/main.c (ratpoison_longopts): remove --kill and --restart. Dependant code updated. (init_defaults): use x11 gravity constants to denote gravity. (main): only display the startup message if defaults.startup_message is on. * src/list.c (update_window_gravity): rename from update_window_position. dependant code updated * src/events.c (client_msg): don't test for restart or kill client messages. (client_msg): properly handle iconify requests. (get_event): kill and restart the process here. * src/data.h (TOP_LEFT): remove define (TOP_CENTER): likewise (TOP_RIGHT): likewise (CENTER_LEFT): likewise (CENTER_CENTER): likewise (CENTER_RIGHT): likewise (BOTTOM_LEFT): likewise (BOTTOM_CENTER): likewise (BOTTOM_RIGHT): likewise (struct rp_window): rename field to position to gravity. (struct rp_defaults): rename win_pos to win_gravity, trans_pos to trans_gravity and maxsize_pos to maxsize_gravity. (rp_restart): remove global variable (rp_kill): likewise * src/communications.h (send_kill): remove prototype (send_restart): likewise * src/communications.c (send_restart): remove function. obsolete. (send_kill): likewise * src/bar.c (bar_x): Use X11 gravity constants to denote location. (bar_y): likewise * src/actions.h (cmd_focusup): new prototype (cmd_focusdown): likewise (cmd_focusleft): likewise (cmd_focusright): likewise (cmd_startup_message): likewise (cmd_restart): likewise * src/actions.c (cmd_quit): just set the kill_signalled variable. (parse_wingravity): use compass directions to describe the gravity (parse_wingravity): renamed from parse_winpos. dependant code updated. (cmd_gravity): renamed from cmd_pos. dependant code updated. (cmd_defwingravity): renamed from cmd_defwinpos. dependant code updated. (cmd_deftransgravity): renamed from cmd_deftranspos. dependant code updated. (cmd_defmaxsizegravity): renamed from cmd_defmaxsizepos. dependant code updated. (cmd_focusup): new function (cmd_focusdown): likewise (cmd_focusleft): likewise (cmd_focusright): likewise (cmd_restart): likewise (cmd_startup_message): likewise (user_commands): new commands "focusup" "focusdown" "focusright" "focusleft" "startup_message" "restart".
2001-08-27code cleanup, unmap_notify bug fixessabetts
2001-08-18commands can be called interactively and non-interactively. commands return ↵sabetts
a result string
2001-03-29better command functionalitysabetts
2001-03-19* src/main.c (ratpoison_longopts): add --command to recognizedsabetts
command-line options. * src/communications.h (send_command): new function prototype * src/data.h (rp_command): new global variable * src/events.c (receive_command): new function (property_notify): handles rp_command Atoms * src/communications.c (send_command): new function * src/main.c (print_help): prints help for --command (main): handles --command command-line option
2001-02-15header cleanups & copyright year update & coalgernon
2001-02-10* communications.c (send_restart, send_kill): Addedsabetts
* ratpoison.h: includes communications.h * main.c (send_restart, send_kill): Moved to communications.c * list.c (get_mouse_root_position): Added (add_to_window_list): Initialize new rp_window fields (save_mouse_position): Added (set_active_window): Added code to save and restore the position of the mouse * events.c (property_notify): Added code to listen for a WM_TRANSIENT_FOR property change. * data.h (struct rp_window): Added transient, transient_for, mouse_x, mouse_y. * actions.c (maximize_transient): Added (maximize): Added code to handle transient windows differently * Makefile.am (ratpoison_SOURCES): Added communications.h and communications.c