- Timestamp:
- Sep 18, 2010, 5:07:39 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- cb81570
- Parents:
- 818f19c
- git-author:
- David Benjamin <davidben@mit.edu> (08/07/10 16:15:02)
- git-committer:
- David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r818f19c r1d74663 174 174 mode |= OWL_CTX_INTERACTIVE; 175 175 c = owl_malloc(sizeof *c); 176 memset(c, 0, sizeof(*c)); 176 177 c->mode = mode; 177 178 c->data = data; 178 179 c->cursor = cursor ? g_object_ref(cursor) : NULL; 179 180 c->keymap = owl_strdup(keymap); 181 owl_global_push_context_obj(g, c); 182 } 183 184 void owl_global_push_context_obj(owl_global *g, owl_context *c) 185 { 180 186 g->context_stack = g_list_prepend(g->context_stack, c); 181 187 owl_global_activate_context(g, owl_global_get_context(g)); 182 188 } 183 189 190 /* Pops the current context from the context stack and returns it. Caller is 191 * responsible for freeing. */ 192 owl_context *owl_global_pop_context_no_delete(owl_global *g) { 193 owl_context *c; 194 if (!g->context_stack) 195 return NULL; 196 c = owl_global_get_context(g); 197 owl_context_deactivate(c); 198 g->context_stack = g_list_delete_link(g->context_stack, 199 g->context_stack); 200 owl_global_activate_context(g, owl_global_get_context(g)); 201 return c; 202 } 203 204 /* Pops the current context from the context stack and deletes it. */ 184 205 void owl_global_pop_context(owl_global *g) { 185 206 owl_context *c; 186 if (!g->context_stack) 187 return; 188 c = owl_global_get_context(g); 189 g->context_stack = g_list_delete_link(g->context_stack, 190 g->context_stack); 191 if (c->cursor) 192 g_object_unref(c->cursor); 193 owl_free(c->keymap); 194 owl_free(c); 195 owl_global_activate_context(g, owl_global_get_context(g)); 207 c = owl_global_pop_context_no_delete(g); 208 if (c) 209 owl_context_delete(c); 196 210 } 197 211
Note: See TracChangeset
for help on using the changeset viewer.
