File: session.h

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (85 lines) | stat: -rw-r--r-- 2,990 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef SESSION_H_HEADER_INCLUDED
#define SESSION_H_HEADER_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

struct ASFeel ;
struct MyLook ;
struct ScreenInfo;

typedef struct ASDeskSession
{
  int desk;
  char *background_file;
  char *feel_file;
  struct ASFeel *feel ;
  char *look_file;
  struct MyLook *look ;
  char *theme_file;
  char *colorscheme_file;
}ASDeskSession;

typedef struct ASSession
{
  struct ScreenInfo *scr ; /* back pointer to owning screen data */
  int   colordepth ;
  char *ashome, *asshare ; /* locations of the AfterStep config directories */
  char *overriding_file  ; /* if user specifies -f option to AS then we use this file for everything */
  char *overriding_look, *overriding_feel, *overriding_theme, *overriding_colorscheme ;

  char *workspace_state ;  /* n-c/workspace_state_scr# */
  char *webcache;  /* n-c/workspace_state_scr# */

  ASDeskSession *defaults;
  ASDeskSession **desks;
  unsigned int desks_used, desks_allocated ;

  void (*on_feel_changed_func)( struct ScreenInfo *scr, int desk, struct ASFeel *old_feel );
  void (*on_look_changed_func)( struct ScreenInfo *scr, int desk, struct MyLook *old_look );

  Bool changed;
}ASSession;


ASSession *create_assession ( struct ScreenInfo *scr, char *ashome, char *asshare);
void 	   destroy_assession (ASSession * session);

void       update_default_session ( ASSession *session, int func);

void 	   set_session_override(ASSession * session, const char *overriding_file, int function );
const char *get_session_override(ASSession * session, int function );

void 	   change_default_session (ASSession * session, const char *new_val, int function);
void 	   change_desk_session (ASSession * session, int desk, const char *new_val, int function);

void	   change_desk_session_feel (ASSession * session, int desk, struct ASFeel *feel);
void 	   change_desk_session_look (ASSession * session, int desk, struct MyLook *look);


const char   *get_session_file (ASSession * session, int desk, int function, Bool no_default);
char **get_session_file_list (ASSession *session, int desk1, int desk2, int function);

const char   *get_session_ws_file ( ASSession * session, Bool only_if_available );/* workspace_state filename */
char   *make_session_apps_path ( ASSession * session );

char *make_session_file   (ASSession * session, const char *source, Bool use_depth );
char *make_session_dir    (ASSession * session, const char *source, Bool use_depth );
char *make_session_data_file  (ASSession * session, Bool shared, int if_mode_only, ... );
char *make_session_rc_file( ASSession *session, const char *tmpl );
char *make_session_webcache_file (ASSession *session, const char *url);

int CheckOrCreate (const char *what);
void check_AfterStep_dirtree ( char * ashome, Bool create_non_conf);

/* legacy session using non-configurable dir to store config files : */
ASSession *GetNCASSession (struct ScreenInfo *scr, const char *home, const char *share );

#ifdef __cplusplus
}
#endif


#endif