Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Ecore_Cocoa.h File Reference

Ecore_Cocoa Wrapper Library to interact with the Cocoa environment (Mac OS X) from the E environment. More...

Data Structures

struct  _Ecore_Cocoa_Event_Window_Resize_Request
 Data available when a window is resized. More...
 
struct  _Ecore_Cocoa_Event_Window_Focused
 Data available when a Cocoa window receives focus. More...
 
struct  _Ecore_Cocoa_Event_Window_Unfocused
 Data available when a Cocoa window losrs focus. More...
 
struct  _Ecore_Cocoa_Event_Window_Destroy
 Data available when a Cocoa window is destroyed. More...
 

Macros

#define EAPI
 
#define ECORE_COCOA_CURSOR_DEFAULT   ECORE_COCOA_CURSOR_ARROW
 Defines the default Cocoa cursor, to be used when nothing is specified or as a fallback. More...
 
#define EAPI
 

Typedefs

typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window
 Opaque handler to manipulate a Cocoa Window through Ecore. More...
 
typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen
 Opaque handler to manipulate a Cocoa Screen through Ecore. More...
 
typedef void Ecore_Cocoa_Object
 Opaque handler to refer to an objective-c object (a.k.a. More...
 
typedef struct _Ecore_Cocoa_Event_Window_Resize_Request Ecore_Cocoa_Event_Window_Resize_Request
 Type of event thrown when a Cocoa window is resized. More...
 
typedef struct _Ecore_Cocoa_Event_Window_Focused Ecore_Cocoa_Event_Window_Focused
 Type of event thrown when a Cocoa window receives focus. More...
 
typedef struct _Ecore_Cocoa_Event_Window_Unfocused Ecore_Cocoa_Event_Window_Unfocused
 Type of event thrown when a Cocoa window loses the focus. More...
 
typedef struct _Ecore_Cocoa_Event_Window_Destroy Ecore_Cocoa_Event_Window_Destroy
 Type of event thrown when a Cocoa window gets destoyed. More...
 
typedef Eina_Bool(* Ecore_Cocoa_Terminate_Cb) (Ecore_Cocoa_Object *sender)
 Callback called when a delete request is sent to the application. More...
 

Enumerations

enum  Ecore_Cocoa_Cursor {
  ECORE_COCOA_CURSOR_ARROW = 0 ,
  ECORE_COCOA_CURSOR_CONTEXTUAL_MENU ,
  ECORE_COCOA_CURSOR_CLOSED_HAND ,
  ECORE_COCOA_CURSOR_CROSSHAIR ,
  ECORE_COCOA_CURSOR_DISAPPEARING_ITEM ,
  ECORE_COCOA_CURSOR_DRAG_COPY ,
  ECORE_COCOA_CURSOR_DRAG_LINK ,
  ECORE_COCOA_CURSOR_IBEAM ,
  ECORE_COCOA_CURSOR_OPEN_HAND ,
  ECORE_COCOA_CURSOR_OPERATION_NOT_ALLOWED ,
  ECORE_COCOA_CURSOR_POINTING_HAND ,
  ECORE_COCOA_CURSOR_RESIZE_DOWN ,
  ECORE_COCOA_CURSOR_RESIZE_LEFT ,
  ECORE_COCOA_CURSOR_RESIZE_LEFT_RIGHT ,
  ECORE_COCOA_CURSOR_RESIZE_RIGHT ,
  ECORE_COCOA_CURSOR_RESIZE_UP ,
  ECORE_COCOA_CURSOR_RESIZE_UP_DOWN ,
  ECORE_COCOA_CURSOR_IBEAM_VERTICAL ,
  __ECORE_COCOA_CURSOR_LAST
}
 Values of the Cocoa cursors handled by Ecore_Cocoa See https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCursor_Class/index.html for images of each cursors. More...
 

Functions

EAPI int ecore_cocoa_init (void)
 Inits the Ecore_Cocoa library. More...
 
EAPI int ecore_cocoa_shutdown (void)
 Shuts the Ecore_Cocoa library down. More...
 
EAPI void ecore_cocoa_screen_size_get (Ecore_Cocoa_Screen *screen, int *w, int *h)
 Retrieves the size of a Cocoa screen. More...
 
EAPI Ecore_Cocoa_Windowecore_cocoa_window_new (int x, int y, int w, int h)
 Creates a Cocoa window. More...
 
EAPI void ecore_cocoa_window_free (Ecore_Cocoa_Window *window)
 Releases a Cocoa window. More...
 
EAPI void ecore_cocoa_window_move (Ecore_Cocoa_Window *window, int x, int y)
 Moves a Cocoa window at a given point. More...
 
EAPI void ecore_cocoa_window_resize (Ecore_Cocoa_Window *window, int w, int h)
 Resizes a Cocoa window to a given size. More...
 
EAPI void ecore_cocoa_window_move_resize (Ecore_Cocoa_Window *window, int x, int y, int w, int h)
 Moves and resizes a Cocoa window to a given point and size. More...
 
EAPI void ecore_cocoa_window_geometry_get (const Ecore_Cocoa_Window *window, int *x, int *y, int *w, int *h)
 Gets the geometry of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets the size of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_min_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets the minimum size of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_min_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets the minimum size size of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_max_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets the maximum size of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_max_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets the maximum size size of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_size_step_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets a Cocoa window's resize increment. More...
 
EAPI void ecore_cocoa_window_size_step_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets a Cocoa window's resize increment. More...
 
EAPI void ecore_cocoa_window_show (Ecore_Cocoa_Window *window)
 Displays a Cocoa window. More...
 
EAPI void ecore_cocoa_window_hide (Ecore_Cocoa_Window *window)
 Hides a Cocoa window. More...
 
EAPI void ecore_cocoa_window_raise (Ecore_Cocoa_Window *window)
 Brings a Cocoa window to front. More...
 
EAPI void ecore_cocoa_window_lower (Ecore_Cocoa_Window *window)
 Brings a Cocoa window back. More...
 
EAPI void ecore_cocoa_window_activate (Ecore_Cocoa_Window *window)
 Makes a Cocoa window the current key window by raising it. More...
 
EAPI void ecore_cocoa_window_title_set (Ecore_Cocoa_Window *window, const char *title)
 Changes the title of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_iconified_set (Ecore_Cocoa_Window *window, Eina_Bool on)
 Miniaturizes or deminiaturizes a Cocoa window. More...
 
EAPI void ecore_cocoa_window_borderless_set (Ecore_Cocoa_Window *window, Eina_Bool on)
 Manages the borders of a Cocoa window. More...
 
EAPI void ecore_cocoa_window_view_set (Ecore_Cocoa_Window *window, Ecore_Cocoa_Object *view)
 Sets the content view of a Cocoa window. More...
 
EAPI int ecore_cocoa_titlebar_height_get (void)
 Gets the height of the title bar of Cocoa windows. More...
 
EAPI Ecore_Cocoa_Objectecore_cocoa_window_get (const Ecore_Cocoa_Window *window)
 Retrieves the actual NSWindow behind the Ecore_Cocoa wrapper. More...
 
EAPI void ecore_cocoa_window_cursor_set (Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c)
 Sets the Cocoa cursor for a given Cocoa window. More...
 
EAPI void ecore_cocoa_window_cursor_show (Ecore_Cocoa_Window *win, Eina_Bool show)
 Hides or shows the Cocoa cursor for a given Cocoa window. More...
 
EAPI void ecore_cocoa_terminate_cb_set (Ecore_Cocoa_Terminate_Cb cb)
 Overrides the default behaviour in response to an application delete request. More...
 
EAPI Eina_Bool ecore_cocoa_clipboard_set (const void *data, int size, const char *mime_type)
 
EAPI void * ecore_cocoa_clipboard_get (int *size, const char *mime_type)
 
EAPI void ecore_cocoa_clipboard_clear (void)
 
EAPI Eina_Bool ecore_cocoa_clipboard_exists (void)
 

Variables

EAPI int ECORE_COCOA_EVENT_WINDOW_FOCUSED
 Event triggered when a Cocoa window receives focus. More...
 
EAPI int ECORE_COCOA_EVENT_WINDOW_UNFOCUSED
 Event triggered when a Cocoa window loses focus. More...
 
EAPI int ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST
 Event triggered when a Cocoa window is resized. More...
 
EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY
 Event triggered when a Cocoa window get destroyed. More...
 

Detailed Description

Ecore_Cocoa Wrapper Library to interact with the Cocoa environment (Mac OS X) from the E environment.

Macro Definition Documentation

◆ ECORE_COCOA_CURSOR_DEFAULT

#define ECORE_COCOA_CURSOR_DEFAULT   ECORE_COCOA_CURSOR_ARROW

Defines the default Cocoa cursor, to be used when nothing is specified or as a fallback.

Since
1.18

Typedef Documentation

◆ Ecore_Cocoa_Window

Opaque handler to manipulate a Cocoa Window through Ecore.

Since
1.18

◆ Ecore_Cocoa_Screen

Opaque handler to manipulate a Cocoa Screen through Ecore.

Since
1.18

◆ Ecore_Cocoa_Object

Opaque handler to refer to an objective-c object (a.k.a.

id)

Since
1.18

◆ Ecore_Cocoa_Event_Window_Resize_Request

Type of event thrown when a Cocoa window is resized.

Since
1.18

◆ Ecore_Cocoa_Event_Window_Focused

Type of event thrown when a Cocoa window receives focus.

Since
1.18

◆ Ecore_Cocoa_Event_Window_Unfocused

Type of event thrown when a Cocoa window loses the focus.

Since
1.18

◆ Ecore_Cocoa_Event_Window_Destroy

Type of event thrown when a Cocoa window gets destoyed.

Since
1.18

◆ Ecore_Cocoa_Terminate_Cb

Ecore_Cocoa_Terminate_Cb

Callback called when a delete request is sent to the application.

Such function must return EINA_TRUE for the application to terminate, and EINA_FALSE to ignore application termination. It is typically called by a CMD+Q signal.

Parameters
senderThe NSApplication instance to be terminated
Since
1.19

Enumeration Type Documentation

◆ Ecore_Cocoa_Cursor

Values of the Cocoa cursors handled by Ecore_Cocoa See https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCursor_Class/index.html for images of each cursors.

Since
1.18
Enumerator
ECORE_COCOA_CURSOR_ARROW 

Arrow cursor.

ECORE_COCOA_CURSOR_CONTEXTUAL_MENU 

Contextual menu cursor.

ECORE_COCOA_CURSOR_CLOSED_HAND 

Closed hand cursor.

ECORE_COCOA_CURSOR_CROSSHAIR 

Crosshair cursor.

ECORE_COCOA_CURSOR_DISAPPEARING_ITEM 

Disappearing item cursor.

ECORE_COCOA_CURSOR_DRAG_LINK 

Drag copy cursor.

Drag link cursor

ECORE_COCOA_CURSOR_IBEAM 

IBeam cursor.

ECORE_COCOA_CURSOR_OPEN_HAND 

Open hand cursor.

ECORE_COCOA_CURSOR_OPERATION_NOT_ALLOWED 

Operation not allowed cursor.

ECORE_COCOA_CURSOR_POINTING_HAND 

Pointing hand cursor.

ECORE_COCOA_CURSOR_RESIZE_DOWN 

Resize down cursor.

ECORE_COCOA_CURSOR_RESIZE_LEFT 

Resize left cursor.

ECORE_COCOA_CURSOR_RESIZE_LEFT_RIGHT 

Resize left right cursor.

ECORE_COCOA_CURSOR_RESIZE_RIGHT 

Resize right cursor.

ECORE_COCOA_CURSOR_RESIZE_UP 

Resize up cursor.

ECORE_COCOA_CURSOR_RESIZE_UP_DOWN 

Resize up down cursor.

ECORE_COCOA_CURSOR_IBEAM_VERTICAL 

IBeam vertical cursor.

__ECORE_COCOA_CURSOR_LAST 

Sentinel.

DO NOT USE

Function Documentation

◆ ecore_cocoa_init()

EAPI int ecore_cocoa_init ( void  )

Inits the Ecore_Cocoa library.

Returns
How many times Ecore_Cocoa has been initted
Since
1.18

◆ ecore_cocoa_shutdown()

EAPI int ecore_cocoa_shutdown ( void  )

Shuts the Ecore_Cocoa library down.

Returns
How many times Ecore_Cocoa has been shut down
Since
1.18

◆ ecore_cocoa_screen_size_get()

EAPI void ecore_cocoa_screen_size_get ( Ecore_Cocoa_Screen screen,
int *  w,
int *  h 
)

Retrieves the size of a Cocoa screen.

Parameters
screenThe screen which size must be retrieved
[out]wThe width of the screen
[out]hThe height of the screen
Since
1.18

◆ ecore_cocoa_window_new()

EAPI Ecore_Cocoa_Window * ecore_cocoa_window_new ( int  x,
int  y,
int  w,
int  h 
)

Creates a Cocoa window.

Parameters
xThe origin (X) where the window must be created
yThe origin (Y) where the window must be created
wThe width of the window
hThe height of the window
Returns
A handler on the window. NULL on failure
Since
1.18

◆ ecore_cocoa_window_free()

EAPI void ecore_cocoa_window_free ( Ecore_Cocoa_Window window)

Releases a Cocoa window.

Parameters
windowThe window to be released
Since
1.18

◆ ecore_cocoa_window_move()

EAPI void ecore_cocoa_window_move ( Ecore_Cocoa_Window window,
int  x,
int  y 
)

Moves a Cocoa window at a given point.

Parameters
windowThe window to be moved
xThe new origin of the window (X)
yThe new origin of the window (Y)
Since
1.18

◆ ecore_cocoa_window_resize()

EAPI void ecore_cocoa_window_resize ( Ecore_Cocoa_Window window,
int  w,
int  h 
)

Resizes a Cocoa window to a given size.

Parameters
windowThe window to be moved
wThe new width of the window
hThe new height of the window
Since
1.18

◆ ecore_cocoa_window_move_resize()

EAPI void ecore_cocoa_window_move_resize ( Ecore_Cocoa_Window window,
int  x,
int  y,
int  w,
int  h 
)

Moves and resizes a Cocoa window to a given point and size.

Parameters
windowThe window to be moved
xThe new origin of the window (X)
yThe new origin of the window (Y)
wThe new width of the window
hThe new height of the window
See also
ecore_cocoa_window_resize()
ecore_cocoa_window_move()
Since
1.18

◆ ecore_cocoa_window_geometry_get()

EAPI void ecore_cocoa_window_geometry_get ( const Ecore_Cocoa_Window window,
int *  x,
int *  y,
int *  w,
int *  h 
)

Gets the geometry of a Cocoa window.

Parameters
windowThe window which geometry is queried
xPointer used to retrieve its origin in X
yPointer used to retrieve its origin in Y
wPointer used to retrieve its width
hPointer used to retrieve its height
Since
1.18

◆ ecore_cocoa_window_size_get()

EAPI void ecore_cocoa_window_size_get ( const Ecore_Cocoa_Window window,
int *  w,
int *  h 
)

Gets the size of a Cocoa window.

Parameters
windowThe window which size is queried
wPointer used to retrieve its width
hPointer used to retrieve its height
Since
1.18

◆ ecore_cocoa_window_size_min_set()

EAPI void ecore_cocoa_window_size_min_set ( Ecore_Cocoa_Window window,
int  w,
int  h 
)

Sets the minimum size of a Cocoa window.

Parameters
windowThe window which minimum size is to be altered
wThe new minimum width of the window
hThe new minimum height of the window
Since
1.18

◆ ecore_cocoa_window_size_min_get()

EAPI void ecore_cocoa_window_size_min_get ( const Ecore_Cocoa_Window window,
int *  w,
int *  h 
)

Gets the minimum size size of a Cocoa window.

Parameters
windowThe window which minimum size is queried
wPointer used to retrieve its minimum width
hPointer used to retrieve its minimum height
Since
1.18

◆ ecore_cocoa_window_size_max_set()

EAPI void ecore_cocoa_window_size_max_set ( Ecore_Cocoa_Window window,
int  w,
int  h 
)

Sets the maximum size of a Cocoa window.

Parameters
windowThe window which maximum size is to be altered
wThe new maximum width of the window
hThe new maximum height of the window
Since
1.18

◆ ecore_cocoa_window_size_max_get()

EAPI void ecore_cocoa_window_size_max_get ( const Ecore_Cocoa_Window window,
int *  w,
int *  h 
)

Gets the maximum size size of a Cocoa window.

Parameters
windowThe window which maximum size is queried
wPointer used to retrieve its maximum width
hPointer used to retrieve its maximum height
Since
1.18

◆ ecore_cocoa_window_size_step_set()

EAPI void ecore_cocoa_window_size_step_set ( Ecore_Cocoa_Window window,
int  w,
int  h 
)

Sets a Cocoa window's resize increment.

Parameters
windowThe Cocoa window which resize increment is to be set
wThe width size increment
hThe height size increment
Since
1.18

◆ ecore_cocoa_window_size_step_get()

EAPI void ecore_cocoa_window_size_step_get ( const Ecore_Cocoa_Window window,
int *  w,
int *  h 
)

Gets a Cocoa window's resize increment.

Parameters
windowThe Cocoa window which resize increment queried
wThe width size increment
hThe height size increment
Since
1.18

◆ ecore_cocoa_window_show()

EAPI void ecore_cocoa_window_show ( Ecore_Cocoa_Window window)

Displays a Cocoa window.

Parameters
windowThe Cocoa window to be displayed
Since
1.18

◆ ecore_cocoa_window_hide()

EAPI void ecore_cocoa_window_hide ( Ecore_Cocoa_Window window)

Hides a Cocoa window.

Parameters
windowThe Cocoa window to be hid
Since
1.18

◆ ecore_cocoa_window_raise()

EAPI void ecore_cocoa_window_raise ( Ecore_Cocoa_Window window)

Brings a Cocoa window to front.

Parameters
windowThe Cocoa window to be raised
Since
1.18

◆ ecore_cocoa_window_lower()

EAPI void ecore_cocoa_window_lower ( Ecore_Cocoa_Window window)

Brings a Cocoa window back.

Parameters
windowThe Cocoa window to be lowered
Since
1.18

◆ ecore_cocoa_window_activate()

EAPI void ecore_cocoa_window_activate ( Ecore_Cocoa_Window window)

Makes a Cocoa window the current key window by raising it.

Parameters
windowThe Cocoa window to be activated
Since
1.18

◆ ecore_cocoa_window_title_set()

EAPI void ecore_cocoa_window_title_set ( Ecore_Cocoa_Window window,
const char *  title 
)

Changes the title of a Cocoa window.

Parameters
windowThe Cocoa window which title is to be changed
titleThe new title of the Cocoa window
Since
1.18

◆ ecore_cocoa_window_iconified_set()

EAPI void ecore_cocoa_window_iconified_set ( Ecore_Cocoa_Window window,
Eina_Bool  on 
)

Miniaturizes or deminiaturizes a Cocoa window.

Parameters
windowThe Cocoa window which iconify status is to be changed
onIf EINA_TRUE, will miniaturize the window. Will deminiaturize it if EINA_FALSE
Since
1.18

◆ ecore_cocoa_window_borderless_set()

EAPI void ecore_cocoa_window_borderless_set ( Ecore_Cocoa_Window window,
Eina_Bool  on 
)

Manages the borders of a Cocoa window.

Parameters
windowThe Cocoa window which borders are to be changed
onIf EINA_TRUE, will remove borders. Will restore them if EINA_FALSE
Since
1.18

◆ ecore_cocoa_window_view_set()

EAPI void ecore_cocoa_window_view_set ( Ecore_Cocoa_Window window,
Ecore_Cocoa_Object view 
)

Sets the content view of a Cocoa window.

Refer to Apple's documentation of the property 'contentView' of the NSWindow class for more details about the content view.

Parameters
windowThe Cocoa window which internal view is to be set
viewThe NSView to be set as window content view
Since
1.18

◆ ecore_cocoa_titlebar_height_get()

EAPI int ecore_cocoa_titlebar_height_get ( void  )

Gets the height of the title bar of Cocoa windows.

Returns
The height of the title bar of Cocoa windows
Since
1.18

◆ ecore_cocoa_window_get()

EAPI Ecore_Cocoa_Object * ecore_cocoa_window_get ( const Ecore_Cocoa_Window window)

Retrieves the actual NSWindow behind the Ecore_Cocoa wrapper.

Parameters
windowThe Ecore_Cocoa wrapper which window is to be retrieved
Returns
The Cocoa NSWindow manipulated by window
Since
1.18

◆ ecore_cocoa_window_cursor_set()

EAPI void ecore_cocoa_window_cursor_set ( Ecore_Cocoa_Window win,
Ecore_Cocoa_Cursor  c 
)

Sets the Cocoa cursor for a given Cocoa window.

Parameters
winThe Cocoa window on which the cursor is to be changed.
cThe cursor to be set
Since
1.18

◆ ecore_cocoa_window_cursor_show()

EAPI void ecore_cocoa_window_cursor_show ( Ecore_Cocoa_Window win,
Eina_Bool  show 
)

Hides or shows the Cocoa cursor for a given Cocoa window.

Parameters
winThe Cocoa window on which the cursor is to be hid
showShows the cursor if EINA_TRUE. Hides it if EINA_FALSE
Since
1.18

◆ ecore_cocoa_terminate_cb_set()

EAPI void ecore_cocoa_terminate_cb_set ( Ecore_Cocoa_Terminate_Cb  cb)

Overrides the default behaviour in response to an application delete request.

When an application receives a delete request (i.e. CMD+Q) the termination callback will be called and its result will determine whether the application should terminate or not

Parameters
cbThe custom termination callback to set
See also
Ecore_Cocoa_Terminate_Cb
Since
1.19

Variable Documentation

◆ ECORE_COCOA_EVENT_WINDOW_FOCUSED

EAPI int ECORE_COCOA_EVENT_WINDOW_FOCUSED
extern

Event triggered when a Cocoa window receives focus.

Since
1.18

◆ ECORE_COCOA_EVENT_WINDOW_UNFOCUSED

EAPI int ECORE_COCOA_EVENT_WINDOW_UNFOCUSED
extern

Event triggered when a Cocoa window loses focus.

Since
1.18

◆ ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST

EAPI int ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST
extern

Event triggered when a Cocoa window is resized.

Since
1.18

◆ ECORE_COCOA_EVENT_WINDOW_DESTROY

EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY
extern

Event triggered when a Cocoa window get destroyed.

Since
1.18