- printf("init() <--\n");
- return true;
-}
-
-void AFBClient::requestSurface(const char *label)
-{
- printf("requestSurface(%s) -->\n", label);
- fflush(stdout);
-
- static int num = 0;
- char *key;
- int rc;
- const char begin[] = "{\"drawing_name\":\"";
- const char end[] = "\"}";
- const char verb[] = "request_surface";
- char *parameter = (char *)malloc(strlen(begin) +
- strlen(label) +
- strlen(end) + 1);
- strcpy(parameter, begin);
- strcat(parameter, label);
- strcat(parameter, end);
-
- /* allocates an id for the request */
- rc = asprintf(&key, "%d:%s/%s", ++num, AFBClient::wmAPI, verb);
-
- /* send the request */
- rc = afb_wsj1_call_s(wsj1, AFBClient::wmAPI, verb, parameter, AFBClient::onRequestSurfaceReply, key);
- if (rc < 0)
- fprintf(stderr, "calling %s/%s(%s) failed: %m\n", AFBClient::wmAPI, verb, parameter);
-
- printf("requestSurface(%s) <--\n", label);
- fflush(stdout);
-}
-
-void AFBClient::activateSurface(const char *label)
-{
- printf("activateSurface(%s) -->\n", label);
- fflush(stdout);
-
- const char begin[] = "{\"drawing_name\":\"";
- const char end[] = "\"}";
- const char verb[] = "activate_surface";
- char *parameter = (char *)malloc(strlen(begin) +
- strlen(label) +
- strlen(end) + 1);
- strcpy(parameter, begin);
- strcat(parameter, label);
- strcat(parameter, end);
- call(AFBClient::wmAPI, verb, parameter);
-
- printf("activateSurface(%s) <--\n", label);
- fflush(stdout);
-}
-
-int AFBClient::dispatch() {
- return sd_event_run(loop, -1);
-}
-
-void AFBClient::deactivateSurface(const char *label)
-{
- UNUSED(label);
-}
-
-void AFBClient::endDraw(const char *label)
-{
- UNUSED(label);
-}
-