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

Last change on this file since 2403 was 2403, checked in by Jean-Yves Lamoureux, 14 years ago
  • Speed up rendering while in full-wm and thumbnails are not activated
  • 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 2403 2008-06-15 13:28:32Z 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
19enum wm_types
20{
21    WM_FULL,
22    WM_CARD,
23    WM_HSPLIT,
24    WM_VSPLIT,
25
26    WM_MAX,
27};
28
29struct screen
30{
31    /* Graphics stuff */
32    int init;
33    cucul_canvas_t *cv;
34    uint32_t clearattr;
35    uint8_t fg, bg;   /* ANSI-context fg/bg */
36    uint8_t dfg, dbg; /* Default fg/bg */
37    uint8_t bold, blink, italics, negative, concealed, underline;
38    uint8_t faint, strike, proportional; /* unsupported */
39
40    /* Other stuff */
41    int visible;
42    int fd;
43    unsigned char *buf;
44    char *title;
45    long int total;
46    int bell;
47    int pid;
48
49    int x, y;
50    int w, h;
51};
52
53struct screen_list
54{
55    int wm_type;
56    int in_bell;
57    /* Add-ons*/
58    int mini;
59    int status;
60    int help;
61
62    int count;
63    int width, height;
64    struct screen **screen;
65};
66
67
68int create_pty(char *cmd, unsigned int w, unsigned int h, int *cpid);
69
70long int import_term(struct screen_list *screen_list, struct screen *sc, void const *data, unsigned int size);
71int set_tty_size(int fd, unsigned int w, unsigned int h);
72int update_terms(struct screen_list* screen_list);
73void refresh_screens(cucul_canvas_t *cv,
74                     caca_display_t *dp,
75                     struct screen_list *screen_list,
76                     int pty);
77int update_screens_contents(struct screen_list* screen_list,
78                             int *pty, int *prevpty);
79
80/* Screens management */
81struct screen* create_screen(int w, int h, char *command);
82int destroy_screen(struct screen *s);
83int add_screen(struct screen_list *list, struct screen *s);
84int remove_screen(struct screen_list *list, int n, int please_kill);
85void resize_screen(struct screen *s, int z, int h);
86
87/* Window managers */
88void update_windows_props(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
89void update_windows_props_cards(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
90void update_windows_props_hsplit(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
91void update_windows_props_full(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
92void update_windows_props_vsplit(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
93
94/* Effects and addons */
95void draw_thumbnails(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
96void draw_status(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
97void draw_help(cucul_canvas_t *cv, struct screen_list *screen_list, int pty);
98
99
100
101
102#if 0
103#   define debug(f, z...) fprintf(stderr, f "\n", z)
104#else
105#   define debug(f, z...) do {} while(0)
106#endif
107
Note: See TracBrowser for help on using the repository browser.