Logo Search packages:      
Sourcecode: xdotool version File versions  Download package

xdo_t* xdo_new_with_opened_display ( Display *  xdpy,
const char *  display,
int  close_display_when_freed 
)

Create a new xdo_t instance with an existing X11 Display instance.

Parameters:
xdpy the Display pointer given by a previous XOpenDisplay()
display the string display name
close_display_when_freed If true, we will close the display when xdo_free is called. Otherwise, we leave it open.

Definition at line 84 of file xdo.c.

References xdo::close_display_when_freed, xdo::display_name, and xdo::xdpy.

                                                                 {
  xdo_t *xdo = NULL;

  if (xdpy == NULL) {
    fprintf(stderr, "xdo_new: xdisplay I was given is a null pointer\n");
    return NULL;
  }

  /* XXX: Check for NULL here */
  xdo = malloc(sizeof(xdo_t));
  memset(xdo, 0, sizeof(xdo_t));

  xdo->xdpy = xdpy;
  xdo->close_display_when_freed = close_display_when_freed;

  if (display == NULL)
    display = "unknown";

  if (!_xdo_has_xtest(xdo)) {
    fprintf(stderr, "Error: XTEST extension unavailable on '%s'.", 
            xdo->display_name);
    xdo_free(xdo);
    return NULL;
  }

  _xdo_populate_charcode_map(xdo);
  return xdo;
}


Generated by  Doxygen 1.6.0   Back to index