main.c File Reference

When entrance starts, and ui specific variables. More...


Defines

#define WINW   800
#define WINH   600

Functions

Ecore_Evas * setup_ecore_evas (int wx, int wy, int ww, int wh, int fullscreen)
static int idler_before_cb (void *data)
static int idler_after_cb (void *data)
static char * get_my_hostname (void)
 get the hostname of the machine, surrounded by the before and after strings the config specifies
static int screensaver_notify_cb (void *data, int ev_type, void *ev)
 Called when the screensaver starts/stops.
static int exit_cb (void *data, int ev_type, void *ev)
 what to do if we SIGINT(^c) it
static void window_del_cb (Ecore_Evas *ee)
 what to do when we receive a window delete event
static void window_resize_cb (Ecore_Evas *ee)
 handle when the ecore_evas needs to be resized
static void focus_swap (Evas_Object *o, int selecto)
 swap key input focus between the password and user entries
static void interp_return_key (void *data, const char *str)
 when Enter is hit on the keyboard we end up here
static void focus (void *data, Evas_Object *o, const char *emission, const char *source)
 an edje signal emission
static void set_date (void *data, Evas_Object *o, const char *emission, const char *source)
 Set the "entrance.date" part's text.
static void set_time (void *data, Evas_Object *o, const char *emission, const char *source)
 Set the "entrance.time" part's text.
static void done_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when an EntranceAuthSuccessDone signal is emitted.
void session_item_selected_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when a Session is selected.
void user_selected_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when a Session is selected.
void user_unselected_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when a Session is unselected.
static void reboot_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when an EntranceSystemReboot signal is emitted.
static void shutdown_cb (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when an EntranceSystemHalt signal is emitted.
static void _user_session_set (void *data, Evas_Object *o, const char *emission, const char *source)
 Executed when an SessionDefaultSet signal is emitted.
static void _container_scroll (void *data, Evas_Object *o, const char *emission, const char *source)
static void entrance_help (char **argv)
 print the "Help" associated with the app, shows cli args etc
int timer_cb (void *data)
 we handle this iteration outside of the theme, update date and time
static void screen_switch_cb (void *data, Evas_Object *obj, const char *signal, const char *source)
 When the pointer switches screens, this moves the widgets to the new screen.
int main (int argc, char *argv[])
 main - where it all starts !

Variables

static Entrance_Sessionsession = NULL
int ENTRANCE_DESKTOP_TYPE_XSESSION = -1

Detailed Description

When entrance starts, and ui specific variables.


Define Documentation

#define WINH   600

Referenced by main().

#define WINW   800

Referenced by main().


Function Documentation

static void _container_scroll ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

References _Entrance_Session::edje.

Referenced by setup_ecore_evas().

static void _user_session_set ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Executed when an SessionDefaultSet signal is emitted.

Parameters:
data - the Entrance_Session in context
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Save out the current Entrance_Session's EntranceSession as the user's new default session to be executed when they log in.

References entrance_session_user_session_default_set().

Referenced by setup_ecore_evas().

static void done_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Executed when an EntranceAuthSuccessDone signal is emitted.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Ensure that the session is authed, and quit the main ecore_loop

References _Entrance_Session::authed, and entrance_session_setup_user_session().

Referenced by setup_ecore_evas().

static void entrance_help ( char **  argv  )  [static]

print the "Help" associated with the app, shows cli args etc

Parameters:
argv the argv that was passed from the application

Referenced by main().

static int exit_cb ( void *  data,
int  ev_type,
void *  ev 
) [static]

what to do if we SIGINT(^c) it

Parameters:
data - no clue
ev_type - kill event ?
ev - event data
Returns:
1 Obviously I want to exit here.

Referenced by main().

static void focus ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

an edje signal emission

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part"

Referenced by setup_ecore_evas().

static void focus_swap ( Evas_Object *  o,
int  selecto 
) [static]

swap key input focus between the password and user entries

Parameters:
o - the object we want to swap focus with
selecto - whether to focus on o, or the other entry

Referenced by interp_return_key().

static char* get_my_hostname ( void   )  [static]

get the hostname of the machine, surrounded by the before and after strings the config specifies

Returns:
- a valid string for the hostname, Localhost on failure or whatever the system provides

References _Entrance_Config::after, _Entrance_Config::before, _Entrance_Session::config, and _Entrance_Config::string.

Referenced by setup_ecore_evas().

static int idler_after_cb ( void *  data  )  [static]

Referenced by main().

static int idler_before_cb ( void *  data  )  [static]

Referenced by main().

static void interp_return_key ( void *  data,
const char *  str 
) [static]

when Enter is hit on the keyboard we end up here

Parameters:
data - The smart object that is this Entry
str - The string that was in the buffer when Enter was pressed

References _Entrance_Session::authed, entrance_session_pass_set(), entrance_session_user_reset(), entrance_session_user_set(), and focus_swap().

Referenced by setup_ecore_evas().

int main ( int  argc,
char *  argv[] 
)

main - where it all starts !

Parameters:
argc - the number of arguments entrance was called with
argv - the args entrance was called with
Entrance works like this:
  1. Init Ecore
  2. Parse command line arguments
  3. Create a New Entrance_Session(Parses config for you)
  4. Init Ecore_X
  5. Init Ecore_Evas
  6. Init Edje
  7. Detect Ecore_Evas type from config, software or gl
  8. Set the cursor specified in the config
  9. Add key modifiers, setup caches and paths
  10. Load theme specified in config, or from cli(cli overrides config)
  11. Swallow the username and password entries into the edje
  12. Detect theme part presence, swallow/setup as appropriate
  13. Setup signal callbacks that our main edje might emit
  14. Show the main edje
  15. Emit an "In" signal on the main entry for lazy themers
  16. Tell the Entrance_Sesssion that the Ecore_Evas belongs to it
  17. Run.............. until ecore_main_(loop_quit is called
  18. If the user is authenticated, try to run their session
  19. Shut down edje, ecore_evas, ecore_x, ecore

References atog(), _Entrance_Session::authed, _Entrance_Session::config, ENTRANCE_DESKTOP_TYPE_XSESSION, entrance_help(), entrance_ipc_init(), entrance_ipc_session_set(), entrance_ipc_shutdown(), entrance_session_ecore_evas_set(), entrance_session_free(), entrance_session_new(), entrance_session_run(), entrance_session_start_user_session(), exit_cb(), EXITCODE, idler_after_cb(), idler_before_cb(), setup_ecore_evas(), _Entrance_Session::testing, _Entrance_Config::theme, theme_normalize_path(), WINH, and WINW.

static void reboot_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Executed when an EntranceSystemReboot signal is emitted.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part"

References _Entrance_Session::config, entrance_session_free(), EXITCODE, _Entrance_Config::reboot, and _Entrance_Session::testing.

Referenced by setup_ecore_evas().

static void screen_switch_cb ( void *  data,
Evas_Object *  obj,
const char *  signal,
const char *  source 
) [static]

When the pointer switches screens, this moves the widgets to the new screen.

Parameters:
data the integer value of the new screen

References _Entrance_Session::current_screen, and _Entrance_Session::edje.

Referenced by setup_ecore_evas().

static int screensaver_notify_cb ( void *  data,
int  ev_type,
void *  ev 
) [static]

Called when the screensaver starts/stops.

Referenced by setup_ecore_evas().

void session_item_selected_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
)

Executed when a Session is selected.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Attempt to set the Part named "entrance.time" to the results of localtime. This way the interval is configurable via a program in the theme and not statically bound to a value.

References _Entrance_Session::edje, entrance_session_x_session_set(), and _Entrance_Session::session_selected.

Referenced by entrance_x_session_button_new(), and entrance_x_session_edje_get().

static void set_date ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Set the "entrance.date" part's text.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Attempt to set the Part named "entrance.date" to the results of localtime. This way the interval is configurable via a program in the theme and not statically bound to a value.

References _Entrance_Session::config, _Entrance_Config::date, and _Entrance_Config::string.

Referenced by setup_ecore_evas(), and timer_cb().

static void set_time ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Set the "entrance.time" part's text.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Attempt to set the Part named "entrance.time" to the results of localtime. This way the interval is configurable via a program in the theme and not statically bound to a value.

References _Entrance_Session::config, _Entrance_Config::string, and _Entrance_Config::time.

Referenced by setup_ecore_evas(), and timer_cb().

Ecore_Evas * setup_ecore_evas ( int  wx,
int  wy,
int  ww,
int  wh,
int  fullscreen 
)

static void shutdown_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
) [static]

