diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2003-04-03 04:28:15 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2003-04-03 04:28:15 +0000 |
| commit | 7903799bf2ece8f5fdb760c507c1e64ce8418b97 (patch) | |
| tree | bbca22ac108e37d07b3868ce0571b445d77ce018 /src | |
| parent | 14b142f7a8fc71d2b3089bf02711d9831dfaafdf (diff) | |
- sorted fluid menu bar
- fixed some minor Valgrind memory checker complaints
- added conditional compile flag for OS X w/ MetroWerks compiler
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2967 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_get_key.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 72 | ||||
| -rw-r--r-- | src/fl_cursor.cxx | 6 | ||||
| -rw-r--r-- | src/flstring.h | 6 |
4 files changed, 46 insertions, 43 deletions
diff --git a/src/Fl_get_key.cxx b/src/Fl_get_key.cxx index 3b64ce15a..62e0aa6ef 100644 --- a/src/Fl_get_key.cxx +++ b/src/Fl_get_key.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_get_key.cxx,v 1.5.2.3.2.4 2003/01/30 21:43:04 easysw Exp $" +// "$Id: Fl_get_key.cxx,v 1.5.2.3.2.5 2003/04/03 04:28:15 matthiaswm Exp $" // // Keyboard state routines for the Fast Light Tool Kit (FLTK). // @@ -50,6 +50,7 @@ int Fl::event_key(int k) { else # endif i = XKeysymToKeycode(fl_display, k); + if (i==0) return 0; return fl_key_vector[i/8] & (1 << (i%8)); } @@ -62,5 +63,5 @@ int Fl::get_key(int k) { #endif // -// End of "$Id: Fl_get_key.cxx,v 1.5.2.3.2.4 2003/01/30 21:43:04 easysw Exp $". +// End of "$Id: Fl_get_key.cxx,v 1.5.2.3.2.5 2003/04/03 04:28:15 matthiaswm Exp $". // diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index f74beab82..83b23e707 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_x.cxx,v 1.24.2.24.2.27 2003/03/09 02:00:06 spitzak Exp $" +// "$Id: Fl_x.cxx,v 1.24.2.24.2.28 2003/04/03 04:28:15 matthiaswm Exp $" // // X specific code for the Fast Light Tool Kit (FLTK). // @@ -1087,20 +1087,21 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) XChangeProperty(fl_display, xp->xid, fl_XdndAware, XA_ATOM, sizeof(int)*8, 0, (unsigned char*)&version, 1); - XWMHints hints; - hints.input = True; - hints.flags = InputHint; + XWMHints *hints = XAllocWMHints(); + hints->input = True; + hints->flags = InputHint; if (fl_show_iconic) { - hints.flags |= StateHint; - hints.initial_state = IconicState; + hints->flags |= StateHint; + hints->initial_state = IconicState; fl_show_iconic = 0; showit = 0; } if (win->icon()) { - hints.icon_pixmap = (Pixmap)win->icon(); - hints.flags |= IconPixmapHint; + hints->icon_pixmap = (Pixmap)win->icon(); + hints->flags |= IconPixmapHint; } - XSetWMHints(fl_display, xp->xid, &hints); + XSetWMHints(fl_display, xp->xid, hints); + XFree(hints); } XMapWindow(fl_display, xp->xid); @@ -1129,51 +1130,51 @@ void Fl_X::sendxjunk() { return; // because this recursively called here } - XSizeHints hints; + XSizeHints *hints = XAllocSizeHints(); // memset(&hints, 0, sizeof(hints)); jreiser suggestion to fix purify? - hints.min_width = w->minw; - hints.min_height = w->minh; - hints.max_width = w->maxw; - hints.max_height = w->maxh; - hints.width_inc = w->dw; - hints.height_inc = w->dh; - hints.win_gravity = StaticGravity; + hints->min_width = w->minw; + hints->min_height = w->minh; + hints->max_width = w->maxw; + hints->max_height = w->maxh; + hints->width_inc = w->dw; + hints->height_inc = w->dh; + hints->win_gravity = StaticGravity; // see the file /usr/include/X11/Xm/MwmUtil.h: // fill all fields to avoid bugs in kwm and perhaps other window managers: // 0, MWM_FUNC_ALL, MWM_DECOR_ALL long prop[5] = {0, 1, 1, 0, 0}; - if (hints.min_width != hints.max_width || - hints.min_height != hints.max_height) { // resizable - hints.flags = PMinSize|PWinGravity; - if (hints.max_width >= hints.min_width || - hints.max_height >= hints.min_height) { - hints.flags = PMinSize|PMaxSize|PWinGravity; + if (hints->min_width != hints->max_width || + hints->min_height != hints->max_height) { // resizable + hints->flags = PMinSize|PWinGravity; + if (hints->max_width >= hints->min_width || + hints->max_height >= hints->min_height) { + hints->flags = PMinSize|PMaxSize|PWinGravity; // unfortunately we can't set just one maximum size. Guess a // value for the other one. Some window managers will make the // window fit on screen when maximized, others will put it off screen: - if (hints.max_width < hints.min_width) hints.max_width = Fl::w(); - if (hints.max_height < hints.min_height) hints.max_height = Fl::h(); + if (hints->max_width < hints->min_width) hints->max_width = Fl::w(); + if (hints->max_height < hints->min_height) hints->max_height = Fl::h(); } - if (hints.width_inc && hints.height_inc) hints.flags |= PResizeInc; + if (hints->width_inc && hints->height_inc) hints->flags |= PResizeInc; if (w->aspect) { // stupid X! It could insist that the corner go on the // straight line between min and max... - hints.min_aspect.x = hints.max_aspect.x = hints.min_width; - hints.min_aspect.y = hints.max_aspect.y = hints.min_height; - hints.flags |= PAspect; + hints->min_aspect.x = hints->max_aspect.x = hints->min_width; + hints->min_aspect.y = hints->max_aspect.y = hints->min_height; + hints->flags |= PAspect; } } else { // not resizable: - hints.flags = PMinSize|PMaxSize|PWinGravity; + hints->flags = PMinSize|PMaxSize|PWinGravity; prop[0] = 1; // MWM_HINTS_FUNCTIONS prop[1] = 1|2|16; // MWM_FUNC_ALL | MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE } if (w->flags() & Fl_Window::FL_FORCE_POSITION) { - hints.flags |= USPosition; - hints.x = w->x(); - hints.y = w->y(); + hints->flags |= USPosition; + hints->x = w->x(); + hints->y = w->y(); } if (!w->border()) { @@ -1181,10 +1182,11 @@ void Fl_X::sendxjunk() { prop[2] = 0; // no decorations } - XSetWMNormalHints(fl_display, xid, &hints); + XSetWMNormalHints(fl_display, xid, hints); XChangeProperty(fl_display, xid, fl_MOTIF_WM_HINTS, fl_MOTIF_WM_HINTS, 32, 0, (unsigned char *)prop, 5); + XFree(hints); } void Fl_Window::size_range_() { @@ -1264,5 +1266,5 @@ void Fl_Window::make_current() { #endif // -// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.27 2003/03/09 02:00:06 spitzak Exp $". +// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.28 2003/04/03 04:28:15 matthiaswm Exp $". // diff --git a/src/fl_cursor.cxx b/src/fl_cursor.cxx index 329fbdf88..152df8ddc 100644 --- a/src/fl_cursor.cxx +++ b/src/fl_cursor.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_cursor.cxx,v 1.6.2.6.2.8 2003/01/30 21:43:30 easysw Exp $" +// "$Id: fl_cursor.cxx,v 1.6.2.6.2.9 2003/04/03 04:28:15 matthiaswm Exp $" // // Mouse cursor support for the Fast Light Tool Kit (FLTK). // @@ -279,7 +279,7 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { if (c >= FL_CURSOR_NS) { TableEntry *q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS); if (!(q->cursor)) { - XColor dummy; + XColor dummy = { 0 }; Pixmap p = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), (const char*)(q->bits), CURSORSIZE, CURSORSIZE); @@ -312,5 +312,5 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { #endif // -// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.8 2003/01/30 21:43:30 easysw Exp $". +// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.9 2003/04/03 04:28:15 matthiaswm Exp $". // diff --git a/src/flstring.h b/src/flstring.h index 91663db2d..c2d78e2f8 100644 --- a/src/flstring.h +++ b/src/flstring.h @@ -1,5 +1,5 @@ /* - * "$Id: flstring.h,v 1.1.2.11 2003/01/30 21:44:26 easysw Exp $" + * "$Id: flstring.h,v 1.1.2.12 2003/04/03 04:28:15 matthiaswm Exp $" * * Common string header file for the Fast Light Tool Kit (FLTK). * @@ -63,7 +63,7 @@ extern "C" { * when included - to be resolved... */ -# if defined(__APPLE__) && defined(__MWERKS__) +# if defined(__APPLE__) && defined(__MWERKS__) && defined(_MSL_USING_MW_C_HEADERS) int strcasecmp(const char*,const char*); int strncasecmp(const char*,const char*,int); char *strdup(const char*); @@ -101,5 +101,5 @@ FL_EXPORT extern size_t fl_strlcpy(char *, const char *, size_t); /* - * End of "$Id: flstring.h,v 1.1.2.11 2003/01/30 21:44:26 easysw Exp $". + * End of "$Id: flstring.h,v 1.1.2.12 2003/04/03 04:28:15 matthiaswm Exp $". */ |
