Changeset 03ca005
- Timestamp:
- Sep 18, 2010, 5:07:39 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 61c1f19
- Parents:
- b3b1b05
- git-author:
- David Benjamin <davidben@mit.edu> (08/01/10 13:50:19)
- git-committer:
- David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r4cf7b1b r03ca005 1237 1237 owl_viewwin *v; 1238 1238 1239 pw=owl_global_get_popwin(&g);1240 1239 v=owl_global_get_viewwin(&g); 1241 1240 1242 if (owl_ popwin_up(pw) != 0) {1241 if (owl_global_get_popwin(&g)) { 1243 1242 owl_function_error("Popwin already in use."); 1244 1243 return; 1245 1244 } 1245 pw = owl_popwin_new(); 1246 owl_global_set_popwin(&g, pw); 1247 owl_popwin_up(pw); 1246 1248 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1247 1249 owl_viewwin_init_text(v, owl_popwin_get_content(pw), text); … … 1253 1255 owl_viewwin *v; 1254 1256 1255 pw=owl_global_get_popwin(&g);1256 1257 v=owl_global_get_viewwin(&g); 1257 1258 1258 if (owl_ popwin_up(pw) != 0) {1259 if (owl_global_get_popwin(&g)) { 1259 1260 owl_function_error("Popwin already in use."); 1260 1261 return; 1261 1262 } 1263 pw = owl_popwin_new(); 1264 owl_global_set_popwin(&g, pw); 1265 owl_popwin_up(pw); 1262 1266 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1263 1267 owl_viewwin_init_fmtext(v, owl_popwin_get_content(pw), fm); -
global.c
r5b68c05 r03ca005 48 48 g->rightshift=0; 49 49 50 g->pw = NULL; 50 51 g->tw = NULL; 51 52 … … 126 127 /* Create the widgets */ 127 128 owl_mainwin_init(&(g->mw), g->mainpanel.recwin); 128 owl_popwin_init(&(g->pw));129 129 owl_msgwin_init(&(g->msgwin), g->mainpanel.msgwin); 130 130 owl_sepbar_init(g->mainpanel.sepwin); … … 255 255 256 256 owl_popwin *owl_global_get_popwin(owl_global *g) { 257 return(&(g->pw)); 257 return g->pw; 258 } 259 260 void owl_global_set_popwin(owl_global *g, owl_popwin *pw) { 261 g->pw = pw; 258 262 } 259 263 -
owl.h
rb3b1b05 r03ca005 410 410 gulong sig_redraw_id; 411 411 gulong sig_resize_id; 412 int active;413 412 } owl_popwin; 414 413 … … 563 562 typedef struct _owl_global { 564 563 owl_mainwin mw; 565 owl_popwin pw;564 owl_popwin *pw; 566 565 owl_msgwin msgwin; 567 566 owl_history cmdhist; /* command history */ -
popexec.c
r4cf7b1b r03ca005 17 17 pid_t pid; 18 18 19 if (owl_global_get_popwin(&g)) { 20 owl_function_error("Popwin already in use."); 21 return NULL; 22 } 23 19 24 pe = owl_malloc(sizeof(owl_popexec)); 20 25 if (!pe) return NULL; … … 23 28 pe->refcount=0; 24 29 25 pw=owl_global_get_popwin(&g);26 30 pe->vwin=v=owl_global_get_viewwin(&g); 31 pw = owl_popwin_new(); 32 owl_global_set_popwin(&g, pw); 33 owl_popwin_up(pw); 27 34 28 if (owl_popwin_up(pw) != 0) {29 owl_function_error("Popwin already in use.");30 return NULL;31 }32 35 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 33 36 owl_viewwin_init_text(v, owl_popwin_get_content(pw), ""); -
popwin.c
rb3b1b05 r03ca005 1 1 #include "owl.h" 2 2 3 int owl_popwin_init(owl_popwin *pw)3 owl_popwin *owl_popwin_new(void) 4 4 { 5 pw->active=0; 6 return(0); 7 } 5 owl_popwin *pw = owl_malloc(sizeof(owl_popwin)); 6 memset(pw, 0, sizeof(*pw)); 8 7 9 int owl_popwin_up(owl_popwin *pw)10 {11 if (pw->active)12 return 1;13 8 pw->border = owl_window_new(NULL); 14 9 pw->content = owl_window_new(pw->border); … … 23 18 owl_popwin_size_border(owl_window_get_screen(), pw->border); 24 19 25 owl_window_show _all(pw->border);20 owl_window_show(pw->content); 26 21 27 pw->active=1; 28 return(0); 22 return pw; 23 } 24 25 int owl_popwin_up(owl_popwin *pw) 26 { 27 if (owl_window_is_shown(pw->border)) 28 return 1; 29 owl_window_show(pw->border); 30 return 0; 29 31 } 30 32 … … 74 76 int owl_popwin_close(owl_popwin *pw) 75 77 { 76 if (! pw->active)78 if (!owl_window_is_shown(pw->border)) 77 79 return 1; 80 owl_window_hide(pw->border); 81 return 0; 82 } 83 84 void owl_popwin_delete(owl_popwin *pw) 85 { 86 owl_popwin_close(pw); 87 88 /* Remove everything that references us. */ 78 89 g_signal_handler_disconnect(pw->border, pw->sig_resize_id); 79 90 g_signal_handler_disconnect(pw->border, pw->sig_redraw_id); … … 82 93 g_object_unref(pw->content); 83 94 84 pw->border = 0; 85 pw->content = 0; 86 pw->active=0; 87 return(0); 95 owl_free(pw); 88 96 } 89 97 90 98 int owl_popwin_is_active(const owl_popwin *pw) 91 99 { 92 return pw->active;100 return owl_window_is_shown(pw->border); 93 101 } 94 102
Note: See TracChangeset
for help on using the changeset viewer.