source: neercs/trunk/src/neercs.h @ 2421

Last change on this file since 2421 was 2421, checked in by Jean-Yves Lamoureux, 14 years ago
  • Put pty and prevpty in screen_list structure
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1/*
2 *  neercs        console-based window manager
3 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
4 *                2008 Jean-Yves Lamoureux <jylam@lnxscene.org>
5 *                All Rights Reserved
6 *
7 *  $Id: neercs.h 2421 2008-06-15 15:13:41Z jylam $
8 *
9 *  This program is free software. It comes without any warranty, to
10 *  the extent permitted by applicable law. You can redistribute it
11 *  and/or modify it under the terms of the Do What The Fuck You Want
12 *  To Public License, Version 2, as published by Sam Hocevar. See
13 *  http://sam.zoy.org/wtfpl/COPYING for more details.
14 */
15
16#include <stdint.h>
17#include <cucul.h>
18
19
20#define CURRENTSCREEN screen_list->screen[screen_list->pty]
21
22
23enum wm_types
24{
25    WM_FULL,
26    WM_CARD,
27    WM_HSPLIT,
28    WM_VSPLIT,
29
30    WM_MAX,
31};
32
33struct screen
34{
35    /* Graphics stuff */
36    int init;
37    cucul_canvas_t *cv;
38    uint32_t clearattr;
39    uint8_t fg, bg;   /* ANSI-context fg/bg */
40    uint8_t dfg, dbg; /* Default fg/bg */
41    uint8_t bold, blink, italics, negative, concealed, underline;
42    uint8_t faint, strike, proportional; /* unsupported */
43
44    /* Other stuff */
45    int visible;
46    int fd;
47    unsigned char *buf;
48    char *title;
49    long int total;
50    int bell;
51    unsigned int scroll, s1, s2;
52    int pid;
53
54    int kill_time;
55
56    int x, y;
57    int w, h;
58};
59
60struct screen_list
61{
62    int wm_type;
63    int in_bell;
64    /* Add-ons*/
65    int mini;
66    int status;
67    int help;
68
69
70    int pty, prevpty;
71    int count;
72    int width, height;
73    struct screen **screen;
74};
75
76
77int create_pty(char *cmd, unsigned int w, unsigned int h, int *cpid);
78
79long int import_term(struct screen_list *screen_list, struct screen *sc, void const *data, unsigned int size);
80int set_tty_size(int fd, unsigned int w, unsigned int h);
81int update_terms(struct screen_list* screen_list);
82void refresh_screens(cucul_canvas_t *cv,
83                     caca_display_t *dp,
84                     struct screen_list *screen_list);
85int update_screens_contents(struct screen_list* screen_list);
86
87/* Screens management */
88struct screen* create_screen(int w, int h, char *command);
89int destroy_screen(struct screen *s);
90int add_screen(struct screen_list *list, struct screen *s);
91int remove_screen(struct screen_list *list, int n, int please_kill);
92void resize_screen(struct screen *s, int z, int h);
93
94/* Window managers */
95void update_windows_props(cucul_canvas_t *cv, struct screen_list *screen_list);
96void update_windows_props_cards(cucul_canvas_t *cv, struct screen_list *screen_list);
97void update_windows_props_hsplit(cucul_canvas_t *cv, struct screen_list *screen_list);
98void update_windows_props_full(cucul_canvas_t *cv, struct screen_list *screen_list);
99void update_windows_props_vsplit(cucul_canvas_t *cv, struct screen_list *screen_list);
100
101/* Effects and addons */
102void draw_thumbnails(cucul_canvas_t *cv, struct screen_list *screen_list);
103void draw_status(cucul_canvas_t *cv, struct screen_list *screen_list);
104void draw_help(cucul_canvas_t *cv, struct screen_list *screen_list);
105
106
107
108
109#if 0
110#   define debug(f, z...) fprintf(stderr, f "\n", z)
111#else
112#   define debug(f, z...) do {} while(0)
113#endif
114
Note: See TracBrowser for help on using the repository browser.