~benklop/+junk/lcdproc

« back to all changes in this revision

Viewing changes to server/screen.h

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Tallon
  • Date: 2006-07-23 20:23:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060723202348-w65hrbvpwniqn9by
Tags: 0.5.0-1
* New upstream version (Closes: #367945)
  - New maintainer. Thank you for your previous work, Jon!
  - Upstream added suport for 'imon' devices (Closes: #365496)
  - Upstream fixed descriptor leak (Closes: #355460)
  - Upstream fixed placing widgets in frame (Closes: #355458)

* Packaging
  - Depend on debconf-2.0; Allow transition (Closes: #331885)
  - Remove dependency on automake (Closes: #376449)
  - Include missing INSTALL instructions (Closes: #365436)
  - Changed most "by hand" installation steps into debhelper-based ones
  - Updated to 3.7.2 standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * COPYING file distributed with this package.
7
7
 *
8
8
 * Copyright (c) 1999, William Ferrell, Scott Scriven
 
9
 *               2003, Joris Robijn
9
10
 *
10
11
 */
11
12
 
 
13
#include "menu.h"
 
14
#include "menuitem.h"
 
15
#include "client.h"
 
16
/* These headers are placed here on purpose ! (circular references) */
 
17
 
12
18
#ifndef SCREEN_H
13
19
#define SCREEN_H
14
20
 
15
21
#include "shared/LL.h"
16
 
#include "clients.h"
17
 
 
18
 
typedef struct screen {
 
22
#include "client.h"
 
23
 
 
24
typedef enum {  PRI_HIDDEN, PRI_BACKGROUND, PRI_INFO, PRI_FOREGROUND,
 
25
                PRI_ALERT, PRI_INPUT
 
26
} Priority;
 
27
 
 
28
typedef struct Screen {
19
29
        char *id;
20
30
        char *name;
21
 
        int wid, hgt;
22
 
        int priority;
 
31
        int width, height;
23
32
        int duration;
24
 
        int heartbeat;
25
33
        int timeout;
26
 
        int backlight_state;
 
34
        Priority priority;
 
35
        short int heartbeat;
 
36
        short int backlight;
 
37
        short int cursor;
 
38
        short int cursor_x;
 
39
        short int cursor_y;
27
40
        char *keys;
28
 
        LinkedList *widgets;
29
 
        client *parent;
30
 
} screen;
 
41
        LinkedList *widgetlist;
 
42
        struct Client *client;
 
43
} Screen;
 
44
 
 
45
#include "widget.h"
 
46
 
31
47
 
32
48
extern int  default_duration ;
33
49
extern int  default_priority ;
34
50
 
35
 
screen *screen_create ();
36
 
int screen_destroy (screen * s);
37
 
 
38
 
screen *screen_find (client * c, char *id);
39
 
 
40
 
int screen_add (client * c, char *id);
41
 
int screen_remove (client * c, char *id);
 
51
#include "client.h"
 
52
 
 
53
/* Creates a new screen */
 
54
Screen * screen_create (char * id, Client * client);
 
55
 
 
56
/* Destroys a screen */
 
57
int screen_destroy (Screen * s);
 
58
 
 
59
/* Add a widget to a screen */
 
60
int screen_add_widget (Screen * s, Widget * w);
 
61
 
 
62
/* Remove a widget from a screen (does not destroy it) */
 
63
int screen_remove_widget (Screen * s, Widget * w);
 
64
 
 
65
/* List functions */
 
66
static inline Widget * screen_getfirst_widget (Screen * s)
 
67
{
 
68
        return (Widget *) ((s != NULL)
 
69
                           ? LL_GetFirst(s->widgetlist)
 
70
                           : NULL);
 
71
}
 
72
 
 
73
static inline Widget * screen_getnext_widget (Screen * s)
 
74
{
 
75
        return (Widget *) ((s != NULL)
 
76
                           ? LL_GetNext(s->widgetlist)
 
77
                           : NULL);
 
78
}
 
79
 
 
80
 
 
81
/* Find a widget in a screen */
 
82
Widget *screen_find_widget (Screen * s, char *id);
 
83
 
 
84
/* Convert priority names to priority and vv */
 
85
Priority screen_pri_name_to_pri (char * pri_name);
 
86
char * screen_pri_to_pri_name (Priority pri);
42
87
 
43
88
#endif