Changeset cb81570 for context.c


Ignore:
Timestamp:
Sep 18, 2010, 5:07:39 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
08263a8
Parents:
1d74663
git-author:
David Benjamin <davidben@mit.edu> (08/07/10 16:23:50)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
Message:
Add a separate owl_context_new and remove owl_context_init

The latter is unused anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • context.c

    r1d74663 rcb81570  
    55#define SET_MODE(ctx, new) ctx->mode = ((ctx->mode)&~OWL_CTX_MODE_BITS)|new
    66
    7 int owl_context_init(owl_context *ctx)
     7/* TODO: dependency from owl_context -> owl_window is annoying. */
     8owl_context *owl_context_new(int mode, void *data, const char *keymap, owl_window *cursor)
    89{
    9   ctx->mode = OWL_CTX_STARTUP;
    10   ctx->data = NULL;
    11   ctx->cursor = NULL;
    12   return 0;
     10  owl_context *c;
     11  if (!(mode & OWL_CTX_MODE_BITS))
     12    mode |= OWL_CTX_INTERACTIVE;
     13  c = owl_malloc(sizeof *c);
     14  memset(c, 0, sizeof(*c));
     15  c->mode = mode;
     16  c->data = data;
     17  c->cursor = cursor ? g_object_ref(cursor) : NULL;
     18  c->keymap = owl_strdup(keymap);
     19  return c;
    1320}
    14 
    1521
    1622/* returns whether test matches the current context */
Note: See TracChangeset for help on using the changeset viewer.