Mercurial > hg > xemacs-beta
comparison src/gui-x.c @ 259:11cf20601dec r20-5b28
Import from CVS: tag r20-5b28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:23:02 +0200 |
parents | 557eaa0339bf |
children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
258:58424f6abf56 | 259:11cf20601dec |
---|---|
1 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs) | 1 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs) |
2 Copyright (C) 1995 Board of Trustees, University of Illinois. | 2 Copyright (C) 1995 Board of Trustees, University of Illinois. |
3 Copyright (C) 1995, 1996 Ben Wing. | 3 Copyright (C) 1995, 1996 Ben Wing. |
4 Copyright (C) 1995 Sun Microsystems, Inc. | 4 Copyright (C) 1995 Sun Microsystems, Inc. |
5 Copyright (C) 1998 Free Software Foundation, Inc. | |
5 | 6 |
6 This file is part of XEmacs. | 7 This file is part of XEmacs. |
7 | 8 |
8 XEmacs is free software; you can redistribute it and/or modify it | 9 XEmacs is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 10 under the terms of the GNU General Public License as published by the |
373 int length = XVECTOR_LENGTH (desc); | 374 int length = XVECTOR_LENGTH (desc); |
374 Lisp_Object *contents = XVECTOR_DATA (desc); | 375 Lisp_Object *contents = XVECTOR_DATA (desc); |
375 int plist_p; | 376 int plist_p; |
376 int selected_spec = 0, included_spec = 0; | 377 int selected_spec = 0, included_spec = 0; |
377 | 378 |
378 if (length < 3) | 379 if (length < 2) |
379 signal_simple_error ("button descriptors must be at least 3 long", desc); | 380 signal_simple_error ("button descriptors must be at least 2 long", desc); |
380 | 381 |
381 /* length 3: [ "name" callback active-p ] | 382 /* length 2: [ "name" callback ] |
383 length 3: [ "name" callback active-p ] | |
382 length 4: [ "name" callback active-p suffix ] | 384 length 4: [ "name" callback active-p suffix ] |
383 or [ "name" callback keyword value ] | 385 or [ "name" callback keyword value ] |
384 length 5+: [ "name" callback [ keyword value ]+ ] | 386 length 5+: [ "name" callback [ keyword value ]+ ] |
385 */ | 387 */ |
386 plist_p = (length >= 5 || KEYWORDP (contents [2])); | 388 plist_p = (length >= 5 || (length > 2 && KEYWORDP (contents [2]))); |
387 | 389 |
388 if (!plist_p) | 390 if (!plist_p && length > 2) |
389 /* the old way */ | 391 /* the old way */ |
390 { | 392 { |
391 name = contents [0]; | 393 name = contents [0]; |
392 callback = contents [1]; | 394 callback = contents [1]; |
393 active_p = contents [2]; | 395 active_p = contents [2]; |
451 wv->accel = LISP_TO_VOID (accel); | 453 wv->accel = LISP_TO_VOID (accel); |
452 | 454 |
453 if (!NILP (suffix)) | 455 if (!NILP (suffix)) |
454 { | 456 { |
455 CONST char *const_bogosity; | 457 CONST char *const_bogosity; |
456 CHECK_STRING (suffix); | 458 Lisp_Object suffix2; |
457 GET_C_STRING_FILENAME_DATA_ALLOCA (suffix, const_bogosity); | 459 |
460 /* Shortcut to avoid evaluating suffix each time */ | |
461 if (STRINGP (suffix)) | |
462 suffix2 = suffix; | |
463 else | |
464 { | |
465 suffix2 = Feval (suffix); | |
466 CHECK_STRING (suffix2); | |
467 } | |
468 | |
469 GET_C_STRING_FILENAME_DATA_ALLOCA (suffix2, const_bogosity); | |
458 wv->value = (char *) const_bogosity; | 470 wv->value = (char *) const_bogosity; |
459 wv->value = xstrdup (wv->value); | 471 wv->value = xstrdup (wv->value); |
460 } | 472 } |
461 | 473 |
462 wv_set_evalable_slot (wv->enabled, active_p); | 474 wv_set_evalable_slot (wv->enabled, active_p); |