Back to index

plt-scheme  4.2.1
Classes | Defines | Functions | Variables
Window.cc File Reference
#include "wx.h"
#include "widgets.h"
#include "xdnd.h"
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include "xdnd.c"

Go to the source code of this file.

Classes

class  Accum_Single_Instance_Message

Defines

#define Uses_XtIntrinsicP
#define Uses_wxGDI
#define Uses_wxLayout
#define Uses_wxMenu
#define Uses_wxMenuBar
#define Uses_wxTypeTree
#define Uses_wxWindow
#define Uses_wxDialogBox
#define Uses_wxItem
#define Uses_wxCanvas
#define Uses_wxApp
#define Uses_wxClipboard
#define Uses_ScrollWinWidget
#define Uses_Scrollbar
#define Uses_ShellWidget
#define Uses_SimpleWidget
#define Uses_EnforcerWidget
#define Uses_LabelWidget
#define Uses_MultiListWidget
#define Uses_ScrollbarWidget
#define ACTIVE_VIA_POINTER_FLAG   0x1
#define DISABLED_FLAG   0x2
#define SHOWN_FLAG   0x4
#define NO_AUTO_SCROLL_FLAG   0x8
#define FOCUS_FLAG   0x10
#define REPORT_ZERO_WIDTH_FLAG   0x20
#define REPORT_ZERO_HEIGHT_FLAG   0x40
#define LAST_WAS_ALT_DOWN_FLAG   0x80
#define XMB_KC_STATUS(status)   ((status == XLookupKeySym) || (status == XLookupBoth))
#define XMB_STR_STATUS(status)   ((status == XLookupChars) || (status == XLookupBoth))
#define XMB_STR_PREFERRED_STATUS(status, xev)   ((status == XLookupChars) || ((status == XLookupBoth) && !(xev->xkey.state & ControlMask)))
#define DEFAULT_XMB_STATUS   XLookupKeySym
#define X___LookupString   XmbLookupString

Functions

void wxSetSensitive (Widget, Bool enabled)
int wxLocaleStringToChar (char *str, int slen)
int wxUTF8StringToChar (char *str, int slen)
wxWindowwxLocationToWindow (int x, int y)
static void parse_and_drop_runtime (int len, char *s)
static void decode_percent_escapes (char *s)
void wxDrop_Runtime (char **argv, int argc)
_XFUNCPROTOBEGIN EventMask _XtConvertTypeToMask (int type)
void _XtTranslateEvent (Widget w, XEvent *ev)
static void FreeSaferef (Widget WXUNUSED(w), wxWindow **winp, XtPointer WXUNUSED(null))
static void AdjustMousePosition (Window xevwin, Widget handle, wxWindow *win, wxMouseEvent *wxevent)
Bool wxIsAlt (KeySym key_sym)
static int extract_string_key (char *str, int slen)
static int status_to_kc (Status status, XEvent *xev, KeySym keysym, char *str, int slen)
static int ishexdig (char s)
static int hexval (char s)

Variables

static Atom utf8_atom = 0
static Atom net_wm_name_atom
static Atom net_wm_icon_name_atom
static wxWindowgrabbing_panel
static Time grabbing_panel_time
static Bool grabbing_panel_regsitered
static int dnd_inited = 0
static DndClass dnd
Atom wx_single_instance_tag = 0
static XIM the_im
static int si_registered
static
Accum_Single_Instance_Message
si_msgs
static XComposeStatus compose_status
static XModifierKeymap * xmodkeymap

Class Documentation

class Accum_Single_Instance_Message

Definition at line 84 of file Window.cc.

Collaboration diagram for Accum_Single_Instance_Message:
Class Members
char * accum
int len
Accum_Single_Instance_Message * next
int size
long src

Define Documentation

#define ACTIVE_VIA_POINTER_FLAG   0x1

Definition at line 101 of file Window.cc.

#define DEFAULT_XMB_STATUS   XLookupKeySym

Definition at line 1765 of file Window.cc.

#define DISABLED_FLAG   0x2

Definition at line 102 of file Window.cc.

#define FOCUS_FLAG   0x10

Definition at line 105 of file Window.cc.

#define LAST_WAS_ALT_DOWN_FLAG   0x80

Definition at line 108 of file Window.cc.

#define NO_AUTO_SCROLL_FLAG   0x8

Definition at line 104 of file Window.cc.

#define REPORT_ZERO_HEIGHT_FLAG   0x40

Definition at line 107 of file Window.cc.

#define REPORT_ZERO_WIDTH_FLAG   0x20

Definition at line 106 of file Window.cc.

#define SHOWN_FLAG   0x4

Definition at line 103 of file Window.cc.

Definition at line 48 of file Window.cc.

Definition at line 49 of file Window.cc.

Definition at line 50 of file Window.cc.

#define Uses_Scrollbar

Definition at line 45 of file Window.cc.

Definition at line 51 of file Window.cc.

Definition at line 44 of file Window.cc.

Definition at line 46 of file Window.cc.

Definition at line 47 of file Window.cc.

#define Uses_wxApp

Definition at line 41 of file Window.cc.

#define Uses_wxCanvas

Definition at line 40 of file Window.cc.

Definition at line 42 of file Window.cc.

Definition at line 38 of file Window.cc.

#define Uses_wxGDI

Definition at line 32 of file Window.cc.

#define Uses_wxItem

Definition at line 39 of file Window.cc.

#define Uses_wxLayout

Definition at line 33 of file Window.cc.

#define Uses_wxMenu

Definition at line 34 of file Window.cc.

#define Uses_wxMenuBar

Definition at line 35 of file Window.cc.

#define Uses_wxTypeTree

Definition at line 36 of file Window.cc.

#define Uses_wxWindow

Definition at line 37 of file Window.cc.

Definition at line 31 of file Window.cc.

#define X___LookupString   XmbLookupString

Definition at line 1769 of file Window.cc.

#define XMB_KC_STATUS (   status)    ((status == XLookupKeySym) || (status == XLookupBoth))

Definition at line 1762 of file Window.cc.

#define XMB_STR_PREFERRED_STATUS (   status,
  xev 
)    ((status == XLookupChars) || ((status == XLookupBoth) && !(xev->xkey.state & ControlMask)))

Definition at line 1764 of file Window.cc.

#define XMB_STR_STATUS (   status)    ((status == XLookupChars) || (status == XLookupBoth))

Definition at line 1763 of file Window.cc.


Function Documentation

_XFUNCPROTOBEGIN EventMask _XtConvertTypeToMask ( int  type)

Here is the caller graph for this function:

void _XtTranslateEvent ( Widget  w,
XEvent *  ev 
)

Here is the caller graph for this function:

static void AdjustMousePosition ( Window  xevwin,
Widget  handle,
wxWindow win,
wxMouseEvent wxevent 
) [static]

Definition at line 1736 of file Window.cc.

{
  if (xevwin != XtWindow(handle)) {
    Widget wgt;
    wgt = XtWindowToWidget(XtDisplay(handle), xevwin);
    if (wgt) {
      Position cx, cy, wx, wy;
      XtTranslateCoords(wgt, 0, 0, &cx, &cy);
      XtTranslateCoords(handle, 0, 0, &wx, &wy);
      wxevent->x += (cx - wx);
      wxevent->y += (cy - wy);
    }
  } else if (wxSubType(win->__type, wxTYPE_CANVAS)) {
    /* Reverse scroll effects: */
    int dx, dy;
    ((wxCanvas *)win)->ViewStart(&dx, &dy);
    wxevent->x -= dx;
    wxevent->y -= dy;
  }
}

Here is the call graph for this function:

static void decode_percent_escapes ( char *  s) [static]

Definition at line 2594 of file Window.cc.

{
  int src = 0, dest = 0;
  while (s[src]) {
    if ((s[src] == '%')
       && ishexdig(s[src+1])
       && ishexdig(s[src+2])) {
      int v;
      v = ((hexval(s[src+1]) << 4) + hexval(s[src+2]));
      s[dest++] = v;
      src += 3;
    } else {
      s[dest++] = s[src++];
    }
  }
  s[dest] = 0;
}

Here is the call graph for this function:

static int extract_string_key ( char *  str,
int  slen 
) [static]

Definition at line 1780 of file Window.cc.

{
  if (slen > 9)
    slen = 9;
  str[slen] = 0;
#ifdef X_HAVE_UTF8_STRING
  return wxUTF8StringToChar(str, slen);
#else
  return wxLocaleStringToChar(str, slen);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void FreeSaferef ( Widget   WXUNUSEDw,
wxWindow **  winp,
XtPointer   WXUNUSEDnull 
) [static]

Definition at line 1164 of file Window.cc.

{
  FREE_SAFEREF((char *)winp);

  /* No XFORM_RESET_VAR_STACK because this one isn't xformed.  No need
     to xform because FREE_SAFEREF won't set the GC variable stack. */
}

Here is the caller graph for this function:

static int hexval ( char  s) [static]

Definition at line 2586 of file Window.cc.

                          { 
  return (((s >= '0') && (s <= '9'))
         ? s - '0'
         : (((s >= 'a') && (s <= 'f'))
            ? s - 'a' + 10
            : s - 'A' + 10));
}

Here is the caller graph for this function:

static int ishexdig ( char  s) [static]

Definition at line 2581 of file Window.cc.

                            { 
  return (((s >= '0') && (s <= '9'))
         || ((s >= 'a') && (s <= 'f'))
         || ((s >= 'A') && (s <= 'F'))); 
}

Here is the caller graph for this function:

static void parse_and_drop_runtime ( int  len,
char *  s 
) [static]

Definition at line 2535 of file Window.cc.

{
  char **argv, *a;
  int cnt = 0, pos = 0;
  int sz;

  while (pos < len) {
    sz = 0;
    while ((pos < len) && (s[pos] != ':')) {
      sz = (sz * 10) + (s[pos] - '0');
      pos++;
    }
    pos++;
    if (sz > 0)
      pos += sz;
    cnt++;
  }
  
  argv = new WXGC_PTRS char*[cnt];
  
  pos = cnt = 0;
  while (pos < len) {
    sz = 0;
    while ((pos < len) && (s[pos] != ':')) {
      sz = (sz * 10) + (s[pos] - '0');
      pos++;
    }
    pos++;

    if (sz > len - pos)
      sz = len - pos;
    if (sz < 0)
      sz = 0;
    a = new WXGC_ATOMIC char[sz + 1];
    memcpy(a, s + pos, sz);
    a[sz] = 0;
    argv[cnt] = a;
    
    if (sz > 0)
      pos += sz;
    cnt++;
  }
  
  wxDrop_Runtime(argv, cnt);
}

Here is the call graph for this function:

static int status_to_kc ( Status  status,
XEvent *  xev,
KeySym  keysym,
char *  str,
int  slen 
) [static]

Definition at line 1871 of file Window.cc.

{
  if (XMB_STR_PREFERRED_STATUS(status, xev))
    return extract_string_key(str, slen);
  else if (XMB_KC_STATUS(status))
    return CharCodeXToWX(keysym);
  else if (XMB_STR_STATUS(status))
    return extract_string_key(str, slen);
  else 
    return 0;
}

Here is the call graph for this function:

void wxDrop_Runtime ( char **  argv,
int  argc 
)

Definition at line 3667 of file mred.cxx.

{
  int i;

  for (i = 0; i < argc; i++) {
    Scheme_Object *p[1];
#ifdef wx_xt
    p[0] = scheme_char_string_to_path(scheme_make_utf8_string(argv[i]));
#else
    p[0] = scheme_make_path(argv[i]);
#endif
    wxDo(wxs_app_file_proc, 1, p);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool wxIsAlt ( KeySym  key_sym)

Definition at line 181 of file EvtHandler.cc.

{
  if ((key_sym == XK_Alt_L) || (key_sym == XK_Alt_R)
      || (key_sym == XK_Meta_L) || (key_sym == XK_Meta_R)) {
    return TRUE;
  }

  return FALSE;
}
int wxLocaleStringToChar ( char *  str,
int  slen 
)

Definition at line 755 of file mredx.cxx.

{
  Scheme_Object *s;
  s = scheme_make_locale_string(str);
  if (SCHEME_CHAR_STRLEN_VAL(s))
    return SCHEME_CHAR_STR_VAL(s)[0];
  else
    return 0;
}

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;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSetSensitive ( Widget  ,
Bool  enabled 
)

Definition at line 432 of file mredx.cxx.

{
  if (!disabled_widgets) {
    if (enabled)
      return;

    wxREGGLOB(disabled_widgets);
    disabled_widgets = scheme_make_hash_table(SCHEME_hash_ptr);
#ifdef MZ_PRECISE_GC
    disabled_widgets->make_hash_indices = widget_hash_indices;
#endif
  }

  if (enabled) {
    scheme_hash_set(disabled_widgets, (Scheme_Object *)w, NULL);
  } else {
    scheme_hash_set(disabled_widgets, (Scheme_Object *)w, (Scheme_Object *)0x1);
  }
}

Here is the caller graph for this function:

int wxUTF8StringToChar ( char *  str,
int  slen 
)

Definition at line 765 of file mredx.cxx.

{
  mzchar s[1];
  s[0] = 0;
  scheme_utf8_decode((unsigned char *)str, 0, slen,
                   s, 0, 1,
                   NULL, 0, '?');
  return (int)s[0];
}

Here is the caller graph for this function:


Variable Documentation

XComposeStatus compose_status [static]

Definition at line 1760 of file Window.cc.

DndClass dnd [static]

Definition at line 76 of file Window.cc.

int dnd_inited = 0 [static]

Definition at line 75 of file Window.cc.

Definition at line 69 of file Window.cc.

Definition at line 71 of file Window.cc.

Time grabbing_panel_time [static]

Definition at line 70 of file Window.cc.

Atom net_wm_icon_name_atom [static]

Definition at line 62 of file Window.cc.

Atom net_wm_name_atom [static]

Definition at line 62 of file Window.cc.

Definition at line 92 of file Window.cc.

int si_registered [static]

Definition at line 91 of file Window.cc.

XIM the_im [static]

Definition at line 81 of file Window.cc.

Atom utf8_atom = 0 [static]

Definition at line 62 of file Window.cc.

Definition at line 78 of file Window.cc.

XModifierKeymap* xmodkeymap [static]

Definition at line 1778 of file Window.cc.