enlightenment/src/bin/e_bg.h

45 lines
1.2 KiB
C
Raw Normal View History

/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
typedef enum {
E_BG_TRANSITION_NONE,
E_BG_TRANSITION_START,
E_BG_TRANSITION_DESK,
E_BG_TRANSITION_CHANGE
} E_Bg_Transition;
typedef struct _E_Event_Bg_Update E_Event_Bg_Update;
#else
#ifndef E_BG_H
#define E_BG_H
extern EAPI int E_EVENT_BG_UPDATE;
struct _E_Event_Bg_Update
{
int container;
int zone;
int desk_x;
int desk_y;
};
2006-10-17 05:29:00 -07:00
EAPI int e_bg_init(void);
EAPI int e_bg_shutdown(void);
EAPI const E_Config_Desktop_Background *e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y);
EAPI const char *e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y);
EAPI void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition);
Larger backgrounds can now be set to scroll whenever a E changes between desks. Kind of like a transition, but uses only one (the first desk's), larger wallpaper instead of several wallpapers for all desks, and it overrides the transition settings if activated. The option can currently be activated from Virtual Desktops Settings -> Advanced. A better home and preview would be better for these settings. In more detail, this option can make a wallpaper, larger than the geometry of the zone, scroll appropriately with each desk change. Consider a nice panorama picture, which is as wide as the total desks' width. Then, at most, E will scroll the background by 1 / (number of desks) for each desk change. The direction of the scrolling is dependent on the desk change itself. Also, the user can specify a coefficient of maximum scrolling for each axis. If the coefficient is 0, the wallpaper will not move. More advanced animations can be constructed with edje. The data item "directional_freedom" "(1|0) (1|0)" can toggle the actual wallpaper scrolling done by E for each axis. A message with the current x/y position, panning w|h, and zone w|h is sent to the background edje with each desk change animation tick. An example embryo script that handles the message, and changes a hypothetical "a1" part in the "e/desktop/background" group is shown below: public message(Msg_Type:type, id, ...) { if (type == MSG_INT_SET) { new x = getarg(2); new y = getarg(3); // new max_x = getarg(4); // new max_y = getarg(5); // new w = getarg(6); // new h = getarg(7); custom_state(PART:"a1", "default", 0.0); set_state_val(PART:"a1", STATE_FILL_POS, 0.0, 0.0, -x / 4, -y / 4); set_state(PART:"a1", "custom", 0.0); } } SVN revision: 40543
2009-05-07 11:39:55 -07:00
EAPI void e_bg_zone_slide(E_Zone *zone, int prev_x, int prev_y);
EAPI void e_bg_add(int container, int zone, int desk_x, int desk_y, char *file);
EAPI void e_bg_del(int container, int zone, int desk_x, int desk_y);
2006-10-17 05:29:00 -07:00
EAPI void e_bg_default_set(char *file);
EAPI void e_bg_update(void);
EAPI void e_bg_handler_set(Evas_Object *obj, const char *path, void *data);
EAPI int e_bg_handler_test(Evas_Object *obj, const char *path, void *data);
#endif
#endif