Changeset 4063


Ignore:
Timestamp:
11/29/09 13:48:53 (3 years ago)
Author:
jylam
Message:
  • Moved modal windows flags to struct modal
Location:
neercs/trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/client.c

    r4059 r4063  
    242242 
    243243        if (ret) 
     244        { 
     245            debug("ret1\n"); 
    244246            break; 
    245  
     247        } 
    246248        ret = caca_get_event(screen_list->dp, 
    247249                             CACA_EVENT_KEY_PRESS 
     
    255257 
    256258        if (ret) 
     259        { 
     260            debug("ret2\n"); 
    257261            break; 
     262        } 
    258263    } 
    259264 
  • neercs/trunk/src/configuration.c

    r4060 r4063  
    404404{ 
    405405    if (IS_OPTION_TRUE) 
    406         screen_list->mini = 1; 
    407     else 
    408         screen_list->mini = 0; 
     406        screen_list->modals.mini = 1; 
     407    else 
     408        screen_list->modals.mini = 0; 
    409409    return 0; 
    410410 
     
    414414{ 
    415415    if (IS_OPTION_TRUE) 
    416         screen_list->status = 1; 
    417     else 
    418         screen_list->status = 0; 
     416        screen_list->modals.status = 1; 
     417    else 
     418        screen_list->modals.status = 0; 
    419419    return 0; 
    420420} 
     
    510510char *get_thumbnails(struct screen_list *screen_list) 
    511511{ 
    512     if (screen_list->mini) 
     512    if (screen_list->modals.mini) 
    513513        return "true"; 
    514514    return "false"; 
     
    517517char *get_status_bar(struct screen_list *screen_list) 
    518518{ 
    519     if (screen_list->status) 
     519    if (screen_list->modals.status) 
    520520        return "true"; 
    521521    return "false"; 
  • neercs/trunk/src/effects.c

    r4000 r4063  
    3434    uint8_t *buf; 
    3535    int i, y = 
    36         caca_get_canvas_height(screen_list->cv) - 6 - screen_list->status; 
     36        caca_get_canvas_height(screen_list->cv) - 6 - screen_list->modals.status; 
    3737    int miniw, minih; 
    3838 
     
    187187    { 
    188188    case 0x111: 
    189         if (screen_list->cur_in_list > 0) 
    190             screen_list->cur_in_list--; 
     189        if (screen_list->modals.cur_in_list > 0) 
     190            screen_list->modals.cur_in_list--; 
    191191        break; 
    192192    case 0x112: 
    193         if (screen_list->cur_in_list < screen_list->count - 1) 
    194             screen_list->cur_in_list++; 
     193        if (screen_list->modals.cur_in_list < screen_list->count - 1) 
     194            screen_list->modals.cur_in_list++; 
    195195        break; 
    196196    case 0xd: 
    197         screen_list->window_list = 0; 
     197        screen_list->modals.window_list = 0; 
    198198        screen_list->prevpty = screen_list->pty; 
    199         screen_list->pty = screen_list->cur_in_list; 
     199        screen_list->pty = screen_list->modals.cur_in_list; 
    200200        break; 
    201201    case 0x22: 
    202         screen_list->window_list = 0; 
     202        screen_list->modals.window_list = 0; 
    203203        break; 
    204204    default: 
     
    225225    { 
    226226        char line[1024]; 
    227         if (screen_list->cur_in_list == i) 
     227        if (screen_list->modals.cur_in_list == i) 
    228228            caca_set_color_ansi(screen_list->cv, CACA_BLACK, CACA_WHITE); 
    229229        else 
  • neercs/trunk/src/help.c

    r3999 r4063  
    3131    if (c == CACA_KEY_ESCAPE || c == 'h') 
    3232    { 
    33         screen_list->help = 0; 
     33        screen_list->modals.help = 0; 
    3434        screen_list->changed = 1; 
    3535        return 1; 
  • neercs/trunk/src/input.c

    r4060 r4063  
    103103    case 'm': 
    104104    case 0x0d:                 // CACA_KEY_CTRL_M: 
    105         screen_list->mini = !screen_list->mini; 
     105        screen_list->modals.mini = !screen_list->modals.mini; 
    106106        refresh = 1; 
    107107        break; 
     
    166166    case '?': 
    167167    case 0x08:                 // CACA_KEY_CTRL_H: 
    168         screen_list->help = !screen_list->help; 
     168        screen_list->modals.help = !screen_list->modals.help; 
    169169        refresh = 1; 
    170170        break; 
    171171    case '"': 
    172172    case 0x34:                 // CTRL+" 
    173         screen_list->cur_in_list = screen_list->pty; 
    174         screen_list->window_list = !screen_list->window_list; 
     173        screen_list->modals.cur_in_list = screen_list->pty; 
     174        screen_list->modals.window_list = !screen_list->modals.window_list; 
    175175        refresh = 1; 
    176176        break; 
     
    182182    case 'e': 
    183183    case 0x05: 
    184         screen_list->python_command = 1; 
     184        debug("py : command is %d, setting to 1 (at %p)\n", screen_list->modals.python_command, &screen_list->modals.python_command); 
     185        screen_list->modals.python_command = 1; 
    185186        break; 
    186187#endif 
  • neercs/trunk/src/neercs.h

    r4060 r4063  
    185185}; 
    186186 
     187struct modals 
     188{ 
     189    /* Add-ons*/ 
     190    int mini;                    /* Thumbnails */ 
     191    int status;                  /* Status bar */ 
     192    int help;                    /* Help */ 
     193    int python_command;          /* Python command */ 
     194    int window_list;             /* Window list */ 
     195    int cur_in_list;             /* Window list */   
     196}; 
     197 
    187198struct screen_list 
    188199{ 
    189200    int outfd;                   /* Debug */ 
    190     int wm_type;                 /* Window manager type */ 
    191201    int in_bell;                 /* Bell occuring in a window  */ 
    192202    int was_in_bell; 
     
    197207    int need_refresh;            /* If we skipped a refresh, do it next time */ 
    198208    int command; 
     209    int eyecandy;                /* Eye Candy */ 
     210     
    199211    long long unsigned int last_key_time; 
    200212    long long unsigned int last_refresh_time; 
     
    206218        struct lock lock; 
    207219 
    208     /* Add-ons*/ 
    209     int eyecandy;                /* Eye Candy */ 
    210     int mini;                    /* Thumbnails */ 
    211     int status;                  /* Status bar */ 
    212     int help;                    /* Help */ 
    213     int python_command;          /* Python command */ 
    214     int border_size;             /* Borders */ 
    215     int window_list;             /* Window list */ 
    216     int cur_in_list;             /* Window list */ 
    217     char *title;                 /* Window title */ 
    218     struct cube_props cube;      /* Cube */ 
    219     long long unsigned int last_switch; /* Cube */ 
     220    /* Modal windows */ 
     221        struct modals modals; 
     222     
     223    /* Python interpreter */ 
    220224    struct interpreter_props interpreter_props; 
    221225 
     
    226230    int count;                   /* Window count */ 
    227231    int width, height;           /* caca window size */ 
     232    int wm_type;                 /* Window manager type */ 
     233    struct cube_props cube;      /* Cube */ 
     234    long long unsigned int last_switch; /* Cube */ 
     235    int border_size;             /* Borders */ 
     236     
    228237    struct screen **screen;      /* Windows */ 
    229238 
     
    240249    struct recurrent_list *recurrent_list; 
    241250     
     251    char *title;                 /* Window title */ 
    242252    caca_canvas_t *cv; 
    243253    caca_display_t *dp; 
  • neercs/trunk/src/python/interpreter.c

    r4048 r4063  
    4646int python_command_handle_key(struct screen_list *screen_list, unsigned int c) 
    4747{ 
    48  
    4948    int ret = widget_ibox_handle_key(screen_list->interpreter_props.box, c); 
    5049 
     
    5352        widget_ibox_destroy(screen_list->interpreter_props.box); 
    5453        screen_list->interpreter_props.box = NULL; 
    55         screen_list->python_command = 0; 
     54        screen_list->modals.python_command = 0; 
    5655    } 
    5756    else if (ret == INPUT_BOX_RET) 
     
    6766{ 
    6867    if (!screen_list->interpreter_props.box) 
     68    { 
    6969        screen_list->interpreter_props.box = 
    7070            widget_ibox_init(screen_list->cv, 65, 6); 
    71  
     71        debug("py Init %p\n", screen_list->interpreter_props.box); 
     72    } 
     73    debug("py Drawing !\n"); 
    7274    widget_ibox_draw(screen_list->interpreter_props.box); 
    7375} 
     
    156158    { 
    157159        widget_ibox_destroy(sl->interpreter_props.box); 
    158         sl->python_command = 0; 
     160        sl->interpreter_props.box = NULL; 
     161        sl->modals.python_command = 0; 
    159162    } 
    160163    sl->changed = 1; 
  • neercs/trunk/src/screen_list.c

    r4061 r4063  
    5656     
    5757    screen_list->count = 0; 
    58     screen_list->mini = 1; 
    59     screen_list->help = 0; 
    60     screen_list->status = 1; 
     58    screen_list->modals.mini = 1; 
     59    screen_list->modals.help = 0; 
     60    screen_list->modals.status = 1; 
     61    screen_list->modals.window_list = 0; 
     62    screen_list->modals.python_command = 0; 
    6163    screen_list->eyecandy = 1; 
    6264    screen_list->border_size = 1; 
    6365    screen_list->title = NULL; 
    64     screen_list->window_list = 0; 
    6566    screen_list->wm_type = WM_VSPLIT; 
    6667    screen_list->in_bell = 0; 
     
    9899    screen_list->cube.duration = 1000000; 
    99100     
    100     screen_list->python_command = 0; 
    101101    screen_list->interpreter_props.box = NULL; 
    102102     
  • neercs/trunk/src/screens.c

    r4057 r4063  
    189189 
    190190 
    191     debug("Current pty is %d\n", screen_list->pty); 
    192  
    193191    screen_list->width = caca_get_canvas_width(screen_list->cv); 
    194192    screen_list->height = 
    195         caca_get_canvas_height(screen_list->cv) - (screen_list->mini * 6) - 
    196         screen_list->status; 
     193        caca_get_canvas_height(screen_list->cv) - (screen_list->modals.mini * 6) - 
     194        screen_list->modals.status; 
    197195 
    198196    if (!screen_list->dont_update_coords) 
     
    216214 
    217215 
    218     if (screen_list->mini) 
     216    if (screen_list->modals.mini) 
    219217    { 
    220218        draw_thumbnails(screen_list); 
    221219    } 
    222     if (screen_list->status) 
     220    if (screen_list->modals.status) 
    223221    { 
    224222        draw_status(screen_list); 
    225223    } 
    226     if (screen_list->help) 
     224    if (screen_list->modals.help) 
    227225    { 
    228226        draw_help(screen_list); 
    229227    } 
    230     if (screen_list->window_list) 
     228    if (screen_list->modals.window_list) 
    231229    { 
    232230        draw_list(screen_list); 
    233231    } 
    234232#ifdef USE_PYTHON 
    235     if(screen_list->python_command) 
     233    debug("py : command is %d (at %p)\n", screen_list->modals.python_command, &screen_list->modals.python_command); 
     234    if(screen_list->modals.python_command) 
    236235    { 
    237236        draw_python_command(screen_list);    
  • neercs/trunk/src/server.c

    r4060 r4063  
    415415    screen_list->cv = caca_create_canvas(screen_list->width, 
    416416                                         screen_list->height 
    417                                          + screen_list->mini * 6 
    418                                          + screen_list->status); 
     417                                         + screen_list->modals.mini * 6 
     418                                         + screen_list->modals.status); 
    419419 
    420420    if (!screen_list->to_grab && !screen_list->to_start) 
     
    477477    int size = 0; 
    478478 
    479     if (screen_list->help) 
     479    if (screen_list->modals.help) 
    480480    { 
    481481        return help_handle_key(screen_list, c); 
    482482    } 
    483483#ifdef USE_PYTHON 
    484     if (screen_list->python_command) 
     484    if (screen_list->modals.python_command) 
    485485    { 
    486486        return python_command_handle_key(screen_list, c); 
     
    516516            screen_list->changed = 1; 
    517517        } 
    518         else if (screen_list->window_list) 
     518        else if (screen_list->modals.window_list) 
    519519        { 
    520520            refresh |= update_window_list(c, screen_list); 
  • neercs/trunk/src/term.c

    r4058 r4063  
    12121212                        screen_list->screen[i]->buf + bytes, 
    12131213                        screen_list->screen[i]->total); 
    1214                 if (screen_list->screen[i]->visible || screen_list->mini) 
     1214                if (screen_list->screen[i]->visible || screen_list->modals.mini) 
    12151215                    refresh = 1; 
    12161216            } 
Note: See TracChangeset for help on using the changeset viewer.