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.
#define EAPI

Typedefs

typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window
 Opaque handler to manipulate a Cocoa Window through Ecore.
typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen
 Opaque handler to manipulate a Cocoa Screen through Ecore.
typedef void Ecore_Cocoa_Object
 Opaque handler to refer to an objective-c object (a.k.a.
typedef struct _Ecore_Cocoa_Event_Window_Resize_Request Ecore_Cocoa_Event_Window_Resize_Request
 Type of event thrown when a Cocoa window is resized.
typedef struct _Ecore_Cocoa_Event_Window_Focused Ecore_Cocoa_Event_Window_Focused
 Type of event thrown when a Cocoa window receives focus.
typedef struct _Ecore_Cocoa_Event_Window_Unfocused Ecore_Cocoa_Event_Window_Unfocused
 Type of event thrown when a Cocoa window loses the focus.
typedef struct _Ecore_Cocoa_Event_Window_Destroy Ecore_Cocoa_Event_Window_Destroy
 Type of event thrown when a Cocoa window gets destoyed.
typedef Eina_Bool(*) Ecore_Cocoa_Terminate_Cb(Ecore_Cocoa_Object *sender)
 Callback called when a delete request is sent to the application.
typedef Eina_Bool(*) Ecore_Cocoa_Reopen_Cb(Eina_Bool has_visible)
 Callback called when the application is asked to reopen (e.g.
typedef Eina_Bool(*) Ecore_Cocoa_URL_Open_Cb(const char *url)
 Callback called when macOS asks the application to open a URL.
typedef struct _Ecore_Cocoa_Menu Ecore_Cocoa_Menu
 Opaque handle for a native NSMenu managed through Ecore_Cocoa.

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.
EAPI int ecore_cocoa_shutdown (void)
 Shuts the Ecore_Cocoa library down.
EAPI void ecore_cocoa_screen_size_get (Ecore_Cocoa_Screen *screen, int *w, int *h)
 Retrieves the size of a Cocoa screen.
EAPI Ecore_Cocoa_Window * ecore_cocoa_window_new (int x, int y, int w, int h)
 Creates a Cocoa window.
EAPI void ecore_cocoa_window_free (Ecore_Cocoa_Window *window)
 Releases a Cocoa window.
EAPI void ecore_cocoa_window_move (Ecore_Cocoa_Window *window, int x, int y)
 Moves a Cocoa window at a given point.
EAPI void ecore_cocoa_window_resize (Ecore_Cocoa_Window *window, int w, int h)
 Resizes a Cocoa window to a given size.
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.
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.
EAPI void ecore_cocoa_window_size_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets the size of a Cocoa window.
EAPI void ecore_cocoa_window_size_min_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets the minimum size of a Cocoa window.
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.
EAPI void ecore_cocoa_window_size_max_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets the maximum size of a Cocoa window.
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.
EAPI void ecore_cocoa_window_size_step_set (Ecore_Cocoa_Window *window, int w, int h)
 Sets a Cocoa window's resize increment.
EAPI void ecore_cocoa_window_size_step_get (const Ecore_Cocoa_Window *window, int *w, int *h)
 Gets a Cocoa window's resize increment.
EAPI void ecore_cocoa_window_show (Ecore_Cocoa_Window *window)
 Displays a Cocoa window.
EAPI void ecore_cocoa_window_hide (Ecore_Cocoa_Window *window)
 Hides a Cocoa window.
EAPI void ecore_cocoa_window_raise (Ecore_Cocoa_Window *window)
 Brings a Cocoa window to front.
EAPI void ecore_cocoa_window_lower (Ecore_Cocoa_Window *window)
 Brings a Cocoa window back.
EAPI void ecore_cocoa_window_activate (Ecore_Cocoa_Window *window)
 Makes a Cocoa window the current key window by raising it.
EAPI void ecore_cocoa_window_title_set (Ecore_Cocoa_Window *window, const char *title)
 Changes the title of a Cocoa window.
EAPI void ecore_cocoa_window_iconified_set (Ecore_Cocoa_Window *window, Eina_Bool on)
 Miniaturizes or deminiaturizes a Cocoa window.
EAPI void ecore_cocoa_window_borderless_set (Ecore_Cocoa_Window *window, Eina_Bool on)
 Manages the borders of a Cocoa window.
EAPI void ecore_cocoa_window_view_set (Ecore_Cocoa_Window *window, Ecore_Cocoa_Object *view)
 Sets the content view of a Cocoa window.
EAPI int ecore_cocoa_titlebar_height_get (void)
 Gets the height of the title bar of Cocoa windows.
EAPI Ecore_Cocoa_Object * ecore_cocoa_window_get (const Ecore_Cocoa_Window *window)
 Retrieves the actual NSWindow behind the Ecore_Cocoa wrapper.
EAPI void ecore_cocoa_window_cursor_set (Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c)
 Sets the Cocoa cursor for a given Cocoa window.
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.
EAPI double ecore_cocoa_window_backing_scale_get (const Ecore_Cocoa_Window *window)
 Gets the backing scale factor for HiDPI/Retina displays.
EAPI void ecore_cocoa_terminate_cb_set (Ecore_Cocoa_Terminate_Cb cb)
 Overrides the default behaviour in response to an application delete request.
EAPI Eina_Bool ecore_cocoa_app_icon_set (const char *path)
 Sets the application icon shown in the Dock and Command+Tab switcher.
EAPI void ecore_cocoa_reopen_cb_set (Ecore_Cocoa_Reopen_Cb cb)
 Registers a callback to be invoked when the application is asked to reopen.
EAPI void ecore_cocoa_url_open_cb_set (Ecore_Cocoa_URL_Open_Cb cb)
 Registers a callback to be invoked when macOS asks the application to open a URL via a registered custom URL scheme (CFBundleURLTypes in Info.plist).
EAPI Ecore_Cocoa_Menu * ecore_cocoa_menu_new (const char *title)
 Creates a new top-level or sub NSMenu.
EAPI void ecore_cocoa_menu_free (Ecore_Cocoa_Menu *menu)
 Frees an NSMenu and all associated target objects.
EAPI int ecore_cocoa_menu_item_add (Ecore_Cocoa_Menu *menu, const char *label, const char *icon, void(*cb)(void *data, Ecore_Cocoa_Menu *menu, int idx), void *data)
 Adds a labeled menu item with an optional action callback.
EAPI int ecore_cocoa_menu_item_add_separator (Ecore_Cocoa_Menu *menu)
 Adds a separator item to the menu.
EAPI void ecore_cocoa_menu_item_del (Ecore_Cocoa_Menu *menu, int idx)
 Removes the item at idx from the menu.
EAPI void ecore_cocoa_menu_item_tag_set (Ecore_Cocoa_Menu *menu, int idx, int tag)
 Sets an integer tag on a menu item.
EAPI void ecore_cocoa_menu_item_del_by_tag (Ecore_Cocoa_Menu *menu, int tag)
 Removes a menu item identified by its tag.
EAPI int ecore_cocoa_menu_item_index_by_tag (Ecore_Cocoa_Menu *menu, int tag)
 Returns the positional index of the menu item matching the given tag.
EAPI void ecore_cocoa_menu_item_enabled_set (Ecore_Cocoa_Menu *menu, int idx, Eina_Bool enabled)
 Enables or disables a menu item.
EAPI void ecore_cocoa_menu_item_enabled_set_by_tag (Ecore_Cocoa_Menu *menu, int tag, Eina_Bool enabled)
 Enables or disables a menu item identified by its tag.
EAPI void ecore_cocoa_menu_item_label_set (Ecore_Cocoa_Menu *menu, int idx, const char *label)
 Updates the label of an existing menu item.
EAPI void ecore_cocoa_menu_submenu_set (Ecore_Cocoa_Menu *menu, int idx, Ecore_Cocoa_Menu *submenu)
 Attaches a sub-menu to an existing menu item.
EAPI void ecore_cocoa_menu_main_set (Ecore_Cocoa_Menu *menu)
 Installs menu as the application's main menu bar.
EAPI Ecore_Cocoa_Menu * ecore_cocoa_menu_main_get (void)
 Returns the current main menu handle, or NULL if none has been set.
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.
EAPI int ECORE_COCOA_EVENT_WINDOW_UNFOCUSED
 Event triggered when a Cocoa window loses focus.
EAPI int ECORE_COCOA_EVENT_WINDOW_RESIZE_REQUEST
 Event triggered when a Cocoa window is resized.
EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY
 Event triggered when a Cocoa window get destroyed.

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

Referenced by elm_object_cursor_unset().

Typedef Documentation

◆ Ecore_Cocoa_Window

typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window

Opaque handler to manipulate a Cocoa Window through Ecore.

Since
1.18

◆ Ecore_Cocoa_Screen

typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen

Opaque handler to manipulate a Cocoa Screen through Ecore.

Since
1.18

◆ Ecore_Cocoa_Object

typedef void 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

typedef Eina_Bool(*) Ecore_Cocoa_Terminate_Cb(Ecore_Cocoa_Object *sender)

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

◆ Ecore_Cocoa_Reopen_Cb

typedef Eina_Bool(*) Ecore_Cocoa_Reopen_Cb(Eina_Bool has_visible)

Callback called when the application is asked to reopen (e.g.

the user clicks the Dock icon or re-launches from Spotlight while the application is already running). This corresponds to the applicationShouldHandleReopen:hasVisibleWindows: NSApplicationDelegate method. Return EINA_TRUE to indicate the event was handled (macOS will not apply default behaviour). Return EINA_FALSE to let macOS apply its default behaviour (bring existing visible windows to front, or do nothing).

Parameters
has_visibleEINA_TRUE if the application has at least one visible window at the time of the reopen request.
Since
1.20

◆ Ecore_Cocoa_URL_Open_Cb

typedef Eina_Bool(*) Ecore_Cocoa_URL_Open_Cb(const char *url)

Callback called when macOS asks the application to open a URL.

This occurs when the user clicks a link using a custom URL scheme registered in the application's Info.plist (CFBundleURLTypes), e.g. terminology://tmux/work. This corresponds to the application:openURLs: NSApplicationDelegate method. The callback is invoked once per URL. Return EINA_TRUE to indicate the URL was handled, EINA_FALSE otherwise.

Parameters
urlThe URL string to open (UTF-8 encoded, caller-owned — the callback must copy it if it needs to persist beyond the call).
Since
1.28

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

References ecore_cocoa_init().

Referenced by ecore_cocoa_init().

◆ 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

References ecore_cocoa_shutdown().

Referenced by ecore_cocoa_shutdown().

◆ 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

References ecore_cocoa_screen_size_get().

Referenced by ecore_cocoa_screen_size_get().

◆ 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

References ecore_cocoa_window_new(), EINA_MALLOC, and EINA_WARN_UNUSED_RESULT.

Referenced by ecore_cocoa_window_new().

◆ 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

References ecore_cocoa_window_free(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_free().

◆ 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

References ecore_cocoa_window_move(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_move().

◆ 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

References ecore_cocoa_window_resize(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_resize().

◆ 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

References ecore_cocoa_window_move_resize(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_move_resize().

◆ 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

References ecore_cocoa_window_geometry_get(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_geometry_get().

◆ 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

References ecore_cocoa_window_size_get(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_get().

◆ 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

References ecore_cocoa_window_size_min_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_min_set().

◆ 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

References ecore_cocoa_window_size_min_get(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_min_get().

◆ 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

References ecore_cocoa_window_size_max_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_max_set().

◆ 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

References ecore_cocoa_window_size_max_get(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_max_get().

◆ 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

References ecore_cocoa_window_size_step_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_step_set().

◆ 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

References ecore_cocoa_window_size_step_get(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_size_step_get().

◆ 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

References ecore_cocoa_window_show(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_show().

◆ 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

References ecore_cocoa_window_hide(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_hide().

◆ 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

References ecore_cocoa_window_raise(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_raise().

◆ 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

References ecore_cocoa_window_lower(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_lower().

◆ 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

References ecore_cocoa_window_activate(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_activate().

◆ 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

References ecore_cocoa_window_title_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_title_set().

◆ 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

References ecore_cocoa_window_iconified_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_iconified_set().

◆ 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

References ecore_cocoa_window_borderless_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_borderless_set().

◆ 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

References ecore_cocoa_window_view_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_view_set().

◆ 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

References ecore_cocoa_titlebar_height_get().

Referenced by ecore_cocoa_titlebar_height_get().

◆ 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

References ecore_cocoa_window_get(), EINA_ARG_NONNULL, and EINA_WARN_UNUSED_RESULT.

Referenced by ecore_cocoa_window_get().

◆ 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

References ecore_cocoa_window_cursor_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_cursor_set(), and elm_object_cursor_unset().

◆ 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

References ecore_cocoa_window_cursor_show(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_window_cursor_show().

◆ ecore_cocoa_window_backing_scale_get()

EAPI double ecore_cocoa_window_backing_scale_get ( const Ecore_Cocoa_Window * window)

Gets the backing scale factor for HiDPI/Retina displays.

Parameters
windowThe Cocoa window to query
Returns
The scale factor (e.g. 2.0 on Retina displays, 1.0 otherwise)

References ecore_cocoa_window_backing_scale_get().

Referenced by ecore_cocoa_window_backing_scale_get().

◆ 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

References ecore_cocoa_terminate_cb_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_terminate_cb_set().

◆ ecore_cocoa_app_icon_set()

EAPI Eina_Bool ecore_cocoa_app_icon_set ( const char * path)

Sets the application icon shown in the Dock and Command+Tab switcher.

Parameters
pathAbsolute path to a PNG or other image file
Returns
EINA_TRUE on success, EINA_FALSE on failure

References ecore_cocoa_app_icon_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_app_icon_set(), and elm_win_icon_name_set().

◆ ecore_cocoa_reopen_cb_set()

EAPI void ecore_cocoa_reopen_cb_set ( Ecore_Cocoa_Reopen_Cb cb)

Registers a callback to be invoked when the application is asked to reopen.

This occurs when the user clicks the running application's Dock icon or re-launches it from Spotlight / Launchpad while it is already running. If cb is NULL the default macOS reopen behaviour is restored (bring visible windows to front).

Parameters
cbThe reopen callback to set, or NULL to clear it.
See also
Ecore_Cocoa_Reopen_Cb
Since
1.20

References ecore_cocoa_reopen_cb_set().

Referenced by ecore_cocoa_reopen_cb_set().

◆ ecore_cocoa_url_open_cb_set()

EAPI void ecore_cocoa_url_open_cb_set ( Ecore_Cocoa_URL_Open_Cb cb)

Registers a callback to be invoked when macOS asks the application to open a URL via a registered custom URL scheme (CFBundleURLTypes in Info.plist).

The callback fires for each URL, both on cold launch (URL triggers app start) and warm launch (app already running). If cb is NULL, incoming URL open requests are silently ignored.

Parameters
cbThe URL open callback to set, or NULL to clear it.
See also
Ecore_Cocoa_URL_Open_Cb
Since
1.28

References ecore_cocoa_url_open_cb_set().

Referenced by ecore_cocoa_url_open_cb_set().

◆ ecore_cocoa_menu_new()

EAPI Ecore_Cocoa_Menu * ecore_cocoa_menu_new ( const char * title)

Creates a new top-level or sub NSMenu.

Parameters
titleThe menu title (used by macOS for the menu bar title).
Returns
An opaque handle, or NULL on failure.

References ecore_cocoa_menu_new(), and EINA_WARN_UNUSED_RESULT.

Referenced by ecore_cocoa_menu_new().

◆ ecore_cocoa_menu_free()

EAPI void ecore_cocoa_menu_free ( Ecore_Cocoa_Menu * menu)

Frees an NSMenu and all associated target objects.

Parameters
menuThe menu to free.

References ecore_cocoa_menu_free().

Referenced by ecore_cocoa_menu_free().

◆ ecore_cocoa_menu_item_add()

EAPI int ecore_cocoa_menu_item_add ( Ecore_Cocoa_Menu * menu,
const char * label,
const char * icon,
void(* cb )(void *data, Ecore_Cocoa_Menu *menu, int idx),
void * data )

Adds a labeled menu item with an optional action callback.

Parameters
menuThe menu to add the item to.
labelUTF-8 label text.
iconReserved for future use (pass NULL).
cbC callback invoked when the item is clicked, or NULL.
dataUser data passed to cb.
Returns
The zero-based index of the new item, or -1 on failure.

References ecore_cocoa_menu_item_add(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_add().

◆ ecore_cocoa_menu_item_add_separator()

EAPI int ecore_cocoa_menu_item_add_separator ( Ecore_Cocoa_Menu * menu)

Adds a separator item to the menu.

Parameters
menuThe menu to add the separator to.
Returns
The zero-based index of the separator, or -1 on failure.

References ecore_cocoa_menu_item_add_separator(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_add_separator().

◆ ecore_cocoa_menu_item_del()

EAPI void ecore_cocoa_menu_item_del ( Ecore_Cocoa_Menu * menu,
int idx )

Removes the item at idx from the menu.

Parameters
menuThe menu.
idxIndex returned by ecore_cocoa_menu_item_add().

References ecore_cocoa_menu_item_del(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_del().

◆ ecore_cocoa_menu_item_tag_set()

EAPI void ecore_cocoa_menu_item_tag_set ( Ecore_Cocoa_Menu * menu,
int idx,
int tag )

Sets an integer tag on a menu item.

Tags can be used to identify items independently of their positional index (which drifts on deletion).

Parameters
menuThe menu.
idxPositional index of the item.
tagInteger tag value (stored in NSMenuItem.tag).

References ecore_cocoa_menu_item_tag_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_tag_set().

◆ ecore_cocoa_menu_item_del_by_tag()

EAPI void ecore_cocoa_menu_item_del_by_tag ( Ecore_Cocoa_Menu * menu,
int tag )

Removes a menu item identified by its tag.

Parameters
menuThe menu.
tagTag previously assigned via ecore_cocoa_menu_item_tag_set().

References ecore_cocoa_menu_item_del_by_tag(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_del_by_tag().

◆ ecore_cocoa_menu_item_index_by_tag()

EAPI int ecore_cocoa_menu_item_index_by_tag ( Ecore_Cocoa_Menu * menu,
int tag )

Returns the positional index of the menu item matching the given tag.

Parameters
menuThe menu.
tagTag previously assigned via ecore_cocoa_menu_item_tag_set().
Returns
Positional index (>= 0) or -1 if not found.

References ecore_cocoa_menu_item_index_by_tag(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_index_by_tag().

◆ ecore_cocoa_menu_item_enabled_set()

EAPI void ecore_cocoa_menu_item_enabled_set ( Ecore_Cocoa_Menu * menu,
int idx,
Eina_Bool enabled )

Enables or disables a menu item.

Parameters
menuThe menu.
idxItem index.
enabledEINA_TRUE to enable, EINA_FALSE to grey out.

References ecore_cocoa_menu_item_enabled_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_enabled_set().

◆ ecore_cocoa_menu_item_enabled_set_by_tag()

EAPI void ecore_cocoa_menu_item_enabled_set_by_tag ( Ecore_Cocoa_Menu * menu,
int tag,
Eina_Bool enabled )

Enables or disables a menu item identified by its tag.

Parameters
menuThe menu.
tagTag value.
enabledEINA_TRUE to enable, EINA_FALSE to grey out.

References ecore_cocoa_menu_item_enabled_set_by_tag(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_enabled_set_by_tag().

◆ ecore_cocoa_menu_item_label_set()

EAPI void ecore_cocoa_menu_item_label_set ( Ecore_Cocoa_Menu * menu,
int idx,
const char * label )

Updates the label of an existing menu item.

Parameters
menuThe menu.
idxItem index.
labelNew UTF-8 label.

References ecore_cocoa_menu_item_label_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_item_label_set().

◆ ecore_cocoa_menu_submenu_set()

EAPI void ecore_cocoa_menu_submenu_set ( Ecore_Cocoa_Menu * menu,
int idx,
Ecore_Cocoa_Menu * submenu )

Attaches a sub-menu to an existing menu item.

Parameters
menuThe parent menu.
idxIndex of the parent item that will own the submenu.
submenuThe child menu to attach.

References ecore_cocoa_menu_submenu_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_submenu_set().

◆ ecore_cocoa_menu_main_set()

EAPI void ecore_cocoa_menu_main_set ( Ecore_Cocoa_Menu * menu)

Installs menu as the application's main menu bar.

The menu is set unconditionally — NSApp is always initialised by the time a window exists.

Parameters
menuThe top-level menu to install.

References ecore_cocoa_menu_main_set(), and EINA_ARG_NONNULL.

Referenced by ecore_cocoa_menu_main_set().

◆ ecore_cocoa_menu_main_get()

EAPI Ecore_Cocoa_Menu * ecore_cocoa_menu_main_get ( void )

Returns the current main menu handle, or NULL if none has been set.

References ecore_cocoa_menu_main_get(), and EINA_WARN_UNUSED_RESULT.

Referenced by ecore_cocoa_menu_main_get().

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