xfw = xf_CreateWindow((xfInfo*) rail->extra,
window->windowOffsetX, window->windowOffsetY,
- window->windowWidth, window->windowHeight, "RAIL");
+ window->windowWidth, window->windowHeight, window->title);
window->extra = (void*) xfw;
window->extraId = (void*) xfw->handle;
}
+void xf_rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
+{
+ xfWindow* xfw;
+ xfw = (xfWindow*) window->extra;
+ xf_DestroyWindow((xfInfo*) rail->extra, xfw);
+}
+
void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail)
{
rail->extra = (void*) xfi;
rail->CreateWindow = xf_rail_CreateWindow;
+ rail->DestroyWindow = xf_rail_DestroyWindow;
}
void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChanMan* chanman, RDP_EVENT* event)
if (class_hints != NULL)
{
- if (name != NULL)
- class_hints->res_name = name;
-
+ class_hints->res_name = "rail";
class_hints->res_class = "freerdp";
XSetClassHint(xfi->display, window->handle, class_hints);
XFree(class_hints);
window->gc = XCreateGC(xfi->display, window->handle, GCGraphicsExposures, &gcv);
window->surface = XCreatePixmap(xfi->display, window->handle, window->width, window->height, xfi->depth);
+ XStoreName(xfi->display, window->handle, name);
+
window_move(xfi, window, x, y, width, height);
}
return window;
}
-void window_destroy(xfInfo* xfi, xfWindow* window)
+void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
{
+ XFreeGC(xfi->display, window->gc);
+ XFreePixmap(xfi->display, window->surface);
+ XUnmapWindow(xfi->display, window->handle);
XDestroyWindow(xfi->display, window->handle);
xfree(window);
}
void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show);
xfWindow* window_create(xfInfo* xfi, char* name);
-void window_destroy(xfInfo* xfi, xfWindow* window);
+void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char* name);
+void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
#endif /* __XF_WINDOW_H */
XFreeGC(xfi->display, xfi->gc);
xfi->gc = 0;
- window_destroy(xfi, xfi->window);
+ xf_DestroyWindow(xfi, xfi->window);
xfi->window = NULL;
if (xfi->primary)
#include <freerdp/rail/window_list.h>
typedef void (*railCreateWindow)(rdpRail* rail, rdpWindow* window);
+typedef void (*railDestroyWindow)(rdpRail* rail, rdpWindow* window);
struct rdp_rail
{
void* extra;
+ UNICONV* uniconv;
rdpWindowList* list;
railCreateWindow CreateWindow;
+ railDestroyWindow DestroyWindow;
};
FREERDP_API void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);
{
void* extra;
void* extraId;
+ char* title;
rdpWindow* prev;
rdpWindow* next;
uint32 windowId;
update_read_cached_icon_info(s, &window_cached_icon->cachedIcon); /* cachedIcon (CACHED_ICON_INFO) */
}
-void update_read_window_deleted_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo)
+void update_read_window_delete_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo)
{
/* window deletion event */
}
else if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_DELETED)
{
DEBUG_WND("Window Deleted Order");
- update_read_window_deleted_order(s, orderInfo);
+ update_read_window_delete_order(s, orderInfo);
IFCALL(update->WindowDelete, update, orderInfo);
}
else
update_read_cached_icon_info(s, ¬ify_icon_state->cachedIcon); /* cachedIcon (CACHED_ICON_INFO) */
}
-void update_read_notification_icon_deleted_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo)
+void update_read_notification_icon_delete_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo)
{
/* notification icon deletion event */
}
if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_DELETED)
{
DEBUG_WND("Delete Notification Icon Deleted Order");
- update_read_notification_icon_deleted_order(s, orderInfo);
+ update_read_notification_icon_delete_order(s, orderInfo);
IFCALL(update->NotifyIconDelete, update, orderInfo);
}
else
if (rail != NULL)
{
rail->list = window_list_new(rail);
+ rail->uniconv = freerdp_uniconv_new();
}
return rail;
{
if (rail != NULL)
{
+ window_list_free(rail->list);
+ freerdp_uniconv_free(rail->uniconv);
xfree(rail);
}
}
#include <freerdp/utils/stream.h>
#include <freerdp/utils/memory.h>
+#include <freerdp/utils/hexdump.h>
+#include <freerdp/utils/unicode.h>
#include <freerdp/rail/window.h>
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
{
-
+ window->titleInfo.length = window_state->titleInfo.length;
+ window->titleInfo.string = xmalloc(window_state->titleInfo.length);
+ memcpy(window->titleInfo.string, window_state->titleInfo.string, window->titleInfo.length);
+ freerdp_hexdump(window->titleInfo.string, window->titleInfo.length);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
void rail_CreateWindow(rdpRail* rail, rdpWindow* window)
{
+ if (window->titleInfo.length > 0)
+ {
+ window->title = freerdp_uniconv_in(rail->uniconv, window->titleInfo.string, window->titleInfo.length);
+ }
+ else
+ {
+ window->title = (char*) xmalloc(sizeof("RAIL"));
+ memcpy(window->title, "RAIL", sizeof("RAIL"));
+ }
+
IFCALL(rail->CreateWindow, rail, window);
}
void rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
{
+ printf("rail_DestroyWindow\n");
+
+ IFCALL(rail->DestroyWindow, rail, window);
+
if (window != NULL)
{
xfree(window);
if (window == NULL)
return NULL;
- while (window->next != NULL)
+ while (window != NULL)
{
if (window->windowId == windowId)
return window;