+ * @brief add a mode to a display
+ * @param root window to which's screen's ressources are added
+ * @param mode_info
+ * @return Ecore_X_Randr_Mode of the added mode. Ecore_X_Randr_None if mode
+ * adding failed.
+ * @since 1.2.0
+ */
+EAPI Ecore_X_Randr_Mode
+ecore_x_randr_mode_info_add(Ecore_X_Window root, Ecore_X_Randr_Mode_Info *mode_info)
+{
+#ifdef ECORE_XCB_RANDR
+ Ecore_X_Randr_Mode mode = Ecore_X_Randr_None;
+ xcb_randr_create_mode_cookie_t cookie;
+ xcb_randr_create_mode_reply_t *reply;
+ xcb_randr_mode_info_t info;
+ int namelen = 0;
+#endif
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ CHECK_XCB_CONN;
+
+#ifdef ECORE_XCB_RANDR
+ RANDR_CHECK_1_2_RET(EINA_FALSE);
+
+ if (!mode_info) return Ecore_X_Randr_None;
+ if (!_ecore_xcb_randr_root_validate(root)) return Ecore_X_Randr_None;
+
+ namelen = strlen(mode_info->name);
+
+ memset(&info, 0, sizeof(info));
+ info.width = mode_info->width;
+ info.height = mode_info->height;
+ info.dot_clock = mode_info->dotClock;
+ info.hsync_start = mode_info->hSyncStart;
+ info.hsync_end = mode_info->hSyncEnd;
+ info.htotal = mode_info->hTotal;
+ info.hskew = mode_info->hSkew;
+ info.vsync_start = mode_info->vSyncStart;
+ info.vsync_end = mode_info->vSyncEnd;
+ info.vtotal = mode_info->vTotal;
+ info.mode_flags = mode_info->modeFlags;
+ info.name_len = namelen;
+
+ cookie =
+ xcb_randr_create_mode_unchecked(_ecore_xcb_conn, root, info,
+ namelen, mode_info->name);
+ reply = xcb_randr_create_mode_reply(_ecore_xcb_conn, cookie, NULL);
+ if (reply)
+ {
+ mode = mode_info->xid;
+ free(reply);
+ }
+#endif
+ return mode;
+}
+
+/*