Executed when an EntranceSystemHalt signal is emitted.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part"

References _Entrance_Session::config, entrance_session_free(), EXITCODE, _Entrance_Config::halt, and _Entrance_Session::testing.

Referenced by setup_ecore_evas().

int timer_cb ( void *  data  ) 

we handle this iteration outside of the theme, update date and time

Parameters:
data a pointer to the main edje in entrance
Returns:
1 so the ecore_timer keeps going and going and ...

References set_date(), and set_time().

Referenced by setup_ecore_evas().

void user_selected_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
)

Executed when a Session is selected.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Attempt to set the Part named "entrance.time" to the results of localtime. This way the interval is configurable via a program in the theme and not statically bound to a value.

References entrance_session_user_set().

Referenced by entrance_user_edje_get().

void user_unselected_cb ( void *  data,
Evas_Object *  o,
const char *  emission,
const char *  source 
)

Executed when a Session is unselected.

Parameters:
data - the data passed when the callback was added
o - the evas object(Edje) that created the signal
emission - the signal "type" that was emitted
source - the signal originated from this "part" Set the current EntranceFace part back to nothing

References entrance_session_user_reset().

Referenced by entrance_user_edje_get().

static void window_del_cb ( Ecore_Evas *  ee  )  [static]

what to do when we receive a window delete event

Parameters:
ee - the Ecore_Evas that received the event

Referenced by setup_ecore_evas().

static void window_resize_cb ( Ecore_Evas *  ee  )  [static]

handle when the ecore_evas needs to be resized

Parameters:
ee - The Ecore_Evas we're resizing

Referenced by setup_ecore_evas().


Variable Documentation

Referenced by main().

Entrance_Session* session = NULL [static]