static void add_trailing_cap (struct stroker *stroker, const cairo_stroke_face_t *face, struct stroke_contour *c) { add_cap (stroker, face, c); }
static void add_leading_cap (struct stroker *stroker, const cairo_stroke_face_t *face) { cairo_stroke_face_t reversed; cairo_point_t t; reversed = *face; /* The initial cap needs an outward facing vector. Reverse everything */ reversed.usr_vector.x = -reversed.usr_vector.x; reversed.usr_vector.y = -reversed.usr_vector.y; reversed.dev_vector.dx = -reversed.dev_vector.dx; reversed.dev_vector.dy = -reversed.dev_vector.dy; t = reversed.cw; reversed.cw = reversed.ccw; reversed.ccw = t; add_cap (stroker, &reversed); }
static unsigned char send_device_info(IEContext* ctx, unsigned int reply_id) { dterm_mark_t msg; dterm_t dt; int len = 0; char name[256]; char topology[256]; char uniq_id[256]; struct input_id id; // Get device id. if (ioctl(ctx->mDescriptor, EVIOCGID, &id) < 0) { return IEDRV_RES_IO_ERROR; } if ((len = ioctl(ctx->mDescriptor, EVIOCGNAME(sizeof(name) - 1), name)) < 0) { return IEDRV_RES_IO_ERROR; } name[len] = 0; if ((len = ioctl(ctx->mDescriptor, EVIOCGPHYS(sizeof(topology) - 1), topology)) < 0) { return IEDRV_RES_IO_ERROR; } topology[len] = 0; if ((len = ioctl(ctx->mDescriptor, EVIOCGUNIQ(sizeof(uniq_id) - 1), uniq_id)) < 0) uniq_id[0] = 0; uniq_id[len] = 0; dterm_init(&dt); dterm_tuple_begin(&dt, &msg); { dterm_mark_t prop; dterm_atom(&dt, ie_device_info); dterm_port(&dt, ctx->mDport); dterm_int(&dt, reply_id); // // Setup { id, Bustype, Vendor, Product, Version, Name} // dterm_tuple_begin(&dt, &prop); { dterm_atom(&dt, ie_drv_dev_id); dterm_string(&dt, uniq_id, strlen(uniq_id)); dterm_string(&dt, name, strlen(name)); dterm_atom(&dt, *bus_atoms[id.bustype]); dterm_int(&dt, id.vendor); dterm_int(&dt, id.product); dterm_int(&dt, id.version); dterm_string(&dt, topology, strlen(topology)); // // Setup [{ capability, [ { Cap, [X] }, { Cap, [Y] }, ...}, ...] // add_cap(&dt, ctx->mDescriptor); dterm_tuple_end(&dt, &prop); } } dterm_tuple_end(&dt, &msg); driver_output_term(ctx->mPort, dterm_data(&dt), dterm_used_size(&dt)); dterm_finish(&dt); return IEDRV_RES_OK; }
static void add_trailing_cap (struct stroker *stroker, const cairo_stroke_face_t *face) { add_cap (stroker, face); }