Changeset 1080


Ignore:
Timestamp:
Jun 1, 2008 11:42:03 PM (5 years ago)
Author:
dkg
Message:

xdotool: reverting to upstream sources -- changes do not appear needed

Location:
trunk/xdotool
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/xdotool/xdo.c

    r1079 r1080  
    2828static int _xdo_has_xtest(xdo_t *xdo); 
    2929 
    30 static KeyCode _xdo_keycode_from_char(xdo_t *xdo, char key); 
     30static int _xdo_keycode_from_char(xdo_t *xdo, char key); 
    3131static int _xdo_get_shiftcode_if_needed(xdo_t *xdo, char key); 
    3232 
     
    3636                                   int *window_list_size); 
    3737 
    38 static int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, uint **keys, uint *nkeys); 
     38static int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, int **keys, int *nkeys); 
    3939static int _xdo_keysequence_do(xdo_t *xdo, char *keyseq, int pressed); 
    4040static int _xdo_regex_match_window(xdo_t *xdo, Window window, int flags, regex_t *re); 
     
    124124  int matched_window_list_size = 100; 
    125125 
    126   int ret, i; 
     126  int ret; 
    127127  int i; 
    128128 
     
    181181  XWindowChanges wc; 
    182182  int ret; 
    183   uint cw_flags = 0; 
     183  int cw_flags = 0; 
    184184 
    185185  wc.width = width; 
     
    418418} 
    419419 
    420 int xdo_mousedown(xdo_t *xdo, uint button) { 
     420int xdo_mousedown(xdo_t *xdo, int button) { 
    421421  int ret; 
    422422  ret = XTestFakeButtonEvent(xdo->xdpy, button, True, CurrentTime); 
     
    425425} 
    426426 
    427 int xdo_mouseup(xdo_t *xdo, uint button) { 
     427int xdo_mouseup(xdo_t *xdo, int button) { 
    428428  int ret; 
    429429  ret = XTestFakeButtonEvent(xdo->xdpy, button, False, CurrentTime); 
     
    432432} 
    433433 
    434 int xdo_click(xdo_t *xdo, uint button) { 
     434int xdo_click(xdo_t *xdo, int button) { 
    435435  int ret; 
    436436  ret = xdo_mousedown(xdo, button); 
     
    447447  int i = 0; 
    448448  char key = '0'; 
    449   KeyCode keycode = 0; 
    450   uint shiftcode = 0; 
     449  int keycode = 0; 
     450  int shiftcode = 0; 
    451451 
    452452  for (i = 0; string[i] != '\0'; i++) { 
     
    470470 
    471471int _xdo_keysequence_do(xdo_t *xdo, char *keyseq, int pressed) { 
    472   uint *keys = NULL; 
    473   uint nkeys; 
    474   uint i; 
     472  int *keys = NULL; 
     473  int nkeys; 
    475474  int i; 
    476475 
     
    481480 
    482481  for (i = 0; i < nkeys; i++) { 
    483     /* fprintf(stderr, "Typing %d (%d)\n", keys[i], pressed); */ 
     482    //fprintf(stderr, "Typing %d (%d)\n", keys[i], pressed); 
    484483    XTestFakeKeyEvent(xdo->xdpy, keys[i], pressed, CurrentTime); 
    485484  } 
     
    514513 
    515514/* Helper functions */ 
    516 static KeyCode _xdo_keycode_from_char(xdo_t *xdo, char key) { 
     515static int _xdo_keycode_from_char(xdo_t *xdo, char key) { 
    517516  int i = 0; 
    518517  int len = xdo->keycode_high - xdo->keycode_low; 
     
    522521      return xdo->charcodes[i].code; 
    523522 
    524   return (KeyCode)-1; 
     523  return -1; 
    525524} 
    526525 
     
    545544  int keycodes_length = 0; 
    546545  int shift_keycode = 0; 
    547   KeyCode i; 
    548   int j; 
     546  int i, j; 
    549547 
    550548  XDisplayKeycodes(xdo->xdpy, &(xdo->keycode_low), &(xdo->keycode_high)); 
     
    604602                                   int *window_list_size) { 
    605603  Window dummy; 
    606 <<<<<<< .working 
    607   uint i; 
    608 ======= 
    609 >>>>>>> .merge-right.r1078 
    610604  Window *children; 
    611605  unsigned int i, nchildren; 
     
    637631} 
    638632 
    639 int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, uint **keys, uint *nkeys) { 
     633int _xdo_keysequence_to_keycode_list(xdo_t *xdo, char *keyseq, int **keys, int *nkeys) { 
    640634  char *tokctx = NULL; 
    641635  const char *tok = NULL; 
     
    644638   
    645639  /* Array of keys to press, in order given by keyseq */ 
    646   uint keys_size = 10; 
     640  int keys_size = 10; 
    647641  *nkeys = 0; 
    648642 
     
    655649  strptr = strdup(keyseq); 
    656650  while ((tok = strtok_r(strptr, "+", &tokctx)) != NULL) { 
    657     KeySym keysym; 
     651    int keysym; 
    658652    if (strptr != NULL) 
    659653      strptr = NULL; 
     
    788782  } 
    789783 
    790 <<<<<<< .working 
    791   /* yay = strdup("ctrl+l"); */ 
    792 ======= 
    793784  if (actual_format == 32) 
    794785    nbytes = sizeof(long); 
     
    799790  else if (actual_format == 0) 
    800791    nbytes = 0; 
    801 >>>>>>> .merge-right.r1078 
    802  
    803 <<<<<<< .working 
    804   xdo = xdo_new(display_name); 
    805 /*   xdo_mousemove(xdo, 100, 100); */ 
    806 /*   usleep(100 * 1000); */ 
    807 /*   xdo_keysequence(xdo, strdup("ctrl+l")); */ 
    808 /*   xdo_type(xdo, strdup("ls")); */ 
    809 /*   xdo_keysequence(xdo, strdup("Return")); */ 
    810 ======= 
     792 
    811793  *nitems = _nitems; 
    812794  *type = actual_type; 
     
    814796  return prop; 
    815797} 
    816 >>>>>>> .merge-right.r1078 
    817798 
    818799int _xdo_ewmh_is_supported(xdo_t *xdo, const char *feature) { 
  • trunk/xdotool/xdo.h

    r1079 r1080  
    2727typedef struct charcodemap { 
    2828  char key; 
    29   KeyCode code; 
     29  int code; 
    3030  int shift; 
    3131} charcodemap_t; 
     
    4848int xdo_mousemove(xdo_t *xdo, int x, int y); 
    4949int xdo_mousemove_relative(xdo_t *xdo, int x, int y); 
    50 int xdo_mousedown(xdo_t *xdo, uint button); 
    51 int xdo_mouseup(xdo_t *xdo, uint button); 
     50int xdo_mousedown(xdo_t *xdo, int button); 
     51int xdo_mouseup(xdo_t *xdo, int button); 
    5252 
    53 int xdo_click(xdo_t *xdo, uint button); 
     53int xdo_click(xdo_t *xdo, int button); 
    5454 
    5555int xdo_type(xdo_t *xdo, char *string); 
  • trunk/xdotool/xdotool.c

    r1079 r1080  
    125125void cmd_help(int argc, char **args) { 
    126126  int i; 
    127  
    128   /* touch to clean up warnings (we want the parameters to stick 
    129      around because of the use of function pointers) */ 
    130   argc = 0; 
    131   args = NULL; 
    132    
    133127  printf("Available commands:\n"); 
    134128  for (i = 0; dispatch[i].name != NULL; i++) 
     
    173167 
    174168void cmd_mousedown(int argc, char **args) { 
    175   uint button; 
     169  int button; 
    176170  char *cmd = *args; argc--; args++; 
    177171 
     
    190184 
    191185void cmd_mouseup(int argc, char **args) { 
    192   uint button; 
     186  int button; 
    193187  char *cmd = *args; argc--; args++; 
    194188 
     
    237231    return; 
    238232  } 
     233 
     234  int (*func)(xdo_t *, char *) = NULL; 
    239235 
    240236  if (!strcmp(cmd, "key")) { 
Note: See TracChangeset for help on using the changeset viewer.