forked from enlightenment/efl
document completely the Ecore_Win32 and Ecore_WinCE
SVN revision: 52648
This commit is contained in:
parent
02ffe4765c
commit
89fa0d7741
|
@ -37,206 +37,310 @@ extern "C" {
|
||||||
typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
|
typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
|
||||||
typedef void Ecore_Win32_Cursor;
|
typedef void Ecore_Win32_Cursor;
|
||||||
|
|
||||||
/* Window state */
|
/**
|
||||||
|
* @defgroup Ecore_Win32_Group Ecore_Win32 library
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Window_State
|
||||||
|
* State of a window.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
/* The window is iconified. */
|
ECORE_WIN32_WINDOW_STATE_ICONIFIED, /**< iconified window */
|
||||||
ECORE_WIN32_WINDOW_STATE_ICONIFIED,
|
ECORE_WIN32_WINDOW_STATE_MODAL, /**< modal dialog box */
|
||||||
/* The window is a modal dialog box. */
|
ECORE_WIN32_WINDOW_STATE_STICKY, /**< sticky window */
|
||||||
ECORE_WIN32_WINDOW_STATE_MODAL,
|
ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT, /**< maximum vertical sized window */
|
||||||
/* The window manager should keep the window's position fixed
|
ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ, /**< maximum horizontal sized window */
|
||||||
* even if the virtual desktop scrolls. */
|
ECORE_WIN32_WINDOW_STATE_MAXIMIZED, /**< maximum sized window */
|
||||||
ECORE_WIN32_WINDOW_STATE_STICKY,
|
ECORE_WIN32_WINDOW_STATE_SHADED, /**< shaded window */
|
||||||
/* The window has the maximum vertical size. */
|
ECORE_WIN32_WINDOW_STATE_HIDDEN, /**< hidden (minimized or iconified) window */
|
||||||
ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT,
|
ECORE_WIN32_WINDOW_STATE_FULLSCREEN, /**< fullscreen window */
|
||||||
/* The window has the maximum horizontal size. */
|
ECORE_WIN32_WINDOW_STATE_ABOVE, /**< above window */
|
||||||
ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ,
|
ECORE_WIN32_WINDOW_STATE_BELOW, /**< below window */
|
||||||
/* The window has the maximum horizontal and vertical size. */
|
ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION, /**< To document */
|
||||||
ECORE_WIN32_WINDOW_STATE_MAXIMIZED,
|
ECORE_WIN32_WINDOW_STATE_UNKNOWN /**< Unknown state */
|
||||||
/* The window is shaded. */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_SHADED,
|
|
||||||
/* The window is invisible (i.e. minimized/iconified) */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_HIDDEN,
|
|
||||||
/* The window should fill the entire screen and have no
|
|
||||||
* window border/decorations */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_FULLSCREEN,
|
|
||||||
/* The following are not documented because they are not
|
|
||||||
* intended for use in applications. */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_ABOVE,
|
|
||||||
ECORE_WIN32_WINDOW_STATE_BELOW,
|
|
||||||
/* FIXME: Documentation */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION,
|
|
||||||
/* Unknown state */
|
|
||||||
ECORE_WIN32_WINDOW_STATE_UNKNOWN
|
|
||||||
} Ecore_Win32_Window_State;
|
} Ecore_Win32_Window_State;
|
||||||
|
|
||||||
/* Window type */
|
/**
|
||||||
|
* @typedef Ecore_Win32_Window_Type
|
||||||
|
* Type of a window.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
/* Desktop feature*/
|
ECORE_WIN32_WINDOW_TYPE_DESKTOP, /**< Desktop feature */
|
||||||
ECORE_WIN32_WINDOW_TYPE_DESKTOP,
|
ECORE_WIN32_WINDOW_TYPE_DOCK, /**< Dock window (should be on top of other windows) */
|
||||||
/* Dock window (should be on top of other windows */
|
ECORE_WIN32_WINDOW_TYPE_TOOLBAR, /**< Toolbar window */
|
||||||
ECORE_WIN32_WINDOW_TYPE_DOCK,
|
ECORE_WIN32_WINDOW_TYPE_MENU, /**< Menu window */
|
||||||
/* Toolbar window */
|
ECORE_WIN32_WINDOW_TYPE_UTILITY, /**< Small persistent utility window, such as a palette or toolbox */
|
||||||
ECORE_WIN32_WINDOW_TYPE_TOOLBAR,
|
ECORE_WIN32_WINDOW_TYPE_SPLASH, /**< Splash screen window displayed as an application is starting up */
|
||||||
/* Menu window */
|
ECORE_WIN32_WINDOW_TYPE_DIALOG, /**< Dialog window */
|
||||||
ECORE_WIN32_WINDOW_TYPE_MENU,
|
ECORE_WIN32_WINDOW_TYPE_NORMAL, /**< Normal top-level window */
|
||||||
/* Small persistent utility window, such as a palette or toolbox */
|
ECORE_WIN32_WINDOW_TYPE_UNKNOWN /**< Unknown type */
|
||||||
ECORE_WIN32_WINDOW_TYPE_UTILITY,
|
|
||||||
/* Splash screen window displayed as an application is starting up */
|
|
||||||
ECORE_WIN32_WINDOW_TYPE_SPLASH,
|
|
||||||
/* Dialog window */
|
|
||||||
ECORE_WIN32_WINDOW_TYPE_DIALOG,
|
|
||||||
/* Normal top-level window */
|
|
||||||
ECORE_WIN32_WINDOW_TYPE_NORMAL,
|
|
||||||
/* Unknown type */
|
|
||||||
ECORE_WIN32_WINDOW_TYPE_UNKNOWN
|
|
||||||
} Ecore_Win32_Window_Type;
|
} Ecore_Win32_Window_Type;
|
||||||
|
|
||||||
/*cursor shapes */
|
/**
|
||||||
|
* @typedef Ecore_Win32_Cursor_Shape
|
||||||
|
* Shape of a cursor.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ECORE_WIN32_CURSOR_SHAPE_APP_STARTING, /* Standard arrow and small hourglass */
|
ECORE_WIN32_CURSOR_SHAPE_APP_STARTING, /**< Standard arrow and small hourglass */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_ARROW, /* Standard arrow */
|
ECORE_WIN32_CURSOR_SHAPE_ARROW, /**< Standard arrow */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_CROSS, /* Crosshair */
|
ECORE_WIN32_CURSOR_SHAPE_CROSS, /**< Crosshair */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_HAND, /* Hand */
|
ECORE_WIN32_CURSOR_SHAPE_HAND, /**< Hand */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_HELP, /* Arrow and question mark */
|
ECORE_WIN32_CURSOR_SHAPE_HELP, /**< Arrow and question mark */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_I_BEAM, /* I-beam */
|
ECORE_WIN32_CURSOR_SHAPE_I_BEAM, /**< I-beam */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_NO, /* Slashed circle */
|
ECORE_WIN32_CURSOR_SHAPE_NO, /**< Slashed circle */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL, /* Four-pointed arrow pointing north, south, east, and west */
|
ECORE_WIN32_CURSOR_SHAPE_SIZE_ALL, /**< Four-pointed arrow pointing north, south, east, and west */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW, /* Double-pointed arrow pointing northeast and southwest */
|
ECORE_WIN32_CURSOR_SHAPE_SIZE_NESW, /**< Double-pointed arrow pointing northeast and southwest */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_SIZE_NS, /* Double-pointed arrow pointing north and south */
|
ECORE_WIN32_CURSOR_SHAPE_SIZE_NS, /**< Double-pointed arrow pointing north and south */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE, /* Double-pointed arrow pointing northwest and southeast */
|
ECORE_WIN32_CURSOR_SHAPE_SIZE_NWSE, /**< Double-pointed arrow pointing northwest and southeast */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_SIZE_WE, /* Double-pointed arrow pointing west and east */
|
ECORE_WIN32_CURSOR_SHAPE_SIZE_WE, /**< Double-pointed arrow pointing west and east */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_UP_ARROW, /* Vertical arrow */
|
ECORE_WIN32_CURSOR_SHAPE_UP_ARROW, /**< Vertical arrow */
|
||||||
ECORE_WIN32_CURSOR_SHAPE_WAIT /* Hourglass */
|
ECORE_WIN32_CURSOR_SHAPE_WAIT /**< Hourglass */
|
||||||
} Ecore_Win32_Cursor_Shape;
|
} Ecore_Win32_Cursor_Shape;
|
||||||
|
|
||||||
/* Events */
|
/**
|
||||||
|
* @typedef Ecore_Win32_DnD_State
|
||||||
|
* State of a DnD operation.
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ECORE_WIN32_DND_EVENT_DRAG_ENTER = 1, /**< Drag enter */
|
||||||
|
ECORE_WIN32_DND_EVENT_DRAG_OVER = 2, /**< Drag over */
|
||||||
|
ECORE_WIN32_DND_EVENT_DRAG_LEAVE = 3, /**< Drag leave */
|
||||||
|
ECORE_WIN32_DND_EVENT_DROP = 4 /**< Drop */
|
||||||
|
} Ecore_Win32_DnD_State;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Mouse_In
|
||||||
|
* Event sent when the mouse enters the window.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
|
typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Mouse_Out
|
||||||
|
* Event sent when the mouse leaves the window.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
|
typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Focus_In
|
||||||
|
* Event sent when the window gets the focus.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
|
typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Focus_Out
|
||||||
|
* Event sent when the window looses the focus.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
|
typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Damage
|
||||||
|
* Event sent when the window is damaged.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
|
typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Create
|
||||||
|
* Event sent when the window is created.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Create Ecore_Win32_Event_Window_Create;
|
typedef struct _Ecore_Win32_Event_Window_Create Ecore_Win32_Event_Window_Create;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Destroy
|
||||||
|
* Event sent when the window is destroyed.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
|
typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Hide
|
||||||
|
* Event sent when the window is hidden.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
|
typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Show
|
||||||
|
* Event sent when the window is shown.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
|
typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Configure
|
||||||
|
* Event sent when the window is configured.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Configure Ecore_Win32_Event_Window_Configure;
|
typedef struct _Ecore_Win32_Event_Window_Configure Ecore_Win32_Event_Window_Configure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Resize
|
||||||
|
* Event sent when the window is resized.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window_Resize;
|
typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window_Resize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_Win32_Event_Window_Delete_Request
|
||||||
|
* Event sent when the window is deleted.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
|
typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Mouse_In
|
||||||
|
* Event sent when the mouse enters the window.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Mouse_In
|
struct _Ecore_Win32_Event_Mouse_In
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate where the mouse leaved */
|
||||||
int y;
|
int y; /**< The y coordinate where the mouse entered */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Mouse_Out
|
||||||
|
* Event sent when the mouse leaves the window.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Mouse_Out
|
struct _Ecore_Win32_Event_Mouse_Out
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate where the mouse leaved */
|
||||||
int y;
|
int y; /**< The y coordinate where the mouse leaved */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Focus_In
|
||||||
|
* Event sent when the window gets the focus.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Focus_In
|
struct _Ecore_Win32_Event_Window_Focus_In
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long long time;
|
long long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Focus_Out
|
||||||
|
* Event sent when the window looses the focus.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Focus_Out
|
struct _Ecore_Win32_Event_Window_Focus_Out
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Damage
|
||||||
|
* Event sent when the window is damaged.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Damage
|
struct _Ecore_Win32_Event_Window_Damage
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate of the top left corner of the damaged region */
|
||||||
int y;
|
int y; /**< The y coordinate of the top left corner of the damaged region */
|
||||||
int width;
|
int width; /**< The width of the damaged region */
|
||||||
int height;
|
int height; /**< The time the event occured */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Create
|
||||||
|
* Event sent when the window is created.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Create
|
struct _Ecore_Win32_Event_Window_Create
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Destroy
|
||||||
|
* Event sent when the window is destroyed.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Destroy
|
struct _Ecore_Win32_Event_Window_Destroy
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Hide
|
||||||
|
* Event sent when the window is hidden.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Hide
|
struct _Ecore_Win32_Event_Window_Hide
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Show
|
||||||
|
* Event sent when the window is shown.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Show
|
struct _Ecore_Win32_Event_Window_Show
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Configure
|
||||||
|
* Event sent when the window is configured.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Configure
|
struct _Ecore_Win32_Event_Window_Configure
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
Ecore_Win32_Window *abovewin;
|
Ecore_Win32_Window *abovewin;
|
||||||
int x;
|
int x; /**< The new x coordinate of the top left corner */
|
||||||
int y;
|
int y; /**< The new y coordinate of the top left corner */
|
||||||
int width;
|
int width; /**< The new width */
|
||||||
int height;
|
int height; /**< The new height */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Resize
|
||||||
|
* Event sent when the window is resized.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Resize
|
struct _Ecore_Win32_Event_Window_Resize
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
int width;
|
int width; /**< The new width */
|
||||||
int height;
|
int height; /**< The new height */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_Win32_Event_Window_Delete_Request
|
||||||
|
* Event sent when the window is deleted.
|
||||||
|
*/
|
||||||
struct _Ecore_Win32_Event_Window_Delete_Request
|
struct _Ecore_Win32_Event_Window_Delete_Request
|
||||||
{
|
{
|
||||||
Ecore_Win32_Window *window;
|
Ecore_Win32_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ECORE_WIN32_DND_EVENT_DRAG_ENTER 1
|
/**
|
||||||
#define ECORE_WIN32_DND_EVENT_DRAG_OVER 2
|
* @typedef Ecore_Win32_Dnd_DropTarget_Callback
|
||||||
#define ECORE_WIN32_DND_EVENT_DRAG_LEAVE 3
|
* Callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
|
||||||
#define ECORE_WIN32_DND_EVENT_DROP 4
|
*/
|
||||||
|
|
||||||
|
|
||||||
typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
|
typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
|
||||||
|
|
||||||
EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN;
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT;
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the #Ecore_Win32_Event_Damage event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the #Ecore_Win32_Event_Create event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the #Ecore_Win32_Event_Destroy event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the #Ecore_Win32_Event_Hide event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the #Ecore_Win32_Event_Show event */
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the #Ecore_Win32_Event_Configure event *>
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the #Ecore_Win32_Event_Resize event *>
|
||||||
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST;
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
|
||||||
|
|
||||||
|
|
||||||
/* Core */
|
/* Core */
|
||||||
|
@ -244,8 +348,9 @@ EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST;
|
||||||
EAPI int ecore_win32_init();
|
EAPI int ecore_win32_init();
|
||||||
EAPI int ecore_win32_shutdown();
|
EAPI int ecore_win32_shutdown();
|
||||||
EAPI int ecore_win32_screen_depth_get();
|
EAPI int ecore_win32_screen_depth_get();
|
||||||
|
EAPI void ecore_win32_double_click_time_set(double t);
|
||||||
|
EAPI double ecore_win32_double_click_time_get(void);
|
||||||
EAPI long ecore_win32_current_time_get(void);
|
EAPI long ecore_win32_current_time_get(void);
|
||||||
EAPI void ecore_win32_message_loop_begin (void);
|
|
||||||
|
|
||||||
/* Window */
|
/* Window */
|
||||||
|
|
||||||
|
@ -334,13 +439,13 @@ EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
||||||
EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
|
EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
||||||
int on);
|
Eina_Bool on);
|
||||||
|
|
||||||
EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
||||||
int on);
|
Eina_Bool on);
|
||||||
|
|
||||||
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
int on);
|
Eina_Bool on);
|
||||||
|
|
||||||
EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
||||||
unsigned short width,
|
unsigned short width,
|
||||||
|
@ -372,20 +477,24 @@ EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
|
||||||
|
|
||||||
EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
|
EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
|
||||||
|
|
||||||
EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape);
|
EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
|
||||||
|
|
||||||
EAPI int ecore_win32_cursor_size_get(void);
|
EAPI void ecore_win32_cursor_size_get(int *width, int *height);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Drag and drop */
|
/* Drag and drop */
|
||||||
EAPI int ecore_win32_dnd_init();
|
EAPI int ecore_win32_dnd_init();
|
||||||
EAPI int ecore_win32_dnd_shutdown();
|
EAPI int ecore_win32_dnd_shutdown();
|
||||||
EAPI int ecore_win32_dnd_begin(const char *data,
|
EAPI Eina_Bool ecore_win32_dnd_begin(const char *data,
|
||||||
int size);
|
int size);
|
||||||
EAPI int ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
|
EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
|
||||||
Ecore_Win32_Dnd_DropTarget_Callback callback);
|
Ecore_Win32_Dnd_DropTarget_Callback callback);
|
||||||
EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
|
EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
#include "Ecore_Win32.h"
|
#include "Ecore_Win32.h"
|
||||||
#include "ecore_win32_private.h"
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
|
*/
|
||||||
|
|
||||||
/* OLE IID for Drag'n Drop */
|
/* OLE IID for Drag'n Drop */
|
||||||
|
|
||||||
|
@ -28,219 +35,8 @@ DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
|
||||||
DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
|
DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
|
||||||
DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
|
DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
/***** Global declarations *****/
|
|
||||||
|
|
||||||
HINSTANCE _ecore_win32_instance = NULL;
|
|
||||||
double _ecore_win32_double_click_time = 0.25;
|
|
||||||
long _ecore_win32_event_last_time = 0;
|
|
||||||
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
|
|
||||||
int _ecore_win32_log_dom_global = -1;
|
|
||||||
|
|
||||||
int ECORE_WIN32_EVENT_MOUSE_IN = 0;
|
|
||||||
int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_DAMAGE = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_CREATE = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_DESTROY = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_SHOW = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_CONFIGURE = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_RESIZE = 0;
|
|
||||||
int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/***** Private declarations *****/
|
|
||||||
|
|
||||||
static int _ecore_win32_init_count = 0;
|
static int _ecore_win32_init_count = 0;
|
||||||
|
|
||||||
LRESULT CALLBACK _ecore_win32_window_procedure(HWND window,
|
|
||||||
UINT message,
|
|
||||||
WPARAM window_param,
|
|
||||||
LPARAM data_param);
|
|
||||||
|
|
||||||
|
|
||||||
/***** API *****/
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
ecore_win32_init()
|
|
||||||
{
|
|
||||||
WNDCLASS wc;
|
|
||||||
|
|
||||||
if (++_ecore_win32_init_count != 1)
|
|
||||||
return _ecore_win32_init_count;
|
|
||||||
|
|
||||||
if (!eina_init())
|
|
||||||
return --_ecore_win32_init_count;
|
|
||||||
|
|
||||||
_ecore_win32_log_dom_global = eina_log_domain_register("ecore_win32", ECORE_WIN32_DEFAULT_LOG_COLOR);
|
|
||||||
if (_ecore_win32_log_dom_global < 0)
|
|
||||||
{
|
|
||||||
EINA_LOG_ERR("Ecore_Win32: Could not register log domain");
|
|
||||||
goto shutdown_eina;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ecore_event_init())
|
|
||||||
{
|
|
||||||
ERR("Ecore_Win32: Could not init ecore_event");
|
|
||||||
goto unregister_log_domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
_ecore_win32_instance = GetModuleHandle(NULL);
|
|
||||||
if (!_ecore_win32_instance)
|
|
||||||
{
|
|
||||||
ERR("GetModuleHandle() failed");
|
|
||||||
goto shutdown_ecore_event;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (&wc, 0, sizeof (WNDCLASS));
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
|
||||||
wc.lpfnWndProc = _ecore_win32_window_procedure;
|
|
||||||
wc.cbClsExtra = 0;
|
|
||||||
wc.cbWndExtra = 0;
|
|
||||||
wc.hInstance = _ecore_win32_instance;
|
|
||||||
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
|
|
||||||
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
|
||||||
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
|
|
||||||
wc.lpszMenuName = NULL;
|
|
||||||
wc.lpszClassName = ECORE_WIN32_WINDOW_CLASS;
|
|
||||||
|
|
||||||
if(!RegisterClass(&wc))
|
|
||||||
{
|
|
||||||
ERR("RegisterClass() failed");
|
|
||||||
goto free_library;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ecore_win32_dnd_init())
|
|
||||||
{
|
|
||||||
ERR("ecore_win32_dnd_init() failed");
|
|
||||||
goto unregister_class;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ECORE_WIN32_EVENT_MOUSE_IN)
|
|
||||||
{
|
|
||||||
ECORE_WIN32_EVENT_MOUSE_IN = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_MOUSE_OUT = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_CREATE = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_RESIZE = ecore_event_type_new();
|
|
||||||
ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _ecore_win32_init_count;
|
|
||||||
|
|
||||||
unregister_class:
|
|
||||||
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
|
|
||||||
free_library:
|
|
||||||
FreeLibrary(_ecore_win32_instance);
|
|
||||||
shutdown_ecore_event:
|
|
||||||
ecore_event_shutdown();
|
|
||||||
unregister_log_domain:
|
|
||||||
eina_log_domain_unregister(_ecore_win32_log_dom_global);
|
|
||||||
shutdown_eina:
|
|
||||||
eina_shutdown();
|
|
||||||
|
|
||||||
return --_ecore_win32_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ecore_win32_shutdown()
|
|
||||||
{
|
|
||||||
if (--_ecore_win32_init_count != 0)
|
|
||||||
return _ecore_win32_init_count;
|
|
||||||
|
|
||||||
ecore_win32_dnd_shutdown();
|
|
||||||
|
|
||||||
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
|
|
||||||
INF("UnregisterClass() failed");
|
|
||||||
|
|
||||||
if (!FreeLibrary(_ecore_win32_instance))
|
|
||||||
INF("FreeLibrary() failed");
|
|
||||||
|
|
||||||
_ecore_win32_instance = NULL;
|
|
||||||
|
|
||||||
ecore_event_shutdown();
|
|
||||||
eina_log_domain_unregister(_ecore_win32_log_dom_global);
|
|
||||||
_ecore_win32_log_dom_global = -1;
|
|
||||||
eina_shutdown();
|
|
||||||
|
|
||||||
return _ecore_win32_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ecore_win32_screen_depth_get()
|
|
||||||
{
|
|
||||||
HDC dc;
|
|
||||||
int depth;
|
|
||||||
|
|
||||||
INF("getting screen depth");
|
|
||||||
|
|
||||||
dc = GetDC(NULL);
|
|
||||||
if (!dc)
|
|
||||||
{
|
|
||||||
ERR("GetDC() failed");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
depth = GetDeviceCaps(dc, BITSPIXEL);
|
|
||||||
if (!ReleaseDC(NULL, dc))
|
|
||||||
{
|
|
||||||
ERR("ReleaseDC() failed (device context not released)");
|
|
||||||
}
|
|
||||||
|
|
||||||
return depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the timeout for a double and triple clicks to be flagged.
|
|
||||||
*
|
|
||||||
* This sets the time between clicks before the double_click flag is
|
|
||||||
* set in a button down event. If 3 clicks occur within double this
|
|
||||||
* time, the triple_click flag is also set.
|
|
||||||
*
|
|
||||||
* @param t The time in seconds
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
ecore_win32_double_click_time_set(double t)
|
|
||||||
{
|
|
||||||
if (t < 0.0) t = 0.0;
|
|
||||||
_ecore_win32_double_click_time = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves the double and triple click flag timeout.
|
|
||||||
*
|
|
||||||
* See @ref ecore_win32_double_click_time_set for more information.
|
|
||||||
*
|
|
||||||
* @return The timeout for double clicks in seconds.
|
|
||||||
*/
|
|
||||||
double
|
|
||||||
ecore_win32_double_click_time_get(void)
|
|
||||||
{
|
|
||||||
return _ecore_win32_double_click_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the last event time
|
|
||||||
*/
|
|
||||||
long
|
|
||||||
ecore_win32_current_time_get(void)
|
|
||||||
{
|
|
||||||
return _ecore_win32_event_last_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***** Private functions definitions *****/
|
|
||||||
|
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT CALLBACK
|
||||||
_ecore_win32_window_procedure(HWND window,
|
_ecore_win32_window_procedure(HWND window,
|
||||||
UINT message,
|
UINT message,
|
||||||
|
@ -424,3 +220,259 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
return DefWindowProc(window, message, window_param, data_param);
|
return DefWindowProc(window, message, window_param, data_param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
HINSTANCE _ecore_win32_instance = NULL;
|
||||||
|
double _ecore_win32_double_click_time = 0.25;
|
||||||
|
long _ecore_win32_event_last_time = 0;
|
||||||
|
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
|
||||||
|
int _ecore_win32_log_dom_global = -1;
|
||||||
|
|
||||||
|
int ECORE_WIN32_EVENT_MOUSE_IN = 0;
|
||||||
|
int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_DAMAGE = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_CREATE = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_DESTROY = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_SHOW = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_CONFIGURE = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_RESIZE = 0;
|
||||||
|
int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = 0;
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_Win32_Group Ecore_Win32 library
|
||||||
|
*
|
||||||
|
* Ecore_Win32 is a library that wraps Windows graphic functions
|
||||||
|
* and integrate them nicely into the Ecore main loop.
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the Ecore_Win32 library.
|
||||||
|
*
|
||||||
|
* @return 1 or greater on success, 0 on error.
|
||||||
|
*
|
||||||
|
* This function sets up the Windows graphic system. It returns 0 on
|
||||||
|
* failure, otherwise it returns the number of times it has already been
|
||||||
|
* called.
|
||||||
|
*
|
||||||
|
* When Ecore_Win32 is not used anymore, call ecore_win32_shutdown()
|
||||||
|
* to shut down the Ecore_Win32 library.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_init()
|
||||||
|
{
|
||||||
|
WNDCLASS wc;
|
||||||
|
|
||||||
|
if (++_ecore_win32_init_count != 1)
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
|
||||||
|
if (!eina_init())
|
||||||
|
return --_ecore_win32_init_count;
|
||||||
|
|
||||||
|
_ecore_win32_log_dom_global = eina_log_domain_register("ecore_win32", ECORE_WIN32_DEFAULT_LOG_COLOR);
|
||||||
|
if (_ecore_win32_log_dom_global < 0)
|
||||||
|
{
|
||||||
|
EINA_LOG_ERR("Ecore_Win32: Could not register log domain");
|
||||||
|
goto shutdown_eina;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ecore_event_init())
|
||||||
|
{
|
||||||
|
ERR("Ecore_Win32: Could not init ecore_event");
|
||||||
|
goto unregister_log_domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ecore_win32_instance = GetModuleHandle(NULL);
|
||||||
|
if (!_ecore_win32_instance)
|
||||||
|
{
|
||||||
|
ERR("GetModuleHandle() failed");
|
||||||
|
goto shutdown_ecore_event;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset (&wc, 0, sizeof (WNDCLASS));
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.lpfnWndProc = _ecore_win32_window_procedure;
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hInstance = _ecore_win32_instance;
|
||||||
|
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
|
||||||
|
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||||
|
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
|
||||||
|
wc.lpszMenuName = NULL;
|
||||||
|
wc.lpszClassName = ECORE_WIN32_WINDOW_CLASS;
|
||||||
|
|
||||||
|
if(!RegisterClass(&wc))
|
||||||
|
{
|
||||||
|
ERR("RegisterClass() failed");
|
||||||
|
goto free_library;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ecore_win32_dnd_init())
|
||||||
|
{
|
||||||
|
ERR("ecore_win32_dnd_init() failed");
|
||||||
|
goto unregister_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ECORE_WIN32_EVENT_MOUSE_IN)
|
||||||
|
{
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_IN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_CREATE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_RESIZE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
|
||||||
|
unregister_class:
|
||||||
|
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
|
||||||
|
free_library:
|
||||||
|
FreeLibrary(_ecore_win32_instance);
|
||||||
|
shutdown_ecore_event:
|
||||||
|
ecore_event_shutdown();
|
||||||
|
unregister_log_domain:
|
||||||
|
eina_log_domain_unregister(_ecore_win32_log_dom_global);
|
||||||
|
shutdown_eina:
|
||||||
|
eina_shutdown();
|
||||||
|
|
||||||
|
return --_ecore_win32_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Shut down the Ecore_Win32 library.
|
||||||
|
*
|
||||||
|
* @return 0 when the library is completely shut down, 1 or
|
||||||
|
* greater otherwise.
|
||||||
|
*
|
||||||
|
* This function shuts down the Ecore_Win32 library. It returns 0 when it has
|
||||||
|
* been called the same number of times than ecore_win32_init(). In that case
|
||||||
|
* it shut down all the Windows graphic system.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_shutdown()
|
||||||
|
{
|
||||||
|
if (--_ecore_win32_init_count != 0)
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
|
||||||
|
ecore_win32_dnd_shutdown();
|
||||||
|
|
||||||
|
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))
|
||||||
|
INF("UnregisterClass() failed");
|
||||||
|
|
||||||
|
if (!FreeLibrary(_ecore_win32_instance))
|
||||||
|
INF("FreeLibrary() failed");
|
||||||
|
|
||||||
|
_ecore_win32_instance = NULL;
|
||||||
|
|
||||||
|
ecore_event_shutdown();
|
||||||
|
eina_log_domain_unregister(_ecore_win32_log_dom_global);
|
||||||
|
_ecore_win32_log_dom_global = -1;
|
||||||
|
eina_shutdown();
|
||||||
|
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the depth of the screen.
|
||||||
|
*
|
||||||
|
* @return The depth of the screen.
|
||||||
|
*
|
||||||
|
* This function returns the depth of the screen. If an error occurs,
|
||||||
|
* it returns 0.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_screen_depth_get()
|
||||||
|
{
|
||||||
|
HDC dc;
|
||||||
|
int depth;
|
||||||
|
|
||||||
|
INF("getting screen depth");
|
||||||
|
|
||||||
|
dc = GetDC(NULL);
|
||||||
|
if (!dc)
|
||||||
|
{
|
||||||
|
ERR("GetDC() failed");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
depth = GetDeviceCaps(dc, BITSPIXEL);
|
||||||
|
if (!ReleaseDC(NULL, dc))
|
||||||
|
{
|
||||||
|
ERR("ReleaseDC() failed (device context not released)");
|
||||||
|
}
|
||||||
|
|
||||||
|
return depth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the timeout for a double and triple clicks to be flagged.
|
||||||
|
*
|
||||||
|
* @param t The time in seconds.
|
||||||
|
*
|
||||||
|
* This function sets the time @p t between clicks before the
|
||||||
|
* double_click flag is set in a button down event. If 3 clicks occur
|
||||||
|
* within double this time, the triple_click flag is also set.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_double_click_time_set(double t)
|
||||||
|
{
|
||||||
|
if (t < 0.0) t = 0.0;
|
||||||
|
_ecore_win32_double_click_time = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the double and triple click flag timeout.
|
||||||
|
*
|
||||||
|
* @return The timeout for double clicks in seconds.
|
||||||
|
*
|
||||||
|
* This function returns the double clicks in seconds. If
|
||||||
|
* ecore_win32_double_click_time_set() has not been called, the
|
||||||
|
* default value is returned. See ecore_win32_double_click_time_set()
|
||||||
|
* for more informations.
|
||||||
|
*/
|
||||||
|
EAPI double
|
||||||
|
ecore_win32_double_click_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_win32_double_click_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the last event time.
|
||||||
|
*
|
||||||
|
* @return The last envent time.
|
||||||
|
*
|
||||||
|
* This function returns the last event time.
|
||||||
|
*/
|
||||||
|
EAPI long
|
||||||
|
ecore_win32_current_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_win32_event_last_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
|
@ -11,10 +11,156 @@
|
||||||
#include "Ecore_Win32.h"
|
#include "Ecore_Win32.h"
|
||||||
#include "ecore_win32_private.h"
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/***** API *****/
|
|
||||||
|
|
||||||
Ecore_Win32_Cursor *
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_Win32_Group Ecore_Win32 library
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create a new cursor.
|
||||||
|
*
|
||||||
|
* @param pixels_and The array of bytes containing the bit values for
|
||||||
|
* the AND mask of the cursor.
|
||||||
|
* @param pixels_xor The array of bytes containing the bit values for
|
||||||
|
* the XOR mask of the cursor.
|
||||||
|
* @param width The width of the cursor.
|
||||||
|
* @param height The height of the cursor.
|
||||||
|
* @param hot_x The horizontal position of the cursor's hot spot.
|
||||||
|
* @param hot_y The vertical position of the cursor's hot spot.
|
||||||
|
* @return A newly user-defined cursor.
|
||||||
|
*
|
||||||
|
* This function creates a new cursor of size @p width and @p
|
||||||
|
* height. They must be valid size. To determine the valid size of a
|
||||||
|
* cursor, useecore_win32_cursor_size_get(). @p pixels_and is an array
|
||||||
|
* of bytes (unsigned char) containing the bits of the cursor that
|
||||||
|
* will be visible. @p pixels_xor is similar but will allow the cursor
|
||||||
|
* to have a shape. Here is the truth table for the masks:
|
||||||
|
*
|
||||||
|
* <table>
|
||||||
|
* <tr><td>AND mask</td><td>XOR mask</td><td>Display</td></tr>
|
||||||
|
* <tr><td>0</td> <td>0</td> <td>Black</td></tr>
|
||||||
|
* <tr><td>0</td> <td>1</td> <td>White</td></tr>
|
||||||
|
* <tr><td>1</td> <td>0</td> <td>Screen</td></tr>
|
||||||
|
* <tr><td>1</td> <td>1</td> <td>Reverse screen</td></tr>
|
||||||
|
* </table>
|
||||||
|
*
|
||||||
|
* @p hot_x and @p hot_y are the position of the hot spot of the
|
||||||
|
* cursor. If @p pixels_and or @p pixels_xor are @c NULL, the function
|
||||||
|
* returns NULL. If @p width or @p height does not match the valid
|
||||||
|
* size of a cursor, the function returns @c NULL. On success, the
|
||||||
|
* function creates a user-defined cursor, otherwise it returns
|
||||||
|
* @c NULL.
|
||||||
|
*
|
||||||
|
* Once the cursor is not used anymore, use ecore_win32_cursor_free()
|
||||||
|
* to free the ressources.
|
||||||
|
*
|
||||||
|
* Example of use:
|
||||||
|
*
|
||||||
|
* @code
|
||||||
|
* unsigned char pixels_and[] ={
|
||||||
|
* 0xFF, 0xFC, 0x3F, 0xFF, // line 1
|
||||||
|
* 0xFF, 0xC0, 0x1F, 0xFF, // line 2
|
||||||
|
* 0xFF, 0x00, 0x3F, 0xFF, // line 3
|
||||||
|
* 0xFE, 0x00, 0xFF, 0xFF, // line 4
|
||||||
|
*
|
||||||
|
* 0xF7, 0x01, 0xFF, 0xFF, // line 5
|
||||||
|
* 0xF0, 0x03, 0xFF, 0xFF, // line 6
|
||||||
|
* 0xF0, 0x03, 0xFF, 0xFF, // line 7
|
||||||
|
* 0xE0, 0x07, 0xFF, 0xFF, // line 8
|
||||||
|
*
|
||||||
|
* 0xC0, 0x07, 0xFF, 0xFF, // line 9
|
||||||
|
* 0xC0, 0x0F, 0xFF, 0xFF, // line 10
|
||||||
|
* 0x80, 0x0F, 0xFF, 0xFF, // line 11
|
||||||
|
* 0x80, 0x0F, 0xFF, 0xFF, // line 12
|
||||||
|
*
|
||||||
|
* 0x80, 0x07, 0xFF, 0xFF, // line 13
|
||||||
|
* 0x00, 0x07, 0xFF, 0xFF, // line 14
|
||||||
|
* 0x00, 0x03, 0xFF, 0xFF, // line 15
|
||||||
|
* 0x00, 0x00, 0xFF, 0xFF, // line 16
|
||||||
|
*
|
||||||
|
* 0x00, 0x00, 0x7F, 0xFF, // line 17
|
||||||
|
* 0x00, 0x00, 0x1F, 0xFF, // line 18
|
||||||
|
* 0x00, 0x00, 0x0F, 0xFF, // line 19
|
||||||
|
* 0x80, 0x00, 0x0F, 0xFF, // line 20
|
||||||
|
*
|
||||||
|
* 0x80, 0x00, 0x07, 0xFF, // line 21
|
||||||
|
* 0x80, 0x00, 0x07, 0xFF, // line 22
|
||||||
|
* 0xC0, 0x00, 0x07, 0xFF, // line 23
|
||||||
|
* 0xC0, 0x00, 0x0F, 0xFF, // line 24
|
||||||
|
*
|
||||||
|
* 0xE0, 0x00, 0x0F, 0xFF, // line 25
|
||||||
|
* 0xF0, 0x00, 0x1F, 0xFF, // line 26
|
||||||
|
* 0xF0, 0x00, 0x1F, 0xFF, // line 27
|
||||||
|
* 0xF8, 0x00, 0x3F, 0xFF, // line 28
|
||||||
|
*
|
||||||
|
* 0xFE, 0x00, 0x7F, 0xFF, // line 29
|
||||||
|
* 0xFF, 0x00, 0xFF, 0xFF, // line 30
|
||||||
|
* 0xFF, 0xC3, 0xFF, 0xFF, // line 31
|
||||||
|
* 0xFF, 0xFF, 0xFF, 0xFF // line 32
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* unsigned char pixels_xor[] =
|
||||||
|
* {
|
||||||
|
* 0x00, 0x00, 0x00, 0x00, // line 1
|
||||||
|
* 0x00, 0x03, 0xC0, 0x00, // line 2
|
||||||
|
* 0x00, 0x3F, 0x00, 0x00, // line 3
|
||||||
|
* 0x00, 0xFE, 0x00, 0x00, // line 4
|
||||||
|
*
|
||||||
|
* 0x0E, 0xFC, 0x00, 0x00, // line 5
|
||||||
|
* 0x07, 0xF8, 0x00, 0x00, // line 6
|
||||||
|
* 0x07, 0xF8, 0x00, 0x00, // line 7
|
||||||
|
* 0x0F, 0xF0, 0x00, 0x00, // line 8
|
||||||
|
*
|
||||||
|
* 0x1F, 0xF0, 0x00, 0x00, // line 9
|
||||||
|
* 0x1F, 0xE0, 0x00, 0x00, // line 10
|
||||||
|
* 0x3F, 0xE0, 0x00, 0x00, // line 11
|
||||||
|
* 0x3F, 0xE0, 0x00, 0x00, // line 12
|
||||||
|
*
|
||||||
|
* 0x3F, 0xF0, 0x00, 0x00, // line 13
|
||||||
|
* 0x7F, 0xF0, 0x00, 0x00, // line 14
|
||||||
|
* 0x7F, 0xF8, 0x00, 0x00, // line 15
|
||||||
|
* 0x7F, 0xFC, 0x00, 0x00, // line 16
|
||||||
|
*
|
||||||
|
* 0x7F, 0xFF, 0x00, 0x00, // line 17
|
||||||
|
* 0x7F, 0xFF, 0x80, 0x00, // line 18
|
||||||
|
* 0x7F, 0xFF, 0xE0, 0x00, // line 19
|
||||||
|
* 0x3F, 0xFF, 0xE0, 0x00, // line 20
|
||||||
|
*
|
||||||
|
* 0x3F, 0xC7, 0xF0, 0x00, // line 21
|
||||||
|
* 0x3F, 0x83, 0xF0, 0x00, // line 22
|
||||||
|
* 0x1F, 0x83, 0xF0, 0x00, // line 23
|
||||||
|
* 0x1F, 0x83, 0xE0, 0x00, // line 24
|
||||||
|
*
|
||||||
|
* 0x0F, 0xC7, 0xE0, 0x00, // line 25
|
||||||
|
* 0x07, 0xFF, 0xC0, 0x00, // line 26
|
||||||
|
* 0x07, 0xFF, 0xC0, 0x00, // line 27
|
||||||
|
* 0x01, 0xFF, 0x80, 0x00, // line 28
|
||||||
|
*
|
||||||
|
* 0x00, 0xFF, 0x00, 0x00, // line 29
|
||||||
|
* 0x00, 0x3C, 0x00, 0x00, // line 30
|
||||||
|
* 0x00, 0x00, 0x00, 0x00, // line 31
|
||||||
|
* 0x00, 0x00, 0x00, 0x00 // line 32
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* Ecore_Win32_Cursor cursor = ecore_win32_cursor_new(pixels_and, pixels_xor, 32, 32, 19, 2);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Win32_Cursor *
|
||||||
ecore_win32_cursor_new(const void *pixels_and,
|
ecore_win32_cursor_new(const void *pixels_and,
|
||||||
const void *pixels_xor,
|
const void *pixels_xor,
|
||||||
int width,
|
int width,
|
||||||
|
@ -28,6 +174,9 @@ ecore_win32_cursor_new(const void *pixels_and,
|
||||||
|
|
||||||
INF("creating cursor");
|
INF("creating cursor");
|
||||||
|
|
||||||
|
if (!pixels_and || !pixels_xor)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
cursor_width = GetSystemMetrics(SM_CXCURSOR);
|
cursor_width = GetSystemMetrics(SM_CXCURSOR);
|
||||||
cursor_height = GetSystemMetrics(SM_CYCURSOR);
|
cursor_height = GetSystemMetrics(SM_CYCURSOR);
|
||||||
|
|
||||||
|
@ -45,7 +194,15 @@ ecore_win32_cursor_new(const void *pixels_and,
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Free the given cursor.
|
||||||
|
*
|
||||||
|
* @param cursor The cursor to free.
|
||||||
|
*
|
||||||
|
* This function free @p cursor. @p cursor must have been obtained
|
||||||
|
* with ecore_win32_cursor_new().
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
|
ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
|
||||||
{
|
{
|
||||||
INF("destroying cursor");
|
INF("destroying cursor");
|
||||||
|
@ -53,8 +210,18 @@ ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
|
||||||
DestroyCursor(cursor);
|
DestroyCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ecore_Win32_Cursor *
|
/**
|
||||||
ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape)
|
* @brief Create a cursor from a Windows ressource.
|
||||||
|
*
|
||||||
|
* @param shape The pre-defined shape of the cursor.
|
||||||
|
* @return The new cursor.
|
||||||
|
*
|
||||||
|
* This funtion returns a pre-defined cursor with a specified
|
||||||
|
* @p shape. This cursor does not need to be freed, as it is loaded
|
||||||
|
* from an existing resource.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Win32_Cursor *
|
||||||
|
ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
|
||||||
{
|
{
|
||||||
Ecore_Win32_Cursor *cursor = NULL;
|
Ecore_Win32_Cursor *cursor = NULL;
|
||||||
const char *cursor_name;
|
const char *cursor_name;
|
||||||
|
@ -115,15 +282,25 @@ ecore_win32_cursor_shape_get(Ecore_Win32_Cursor_Shape shape)
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
/**
|
||||||
ecore_win32_cursor_size_get(void)
|
* @brief Retrieve the size of a valid cursor.
|
||||||
|
*
|
||||||
|
* @param width The width of a valid cursor.
|
||||||
|
* @param height The height of a valid cursor.
|
||||||
|
*
|
||||||
|
* This function returns the size of a cursor that must be passed to
|
||||||
|
* ecore_win32_cursor_new(). @p width and @p height are buffers that
|
||||||
|
* will be filled with the correct size. They can be @c NULL.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_cursor_size_get(int *width, int *height)
|
||||||
{
|
{
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
|
|
||||||
INF("geting size cursor");
|
INF("geting size cursor");
|
||||||
|
|
||||||
width = GetSystemMetrics(SM_CXCURSOR);
|
if (*width) *width = GetSystemMetrics(SM_CXCURSOR);
|
||||||
height = GetSystemMetrics(SM_CYCURSOR);
|
if (*height) *height = GetSystemMetrics(SM_CYCURSOR);
|
||||||
return (width > height) ? width : height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
|
@ -7,6 +7,14 @@
|
||||||
#include "Ecore_Win32.h"
|
#include "Ecore_Win32.h"
|
||||||
#include "ecore_win32_private.h"
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
static int _ecore_win32_dnd_init_count = 0;
|
static int _ecore_win32_dnd_init_count = 0;
|
||||||
|
|
||||||
|
@ -18,8 +26,42 @@ static HANDLE DataToHandle(const char *data, int size)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_Win32_Group Ecore_Win32 library
|
||||||
|
*
|
||||||
|
* Ecore_Win32 is a library that wraps Windows CE graphic functions
|
||||||
|
* and integrate them nicely into the Ecore main loop.
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the Ecore_Win32 Drag and Drop module.
|
||||||
|
*
|
||||||
|
* @return 1 or greater on success, 0 on error.
|
||||||
|
*
|
||||||
|
* This function initialize the Drag and Drop module. It returns 0 on
|
||||||
|
* failure, otherwise it returns the number of times it has already
|
||||||
|
* been called.
|
||||||
|
*
|
||||||
|
* When the Drag and Drop module is not used anymore, call
|
||||||
|
* ecore_win32_dnd_shutdown() to shut down the module.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
ecore_win32_dnd_init()
|
ecore_win32_dnd_init()
|
||||||
{
|
{
|
||||||
if (_ecore_win32_dnd_init_count > 0)
|
if (_ecore_win32_dnd_init_count > 0)
|
||||||
|
@ -36,7 +78,18 @@ ecore_win32_dnd_init()
|
||||||
return _ecore_win32_dnd_init_count;
|
return _ecore_win32_dnd_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ecore_win32_dnd_shutdown()
|
/**
|
||||||
|
* @brief Shut down the Ecore_Win32 Drag and Drop module.
|
||||||
|
*
|
||||||
|
* @return 0 when the module is completely shut down, 1 or
|
||||||
|
* greater otherwise.
|
||||||
|
*
|
||||||
|
* This function shuts down the Drag and Drop module. It returns 0 when it has
|
||||||
|
* been called the same number of times than ecore_win32_dnd_init(). In that case
|
||||||
|
* it shut down the module.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_dnd_shutdown()
|
||||||
{
|
{
|
||||||
_ecore_win32_dnd_init_count--;
|
_ecore_win32_dnd_init_count--;
|
||||||
if (_ecore_win32_dnd_init_count > 0) return _ecore_win32_dnd_init_count;
|
if (_ecore_win32_dnd_init_count > 0) return _ecore_win32_dnd_init_count;
|
||||||
|
@ -48,17 +101,31 @@ int ecore_win32_dnd_shutdown()
|
||||||
return _ecore_win32_dnd_init_count;
|
return _ecore_win32_dnd_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ecore_win32_dnd_begin(const char *data,
|
/**
|
||||||
int size)
|
* @brief Begin a DnD operation.
|
||||||
|
*
|
||||||
|
* @param data The name pf the Drag operation.
|
||||||
|
* @param size The size of the name.
|
||||||
|
* @return EINA_TRUE on success, EINA_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* This function start a Drag operation with the name @p data. If
|
||||||
|
* @p data is @c NULL, EINA_FALSE is returned. if @p size is less than
|
||||||
|
* 0, it is set to the length (as strlen()) of @p data. On success the
|
||||||
|
* function returns EINA_TRUE, otherwise it returns EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_win32_dnd_begin(const char *data,
|
||||||
|
int size)
|
||||||
{
|
{
|
||||||
IDataObject *pDataObject = NULL;
|
IDataObject *pDataObject = NULL;
|
||||||
IDropSource *pDropSource = NULL;
|
IDropSource *pDropSource = NULL;
|
||||||
FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
|
FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
|
||||||
STGMEDIUM stgmed = { TYMED_HGLOBAL, { 0 }, 0 };
|
STGMEDIUM stgmed = { TYMED_HGLOBAL, { 0 }, 0 };
|
||||||
int res = 0;
|
Eina_Bool res = EINA_FALSE;
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return 0;
|
return EINA_FALSE;
|
||||||
|
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
size = strlen(data) + 1;
|
size = strlen(data) + 1;
|
||||||
|
|
||||||
|
@ -92,7 +159,7 @@ int ecore_win32_dnd_begin(const char *data,
|
||||||
//else
|
//else
|
||||||
// printf("DND error\n");
|
// printf("DND error\n");
|
||||||
|
|
||||||
res = 1;
|
res = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ecore_win32_dnd_data_object_free(pDataObject);
|
_ecore_win32_dnd_data_object_free(pDataObject);
|
||||||
|
@ -100,24 +167,48 @@ int ecore_win32_dnd_begin(const char *data,
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
ReleaseStgMedium(&stgmed);
|
ReleaseStgMedium(&stgmed);
|
||||||
return (int)res;
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
|
/**
|
||||||
Ecore_Win32_Dnd_DropTarget_Callback callback)
|
* @brief Register a Drop operation.
|
||||||
|
*
|
||||||
|
* @param window The destination of the Drop operation.
|
||||||
|
* @param callback The callback called when the Drop operation
|
||||||
|
* finishes.
|
||||||
|
* @return EINA_TRUE on success, EINA_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* This function register a Drop operation on @p window. Once the Drop
|
||||||
|
* operation finishes, @p callback is called. If @p window is @c NULL,
|
||||||
|
* the function returns EINA_FALSE. On success, it returns EINA_TRUE,
|
||||||
|
* otherwise it returns EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
|
||||||
|
Ecore_Win32_Dnd_DropTarget_Callback callback)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window;
|
struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
return 0;
|
return EINA_FALSE;
|
||||||
|
|
||||||
wnd->dnd_drop_target = _ecore_win32_dnd_register_drop_window(wnd->window,
|
wnd->dnd_drop_target = _ecore_win32_dnd_register_drop_window(wnd->window,
|
||||||
callback,
|
callback,
|
||||||
(void *)wnd);
|
(void *)wnd);
|
||||||
return (int)(!!wnd->dnd_drop_target);
|
return wnd->dnd_drop_target ? EINA_TRUE : EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window)
|
/**
|
||||||
|
* @brief Unregister a Drop operation.
|
||||||
|
*
|
||||||
|
* @param window The destination of the Drop operation.
|
||||||
|
*
|
||||||
|
* This function unregister a Drop operation on @p window. If
|
||||||
|
* @p window is @c NULL, the function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window;
|
struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
@ -127,3 +218,7 @@ void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window)
|
||||||
if (wnd->dnd_drop_target)
|
if (wnd->dnd_drop_target)
|
||||||
_ecore_win32_dnd_unregister_drop_window(wnd->window, wnd->dnd_drop_target);
|
_ecore_win32_dnd_unregister_drop_window(wnd->window, wnd->dnd_drop_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
|
@ -14,8 +14,13 @@
|
||||||
#include "Ecore_Win32.h"
|
#include "Ecore_Win32.h"
|
||||||
#include "ecore_win32_private.h"
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/***** Private declarations *****/
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
typedef enum _Ecore_Win32_Window_Z_Order Ecore_Win32_Window_Z_Order;
|
typedef enum _Ecore_Win32_Window_Z_Order Ecore_Win32_Window_Z_Order;
|
||||||
|
@ -27,17 +32,151 @@ enum _Ecore_Win32_Window_Z_Order
|
||||||
ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST
|
ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST
|
||||||
};
|
};
|
||||||
|
|
||||||
static Ecore_Win32_Window *ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
static Ecore_Win32_Window *
|
||||||
int x,
|
ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
||||||
int y,
|
int x,
|
||||||
int width,
|
int y,
|
||||||
int height,
|
int width,
|
||||||
DWORD style);
|
int height,
|
||||||
|
DWORD style)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
int minimal_width;
|
||||||
|
int minimal_height;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window));
|
||||||
|
if (!w)
|
||||||
|
{
|
||||||
|
ERR("malloc() failed");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
rect.left = 0;
|
||||||
|
rect.top = 0;
|
||||||
|
rect.right = width;
|
||||||
|
rect.bottom = height;
|
||||||
|
if (!AdjustWindowRect(&rect, style, FALSE))
|
||||||
|
{
|
||||||
|
ERR("AdjustWindowRect() failed");
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
minimal_width = GetSystemMetrics(SM_CXMIN);
|
||||||
|
minimal_height = GetSystemMetrics(SM_CYMIN);
|
||||||
|
/* if (((rect.right - rect.left) < minimal_width) || */
|
||||||
|
/* ((rect.bottom - rect.top) < minimal_height)) */
|
||||||
|
/* { */
|
||||||
|
/* fprintf (stderr, "[Ecore] [Win32] ERROR !!\n"); */
|
||||||
|
/* fprintf (stderr, " Wrong size %ld\n", rect.right - rect.left); */
|
||||||
|
/* free(w); */
|
||||||
|
/* return NULL; */
|
||||||
|
/* } */
|
||||||
|
if ((rect.right - rect.left) < minimal_width)
|
||||||
|
{
|
||||||
|
rect.right = rect.left + minimal_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
w->window = CreateWindowEx(0,
|
||||||
|
ECORE_WIN32_WINDOW_CLASS, "",
|
||||||
|
style,
|
||||||
|
x, y,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL,
|
||||||
|
NULL, _ecore_win32_instance, NULL);
|
||||||
|
if (!w->window)
|
||||||
|
{
|
||||||
|
ERR("CreateWindowEx() failed");
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetLastError(0);
|
||||||
|
if (!SetWindowLongPtr(w->window, GWL_USERDATA, (LONG)w) && (GetLastError() != 0))
|
||||||
|
{
|
||||||
|
ERR("SetWindowLongPtr() failed");
|
||||||
|
DestroyWindow(w->window);
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
w->min_width = 0;
|
||||||
|
w->min_height = 0;
|
||||||
|
w->max_width = 32767;
|
||||||
|
w->max_height = 32767;
|
||||||
|
w->base_width = -1;
|
||||||
|
w->base_height = -1;
|
||||||
|
w->step_width = -1;
|
||||||
|
w->step_height = -1;
|
||||||
|
|
||||||
|
w->state.iconified = 0;
|
||||||
|
w->state.modal = 0;
|
||||||
|
w->state.sticky = 0;
|
||||||
|
w->state.maximized_vert = 0;
|
||||||
|
w->state.maximized_horz = 0;
|
||||||
|
w->state.shaded = 0;
|
||||||
|
w->state.hidden = 0;
|
||||||
|
w->state.fullscreen = 0;
|
||||||
|
w->state.above = 0;
|
||||||
|
w->state.below = 0;
|
||||||
|
w->state.demands_attention = 0;
|
||||||
|
|
||||||
|
w->type.desktop = 0;
|
||||||
|
w->type.dock = 0;
|
||||||
|
w->type.toolbar = 0;
|
||||||
|
w->type.menu = 0;
|
||||||
|
w->type.utility = 0;
|
||||||
|
w->type.splash = 0;
|
||||||
|
w->type.dialog = 0;
|
||||||
|
w->type.normal = 0;
|
||||||
|
|
||||||
|
w->pointer_is_in = 0;
|
||||||
|
w->borderless = 0;
|
||||||
|
w->iconified = 0;
|
||||||
|
w->fullscreen = 0;
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/***** API *****/
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
Ecore_Win32_Window *
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_Win32_Group Ecore_Win32 library
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates a new window.
|
||||||
|
*
|
||||||
|
* @param parent The parent window.
|
||||||
|
* @param x The x coordinate of the top-left corner of the window.
|
||||||
|
* @param y The y coordinate of the top-left corner of the window.
|
||||||
|
* @param width The width of the window.
|
||||||
|
* @param height The height of hte window.
|
||||||
|
* @return A newly allocated window.
|
||||||
|
*
|
||||||
|
* This function creates a new window which parent is @p parent. @p width and
|
||||||
|
* @p height are the size of the window content (the client part),
|
||||||
|
* without the border and title bar. @p x and @p y are the system
|
||||||
|
* coordinates of the top left cerner of the window (that is, of the
|
||||||
|
* title bar). This function returns a newly created window on
|
||||||
|
* success, and @c NULL on failure.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Win32_Window *
|
||||||
ecore_win32_window_new(Ecore_Win32_Window *parent,
|
ecore_win32_window_new(Ecore_Win32_Window *parent,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
@ -52,8 +191,20 @@ ecore_win32_window_new(Ecore_Win32_Window *parent,
|
||||||
WS_OVERLAPPEDWINDOW | WS_SIZEBOX);
|
WS_OVERLAPPEDWINDOW | WS_SIZEBOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* simulate X11 override windows */
|
/**
|
||||||
Ecore_Win32_Window *
|
* @brief Creates a new borderless window.
|
||||||
|
*
|
||||||
|
* @param parent The parent window.
|
||||||
|
* @param x The x coordinate of the top-left corner of the window.
|
||||||
|
* @param y The y coordinate of the top-left corner of the window.
|
||||||
|
* @param width The width of the window.
|
||||||
|
* @param height The height of hte window.
|
||||||
|
* @return A newly allocated window.
|
||||||
|
*
|
||||||
|
* This function is the same than ecore_win32_window_override_new()
|
||||||
|
* but the returned window is borderless.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Win32_Window *
|
||||||
ecore_win32_window_override_new(Ecore_Win32_Window *parent,
|
ecore_win32_window_override_new(Ecore_Win32_Window *parent,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
@ -68,7 +219,15 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent,
|
||||||
WS_POPUP);
|
WS_POPUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Free the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to free.
|
||||||
|
*
|
||||||
|
* This function frees @p window. If @p window is @c NULL, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_free(Ecore_Win32_Window *window)
|
ecore_win32_window_free(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *wnd = window;
|
struct _Ecore_Win32_Window *wnd = window;
|
||||||
|
@ -84,7 +243,15 @@ ecore_win32_window_free(Ecore_Win32_Window *window)
|
||||||
free(window);
|
free(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
/**
|
||||||
|
* @brief Return the window HANDLE associated to the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the HANDLE from.
|
||||||
|
*
|
||||||
|
* This function returns the window HANDLE associated to @p window. If
|
||||||
|
* @p window is @c NULL, this function returns @c NULL.
|
||||||
|
*/
|
||||||
|
EAPI void *
|
||||||
ecore_win32_window_hwnd_get(Ecore_Win32_Window *window)
|
ecore_win32_window_hwnd_get(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return NULL;
|
if (!window) return NULL;
|
||||||
|
@ -124,7 +291,18 @@ ecore_win32_window_configure(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Move the given window to a given position.
|
||||||
|
*
|
||||||
|
* @param window The window to move.
|
||||||
|
* @param x The x coordinate of the destination position.
|
||||||
|
* @param y The y coordinate of the destination position.
|
||||||
|
*
|
||||||
|
* This function move @p window to the new position of coordinates @p x
|
||||||
|
* and @p y. If @p window is @c NULL, or if it is fullscreen, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_move(Ecore_Win32_Window *window,
|
ecore_win32_window_move(Ecore_Win32_Window *window,
|
||||||
int x,
|
int x,
|
||||||
int y)
|
int y)
|
||||||
|
@ -132,6 +310,7 @@ ecore_win32_window_move(Ecore_Win32_Window *window,
|
||||||
RECT rect;
|
RECT rect;
|
||||||
HWND w;
|
HWND w;
|
||||||
|
|
||||||
|
/* FIXME: on fullscreen, should not move it */
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
|
||||||
INF("moving window (%dx%d)", x, y);
|
INF("moving window (%dx%d)", x, y);
|
||||||
|
@ -152,7 +331,18 @@ ecore_win32_window_move(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Resize the given window to a given size.
|
||||||
|
*
|
||||||
|
* @param window The window to resize.
|
||||||
|
* @param width The new width.
|
||||||
|
* @param height The new height.
|
||||||
|
*
|
||||||
|
* This function resize @p window to the new @p width and @p height.
|
||||||
|
* If @p window is @c NULL, or if it is fullscreen, or on error, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_resize(Ecore_Win32_Window *window,
|
ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
|
@ -163,6 +353,7 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
|
/* FIXME: on fullscreen, should not resize it */
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
|
||||||
INF("resizing window (%dx%d)", width, height);
|
INF("resizing window (%dx%d)", width, height);
|
||||||
|
@ -207,7 +398,20 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Move and resize the given window to a given position and size.
|
||||||
|
*
|
||||||
|
* @param window The window to move and resize.
|
||||||
|
* @param x The x coordinate of the destination position.
|
||||||
|
* @param y The x coordinate of the destination position.
|
||||||
|
* @param width The new width.
|
||||||
|
* @param height The new height.
|
||||||
|
*
|
||||||
|
* This function resize @p window to the new position of coordinates @p x
|
||||||
|
* and @p y and the new @p width and @p height. If @p window is @c NULL,
|
||||||
|
* or if it is fullscreen, or on error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
@ -218,6 +422,7 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
struct _Ecore_Win32_Window *w;
|
struct _Ecore_Win32_Window *w;
|
||||||
DWORD style;
|
DWORD style;
|
||||||
|
|
||||||
|
/* FIXME: on fullscreen, should not move/resize it */
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
|
||||||
INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
|
INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height);
|
||||||
|
@ -251,7 +456,23 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the geometry of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the geometry from.
|
||||||
|
* @param x The x coordinate of the position.
|
||||||
|
* @param y The x coordinate of the position.
|
||||||
|
* @param width The width.
|
||||||
|
* @param height The height.
|
||||||
|
*
|
||||||
|
* This function retrieves the position and size of @p window. @p x,
|
||||||
|
* @p y, @p width and @p height can be buffers that will be filled with
|
||||||
|
* the corresponding values. If one of them is @c NULL, nothing will
|
||||||
|
* be done for that parameter. If @p window is @c NULL, and if the
|
||||||
|
* buffers are not @c NULL, they will be filled with respectively 0,
|
||||||
|
* 0, the size of the screen and the height of the screen.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
|
ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
|
||||||
int *x,
|
int *x,
|
||||||
int *y,
|
int *y,
|
||||||
|
@ -309,7 +530,21 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
|
||||||
if (height) *height = h;
|
if (height) *height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the size from.
|
||||||
|
* @param width The width.
|
||||||
|
* @param height The height.
|
||||||
|
*
|
||||||
|
* This function retrieves the size of @p window. @p width and
|
||||||
|
* @p height can be buffers that will be filled with the corresponding
|
||||||
|
* values. If one of them is @c NULL, nothing will be done for that
|
||||||
|
* parameter. If @p window is @c NULL, and if the buffers are not
|
||||||
|
* @c NULL, they will be filled with respectively the size of the screen
|
||||||
|
* and the height of the screen.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_get(Ecore_Win32_Window *window,
|
ecore_win32_window_size_get(Ecore_Win32_Window *window,
|
||||||
int *width,
|
int *width,
|
||||||
int *height)
|
int *height)
|
||||||
|
@ -339,7 +574,18 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
|
||||||
if (height) *height = rect.bottom - rect.top;
|
if (height) *height = rect.bottom - rect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the minimum size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param min_width The minimal width.
|
||||||
|
* @param min_height The minimal height.
|
||||||
|
*
|
||||||
|
* This function sets the minimum size of @p window to @p min_width
|
||||||
|
* and *p min_height. If @p window is @c NULL, this functions does
|
||||||
|
* nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
|
ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
|
||||||
unsigned int min_width,
|
unsigned int min_width,
|
||||||
unsigned int min_height)
|
unsigned int min_height)
|
||||||
|
@ -354,7 +600,18 @@ ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
|
||||||
w->min_height = min_height;
|
w->min_height = min_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the minimum size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param min_width The minimal width.
|
||||||
|
* @param min_height The minimal height.
|
||||||
|
*
|
||||||
|
* This function fills the minimum size of @p window in the buffers
|
||||||
|
* @p min_width and *p min_height. They both can be @c NULL. If
|
||||||
|
* @p window is @c NULL, this functions does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
|
ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
|
||||||
unsigned int *min_width,
|
unsigned int *min_width,
|
||||||
unsigned int *min_height)
|
unsigned int *min_height)
|
||||||
|
@ -369,7 +626,18 @@ ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
|
||||||
if (min_height) *min_height = w->min_height;
|
if (min_height) *min_height = w->min_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the maximum size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param max_width The maximal width.
|
||||||
|
* @param max_height The maximal height.
|
||||||
|
*
|
||||||
|
* This function sets the maximum size of @p window to @p max_width
|
||||||
|
* and *p max_height. If @p window is @c NULL, this functions does
|
||||||
|
* nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
|
ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
|
||||||
unsigned int max_width,
|
unsigned int max_width,
|
||||||
unsigned int max_height)
|
unsigned int max_height)
|
||||||
|
@ -384,7 +652,18 @@ ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
|
||||||
w->max_height = max_height;
|
w->max_height = max_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the maximum size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param max_width The maximal width.
|
||||||
|
* @param max_height The maximal height.
|
||||||
|
*
|
||||||
|
* This function fills the maximum size of @p window in the buffers
|
||||||
|
* @p max_width and *p max_height. They both can be @c NULL. If
|
||||||
|
* @p window is @c NULL, this functions does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
|
ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
|
||||||
unsigned int *max_width,
|
unsigned int *max_width,
|
||||||
unsigned int *max_height)
|
unsigned int *max_height)
|
||||||
|
@ -399,7 +678,18 @@ ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
|
||||||
if (max_height) *max_height = w->max_height;
|
if (max_height) *max_height = w->max_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the base size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param base_width The base width.
|
||||||
|
* @param base_height The base height.
|
||||||
|
*
|
||||||
|
* This function sets the base size of @p window to @p base_width
|
||||||
|
* and *p base_height. If @p window is @c NULL, this functions does
|
||||||
|
* nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
|
ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
|
||||||
unsigned int base_width,
|
unsigned int base_width,
|
||||||
unsigned int base_height)
|
unsigned int base_height)
|
||||||
|
@ -414,7 +704,18 @@ ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
|
||||||
w->base_height = base_height;
|
w->base_height = base_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the base size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param base_width The base width.
|
||||||
|
* @param base_height The bas height.
|
||||||
|
*
|
||||||
|
* This function fills the base size of @p window in the buffers
|
||||||
|
* @p base_width and *p base_height. They both can be @c NULL. If
|
||||||
|
* @p window is @c NULL, this functions does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
|
ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
|
||||||
unsigned int *base_width,
|
unsigned int *base_width,
|
||||||
unsigned int *base_height)
|
unsigned int *base_height)
|
||||||
|
@ -429,7 +730,18 @@ ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
|
||||||
if (base_height) *base_height = w->base_height;
|
if (base_height) *base_height = w->base_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the step size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param step_width The step width.
|
||||||
|
* @param step_height The step height.
|
||||||
|
*
|
||||||
|
* This function sets the step size of @p window to @p step_width
|
||||||
|
* and *p step_height. If @p window is @c NULL, this functions does
|
||||||
|
* nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
|
ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
|
||||||
unsigned int step_width,
|
unsigned int step_width,
|
||||||
unsigned int step_height)
|
unsigned int step_height)
|
||||||
|
@ -444,7 +756,18 @@ ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
|
||||||
w->step_height = step_height;
|
w->step_height = step_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the step size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param step_width The step width.
|
||||||
|
* @param step_height The bas height.
|
||||||
|
*
|
||||||
|
* This function fills the step size of @p window in the buffers
|
||||||
|
* @p step_width and *p step_height. They both can be @c NULL. If
|
||||||
|
* @p window is @c NULL, this functions does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
|
ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
|
||||||
unsigned int *step_width,
|
unsigned int *step_width,
|
||||||
unsigned int *step_height)
|
unsigned int *step_height)
|
||||||
|
@ -459,7 +782,7 @@ ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
|
||||||
if (step_height) *step_height = w->step_height;
|
if (step_height) *step_height = w->step_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
EAPI void
|
||||||
ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
||||||
unsigned short width,
|
unsigned short width,
|
||||||
unsigned short height,
|
unsigned short height,
|
||||||
|
@ -596,7 +919,15 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Show the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to show.
|
||||||
|
*
|
||||||
|
* This function shows @p window. If @p window is @c NULL, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_show(Ecore_Win32_Window *window)
|
ecore_win32_window_show(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -611,7 +942,15 @@ ecore_win32_window_show(Ecore_Win32_Window *window)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: seems to block the taskbar */
|
/* FIXME: seems to block the taskbar */
|
||||||
void
|
/**
|
||||||
|
* @brief Hide the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to show.
|
||||||
|
*
|
||||||
|
* This function hides @p window. If @p window is @c NULL, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_hide(Ecore_Win32_Window *window)
|
ecore_win32_window_hide(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -621,7 +960,15 @@ ecore_win32_window_hide(Ecore_Win32_Window *window)
|
||||||
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE);
|
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Place the given window at the top of the Z order.
|
||||||
|
*
|
||||||
|
* @param window The window to place at the top.
|
||||||
|
*
|
||||||
|
* This function places @p window at the top of the Z order. If
|
||||||
|
* @p window is @c NULL, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_raise(Ecore_Win32_Window *window)
|
ecore_win32_window_raise(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -636,7 +983,15 @@ ecore_win32_window_raise(Ecore_Win32_Window *window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Place the given window at the bottom of the Z order.
|
||||||
|
*
|
||||||
|
* @param window The window to place at the bottom.
|
||||||
|
*
|
||||||
|
* This function places @p window at the bottom of the Z order. If
|
||||||
|
* @p window is @c NULL, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_lower(Ecore_Win32_Window *window)
|
ecore_win32_window_lower(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -651,7 +1006,17 @@ ecore_win32_window_lower(Ecore_Win32_Window *window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the title of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to set the title.
|
||||||
|
* @param title The new title.
|
||||||
|
*
|
||||||
|
* This function sets the title of @p window to @p title. If @p window
|
||||||
|
* is @c NULL, or if @p title is @c NULL or empty, or on error, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
||||||
const char *title)
|
const char *title)
|
||||||
{
|
{
|
||||||
|
@ -667,7 +1032,15 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the focus to the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to give focus to.
|
||||||
|
*
|
||||||
|
* This function gives the focus to @p window. If @p window is
|
||||||
|
* @c NULL, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_focus_set(Ecore_Win32_Window *window)
|
ecore_win32_window_focus_set(Ecore_Win32_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -680,9 +1053,21 @@ ecore_win32_window_focus_set(Ecore_Win32_Window *window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Iconify or restore the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param on EINA_TRUE to iconify the window, EINA_FALSE to restore it.
|
||||||
|
*
|
||||||
|
* This function iconify or restore @p window. If @p on
|
||||||
|
* is set to EINA_TRUE, the window will be iconified, if it is set to
|
||||||
|
* EINA_FALSE, it will be restored. If @p window is @c NULL or if the
|
||||||
|
* state does not change (like iconifying the window while it is
|
||||||
|
* already iconified), this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
||||||
int on)
|
Eina_Bool on)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *ew;
|
struct _Ecore_Win32_Window *ew;
|
||||||
|
|
||||||
|
@ -699,9 +1084,21 @@ ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
||||||
ew->iconified = on;
|
ew->iconified = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Remove or restore the border of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param on EINA_TRUE to remove the border, EINA_FALSE to restore it.
|
||||||
|
*
|
||||||
|
* This function remove or restore the border of @p window. If @p on
|
||||||
|
* is set to EINA_TRUE, the window will have no border, if it is set to
|
||||||
|
* EINA_FALSE, it will have a border. If @p window is @c NULL or if the
|
||||||
|
* state does not change (like setting to borderless while the window
|
||||||
|
* has no border), this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
||||||
int on)
|
Eina_Bool on)
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
DWORD style;
|
DWORD style;
|
||||||
|
@ -765,9 +1162,21 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
||||||
ew->borderless = on;
|
ew->borderless = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the given window to fullscreen.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param on EINA_TRUE for fullscreen mode, EINA_FALSE for windowed mode.
|
||||||
|
*
|
||||||
|
* This function set @p window to fullscreen or windowed mode. If @p on
|
||||||
|
* is set to EINA_TRUE, the window will be fullscreen, if it is set to
|
||||||
|
* EINA_FALSE, it will be windowed. If @p window is @c NULL or if the
|
||||||
|
* state does not change (like setting to fullscreen while the window
|
||||||
|
* is already fullscreen), this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
int on)
|
Eina_Bool on)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *ew;
|
struct _Ecore_Win32_Window *ew;
|
||||||
HWND w;
|
HWND w;
|
||||||
|
@ -847,12 +1256,26 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the given cursor to the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to modify the cursor.
|
||||||
|
* @param cursor The new cursor.
|
||||||
|
*
|
||||||
|
* This function sets @p cursor to @p window. @p cursor must have been
|
||||||
|
* obtained by ecore_win32_cursor_new() or
|
||||||
|
* ecore_win32_cursor_shaped_new(). If @p window or @p cursor is
|
||||||
|
* @c NULL, the function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
|
ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
|
||||||
Ecore_Win32_Cursor *cursor)
|
Ecore_Win32_Cursor *cursor)
|
||||||
{
|
{
|
||||||
INF("setting cursor");
|
INF("setting cursor");
|
||||||
|
|
||||||
|
if (!window || !cursor)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!SetClassLong(((struct _Ecore_Win32_Window *)window)->window,
|
if (!SetClassLong(((struct _Ecore_Win32_Window *)window)->window,
|
||||||
GCL_HCURSOR, (LONG)cursor))
|
GCL_HCURSOR, (LONG)cursor))
|
||||||
{
|
{
|
||||||
|
@ -860,14 +1283,25 @@ ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the state of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to modify the state.
|
||||||
|
* @param state An array of the new states.
|
||||||
|
* @param num The number of states in the array.
|
||||||
|
*
|
||||||
|
* This function set the state of @p window. @p state is an array of
|
||||||
|
* states of size @p num. If @p window or @p state are @c NULL, or if
|
||||||
|
* @p num is less or equal than 0, the function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_state_set(Ecore_Win32_Window *window,
|
ecore_win32_window_state_set(Ecore_Win32_Window *window,
|
||||||
Ecore_Win32_Window_State *state,
|
Ecore_Win32_Window_State *state,
|
||||||
unsigned int num)
|
unsigned int num)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!window || !state || !num)
|
if (!window || !state || (num <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
INF("setting cursor state");
|
INF("setting cursor state");
|
||||||
|
@ -920,7 +1354,20 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Apply the modification of the state to the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param state The state to apply changes.
|
||||||
|
* @param set The value of the state change.
|
||||||
|
*
|
||||||
|
* This function applies the modification of the state @p state of
|
||||||
|
* @p window. @p set is used only for
|
||||||
|
* #ECORE_WIN32_WINDOW_STATE_ICONIFIED and
|
||||||
|
* #ECORE_WIN32_WINDOW_STATE_FULLSCREEN. If @p window is @c NULL, the
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
|
ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
|
||||||
Ecore_Win32_Window_State state,
|
Ecore_Win32_Window_State state,
|
||||||
unsigned int set)
|
unsigned int set)
|
||||||
|
@ -1058,7 +1505,16 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the type of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to modify the type.
|
||||||
|
* @param type The new types.
|
||||||
|
*
|
||||||
|
* This function set the type of @p window to @p type. If
|
||||||
|
* @p window is @c NULL, the function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_win32_window_type_set(Ecore_Win32_Window *window,
|
ecore_win32_window_type_set(Ecore_Win32_Window *window,
|
||||||
Ecore_Win32_Window_Type type)
|
Ecore_Win32_Window_Type type)
|
||||||
{
|
{
|
||||||
|
@ -1099,113 +1555,6 @@ ecore_win32_window_type_set(Ecore_Win32_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/***** Private functions definitions *****/
|
* @}
|
||||||
|
*/
|
||||||
static Ecore_Win32_Window *
|
|
||||||
ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
DWORD style)
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
struct _Ecore_Win32_Window *w;
|
|
||||||
int minimal_width;
|
|
||||||
int minimal_height;
|
|
||||||
|
|
||||||
w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window));
|
|
||||||
if (!w)
|
|
||||||
{
|
|
||||||
ERR("malloc() failed");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
rect.left = 0;
|
|
||||||
rect.top = 0;
|
|
||||||
rect.right = width;
|
|
||||||
rect.bottom = height;
|
|
||||||
if (!AdjustWindowRect(&rect, style, FALSE))
|
|
||||||
{
|
|
||||||
ERR("AdjustWindowRect() failed");
|
|
||||||
free(w);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
minimal_width = GetSystemMetrics(SM_CXMIN);
|
|
||||||
minimal_height = GetSystemMetrics(SM_CYMIN);
|
|
||||||
/* if (((rect.right - rect.left) < minimal_width) || */
|
|
||||||
/* ((rect.bottom - rect.top) < minimal_height)) */
|
|
||||||
/* { */
|
|
||||||
/* fprintf (stderr, "[Ecore] [Win32] ERROR !!\n"); */
|
|
||||||
/* fprintf (stderr, " Wrong size %ld\n", rect.right - rect.left); */
|
|
||||||
/* free(w); */
|
|
||||||
/* return NULL; */
|
|
||||||
/* } */
|
|
||||||
if ((rect.right - rect.left) < minimal_width)
|
|
||||||
{
|
|
||||||
rect.right = rect.left + minimal_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
w->window = CreateWindowEx(0,
|
|
||||||
ECORE_WIN32_WINDOW_CLASS, "",
|
|
||||||
style,
|
|
||||||
x, y,
|
|
||||||
rect.right - rect.left,
|
|
||||||
rect.bottom - rect.top,
|
|
||||||
parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL,
|
|
||||||
NULL, _ecore_win32_instance, NULL);
|
|
||||||
if (!w->window)
|
|
||||||
{
|
|
||||||
ERR("CreateWindowEx() failed");
|
|
||||||
free(w);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetLastError(0);
|
|
||||||
if (!SetWindowLongPtr(w->window, GWL_USERDATA, (LONG)w) && (GetLastError() != 0))
|
|
||||||
{
|
|
||||||
ERR("SetWindowLongPtr() failed");
|
|
||||||
DestroyWindow(w->window);
|
|
||||||
free(w);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
w->min_width = 0;
|
|
||||||
w->min_height = 0;
|
|
||||||
w->max_width = 32767;
|
|
||||||
w->max_height = 32767;
|
|
||||||
w->base_width = -1;
|
|
||||||
w->base_height = -1;
|
|
||||||
w->step_width = -1;
|
|
||||||
w->step_height = -1;
|
|
||||||
|
|
||||||
w->state.iconified = 0;
|
|
||||||
w->state.modal = 0;
|
|
||||||
w->state.sticky = 0;
|
|
||||||
w->state.maximized_vert = 0;
|
|
||||||
w->state.maximized_horz = 0;
|
|
||||||
w->state.shaded = 0;
|
|
||||||
w->state.hidden = 0;
|
|
||||||
w->state.fullscreen = 0;
|
|
||||||
w->state.above = 0;
|
|
||||||
w->state.below = 0;
|
|
||||||
w->state.demands_attention = 0;
|
|
||||||
|
|
||||||
w->type.desktop = 0;
|
|
||||||
w->type.dock = 0;
|
|
||||||
w->type.toolbar = 0;
|
|
||||||
w->type.menu = 0;
|
|
||||||
w->type.utility = 0;
|
|
||||||
w->type.splash = 0;
|
|
||||||
w->type.dialog = 0;
|
|
||||||
w->type.normal = 0;
|
|
||||||
|
|
||||||
w->pointer_is_in = 0;
|
|
||||||
w->borderless = 0;
|
|
||||||
w->iconified = 0;
|
|
||||||
w->fullscreen = 0;
|
|
||||||
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
|
@ -37,107 +37,202 @@ extern "C" {
|
||||||
typedef void Ecore_WinCE_Window;
|
typedef void Ecore_WinCE_Window;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup Ecore_WinCE_Group Ecore_WinCE library
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/* Events */
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Mouse_In
|
||||||
|
* Event sent when the mouse enters the window.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Mouse_In Ecore_WinCE_Event_Mouse_In;
|
typedef struct _Ecore_WinCE_Event_Mouse_In Ecore_WinCE_Event_Mouse_In;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Mouse_Out
|
||||||
|
* Event sent when the mouse leaves the window.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Mouse_Out Ecore_WinCE_Event_Mouse_Out;
|
typedef struct _Ecore_WinCE_Event_Mouse_Out Ecore_WinCE_Event_Mouse_Out;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Focus_In
|
||||||
|
* Event sent when the window gets the focus.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Focus_In Ecore_WinCE_Event_Window_Focus_In;
|
typedef struct _Ecore_WinCE_Event_Window_Focus_In Ecore_WinCE_Event_Window_Focus_In;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Focus_Out
|
||||||
|
* Event sent when the window looses the focus.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Focus_Out Ecore_WinCE_Event_Window_Focus_Out;
|
typedef struct _Ecore_WinCE_Event_Window_Focus_Out Ecore_WinCE_Event_Window_Focus_Out;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Damage
|
||||||
|
* Event sent when the window is damaged.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Damage Ecore_WinCE_Event_Window_Damage;
|
typedef struct _Ecore_WinCE_Event_Window_Damage Ecore_WinCE_Event_Window_Damage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Create
|
||||||
|
* Event sent when the window is created.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Create Ecore_WinCE_Event_Window_Create;
|
typedef struct _Ecore_WinCE_Event_Window_Create Ecore_WinCE_Event_Window_Create;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Destroy
|
||||||
|
* Event sent when the window is destroyed.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Destroy Ecore_WinCE_Event_Window_Destroy;
|
typedef struct _Ecore_WinCE_Event_Window_Destroy Ecore_WinCE_Event_Window_Destroy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Hide
|
||||||
|
* Event sent when the window is hidden.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Hide Ecore_WinCE_Event_Window_Hide;
|
typedef struct _Ecore_WinCE_Event_Window_Hide Ecore_WinCE_Event_Window_Hide;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Show
|
||||||
|
* Event sent when the window is shown.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Show Ecore_WinCE_Event_Window_Show;
|
typedef struct _Ecore_WinCE_Event_Window_Show Ecore_WinCE_Event_Window_Show;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef Ecore_WinCE_Event_Window_Delete_Request
|
||||||
|
* Event sent when the window is deleted.
|
||||||
|
*/
|
||||||
typedef struct _Ecore_WinCE_Event_Window_Delete_Request Ecore_WinCE_Event_Window_Delete_Request;
|
typedef struct _Ecore_WinCE_Event_Window_Delete_Request Ecore_WinCE_Event_Window_Delete_Request;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Mouse_In
|
||||||
|
* Event sent when the mouse enters the window.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Mouse_In
|
struct _Ecore_WinCE_Event_Mouse_In
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate where the mouse entered */
|
||||||
int y;
|
int y; /**< The y coordinate where the mouse entered */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Mouse_Out
|
||||||
|
* Event sent when the mouse leaves the window.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Mouse_Out
|
struct _Ecore_WinCE_Event_Mouse_Out
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate where the mouse leaved */
|
||||||
int y;
|
int y; /**< The y coordinate where the mouse leaved */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Focus_In
|
||||||
|
* Event sent when the window gets the focus.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Focus_In
|
struct _Ecore_WinCE_Event_Window_Focus_In
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Focus_Out
|
||||||
|
* Event sent when the window looses the focus.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Focus_Out
|
struct _Ecore_WinCE_Event_Window_Focus_Out
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Damage
|
||||||
|
* Event sent when the window is damaged.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Damage
|
struct _Ecore_WinCE_Event_Window_Damage
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
int x;
|
int x; /**< The x coordinate of the top left corner of the damaged region */
|
||||||
int y;
|
int y; /**< The y coordinate of the top left corner of the damaged region */
|
||||||
int width;
|
int width; /**< The width of the damaged region */
|
||||||
int height;
|
int height; /**< The height of the damaged region */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Create
|
||||||
|
* Event sent when the window is created.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Create
|
struct _Ecore_WinCE_Event_Window_Create
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Destroy
|
||||||
|
* Event sent when the window is destroyed.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Destroy
|
struct _Ecore_WinCE_Event_Window_Destroy
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Hide
|
||||||
|
* Event sent when the window is hidden.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Hide
|
struct _Ecore_WinCE_Event_Window_Hide
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Show
|
||||||
|
* Event sent when the window is shown.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Show
|
struct _Ecore_WinCE_Event_Window_Show
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Ecore_WinCE_Event_Window_Delete_Request
|
||||||
|
* Event sent when the window is deleted.
|
||||||
|
*/
|
||||||
struct _Ecore_WinCE_Event_Window_Delete_Request
|
struct _Ecore_WinCE_Event_Window_Delete_Request
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Window *window;
|
Ecore_WinCE_Window *window; /**< The window that received the event */
|
||||||
long time;
|
long time; /**< The time the event occured */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
EAPI extern int ECORE_WINCE_EVENT_MOUSE_IN;
|
EAPI extern int ECORE_WINCE_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_WinCE_Event_Mouse_In event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_MOUSE_OUT;
|
EAPI extern int ECORE_WINCE_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_WinCE_Event_Mouse_Out event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Focus_In event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Focus_Out event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DAMAGE;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the #Ecore_WinCE_Event_Damage event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_CREATE;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_CREATE; /**< Ecore_Event for the #Ecore_WinCE_Event_Create event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DESTROY;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the #Ecore_WinCE_Event_Destroy event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_HIDE;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_HIDE; /**< Ecore_Event for the #Ecore_WinCE_Event_Hide event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_SHOW;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_SHOW; /**< Ecore_Event for the #Ecore_WinCE_Event_Show event */
|
||||||
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST;
|
EAPI extern int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_WinCE_Event_Window_Delete_Request event */
|
||||||
|
|
||||||
|
|
||||||
/* Core */
|
/* Core */
|
||||||
|
|
||||||
EAPI int ecore_wince_init();
|
EAPI int ecore_wince_init();
|
||||||
EAPI int ecore_wince_shutdown();
|
EAPI int ecore_wince_shutdown();
|
||||||
|
EAPI void ecore_wince_double_click_time_set(double t);
|
||||||
|
EAPI double ecore_wince_double_click_time_get(void);
|
||||||
EAPI long ecore_wince_current_time_get(void);
|
EAPI long ecore_wince_current_time_get(void);
|
||||||
EAPI void ecore_wince_message_loop_begin (void);
|
|
||||||
|
|
||||||
/* Window */
|
/* Window */
|
||||||
|
|
||||||
|
@ -174,9 +269,9 @@ EAPI void ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
||||||
|
|
||||||
EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
|
EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
|
||||||
|
|
||||||
EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend)(int));
|
EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int));
|
||||||
|
|
||||||
EAPI void ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume)(int));
|
EAPI void ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume_cb)(int));
|
||||||
|
|
||||||
EAPI void ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
|
EAPI void ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
|
||||||
int *x,
|
int *x,
|
||||||
|
@ -189,8 +284,11 @@ EAPI void ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
||||||
int *height);
|
int *height);
|
||||||
|
|
||||||
EAPI void ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
EAPI void ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
||||||
int on);
|
Eina_Bool on);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,200 +16,16 @@
|
||||||
#include "Ecore_WinCE.h"
|
#include "Ecore_WinCE.h"
|
||||||
#include "ecore_wince_private.h"
|
#include "ecore_wince_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/***** Global declarations *****/
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
double _ecore_wince_double_click_time = 0.25;
|
*/
|
||||||
long _ecore_wince_event_last_time = 0;
|
|
||||||
Ecore_WinCE_Window *_ecore_wince_event_last_window = NULL;
|
|
||||||
HINSTANCE _ecore_wince_instance = NULL;
|
|
||||||
int _ecore_wince_log_dom_global = -1;
|
|
||||||
|
|
||||||
int ECORE_WINCE_EVENT_MOUSE_IN = 0;
|
|
||||||
int ECORE_WINCE_EVENT_MOUSE_OUT = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_DAMAGE = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_CREATE = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_DESTROY = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_SHOW = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_HIDE = 0;
|
|
||||||
int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/***** Private declarations *****/
|
|
||||||
|
|
||||||
static int _ecore_wince_init_count = 0;
|
static int _ecore_wince_init_count = 0;
|
||||||
|
|
||||||
LRESULT CALLBACK _ecore_wince_window_procedure(HWND window,
|
|
||||||
UINT message,
|
|
||||||
WPARAM window_param,
|
|
||||||
LPARAM data_param);
|
|
||||||
|
|
||||||
static void _ecore_wince_error_print_cb(const Eina_Log_Domain *d,
|
|
||||||
Eina_Log_Level level,
|
|
||||||
const char *file,
|
|
||||||
const char *fnc,
|
|
||||||
int line,
|
|
||||||
const char *fmt,
|
|
||||||
void *data,
|
|
||||||
va_list args);
|
|
||||||
|
|
||||||
|
|
||||||
/***** API *****/
|
|
||||||
|
|
||||||
int
|
|
||||||
ecore_wince_init()
|
|
||||||
{
|
|
||||||
WNDCLASS wc;
|
|
||||||
|
|
||||||
if (++_ecore_wince_init_count != 1)
|
|
||||||
return _ecore_wince_init_count;
|
|
||||||
|
|
||||||
if (!eina_init())
|
|
||||||
return --_ecore_wince_init_count;
|
|
||||||
|
|
||||||
eina_log_print_cb_set(_ecore_wince_error_print_cb, NULL);
|
|
||||||
_ecore_wince_log_dom_global = eina_log_domain_register("ecore_wince", ECORE_WINCE_DEFAULT_LOG_COLOR);
|
|
||||||
if (_ecore_wince_log_dom_global < 0)
|
|
||||||
{
|
|
||||||
EINA_LOG_ERR("Ecore_WinCE: Could not register log domain");
|
|
||||||
goto shutdown_eina;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ecore_event_init())
|
|
||||||
{
|
|
||||||
ERR("Ecore_WinCE: Could not init ecore_event");
|
|
||||||
goto unregister_log_domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
_ecore_wince_instance = GetModuleHandle(NULL);
|
|
||||||
if (!_ecore_wince_instance)
|
|
||||||
{
|
|
||||||
ERR("GetModuleHandle() failed");
|
|
||||||
goto shutdown_ecore_event;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (&wc, 0, sizeof (wc));
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
|
||||||
wc.lpfnWndProc = _ecore_wince_window_procedure;
|
|
||||||
wc.cbClsExtra = 0;
|
|
||||||
wc.cbWndExtra = 0;
|
|
||||||
wc.hInstance = _ecore_wince_instance;
|
|
||||||
wc.hIcon = NULL;
|
|
||||||
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
|
||||||
wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
|
|
||||||
wc.lpszMenuName = NULL;
|
|
||||||
wc.lpszClassName = ECORE_WINCE_WINDOW_CLASS;
|
|
||||||
|
|
||||||
if(!RegisterClass(&wc))
|
|
||||||
{
|
|
||||||
ERR("RegisterClass() failed");
|
|
||||||
goto free_library;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ECORE_WINCE_EVENT_MOUSE_IN)
|
|
||||||
{
|
|
||||||
ECORE_WINCE_EVENT_MOUSE_IN = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_MOUSE_OUT = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_CREATE = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
|
||||||
ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _ecore_wince_init_count;
|
|
||||||
|
|
||||||
free_library:
|
|
||||||
FreeLibrary(_ecore_wince_instance);
|
|
||||||
shutdown_ecore_event:
|
|
||||||
ecore_event_shutdown();
|
|
||||||
unregister_log_domain:
|
|
||||||
eina_log_domain_unregister(_ecore_wince_log_dom_global);
|
|
||||||
shutdown_eina:
|
|
||||||
eina_shutdown();
|
|
||||||
|
|
||||||
return --_ecore_wince_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ecore_wince_shutdown()
|
|
||||||
{
|
|
||||||
HWND task_bar;
|
|
||||||
|
|
||||||
if (--_ecore_wince_init_count != 0)
|
|
||||||
return _ecore_wince_init_count;
|
|
||||||
|
|
||||||
/* force task bar to be shown (in case the application exits */
|
|
||||||
/* while being fullscreen) */
|
|
||||||
task_bar = FindWindow(L"HHTaskBar", NULL);
|
|
||||||
if (task_bar)
|
|
||||||
{
|
|
||||||
ShowWindow(task_bar, SW_SHOW);
|
|
||||||
EnableWindow(task_bar, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!UnregisterClass(ECORE_WINCE_WINDOW_CLASS, _ecore_wince_instance))
|
|
||||||
ERR("UnregisterClass() failed");
|
|
||||||
|
|
||||||
if (!FreeLibrary(_ecore_wince_instance))
|
|
||||||
ERR("FreeLibrary() failed");
|
|
||||||
|
|
||||||
_ecore_wince_instance = NULL;
|
|
||||||
|
|
||||||
ecore_event_shutdown();
|
|
||||||
eina_log_domain_unregister(_ecore_wince_log_dom_global);
|
|
||||||
_ecore_wince_log_dom_global = -1;
|
|
||||||
eina_shutdown();
|
|
||||||
|
|
||||||
return _ecore_wince_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the timeout for a double and triple clicks to be flagged.
|
|
||||||
*
|
|
||||||
* This sets the time between clicks before the double_click flag is
|
|
||||||
* set in a button down event. If 3 clicks occur within double this
|
|
||||||
* time, the triple_click flag is also set.
|
|
||||||
*
|
|
||||||
* @param t The time in seconds
|
|
||||||
*/
|
|
||||||
EAPI void
|
|
||||||
ecore_wince_double_click_time_set(double t)
|
|
||||||
{
|
|
||||||
if (t < 0.0) t = 0.0;
|
|
||||||
_ecore_wince_double_click_time = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves the double and triple click flag timeout.
|
|
||||||
*
|
|
||||||
* See @ref ecore_wince_double_click_time_set for more information.
|
|
||||||
*
|
|
||||||
* @return The timeout for double clicks in seconds.
|
|
||||||
*/
|
|
||||||
EAPI double
|
|
||||||
ecore_wince_double_click_time_get(void)
|
|
||||||
{
|
|
||||||
return _ecore_wince_double_click_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the last event time
|
|
||||||
*/
|
|
||||||
EAPI long
|
|
||||||
ecore_wince_current_time_get(void)
|
|
||||||
{
|
|
||||||
return _ecore_wince_event_last_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***** Private functions definitions *****/
|
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT CALLBACK
|
||||||
_ecore_wince_window_procedure(HWND window,
|
_ecore_wince_window_procedure(HWND window,
|
||||||
UINT message,
|
UINT message,
|
||||||
|
@ -357,3 +173,225 @@ _ecore_wince_error_print_cb(const Eina_Log_Domain *d __UNUSED__,
|
||||||
fprintf(stderr, "[%s:%d] ", fnc, line);
|
fprintf(stderr, "[%s:%d] ", fnc, line);
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
double _ecore_wince_double_click_time = 0.25;
|
||||||
|
long _ecore_wince_event_last_time = 0;
|
||||||
|
Ecore_WinCE_Window *_ecore_wince_event_last_window = NULL;
|
||||||
|
HINSTANCE _ecore_wince_instance = NULL;
|
||||||
|
int _ecore_wince_log_dom_global = -1;
|
||||||
|
|
||||||
|
int ECORE_WINCE_EVENT_MOUSE_IN = 0;
|
||||||
|
int ECORE_WINCE_EVENT_MOUSE_OUT = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_DAMAGE = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_CREATE = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_DESTROY = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_SHOW = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_HIDE = 0;
|
||||||
|
int ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = 0;
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_WinCE_Group Ecore_WinCE library
|
||||||
|
*
|
||||||
|
* Ecore_WinCE is a library that wraps Windows CE graphic functions
|
||||||
|
* and integrate them nicely into the Ecore main loop.
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the Ecore_WinCE library.
|
||||||
|
*
|
||||||
|
* @return 1 or greater on success, 0 on error.
|
||||||
|
*
|
||||||
|
* This function sets up the Windows CE graphic system. It returns 0 on
|
||||||
|
* failure, otherwise it returns the number of times it has already been
|
||||||
|
* called.
|
||||||
|
*
|
||||||
|
* When Ecore_WinCE is not used anymore, call ecore_wince_shutdown()
|
||||||
|
* to shut down the Ecore_WinCE library.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_wince_init()
|
||||||
|
{
|
||||||
|
WNDCLASS wc;
|
||||||
|
|
||||||
|
if (++_ecore_wince_init_count != 1)
|
||||||
|
return _ecore_wince_init_count;
|
||||||
|
|
||||||
|
if (!eina_init())
|
||||||
|
return --_ecore_wince_init_count;
|
||||||
|
|
||||||
|
eina_log_print_cb_set(_ecore_wince_error_print_cb, NULL);
|
||||||
|
_ecore_wince_log_dom_global = eina_log_domain_register("ecore_wince", ECORE_WINCE_DEFAULT_LOG_COLOR);
|
||||||
|
if (_ecore_wince_log_dom_global < 0)
|
||||||
|
{
|
||||||
|
EINA_LOG_ERR("Ecore_WinCE: Could not register log domain");
|
||||||
|
goto shutdown_eina;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ecore_event_init())
|
||||||
|
{
|
||||||
|
ERR("Ecore_WinCE: Could not init ecore_event");
|
||||||
|
goto unregister_log_domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ecore_wince_instance = GetModuleHandle(NULL);
|
||||||
|
if (!_ecore_wince_instance)
|
||||||
|
{
|
||||||
|
ERR("GetModuleHandle() failed");
|
||||||
|
goto shutdown_ecore_event;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset (&wc, 0, sizeof (wc));
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.lpfnWndProc = _ecore_wince_window_procedure;
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hInstance = _ecore_wince_instance;
|
||||||
|
wc.hIcon = NULL;
|
||||||
|
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||||
|
wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
|
||||||
|
wc.lpszMenuName = NULL;
|
||||||
|
wc.lpszClassName = ECORE_WINCE_WINDOW_CLASS;
|
||||||
|
|
||||||
|
if(!RegisterClass(&wc))
|
||||||
|
{
|
||||||
|
ERR("RegisterClass() failed");
|
||||||
|
goto free_library;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ECORE_WINCE_EVENT_MOUSE_IN)
|
||||||
|
{
|
||||||
|
ECORE_WINCE_EVENT_MOUSE_IN = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_MOUSE_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_CREATE = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
||||||
|
ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _ecore_wince_init_count;
|
||||||
|
|
||||||
|
free_library:
|
||||||
|
FreeLibrary(_ecore_wince_instance);
|
||||||
|
shutdown_ecore_event:
|
||||||
|
ecore_event_shutdown();
|
||||||
|
unregister_log_domain:
|
||||||
|
eina_log_domain_unregister(_ecore_wince_log_dom_global);
|
||||||
|
shutdown_eina:
|
||||||
|
eina_shutdown();
|
||||||
|
|
||||||
|
return --_ecore_wince_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Shut down the Ecore_WinCE library.
|
||||||
|
*
|
||||||
|
* @return 0 when the library is completely shut down, 1 or
|
||||||
|
* greater otherwise.
|
||||||
|
*
|
||||||
|
* This function shuts down the Ecore_WinCE library. It returns 0 when it has
|
||||||
|
* been called the same number of times than ecore_wince_init(). In that case
|
||||||
|
* it shut down all the Windows CE graphic system.
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
ecore_wince_shutdown()
|
||||||
|
{
|
||||||
|
HWND task_bar;
|
||||||
|
|
||||||
|
if (--_ecore_wince_init_count != 0)
|
||||||
|
return _ecore_wince_init_count;
|
||||||
|
|
||||||
|
/* force task bar to be shown (in case the application exits */
|
||||||
|
/* while being fullscreen) */
|
||||||
|
task_bar = FindWindow(L"HHTaskBar", NULL);
|
||||||
|
if (task_bar)
|
||||||
|
{
|
||||||
|
ShowWindow(task_bar, SW_SHOW);
|
||||||
|
EnableWindow(task_bar, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!UnregisterClass(ECORE_WINCE_WINDOW_CLASS, _ecore_wince_instance))
|
||||||
|
ERR("UnregisterClass() failed");
|
||||||
|
|
||||||
|
if (!FreeLibrary(_ecore_wince_instance))
|
||||||
|
ERR("FreeLibrary() failed");
|
||||||
|
|
||||||
|
_ecore_wince_instance = NULL;
|
||||||
|
|
||||||
|
ecore_event_shutdown();
|
||||||
|
eina_log_domain_unregister(_ecore_wince_log_dom_global);
|
||||||
|
_ecore_wince_log_dom_global = -1;
|
||||||
|
eina_shutdown();
|
||||||
|
|
||||||
|
return _ecore_wince_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the timeout for a double and triple clicks to be flagged.
|
||||||
|
*
|
||||||
|
* @param t The time in seconds.
|
||||||
|
*
|
||||||
|
* This function sets the time @p t between clicks before the
|
||||||
|
* double_click flag is set in a button down event. If 3 clicks occur
|
||||||
|
* within double this time, the triple_click flag is also set.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_wince_double_click_time_set(double t)
|
||||||
|
{
|
||||||
|
if (t < 0.0) t = 0.0;
|
||||||
|
_ecore_wince_double_click_time = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the double and triple click flag timeout.
|
||||||
|
*
|
||||||
|
* @return The timeout for double clicks in seconds.
|
||||||
|
*
|
||||||
|
* This function returns the double clicks in seconds. If
|
||||||
|
* ecore_wince_double_click_time_set() has not been called, the
|
||||||
|
* default value is returned. See ecore_wince_double_click_time_set()
|
||||||
|
* for more informations.
|
||||||
|
*/
|
||||||
|
EAPI double
|
||||||
|
ecore_wince_double_click_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_wince_double_click_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the last event time.
|
||||||
|
*
|
||||||
|
* @return The last envent time.
|
||||||
|
*
|
||||||
|
* This function returns the last event time.
|
||||||
|
*/
|
||||||
|
EAPI long
|
||||||
|
ecore_wince_current_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_wince_event_last_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
|
@ -15,8 +15,13 @@
|
||||||
#include "Ecore_WinCE.h"
|
#include "Ecore_WinCE.h"
|
||||||
#include "ecore_wince_private.h"
|
#include "ecore_wince_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/***** Private declarations *****/
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
|
*/
|
||||||
|
|
||||||
static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_window = NULL;
|
static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_window = NULL;
|
||||||
static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_last_window = NULL;
|
static Ecore_WinCE_Window *_ecore_wince_mouse_down_last_last_window = NULL;
|
||||||
|
@ -25,25 +30,346 @@ static long _ecore_wince_mouse_down_last_last_time = 0;
|
||||||
static int _ecore_wince_mouse_down_did_triple = 0;
|
static int _ecore_wince_mouse_down_did_triple = 0;
|
||||||
static int _ecore_wince_mouse_up_count = 0;
|
static int _ecore_wince_mouse_up_count = 0;
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_wince_event_free_key_down(void *data __UNUSED__,
|
||||||
|
void *ev)
|
||||||
|
{
|
||||||
|
Ecore_Event_Key *e;
|
||||||
|
|
||||||
static void _ecore_wince_event_free_key_down(void *data,
|
e = ev;
|
||||||
void *ev);
|
if (e->keyname) free((char *)e->keyname);
|
||||||
|
if (e->key) free((char *)e->key);
|
||||||
|
if (e->string) free((char *)e->string);
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
static void _ecore_wince_event_free_key_up(void *data,
|
static void
|
||||||
void *ev);
|
_ecore_wince_event_free_key_up(void *data __UNUSED__,
|
||||||
|
void *ev)
|
||||||
|
{
|
||||||
|
Ecore_Event_Key *e;
|
||||||
|
|
||||||
static int _ecore_wince_event_keystroke_get(int key,
|
e = ev;
|
||||||
char **keyname,
|
if (e->keyname) free((char *)e->keyname);
|
||||||
char **keysymbol,
|
if (e->key) free((char *)e->key);
|
||||||
char **keycompose);
|
if (e->string) free((char *)e->string);
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
static int _ecore_wince_event_char_get(int key,
|
static int
|
||||||
char **keyname,
|
_ecore_wince_event_keystroke_get(int key,
|
||||||
char **keysymbol,
|
char **keyname,
|
||||||
char **keycompose);
|
char **keysymbol,
|
||||||
|
char **keycompose)
|
||||||
|
{
|
||||||
|
char *kn;
|
||||||
|
char *ks;
|
||||||
|
char *kc;
|
||||||
|
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
*keycompose = NULL;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
/* Keystroke */
|
||||||
|
case VK_PRIOR:
|
||||||
|
kn = "Prior";
|
||||||
|
ks = "Prior";
|
||||||
|
kc = "Prior";
|
||||||
|
break;
|
||||||
|
case VK_NEXT:
|
||||||
|
kn = "Next";
|
||||||
|
ks = "Next";
|
||||||
|
kc = "Next";
|
||||||
|
break;
|
||||||
|
case VK_END:
|
||||||
|
kn = "End";
|
||||||
|
ks = "End";
|
||||||
|
kc = "End";
|
||||||
|
break;
|
||||||
|
case VK_HOME:
|
||||||
|
kn = "Home";
|
||||||
|
ks = "Home";
|
||||||
|
kc = "Home";
|
||||||
|
break;
|
||||||
|
case VK_LEFT:
|
||||||
|
kn = "Left";
|
||||||
|
ks = "Left";
|
||||||
|
kc = "Left";
|
||||||
|
break;
|
||||||
|
case VK_UP:
|
||||||
|
kn = "Up";
|
||||||
|
ks = "Up";
|
||||||
|
kc = "Up";
|
||||||
|
break;
|
||||||
|
case VK_RIGHT:
|
||||||
|
kn = "Right";
|
||||||
|
ks = "Right";
|
||||||
|
kc = "Right";
|
||||||
|
break;
|
||||||
|
case VK_DOWN:
|
||||||
|
kn = "Down";
|
||||||
|
ks = "Down";
|
||||||
|
kc = "Down";
|
||||||
|
break;
|
||||||
|
case VK_INSERT:
|
||||||
|
kn = "Insert";
|
||||||
|
ks = "Insert";
|
||||||
|
kc = "Insert";
|
||||||
|
break;
|
||||||
|
case VK_DELETE:
|
||||||
|
kn = "Delete";
|
||||||
|
ks = "Delete";
|
||||||
|
kc = "Delete";
|
||||||
|
break;
|
||||||
|
case VK_F1:
|
||||||
|
kn = "F1";
|
||||||
|
ks = "F1";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F2:
|
||||||
|
kn = "F2";
|
||||||
|
ks = "F2";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F3:
|
||||||
|
kn = "F3";
|
||||||
|
ks = "F3";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F4:
|
||||||
|
kn = "F4";
|
||||||
|
ks = "F4";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F5:
|
||||||
|
kn = "F5";
|
||||||
|
ks = "F5";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F6:
|
||||||
|
kn = "F6";
|
||||||
|
ks = "F6";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F7:
|
||||||
|
kn = "F7";
|
||||||
|
ks = "F7";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F8:
|
||||||
|
kn = "F8";
|
||||||
|
ks = "F8";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F9:
|
||||||
|
kn = "F9";
|
||||||
|
ks = "F9";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F10:
|
||||||
|
kn = "F10";
|
||||||
|
ks = "F10";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F11:
|
||||||
|
kn = "F11";
|
||||||
|
ks = "F11";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F12:
|
||||||
|
kn = "F12";
|
||||||
|
ks = "F12";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F13:
|
||||||
|
kn = "F13";
|
||||||
|
ks = "F13";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F14:
|
||||||
|
kn = "F14";
|
||||||
|
ks = "F14";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F15:
|
||||||
|
kn = "F15";
|
||||||
|
ks = "F15";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F16:
|
||||||
|
kn = "F16";
|
||||||
|
ks = "F16";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F17:
|
||||||
|
kn = "F17";
|
||||||
|
ks = "F17";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F18:
|
||||||
|
kn = "F18";
|
||||||
|
ks = "F18";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F19:
|
||||||
|
kn = "F19";
|
||||||
|
ks = "F19";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F20:
|
||||||
|
/*
|
||||||
|
* VK_F20 indicates that an arrow key came from a rocker.
|
||||||
|
* This can safely be ignored.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
case VK_F21:
|
||||||
|
/*
|
||||||
|
* VK_F21 indicates that an arrow key came from a directional
|
||||||
|
* pad. This can safely be ignored.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
case VK_F22:
|
||||||
|
kn = "F22";
|
||||||
|
ks = "F22";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F23:
|
||||||
|
/*
|
||||||
|
* Sent with VK_RETURN when doing an action (usually the middle
|
||||||
|
* button on a directional pad. This can safely be ignored.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
case VK_F24:
|
||||||
|
kn = "F24";
|
||||||
|
ks = "F24";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_APPS:
|
||||||
|
kn = "Application";
|
||||||
|
ks = "Application";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_MENU:
|
||||||
|
kn = "Menu";
|
||||||
|
ks = "Menu";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* other non keystroke characters */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keyname = strdup(kn);
|
||||||
|
if (!*keyname) return 0;
|
||||||
|
*keysymbol = strdup(ks);
|
||||||
|
if (!*keysymbol)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
*keyname = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keycompose = strdup(kc);
|
||||||
|
if (!*keycompose)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
free(*keysymbol);
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_ecore_wince_event_char_get(int key,
|
||||||
|
char **keyname,
|
||||||
|
char **keysymbol,
|
||||||
|
char **keycompose)
|
||||||
|
{
|
||||||
|
char kn[32];
|
||||||
|
char ks[32];
|
||||||
|
char kc[32];
|
||||||
|
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
*keycompose = NULL;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case VK_APP3:
|
||||||
|
case VK_BACK:
|
||||||
|
strncpy(kn, "BackSpace", 32);
|
||||||
|
strncpy(ks, "BackSpace", 32);
|
||||||
|
strncpy(kc, "BackSpace", 32);
|
||||||
|
break;
|
||||||
|
case VK_APP4:
|
||||||
|
case VK_TAB:
|
||||||
|
strncpy(kn, "Tab", 32);
|
||||||
|
strncpy(ks, "Tab", 32);
|
||||||
|
strncpy(kc, "Tab", 32);
|
||||||
|
break;
|
||||||
|
case VK_APP5:
|
||||||
|
case 0x0a:
|
||||||
|
/* Line feed (Shift + Enter) */
|
||||||
|
strncpy(kn, "LineFeed", 32);
|
||||||
|
strncpy(ks, "LineFeed", 32);
|
||||||
|
strncpy(kc, "LineFeed", 32);
|
||||||
|
break;
|
||||||
|
case VK_APP2:
|
||||||
|
case VK_RETURN:
|
||||||
|
strncpy(kn, "Return", 32);
|
||||||
|
strncpy(ks, "Return", 32);
|
||||||
|
strncpy(kc, "Return", 32);
|
||||||
|
break;
|
||||||
|
case VK_APP1:
|
||||||
|
case VK_ESCAPE:
|
||||||
|
strncpy(kn, "Escape", 32);
|
||||||
|
strncpy(ks, "Escape", 32);
|
||||||
|
strncpy(kc, "Escape", 32);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* displayable characters */
|
||||||
|
printf (" * key : %d\n", key);
|
||||||
|
kn[0] = (TCHAR)key;
|
||||||
|
kn[1] = '\0';
|
||||||
|
ks[0] = (TCHAR)key;
|
||||||
|
ks[1] = '\0';
|
||||||
|
kc[0] = (TCHAR)key;
|
||||||
|
kc[1] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*keyname = strdup(kn);
|
||||||
|
if (!*keyname) return 0;
|
||||||
|
*keysymbol = strdup(ks);
|
||||||
|
if (!*keysymbol)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
*keyname = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keycompose = strdup(kc);
|
||||||
|
if (!*keycompose)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
free(*keysymbol);
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/***** Global functions *****/
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg,
|
_ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg,
|
||||||
|
@ -577,337 +903,7 @@ _ecore_wince_event_handle_delete_request(Ecore_WinCE_Callback_Data *msg)
|
||||||
ecore_event_add(ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
|
ecore_event_add(ECORE_WINCE_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
/***** Private functions definitions *****/
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_wince_event_free_key_down(void *data __UNUSED__,
|
|
||||||
void *ev)
|
|
||||||
{
|
|
||||||
Ecore_Event_Key *e;
|
|
||||||
|
|
||||||
e = ev;
|
|
||||||
if (e->keyname) free((char *)e->keyname);
|
|
||||||
if (e->key) free((char *)e->key);
|
|
||||||
if (e->string) free((char *)e->string);
|
|
||||||
free(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ecore_wince_event_free_key_up(void *data __UNUSED__,
|
|
||||||
void *ev)
|
|
||||||
{
|
|
||||||
Ecore_Event_Key *e;
|
|
||||||
|
|
||||||
e = ev;
|
|
||||||
if (e->keyname) free((char *)e->keyname);
|
|
||||||
if (e->key) free((char *)e->key);
|
|
||||||
if (e->string) free((char *)e->string);
|
|
||||||
free(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_ecore_wince_event_keystroke_get(int key,
|
|
||||||
char **keyname,
|
|
||||||
char **keysymbol,
|
|
||||||
char **keycompose)
|
|
||||||
{
|
|
||||||
char *kn;
|
|
||||||
char *ks;
|
|
||||||
char *kc;
|
|
||||||
|
|
||||||
*keyname = NULL;
|
|
||||||
*keysymbol = NULL;
|
|
||||||
*keycompose = NULL;
|
|
||||||
|
|
||||||
switch (key)
|
|
||||||
{
|
|
||||||
/* Keystroke */
|
|
||||||
case VK_PRIOR:
|
|
||||||
kn = "Prior";
|
|
||||||
ks = "Prior";
|
|
||||||
kc = "Prior";
|
|
||||||
break;
|
|
||||||
case VK_NEXT:
|
|
||||||
kn = "Next";
|
|
||||||
ks = "Next";
|
|
||||||
kc = "Next";
|
|
||||||
break;
|
|
||||||
case VK_END:
|
|
||||||
kn = "End";
|
|
||||||
ks = "End";
|
|
||||||
kc = "End";
|
|
||||||
break;
|
|
||||||
case VK_HOME:
|
|
||||||
kn = "Home";
|
|
||||||
ks = "Home";
|
|
||||||
kc = "Home";
|
|
||||||
break;
|
|
||||||
case VK_LEFT:
|
|
||||||
kn = "Left";
|
|
||||||
ks = "Left";
|
|
||||||
kc = "Left";
|
|
||||||
break;
|
|
||||||
case VK_UP:
|
|
||||||
kn = "Up";
|
|
||||||
ks = "Up";
|
|
||||||
kc = "Up";
|
|
||||||
break;
|
|
||||||
case VK_RIGHT:
|
|
||||||
kn = "Right";
|
|
||||||
ks = "Right";
|
|
||||||
kc = "Right";
|
|
||||||
break;
|
|
||||||
case VK_DOWN:
|
|
||||||
kn = "Down";
|
|
||||||
ks = "Down";
|
|
||||||
kc = "Down";
|
|
||||||
break;
|
|
||||||
case VK_INSERT:
|
|
||||||
kn = "Insert";
|
|
||||||
ks = "Insert";
|
|
||||||
kc = "Insert";
|
|
||||||
break;
|
|
||||||
case VK_DELETE:
|
|
||||||
kn = "Delete";
|
|
||||||
ks = "Delete";
|
|
||||||
kc = "Delete";
|
|
||||||
break;
|
|
||||||
case VK_F1:
|
|
||||||
kn = "F1";
|
|
||||||
ks = "F1";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F2:
|
|
||||||
kn = "F2";
|
|
||||||
ks = "F2";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F3:
|
|
||||||
kn = "F3";
|
|
||||||
ks = "F3";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F4:
|
|
||||||
kn = "F4";
|
|
||||||
ks = "F4";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F5:
|
|
||||||
kn = "F5";
|
|
||||||
ks = "F5";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F6:
|
|
||||||
kn = "F6";
|
|
||||||
ks = "F6";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F7:
|
|
||||||
kn = "F7";
|
|
||||||
ks = "F7";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F8:
|
|
||||||
kn = "F8";
|
|
||||||
ks = "F8";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F9:
|
|
||||||
kn = "F9";
|
|
||||||
ks = "F9";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F10:
|
|
||||||
kn = "F10";
|
|
||||||
ks = "F10";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F11:
|
|
||||||
kn = "F11";
|
|
||||||
ks = "F11";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F12:
|
|
||||||
kn = "F12";
|
|
||||||
ks = "F12";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F13:
|
|
||||||
kn = "F13";
|
|
||||||
ks = "F13";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F14:
|
|
||||||
kn = "F14";
|
|
||||||
ks = "F14";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F15:
|
|
||||||
kn = "F15";
|
|
||||||
ks = "F15";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F16:
|
|
||||||
kn = "F16";
|
|
||||||
ks = "F16";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F17:
|
|
||||||
kn = "F17";
|
|
||||||
ks = "F17";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F18:
|
|
||||||
kn = "F18";
|
|
||||||
ks = "F18";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F19:
|
|
||||||
kn = "F19";
|
|
||||||
ks = "F19";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F20:
|
|
||||||
/*
|
|
||||||
* VK_F20 indicates that an arrow key came from a rocker.
|
|
||||||
* This can safely be ignored.
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
case VK_F21:
|
|
||||||
/*
|
|
||||||
* VK_F21 indicates that an arrow key came from a directional
|
|
||||||
* pad. This can safely be ignored.
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
case VK_F22:
|
|
||||||
kn = "F22";
|
|
||||||
ks = "F22";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_F23:
|
|
||||||
/*
|
|
||||||
* Sent with VK_RETURN when doing an action (usually the middle
|
|
||||||
* button on a directional pad. This can safely be ignored.
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
case VK_F24:
|
|
||||||
kn = "F24";
|
|
||||||
ks = "F24";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_APPS:
|
|
||||||
kn = "Application";
|
|
||||||
ks = "Application";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
case VK_MENU:
|
|
||||||
kn = "Menu";
|
|
||||||
ks = "Menu";
|
|
||||||
kc = "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* other non keystroke characters */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*keyname = strdup(kn);
|
|
||||||
if (!*keyname) return 0;
|
|
||||||
*keysymbol = strdup(ks);
|
|
||||||
if (!*keysymbol)
|
|
||||||
{
|
|
||||||
free(*keyname);
|
|
||||||
*keyname = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*keycompose = strdup(kc);
|
|
||||||
if (!*keycompose)
|
|
||||||
{
|
|
||||||
free(*keyname);
|
|
||||||
free(*keysymbol);
|
|
||||||
*keyname = NULL;
|
|
||||||
*keysymbol = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_ecore_wince_event_char_get(int key,
|
|
||||||
char **keyname,
|
|
||||||
char **keysymbol,
|
|
||||||
char **keycompose)
|
|
||||||
{
|
|
||||||
char kn[32];
|
|
||||||
char ks[32];
|
|
||||||
char kc[32];
|
|
||||||
|
|
||||||
*keyname = NULL;
|
|
||||||
*keysymbol = NULL;
|
|
||||||
*keycompose = NULL;
|
|
||||||
|
|
||||||
switch (key)
|
|
||||||
{
|
|
||||||
case VK_APP3:
|
|
||||||
case VK_BACK:
|
|
||||||
strncpy(kn, "BackSpace", 32);
|
|
||||||
strncpy(ks, "BackSpace", 32);
|
|
||||||
strncpy(kc, "BackSpace", 32);
|
|
||||||
break;
|
|
||||||
case VK_APP4:
|
|
||||||
case VK_TAB:
|
|
||||||
strncpy(kn, "Tab", 32);
|
|
||||||
strncpy(ks, "Tab", 32);
|
|
||||||
strncpy(kc, "Tab", 32);
|
|
||||||
break;
|
|
||||||
case VK_APP5:
|
|
||||||
case 0x0a:
|
|
||||||
/* Line feed (Shift + Enter) */
|
|
||||||
strncpy(kn, "LineFeed", 32);
|
|
||||||
strncpy(ks, "LineFeed", 32);
|
|
||||||
strncpy(kc, "LineFeed", 32);
|
|
||||||
break;
|
|
||||||
case VK_APP2:
|
|
||||||
case VK_RETURN:
|
|
||||||
strncpy(kn, "Return", 32);
|
|
||||||
strncpy(ks, "Return", 32);
|
|
||||||
strncpy(kc, "Return", 32);
|
|
||||||
break;
|
|
||||||
case VK_APP1:
|
|
||||||
case VK_ESCAPE:
|
|
||||||
strncpy(kn, "Escape", 32);
|
|
||||||
strncpy(ks, "Escape", 32);
|
|
||||||
strncpy(kc, "Escape", 32);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* displayable characters */
|
|
||||||
printf (" * key : %d\n", key);
|
|
||||||
kn[0] = (TCHAR)key;
|
|
||||||
kn[1] = '\0';
|
|
||||||
ks[0] = (TCHAR)key;
|
|
||||||
ks[1] = '\0';
|
|
||||||
kc[0] = (TCHAR)key;
|
|
||||||
kc[1] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*keyname = strdup(kn);
|
|
||||||
if (!*keyname) return 0;
|
|
||||||
*keysymbol = strdup(ks);
|
|
||||||
if (!*keysymbol)
|
|
||||||
{
|
|
||||||
free(*keyname);
|
|
||||||
*keyname = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*keycompose = strdup(kc);
|
|
||||||
if (!*keycompose)
|
|
||||||
{
|
|
||||||
free(*keyname);
|
|
||||||
free(*keysymbol);
|
|
||||||
*keyname = NULL;
|
|
||||||
*keysymbol = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,17 +12,87 @@
|
||||||
#include "Ecore_WinCE.h"
|
#include "Ecore_WinCE.h"
|
||||||
#include "ecore_wince_private.h"
|
#include "ecore_wince_private.h"
|
||||||
|
|
||||||
|
/*============================================================================*
|
||||||
|
* Local *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @cond LOCAL
|
||||||
|
*/
|
||||||
|
|
||||||
/***** Private declarations *****/
|
|
||||||
|
|
||||||
typedef BOOL (__stdcall *UnregisterFunc1Proc)(UINT, UINT);
|
typedef BOOL (__stdcall *UnregisterFunc1Proc)(UINT, UINT);
|
||||||
|
|
||||||
static int _ecore_wince_hardware_keys_register(HWND window);
|
static int
|
||||||
|
_ecore_wince_hardware_keys_register(HWND window)
|
||||||
|
{
|
||||||
|
HINSTANCE core_dll;
|
||||||
|
UnregisterFunc1Proc unregister_fct;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
core_dll = LoadLibrary(L"coredll.dll");
|
||||||
|
if (!core_dll)
|
||||||
|
{
|
||||||
|
ERR("LoadLibrary() failed");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unregister_fct = (UnregisterFunc1Proc)GetProcAddress(core_dll, L"UnregisterFunc1");
|
||||||
|
if (!unregister_fct)
|
||||||
|
{
|
||||||
|
ERR("GetProcAddress() failed");
|
||||||
|
FreeLibrary(core_dll);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0xc1; i <= 0xcf; i++)
|
||||||
|
{
|
||||||
|
unregister_fct(MOD_WIN, i);
|
||||||
|
RegisterHotKey(window, i, MOD_WIN, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
FreeLibrary(core_dll);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @endcond
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/***** API *****/
|
/*============================================================================*
|
||||||
|
* Global *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
Ecore_WinCE_Window *
|
/*============================================================================*
|
||||||
|
* API *
|
||||||
|
*============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Ecore_WinCE_Group Ecore_WinCE library
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates a new window.
|
||||||
|
*
|
||||||
|
* @param parent The parent window.
|
||||||
|
* @param x The x coordinate of the top-left corner of the window.
|
||||||
|
* @param y The y coordinate of the top-left corner of the window.
|
||||||
|
* @param width The width of the window.
|
||||||
|
* @param height The height of hte window.
|
||||||
|
* @return A newly allocated window.
|
||||||
|
*
|
||||||
|
* This function creates a new window which parent is @p parent. @p width and
|
||||||
|
* @p height are the size of the window content (the client part),
|
||||||
|
* without the border and title bar. @p x and @p y are the system
|
||||||
|
* coordinates of the top left cerner of the window (that is, of the
|
||||||
|
* title bar). This function returns a newly created window on
|
||||||
|
* success, and @c NULL on failure.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_WinCE_Window *
|
||||||
ecore_wince_window_new(Ecore_WinCE_Window *parent,
|
ecore_wince_window_new(Ecore_WinCE_Window *parent,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
@ -92,7 +162,15 @@ ecore_wince_window_new(Ecore_WinCE_Window *parent,
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Free the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to free.
|
||||||
|
*
|
||||||
|
* This function frees @p window. If @p window is @c NULL, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_free(Ecore_WinCE_Window *window)
|
ecore_wince_window_free(Ecore_WinCE_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -103,7 +181,15 @@ ecore_wince_window_free(Ecore_WinCE_Window *window)
|
||||||
free(window);
|
free(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
/**
|
||||||
|
* @brief Return the window HANDLE associated to the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the HANDLE from.
|
||||||
|
*
|
||||||
|
* This function returns the window HANDLE associated to @p window. If
|
||||||
|
* @p window is @c NULL, this function returns @c NULL.
|
||||||
|
*/
|
||||||
|
EAPI void *
|
||||||
ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window)
|
ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window)
|
||||||
{
|
{
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@ -112,7 +198,18 @@ ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window)
|
||||||
return ((struct _Ecore_WinCE_Window *)window)->window;
|
return ((struct _Ecore_WinCE_Window *)window)->window;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Move the given window to a given position.
|
||||||
|
*
|
||||||
|
* @param window The window to move.
|
||||||
|
* @param x The x coordinate of the destination position.
|
||||||
|
* @param y The y coordinate of the destination position.
|
||||||
|
*
|
||||||
|
* This function move @p window to the new position of coordinates @p x
|
||||||
|
* and @p y. If @p window is @c NULL, or if it is fullscreen, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_move(Ecore_WinCE_Window *window,
|
ecore_wince_window_move(Ecore_WinCE_Window *window,
|
||||||
int x,
|
int x,
|
||||||
int y)
|
int y)
|
||||||
|
@ -141,7 +238,18 @@ ecore_wince_window_move(Ecore_WinCE_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Resize the given window to a given size.
|
||||||
|
*
|
||||||
|
* @param window The window to resize.
|
||||||
|
* @param width The new width.
|
||||||
|
* @param height The new height.
|
||||||
|
*
|
||||||
|
* This function resize @p window to the new @p width and @p height.
|
||||||
|
* If @p window is @c NULL, or if it is fullscreen, or on error, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_resize(Ecore_WinCE_Window *window,
|
ecore_wince_window_resize(Ecore_WinCE_Window *window,
|
||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
|
@ -196,7 +304,20 @@ ecore_wince_window_resize(Ecore_WinCE_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Move and resize the given window to a given position and size.
|
||||||
|
*
|
||||||
|
* @param window The window to move and resize.
|
||||||
|
* @param x The x coordinate of the destination position.
|
||||||
|
* @param y The x coordinate of the destination position.
|
||||||
|
* @param width The new width.
|
||||||
|
* @param height The new height.
|
||||||
|
*
|
||||||
|
* This function resize @p window to the new position of coordinates @p x
|
||||||
|
* and @p y and the new @p width and @p height. If @p window is @c NULL,
|
||||||
|
* or if it is fullscreen, or on error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_move_resize(Ecore_WinCE_Window *window,
|
ecore_wince_window_move_resize(Ecore_WinCE_Window *window,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
|
@ -243,7 +364,15 @@ ecore_wince_window_move_resize(Ecore_WinCE_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Show the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to show.
|
||||||
|
*
|
||||||
|
* This function shows @p window. If @p window is @c NULL, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_show(Ecore_WinCE_Window *window)
|
ecore_wince_window_show(Ecore_WinCE_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -265,7 +394,15 @@ ecore_wince_window_show(Ecore_WinCE_Window *window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Hide the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to show.
|
||||||
|
*
|
||||||
|
* This function hides @p window. If @p window is @c NULL, or on
|
||||||
|
* error, this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_hide(Ecore_WinCE_Window *window)
|
ecore_wince_window_hide(Ecore_WinCE_Window *window)
|
||||||
{
|
{
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
@ -283,7 +420,17 @@ ecore_wince_window_hide(Ecore_WinCE_Window *window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the title of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to set the title.
|
||||||
|
* @param title The new title.
|
||||||
|
*
|
||||||
|
* This function sets the title of @p window to @p title. If @p window
|
||||||
|
* is @c NULL, or if @p title is @c NULL or empty, or on error, this
|
||||||
|
* function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
||||||
const char *title)
|
const char *title)
|
||||||
{
|
{
|
||||||
|
@ -305,8 +452,30 @@ ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
||||||
free(wtitle);
|
free(wtitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend)
|
* @brief Set the graphic backend used for the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param backend The backend.
|
||||||
|
*
|
||||||
|
* This function sets the graphic backend to use with @p window to
|
||||||
|
* @p backend. If @p window if @c NULL, this function does nothing.
|
||||||
|
*
|
||||||
|
* The valid values for @p backend are
|
||||||
|
*
|
||||||
|
* @li 0: automatic choice of the backend.
|
||||||
|
* @li 1: the framebuffer (fast but could be not well suported).
|
||||||
|
* @li 2: GAPI (less fast but almost always supported).
|
||||||
|
* @li 3: DirectDraw (less fast than GAPI but almost always
|
||||||
|
* supported).
|
||||||
|
* @li 4: GDI (the slowest but always supported).
|
||||||
|
*
|
||||||
|
* The @p backend is used only in Evas and Ecore_Evas. So this
|
||||||
|
* function should not be called if Ecore_Evas is used.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_wince_window_backend_set(Ecore_WinCE_Window *window,
|
||||||
|
int backend)
|
||||||
{
|
{
|
||||||
struct _Ecore_WinCE_Window *w;
|
struct _Ecore_WinCE_Window *w;
|
||||||
|
|
||||||
|
@ -319,8 +488,20 @@ ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend)
|
||||||
w->backend = backend;
|
w->backend = backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend)(int))
|
* @brief Set the suspend callback used for the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param suspend_cb The suspend callback.
|
||||||
|
*
|
||||||
|
* This function sets the suspend callback to use with @p window to
|
||||||
|
* @p suspend_cb. If @p window if @c NULL, this function does nothing.
|
||||||
|
*
|
||||||
|
* The @p suspend_cb is used only in Evas and Ecore_Evas. So this
|
||||||
|
* function should not be called if Ecore_Evas is used.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int))
|
||||||
{
|
{
|
||||||
struct _Ecore_WinCE_Window *w;
|
struct _Ecore_WinCE_Window *w;
|
||||||
|
|
||||||
|
@ -333,8 +514,20 @@ ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend)(int))
|
||||||
w->suspend = suspend;
|
w->suspend = suspend;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume)(int))
|
* @brief Set the resume callback used for the given window.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param resume_cb The resume callback.
|
||||||
|
*
|
||||||
|
* This function sets the resume callback to use with @p window to
|
||||||
|
* @p resume_cb. If @p window if @c NULL, this function does nothing.
|
||||||
|
*
|
||||||
|
* The @p resume_cb is used only in Evas and Ecore_Evas. So this
|
||||||
|
* function should not be called if Ecore_Evas is used.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume_cb)(int))
|
||||||
{
|
{
|
||||||
struct _Ecore_WinCE_Window *w;
|
struct _Ecore_WinCE_Window *w;
|
||||||
|
|
||||||
|
@ -347,7 +540,23 @@ ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume)(int))
|
||||||
w->resume = resume;
|
w->resume = resume;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the geometry of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the geometry from.
|
||||||
|
* @param x The x coordinate of the position.
|
||||||
|
* @param y The x coordinate of the position.
|
||||||
|
* @param width The width.
|
||||||
|
* @param height The height.
|
||||||
|
*
|
||||||
|
* This function retrieves the position and size of @p window. @p x,
|
||||||
|
* @p y, @p width and @p height can be buffers that will be filled with
|
||||||
|
* the corresponding values. If one of them is @c NULL, nothing will
|
||||||
|
* be done for that parameter. If @p window is @c NULL, and if the
|
||||||
|
* buffers are not @c NULL, they will be filled with respectively 0,
|
||||||
|
* 0, the size of the screen and the height of the screen.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
|
ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
|
||||||
int *x,
|
int *x,
|
||||||
int *y,
|
int *y,
|
||||||
|
@ -405,7 +614,21 @@ ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
|
||||||
if (height) *height = h;
|
if (height) *height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Get the size of the given window.
|
||||||
|
*
|
||||||
|
* @param window The window to retrieve the size from.
|
||||||
|
* @param width The width.
|
||||||
|
* @param height The height.
|
||||||
|
*
|
||||||
|
* This function retrieves the size of @p window. @p width and
|
||||||
|
* @p height can be buffers that will be filled with the corresponding
|
||||||
|
* values. If one of them is @c NULL, nothing will be done for that
|
||||||
|
* parameter. If @p window is @c NULL, and if the buffers are not
|
||||||
|
* @c NULL, they will be filled with respectively the size of the screen
|
||||||
|
* and the height of the screen.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
||||||
int *width,
|
int *width,
|
||||||
int *height)
|
int *height)
|
||||||
|
@ -435,9 +658,21 @@ ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
||||||
if (height) *height = rect.bottom - rect.top;
|
if (height) *height = rect.bottom - rect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/**
|
||||||
|
* @brief Set the given window to fullscreen.
|
||||||
|
*
|
||||||
|
* @param window The window.
|
||||||
|
* @param on EINA_TRUE for fullscreen mode, EINA_FALSE for windowed mode.
|
||||||
|
*
|
||||||
|
* This function set @p window to fullscreen or windowed mode. If @p on
|
||||||
|
* is set to EINA_TRUE, the window will be fullscreen, if it is set to
|
||||||
|
* EINA_FALSE, it will be windowed. If @p window is @c NULL or if the
|
||||||
|
* state does not change (like setting to fullscreen while the window
|
||||||
|
* is already fullscreen), this function does nothing.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
||||||
int on)
|
Eina_Bool on)
|
||||||
{
|
{
|
||||||
struct _Ecore_WinCE_Window *ew;
|
struct _Ecore_WinCE_Window *ew;
|
||||||
HWND w;
|
HWND w;
|
||||||
|
@ -555,38 +790,6 @@ ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/***** Private functions definitions *****/
|
* @}
|
||||||
|
*/
|
||||||
static int
|
|
||||||
_ecore_wince_hardware_keys_register(HWND window)
|
|
||||||
{
|
|
||||||
HINSTANCE core_dll;
|
|
||||||
UnregisterFunc1Proc unregister_fct;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
core_dll = LoadLibrary(L"coredll.dll");
|
|
||||||
if (!core_dll)
|
|
||||||
{
|
|
||||||
ERR("LoadLibrary() failed");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
unregister_fct = (UnregisterFunc1Proc)GetProcAddress(core_dll, L"UnregisterFunc1");
|
|
||||||
if (!unregister_fct)
|
|
||||||
{
|
|
||||||
ERR("GetProcAddress() failed");
|
|
||||||
FreeLibrary(core_dll);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0xc1; i <= 0xcf; i++)
|
|
||||||
{
|
|
||||||
unregister_fct(MOD_WIN, i);
|
|
||||||
RegisterHotKey(window, i, MOD_WIN, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
FreeLibrary(core_dll);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue