Back to index

plt-scheme  4.2.1
Defines | Functions | Variables
wxsmred.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MRED_EXTERN   extern
#define CAST_SP

Functions

Scheme_ObjectMrEdGetFrameList (void)
int MrEdCheckForBreak (void)
Scheme_ObjectMrEdEventspaceConfig (Scheme_Object *)
Scheme_ObjectMrEdEventspaceThread (Scheme_Object *e)
Scheme_ObjectMrEdMakeEventspace ()
int wxsIsContextShutdown (void *cx)
Scheme_ObjectwxsBundlePSSetup (wxPrintSetupData *d)
wxPrintSetupData * wxsUnbundlePSSetup (Scheme_Object *s)
void MrEd_add_q_callback (char *who, int argc, Scheme_Object **argv)
void MrEdQueueInEventspace (void *context, Scheme_Object *thunk)
voidwxSchemeYield (void *sema)
wxWindowwxLocationToWindow (int x, int y)
MRED_EXTERN void mred_wait_eventspace (void)
MRED_EXTERN Scheme_ObjectwxSchemeFindDirectory (int argc, Scheme_Object **argv)
int wxGetPreference (const char *name, int *res)
int wxIsUserMainEventspace (Scheme_Object *o)
int mred_current_thread_is_handler (void *ctx)
void wxscheme_early_gl_init (void)

Variables

int mred_eventspace_param
int mred_event_dispatch_param
int mred_ps_setup_param
Scheme_Type mred_eventspace_type
Scheme_ObjectMrEd_mid_queue_key
Scheme_Objectwxs_app_file_proc
Scheme_Objectwxs_app_quit_proc
Scheme_Objectwxs_app_about_proc
Scheme_Objectwxs_app_pref_proc

Define Documentation

#define CAST_SP

Definition at line 51 of file wxsmred.h.

#define MRED_EXTERN   extern

Definition at line 3 of file wxsmred.h.


Function Documentation

void MrEd_add_q_callback ( char *  who,
int  argc,
Scheme_Object **  argv 
)

Definition at line 1990 of file mred.cxx.

{
  MrEdContext *c;
  Q_Callback_Set *cs;
  Q_Callback *cb;
  int hi;

  scheme_check_proc_arity(who, 0, 0, argc, argv);
  c = (MrEdContext *)wxsCheckEventspace("queue-callback");

  if (argc > 1) {
    if (argv[1] == MrEd_mid_queue_key)
      hi = 1;
    else
      hi = (SCHEME_TRUEP(argv[1]) ? 2 : 0);
  } else
    hi = 2;

  cs = q_callbacks + hi;

  cb = (Q_Callback*)scheme_malloc(sizeof(Q_Callback));
  cb->context = c;
  cb->callback = argv[0];

  insert_q_callback(cs, cb);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1017 of file mred.cxx.

{
  Scheme_Thread *thread;
  thread = scheme_get_current_thread();

  if (!ctx)
    ctx = MrEdGetContext();

  return (((MrEdContext *)ctx)->handler_running == thread);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1006 of file mred.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1160 of file mredmac.cxx.

{
  MrQueueElem *q;
  
  if (!KeyOk(TRUE))
    return 0;
  
  TransferQueue(0);

  for (q = first; q; q = q->next) {
    if (q->event.what == keyDown) {
      if ((((q->event.message & charCodeMask) == '.') 
          && (q->event.modifiers & cmdKey))
         || (((q->event.message & charCodeMask) == 3) 
             && (q->event.modifiers & controlKey))) {
        MrDequeue(q);
        return TRUE;
      }
    }
  }
  
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 897 of file mred.cxx.

{
  return (Scheme_Object *)((MrEdContext *)e)->handler_running;
}

Here is the caller graph for this function:

Definition at line 902 of file mred.cxx.

{
  MrEdContext *c;
  Scheme_Object *l = scheme_null;
  c = MrEdGetContext();

  if (c) {
    wxChildNode *node;
    for (node = c->topLevelWindowList->First(); node; node = node->Next()) {
      wxObject *o;
      o = node->Data();
      if (node->IsShown()) {
#ifdef wx_mac
       /* Mac: some frames really represent dialogs. Any modal frame is
          a dialog, so extract its only child. */
       if (((wxFrame *)o)->IsModal()) {
         wxChildNode *node2;
         wxChildList *cl;
         cl = ((wxFrame *)o)->GetChildren();
         node2 = cl->First();
         if (node2)
           o = node2->Data();
       }
#endif
       l = scheme_make_pair(objscheme_bundle_wxObject(o), l);
      }
    }
  }

  return l;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 886 of file mred.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void MrEdQueueInEventspace ( void context,
Scheme_Object thunk 
)

Definition at line 2194 of file mred.cxx.

{
  Q_Callback *cb;

  cb = (Q_Callback*)scheme_malloc(sizeof(Q_Callback));
  cb->context = (MrEdContext *)context;
  cb->callback = thunk;

  insert_q_callback(q_callbacks + 1, cb);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int wxGetPreference ( const char *  name,
int res 
)

Definition at line 2952 of file wxscheme.cxx.

{
  char buf[20];

  if (wxGetPreference(name, buf, 20)) {    
    long v;
    char *p;
    v = strtol(buf, &p, 10);
    if (p == (buf + strlen(buf))) {
      *res = v;
      return 1;
    }
  }

  return 0;
}

Definition at line 565 of file mred.cxx.

{
  return o == (Scheme_Object *)user_main_context;
}

Here is the caller graph for this function:

Definition at line 1315 of file mredmac.cxx.

{
  Point p;
  WindowPtr f;
  Rect bounds;
  int part;

  p.h = x;
  p.v = y;
  part = FindWindow(p, &f);
  
  GetWindowBounds(f, kWindowContentRgn, &bounds);
  if (IsWindowVisible(f)
      && (bounds.left <= x)
      && (bounds.right >= x)
      && (bounds.top <= y)
      && (bounds.bottom >= y)) {
    /* Found it */
    wxFrame *frame;
    void *refcon;

    refcon = (void *)GetWRefCon(f);
    frame = (wxFrame *)GET_SAFEREF(refcon);

    if (frame) {
      /* Mac: some frames really represent dialogs. Any modal frame is
        a dialog, so extract its only child. */
      if (frame->IsModal()) {
       wxChildNode *node2;
       wxChildList *cl;
       cl = frame->GetChildren();
       node2 = cl->First();
       if (node2)
         return (wxWindow *)node2->Data();
      } else
       return frame;
    } else
      return NULL;
  }
  
  return NULL;
}
Scheme_Object* wxsBundlePSSetup ( wxPrintSetupData *  d)

Definition at line 1997 of file wxscheme.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 545 of file wxscheme.cxx.

{
#ifdef PROTECT_GLS
  gl_param = scheme_new_param();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2464 of file wxscheme.cxx.

{
  int which;

  if (argv[0] == init_file_symbol)
    which = id_init_file;
  else if (argv[0] == setup_file_symbol)
    which = id_setup_file;
  else if (argv[0] == x_display_symbol)
    which = id_x_display;
  else {
    scheme_wrong_type("find-graphical-system-path", "graphical path symbol",
                    0, argc, argv);
    return NULL;
  }

#if defined(wx_x) || defined(OS_X)
  {
    Scheme_Object *home;
    int ends_in_slash;

    home = scheme_make_path(scheme_expand_user_filename("~/", 2, NULL, NULL, 0));
    
    ends_in_slash = (SCHEME_BYTE_STR_VAL(home))[SCHEME_BYTE_STRTAG_VAL(home) - 1] == '/';
    
    if (which == id_init_file)
      return append_path(home,
                      scheme_make_path("/.mredrc" + ends_in_slash));
    if (which == id_setup_file)
      return append_path(home,
                      scheme_make_path("/.mred.resources" + ends_in_slash));

    if (which == id_x_display) {
# if defined(wx_x)
      if (x_display_str)
       return scheme_make_path(x_display_str);
# endif
      return scheme_false;
    }
  }
#endif

#ifdef wx_msw
  {
    Scheme_Object *home;
    int ends_in_slash;
    
    home = scheme_make_path_without_copying(win_find_home());
    
    ends_in_slash = (SCHEME_BYTE_STR_VAL(home))[SCHEME_BYTE_STRTAG_VAL(home) - 1];
    ends_in_slash = ((ends_in_slash == '/') || (ends_in_slash == '\\'));
    
    if (which == id_init_file)
      return append_path(home,
                      scheme_make_path("\\mredrc.ss" + ends_in_slash));
    if (which == id_setup_file)
      return append_path(home,
                      scheme_make_path("\\mred.ini" + ends_in_slash));  
    
    if (which == id_x_display)
      return scheme_false;
  }
#endif

#if defined(wx_mac) && !defined(OS_X)
  OSType t;
  FSSpec spec;
  Scheme_Object *home;

  if (which == id_x_display)
    return scheme_false;

  switch (which) {
  case id_init_file:
  default:
    t = 'temp';
    break;
  }

  SInt16 vRefNum;
  SInt32 dirID;
  const Str255 fileName = "\p";

  if (!FindFolder(kOnSystemDisk, t, kCreateFolder, &vRefNum, &dirID) == noErr) {
    FSMakeFSSpec(vRefNum,dirID,fileName,&spec);
    home = scheme_make_path(scheme_mac_spec_to_path(&spec));
  } else if (wxmac_startup_directory) {
    home = scheme_make_path(wxmac_startup_directory);
  } else {
    home = scheme_make_path(scheme_os_getcwd(NULL, 0, NULL, 1));
  }
  
  int ends_in_colon;
  ends_in_colon = (SCHEME_BYTE_STR_VAL(home))[SCHEME_BYTE_STRTAG_VAL(home) - 1] == ':';

  if (which == id_init_file)
    return append_path(home,
                     scheme_make_path(":mredrc.ss" + ends_in_colon));
  if (which == id_setup_file)
    return append_path(home,
                     scheme_make_path(":mred.fnt" + ends_in_colon));  
#endif

  return scheme_void;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* wxSchemeYield ( void sema)

Definition at line 2198 of file wxscheme.cxx.

{
  int is_handler;

  if (!wait_symbol) {
    wxREGGLOB(wait_symbol);
    wait_symbol = scheme_intern_symbol("wait");
  }

  is_handler = mred_current_thread_is_handler(NULL);

  if (sema == wait_symbol) {
    if (is_handler) {
      mred_wait_eventspace();
      return scheme_true;
    } else
      return scheme_false;
  } else if (sema) {
    if (!scheme_is_evt((Scheme_Object *)sema))
      scheme_wrong_type("yield", "evt or 'wait", -1, 0, (Scheme_Object **)(void *)&sema);

    if (is_handler)
      return wxDispatchEventsUntilWaitable((wxDispatch_Check_Fun)NULL, NULL, (Scheme_Object *)sema);
    else {
      Scheme_Object *a[1];
      a[0] = (Scheme_Object *)sema;
      return scheme_sync(1, a);
    }
  } else {
    if (is_handler && wxYield())
      return scheme_true;
    else
      return scheme_false;
  }
}

Here is the call graph for this function:

Definition at line 570 of file mred.cxx.

{
  MrEdContext *c;
  c = (MrEdContext *)cx;

  return c->killed;
}

Here is the caller graph for this function:

wxPrintSetupData* wxsUnbundlePSSetup ( Scheme_Object s)

Definition at line 2002 of file wxscheme.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 247 of file mred.cxx.

Definition at line 246 of file mred.cxx.

Definition at line 248 of file mred.cxx.

Definition at line 1988 of file mred.cxx.

Definition at line 252 of file mred.cxx.

Definition at line 1705 of file wxscheme.cxx.

Definition at line 1703 of file wxscheme.cxx.

Definition at line 1706 of file wxscheme.cxx.

Definition at line 1704 of file wxscheme.cxx.