+ omapsdl_input_get_events(0, key_event_cb,
+ read_tslib ? ts_event_cb : NULL, this);
+}
+
+static void omap_SetCaption(SDL_VideoDevice *this, const char *title, const char *icon)
+{
+ void *display = NULL, *window = NULL;
+ int screen = 0;
+ int ret;
+
+ ret = osdl_video_get_window(&display, &screen, &window);
+ if (ret == 0) {
+ x11reuse_SetCaption(this->hidden->x11reuse_context,
+ display, screen, window, title, icon);
+ }
+}
+
+static void omap_SetIcon(SDL_VideoDevice *this, SDL_Surface *icon, Uint8 *mask)
+{
+ struct SDL_PrivateVideoData *pdata = this->hidden;
+ void *display = NULL, *window = NULL;
+ int screen = 0;
+ int ret;
+
+ ret = osdl_video_get_window(&display, &screen, &window);
+ if (ret == 0) {
+ x11reuse_SetIcon(pdata->x11reuse_context,
+ display, screen, window, icon, mask);
+ }
+ else {
+ SDL_Surface *old_icon = pdata->delayed_icon;
+ void *old_icon_mask = pdata->delayed_icon_mask;
+ int mask_size = ((icon->w + 7) / 8) * icon->h;
+
+ pdata->delayed_icon = SDL_ConvertSurface(icon,
+ icon->format, icon->flags);
+ if (pdata->delayed_icon != NULL) {
+ memcpy(pdata->delayed_icon->pixels, icon->pixels,
+ icon->pitch * icon->h);
+ }
+ if (mask != NULL) {
+ pdata->delayed_icon_mask = malloc(mask_size);
+ if (pdata->delayed_icon_mask)
+ memcpy(pdata->delayed_icon_mask, mask, mask_size);
+ }
+
+ if (old_icon != NULL)
+ SDL_FreeSurface(old_icon);
+ if (old_icon_mask)
+ free(old_icon_mask);
+ }