- Timestamp:
- Nov 29, 2009, 1:48:53 PM (10 years ago)
- Location:
- neercs/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/client.c
r4059 r4063 242 242 243 243 if (ret) 244 { 245 debug("ret1\n"); 244 246 break; 245 247 } 246 248 ret = caca_get_event(screen_list->dp, 247 249 CACA_EVENT_KEY_PRESS … … 255 257 256 258 if (ret) 259 { 260 debug("ret2\n"); 257 261 break; 262 } 258 263 } 259 264 -
neercs/trunk/src/configuration.c
r4060 r4063 404 404 { 405 405 if (IS_OPTION_TRUE) 406 screen_list->m ini = 1;407 else 408 screen_list->m ini = 0;406 screen_list->modals.mini = 1; 407 else 408 screen_list->modals.mini = 0; 409 409 return 0; 410 410 … … 414 414 { 415 415 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; 419 419 return 0; 420 420 } … … 510 510 char *get_thumbnails(struct screen_list *screen_list) 511 511 { 512 if (screen_list->m ini)512 if (screen_list->modals.mini) 513 513 return "true"; 514 514 return "false"; … … 517 517 char *get_status_bar(struct screen_list *screen_list) 518 518 { 519 if (screen_list-> status)519 if (screen_list->modals.status) 520 520 return "true"; 521 521 return "false"; -
neercs/trunk/src/effects.c
r4000 r4063 34 34 uint8_t *buf; 35 35 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; 37 37 int miniw, minih; 38 38 … … 187 187 { 188 188 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--; 191 191 break; 192 192 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++; 195 195 break; 196 196 case 0xd: 197 screen_list-> window_list = 0;197 screen_list->modals.window_list = 0; 198 198 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; 200 200 break; 201 201 case 0x22: 202 screen_list-> window_list = 0;202 screen_list->modals.window_list = 0; 203 203 break; 204 204 default: … … 225 225 { 226 226 char line[1024]; 227 if (screen_list-> cur_in_list == i)227 if (screen_list->modals.cur_in_list == i) 228 228 caca_set_color_ansi(screen_list->cv, CACA_BLACK, CACA_WHITE); 229 229 else -
neercs/trunk/src/help.c
r3999 r4063 31 31 if (c == CACA_KEY_ESCAPE || c == 'h') 32 32 { 33 screen_list-> help = 0;33 screen_list->modals.help = 0; 34 34 screen_list->changed = 1; 35 35 return 1; -
neercs/trunk/src/input.c
r4060 r4063 103 103 case 'm': 104 104 case 0x0d: // CACA_KEY_CTRL_M: 105 screen_list->m ini = !screen_list->mini;105 screen_list->modals.mini = !screen_list->modals.mini; 106 106 refresh = 1; 107 107 break; … … 166 166 case '?': 167 167 case 0x08: // CACA_KEY_CTRL_H: 168 screen_list-> help = !screen_list->help;168 screen_list->modals.help = !screen_list->modals.help; 169 169 refresh = 1; 170 170 break; 171 171 case '"': 172 172 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; 175 175 refresh = 1; 176 176 break; … … 182 182 case 'e': 183 183 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; 185 186 break; 186 187 #endif -
neercs/trunk/src/neercs.h
r4060 r4063 185 185 }; 186 186 187 struct 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 187 198 struct screen_list 188 199 { 189 200 int outfd; /* Debug */ 190 int wm_type; /* Window manager type */191 201 int in_bell; /* Bell occuring in a window */ 192 202 int was_in_bell; … … 197 207 int need_refresh; /* If we skipped a refresh, do it next time */ 198 208 int command; 209 int eyecandy; /* Eye Candy */ 210 199 211 long long unsigned int last_key_time; 200 212 long long unsigned int last_refresh_time; … … 206 218 struct lock lock; 207 219 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 */ 220 224 struct interpreter_props interpreter_props; 221 225 … … 226 230 int count; /* Window count */ 227 231 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 228 237 struct screen **screen; /* Windows */ 229 238 … … 240 249 struct recurrent_list *recurrent_list; 241 250 251 char *title; /* Window title */ 242 252 caca_canvas_t *cv; 243 253 caca_display_t *dp; -
neercs/trunk/src/python/interpreter.c
r4048 r4063 46 46 int python_command_handle_key(struct screen_list *screen_list, unsigned int c) 47 47 { 48 49 48 int ret = widget_ibox_handle_key(screen_list->interpreter_props.box, c); 50 49 … … 53 52 widget_ibox_destroy(screen_list->interpreter_props.box); 54 53 screen_list->interpreter_props.box = NULL; 55 screen_list-> python_command = 0;54 screen_list->modals.python_command = 0; 56 55 } 57 56 else if (ret == INPUT_BOX_RET) … … 67 66 { 68 67 if (!screen_list->interpreter_props.box) 68 { 69 69 screen_list->interpreter_props.box = 70 70 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"); 72 74 widget_ibox_draw(screen_list->interpreter_props.box); 73 75 } … … 156 158 { 157 159 widget_ibox_destroy(sl->interpreter_props.box); 158 sl->python_command = 0; 160 sl->interpreter_props.box = NULL; 161 sl->modals.python_command = 0; 159 162 } 160 163 sl->changed = 1; -
neercs/trunk/src/screen_list.c
r4061 r4063 56 56 57 57 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; 61 63 screen_list->eyecandy = 1; 62 64 screen_list->border_size = 1; 63 65 screen_list->title = NULL; 64 screen_list->window_list = 0;65 66 screen_list->wm_type = WM_VSPLIT; 66 67 screen_list->in_bell = 0; … … 98 99 screen_list->cube.duration = 1000000; 99 100 100 screen_list->python_command = 0;101 101 screen_list->interpreter_props.box = NULL; 102 102 -
neercs/trunk/src/screens.c
r4057 r4063 189 189 190 190 191 debug("Current pty is %d\n", screen_list->pty);192 193 191 screen_list->width = caca_get_canvas_width(screen_list->cv); 194 192 screen_list->height = 195 caca_get_canvas_height(screen_list->cv) - (screen_list->m ini * 6) -196 screen_list-> status;193 caca_get_canvas_height(screen_list->cv) - (screen_list->modals.mini * 6) - 194 screen_list->modals.status; 197 195 198 196 if (!screen_list->dont_update_coords) … … 216 214 217 215 218 if (screen_list->m ini)216 if (screen_list->modals.mini) 219 217 { 220 218 draw_thumbnails(screen_list); 221 219 } 222 if (screen_list-> status)220 if (screen_list->modals.status) 223 221 { 224 222 draw_status(screen_list); 225 223 } 226 if (screen_list-> help)224 if (screen_list->modals.help) 227 225 { 228 226 draw_help(screen_list); 229 227 } 230 if (screen_list-> window_list)228 if (screen_list->modals.window_list) 231 229 { 232 230 draw_list(screen_list); 233 231 } 234 232 #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) 236 235 { 237 236 draw_python_command(screen_list); -
neercs/trunk/src/server.c
r4060 r4063 415 415 screen_list->cv = caca_create_canvas(screen_list->width, 416 416 screen_list->height 417 + screen_list->m ini * 6418 + screen_list-> status);417 + screen_list->modals.mini * 6 418 + screen_list->modals.status); 419 419 420 420 if (!screen_list->to_grab && !screen_list->to_start) … … 477 477 int size = 0; 478 478 479 if (screen_list-> help)479 if (screen_list->modals.help) 480 480 { 481 481 return help_handle_key(screen_list, c); 482 482 } 483 483 #ifdef USE_PYTHON 484 if (screen_list-> python_command)484 if (screen_list->modals.python_command) 485 485 { 486 486 return python_command_handle_key(screen_list, c); … … 516 516 screen_list->changed = 1; 517 517 } 518 else if (screen_list-> window_list)518 else if (screen_list->modals.window_list) 519 519 { 520 520 refresh |= update_window_list(c, screen_list); -
neercs/trunk/src/term.c
r4058 r4063 1212 1212 screen_list->screen[i]->buf + bytes, 1213 1213 screen_list->screen[i]->total); 1214 if (screen_list->screen[i]->visible || screen_list->m ini)1214 if (screen_list->screen[i]->visible || screen_list->modals.mini) 1215 1215 refresh = 1; 1216 1216 }
Note: See TracChangeset
for help on using the changeset viewer.