- Timestamp:
- Sep 18, 2010, 5:07:39 PM (15 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.