2011-08-09 06:24:12 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-09 06:24:12 +04:00
|
|
|
* X11 Windows
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __XF_WINDOW_H
|
|
|
|
#define __XF_WINDOW_H
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <freerdp/freerdp.h>
|
|
|
|
#include <freerdp/utils/memory.h>
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
typedef struct xf_localmove xfLocalMove;
|
2011-08-09 06:24:12 +04:00
|
|
|
typedef struct xf_window xfWindow;
|
|
|
|
|
|
|
|
#include "xfreerdp.h"
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
// Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
|
|
|
|
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
|
|
|
|
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
|
|
|
|
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
|
|
|
|
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
enum xf_localmove_state
|
|
|
|
{
|
|
|
|
LMS_NOT_ACTIVE,
|
2011-12-07 03:42:58 +04:00
|
|
|
LMS_STARTING,
|
2011-12-03 02:51:30 +04:00
|
|
|
LMS_ACTIVE,
|
|
|
|
LMS_TERMINATING
|
|
|
|
};
|
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
struct xf_localmove
|
|
|
|
{
|
2011-12-03 02:51:30 +04:00
|
|
|
int root_x; // relative to root
|
|
|
|
int root_y;
|
|
|
|
int window_x; // relative to window
|
|
|
|
int window_y;
|
|
|
|
enum xf_localmove_state state;
|
2012-08-04 02:35:17 +04:00
|
|
|
int direction;
|
2011-11-29 01:50:08 +04:00
|
|
|
};
|
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
struct xf_window
|
|
|
|
{
|
2011-08-17 10:14:02 +04:00
|
|
|
GC gc;
|
2011-08-23 05:22:05 +04:00
|
|
|
int left;
|
|
|
|
int top;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
2011-08-09 06:24:12 +04:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
Window handle;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL fullscreen;
|
|
|
|
BOOL decorations;
|
2011-09-23 05:23:01 +04:00
|
|
|
rdpWindow* window;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL is_mapped;
|
|
|
|
BOOL is_transient;
|
2011-12-03 02:51:30 +04:00
|
|
|
xfLocalMove local_move;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE rail_state;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL rail_ignore_configure;
|
2011-08-09 06:24:12 +04:00
|
|
|
};
|
|
|
|
|
2011-08-24 08:46:34 +04:00
|
|
|
void xf_ewmhints_init(xfInfo* xfi);
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL xf_GetCurrentDesktop(xfInfo* xfi);
|
|
|
|
BOOL xf_GetWorkArea(xfInfo* xfi);
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
void xf_SetWindowFullscreen(xfInfo* xfi, xfWindow* window, BOOL fullscreen);
|
|
|
|
void xf_SetWindowDecorations(xfInfo* xfi, xfWindow* window, BOOL show);
|
2011-08-30 22:21:16 +04:00
|
|
|
void xf_SetWindowUnlisted(xfInfo* xfi, xfWindow* window);
|
2011-08-24 08:46:34 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, BOOL decorations);
|
2011-09-06 12:22:53 +04:00
|
|
|
void xf_ResizeDesktopWindow(xfInfo* xfi, xfWindow* window, int width, int height);
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, UINT32 id);
|
2012-05-08 00:07:34 +04:00
|
|
|
void xf_SetWindowText(xfInfo *xfi, xfWindow* window, char *name);
|
2011-08-18 06:50:49 +04:00
|
|
|
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
|
2012-10-09 11:01:37 +04:00
|
|
|
void xf_ShowWindow(xfInfo* xfi, xfWindow* window, BYTE state);
|
2011-08-22 01:32:18 +04:00
|
|
|
void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon);
|
2011-08-25 22:11:45 +04:00
|
|
|
void xf_SetWindowRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects);
|
2011-08-30 22:21:16 +04:00
|
|
|
void xf_SetWindowVisibilityRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects);
|
2012-10-09 11:26:39 +04:00
|
|
|
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, UINT32 style, UINT32 ex_style);
|
2011-09-23 05:23:01 +04:00
|
|
|
void xf_UpdateWindowArea(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL xf_IsWindowBorder(xfInfo* xfi, xfWindow* xfw, int x, int y);
|
2011-08-18 06:31:27 +04:00
|
|
|
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
|
2012-09-19 02:57:19 +04:00
|
|
|
rdpWindow* xf_rdpWindowFromWindow(xfInfo* xfi, Window wnd);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL xf_GetWindowProperty(xfInfo* xfi, Window window, Atom property, int length,
|
2012-10-09 11:01:37 +04:00
|
|
|
unsigned long* nitems, unsigned long* bytes, BYTE** prop);
|
2012-08-14 23:59:11 +04:00
|
|
|
|
2011-09-02 02:08:53 +04:00
|
|
|
void xf_SetWindowMinMaxInfo(xfInfo* xfi, xfWindow* window, int maxWidth, int maxHeight,
|
|
|
|
int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight);
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
void xf_StartLocalMoveSize(xfInfo* xfi, xfWindow* window, int direction, int x, int y);
|
2011-12-17 01:09:21 +04:00
|
|
|
void xf_EndLocalMoveSize(xfInfo *xfi, xfWindow *window);
|
2011-11-29 01:50:08 +04:00
|
|
|
void xf_SendClientEvent(xfInfo *xfi, xfWindow* window, Atom atom, unsigned int numArgs, ...);
|
2011-09-01 02:02:22 +04:00
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
#endif /* __XF_WINDOW_H */
|