projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(decoding_table_check_elements): New function.
[chise/xemacs-chise.git-]
/
src
/
dialog-x.c
diff --git
a/src/dialog-x.c
b/src/dialog-x.c
index
1b311dd
..
3d1acc3
100644
(file)
--- a/
src/dialog-x.c
+++ b/
src/dialog-x.c
@@
-25,9
+25,7
@@
Boston, MA 02111-1307, USA. */
#include "lisp.h"
#include "console-x.h"
#include "lisp.h"
#include "console-x.h"
-#include "EmacsManager.h"
#include "EmacsFrame.h"
#include "EmacsFrame.h"
-#include "EmacsShell.h"
#include "gui-x.h"
#include "buffer.h"
#include "gui-x.h"
#include "buffer.h"
@@
-46,22
+44,28
@@
maybe_run_dbox_text_callback (LWLIB_ID id)
widget_value *wv;
int got_some;
wv = xmalloc_widget_value ();
widget_value *wv;
int got_some;
wv = xmalloc_widget_value ();
- wv->name = (char *) "value";
+ wv->name = xstrdup ("value");
got_some = lw_get_some_values (id, wv);
if (got_some)
{
Lisp_Object text_field_callback;
char *text_field_value = wv->value;
VOID_TO_LISP (text_field_callback, wv->call_data);
got_some = lw_get_some_values (id, wv);
if (got_some)
{
Lisp_Object text_field_callback;
char *text_field_value = wv->value;
VOID_TO_LISP (text_field_callback, wv->call_data);
+ text_field_callback = XCAR (XCDR (text_field_callback));
if (text_field_value)
{
if (text_field_value)
{
- void *tmp = LISP_TO_VOID (list2 (text_field_callback,
- build_string (text_field_value)));
+ void *tmp =
+ LISP_TO_VOID (cons3 (Qnil,
+ list2 (text_field_callback,
+ build_string (text_field_value)),
+ Qnil));
popup_selection_callback (0, id, (XtPointer) tmp);
popup_selection_callback (0, id, (XtPointer) tmp);
- xfree (text_field_value);
}
}
}
}
- free_widget_value (wv);
+ /* This code tried to optimize, newing/freeing. This is generally
+ unsafe so we will alwats strdup and always use
+ free_widget_value_tree. */
+ free_widget_value_tree (wv);
}
static void
}
static void
@@
-102,7
+106,7
@@
dbox_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f));
}
lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f));
}
-static CONST char * CONST button_names [] = {
+static const char * const button_names [] = {
"button1", "button2", "button3", "button4", "button5",
"button6", "button7", "button8", "button9", "button10" };
"button1", "button2", "button3", "button4", "button5",
"button6", "button7", "button8", "button9", "button10" };
@@
-122,7
+126,7
@@
dbox_descriptor_to_widget_value (Lisp_Object desc)
widget_value *prev = 0, *kids = 0;
int n = 0;
int count = specpdl_depth ();
widget_value *prev = 0, *kids = 0;
int n = 0;
int count = specpdl_depth ();
- Lisp_Object wv_closure;
+ Lisp_Object wv_closure, gui_item;
CHECK_CONS (desc);
CHECK_STRING (XCAR (desc));
CHECK_CONS (desc);
CHECK_STRING (XCAR (desc));
@@
-146,7
+150,7
@@
dbox_descriptor_to_widget_value (Lisp_Object desc)
wv_closure = make_opaque_ptr (kids);
record_unwind_protect (widget_value_unwind, wv_closure);
wv_closure = make_opaque_ptr (kids);
record_unwind_protect (widget_value_unwind, wv_closure);
- prev->name = (char *) "message";
+ prev->name = xstrdup ("message");
prev->value = xstrdup (name);
prev->enabled = 1;
prev->value = xstrdup (name);
prev->enabled = 1;
@@
-165,9
+169,11
@@
dbox_descriptor_to_widget_value (Lisp_Object desc)
CHECK_VECTOR (button);
wv = xmalloc_widget_value ();
CHECK_VECTOR (button);
wv = xmalloc_widget_value ();
- if (!button_item_to_widget_value (button, wv, allow_text_p, 1))
+ gui_item = gui_parse_item_keywords (button);
+ if (!button_item_to_widget_value (Qdialog,
+ gui_item, wv, allow_text_p, 1, 0))
{
{
- free_widget_value (wv);
+ free_widget_value_tree (wv);
continue;
}
continue;
}
@@
-179,8
+185,9
@@
dbox_descriptor_to_widget_value (Lisp_Object desc)
else /* it's a button */
{
allow_text_p = 0; /* only allow text field at the front */
else /* it's a button */
{
allow_text_p = 0; /* only allow text field at the front */
- wv->value = xstrdup (wv->name); /* what a mess... */
- wv->name = (char *) button_names [n];
+ if (wv->value) xfree (wv->value);
+ wv->value = wv->name; /* what a mess... */
+ wv->name = xstrdup (button_names [n]);
if (partition_seen)
rbuttons++;
if (partition_seen)
rbuttons++;
@@
-203,7
+210,7
@@
dbox_descriptor_to_widget_value (Lisp_Object desc)
widget_value *dbox;
sprintf (tmp_dbox_name, "%c%dBR%d", type, lbuttons + rbuttons, rbuttons);
dbox = xmalloc_widget_value ();
widget_value *dbox;
sprintf (tmp_dbox_name, "%c%dBR%d", type, lbuttons + rbuttons, rbuttons);
dbox = xmalloc_widget_value ();
- dbox->name = tmp_dbox_name;
+ dbox->name = xstrdup (tmp_dbox_name);
dbox->contents = kids;
/* No more need to free the half-filled-in structures. */
dbox->contents = kids;
/* No more need to free the half-filled-in structures. */