+
+/* This hack exists because Lucid/Athena need to execute the strange
+ function below to support geometry management. */
+void
+#ifdef PROTOTYPES
+lw_refigure_widget (Widget w, Boolean doit)
+#else
+lw_refigure_widget (w, doit)
+ Widget w;
+ Boolean doit;
+#endif
+{
+#if defined (USE_XAW)
+ XawPanedSetRefigureMode (w, doit);
+#endif
+#if defined (USE_MOTIF)
+ if (doit)
+ XtManageChild (w);
+ else
+ XtUnmanageChild (w);
+#endif
+}
+
+/* Toolkit independent way of determining if an event window is in the
+ menubar. */
+Boolean
+lw_window_is_in_menubar (win, menubar_widget)
+ Window win;
+ Widget menubar_widget;
+{
+ return menubar_widget
+#if defined (USE_LUCID)
+ && XtWindow (menubar_widget) == win;
+#endif
+#if defined (USE_MOTIF)
+ && ((XtWindow (menubar_widget) == win)
+ || (XtWindowToWidget (XtDisplay (menubar_widget), win)
+ && (XtParent (XtWindowToWidget (XtDisplay (menubar_widget), win))
+ == menubar_widget)));
+#endif
+}
+
+/* Motif hack to set the main window areas. */
+void
+lw_set_main_areas (parent, menubar, work_area)
+ Widget parent;
+ Widget menubar;
+ Widget work_area;
+{
+#if defined (USE_MOTIF)
+ xm_set_main_areas (parent, menubar, work_area);
+#endif
+}
+
+/* Manage resizing for Motif. This disables resizing when the menubar
+ is about to be modified. */
+void
+#ifdef PROTOTYPES
+lw_allow_resizing (Widget w, Boolean flag)
+#else
+lw_allow_resizing (w, flag)
+ Widget w;
+ Boolean flag;
+#endif
+{
+#if defined (USE_MOTIF)
+ xm_manage_resizing (w, flag);
+#endif
+}
+
+
+/* Value is non-zero if LABEL is a menu separator. If it is, *TYPE is
+ set to an appropriate enumerator of type enum menu_separator.
+ MOTIF_P non-zero means map separator types not supported by Motif
+ to similar ones that are supported. */
+
+int
+lw_separator_p (label, type, motif_p)
+ char *label;
+ enum menu_separator *type;
+ int motif_p;
+{
+ int separator_p = 0;
+
+ if (strlen (label) >= 3
+ && bcmp (label, "--:", 3) == 0)
+ {
+ static struct separator_table
+ {
+ char *name;
+ enum menu_separator type;
+ }
+ separator_names[] =
+ {
+ {"space", SEPARATOR_NO_LINE},
+ {"noLine", SEPARATOR_NO_LINE},
+ {"singleLine", SEPARATOR_SINGLE_LINE},
+ {"doubleLine", SEPARATOR_DOUBLE_LINE},
+ {"singleDashedLine", SEPARATOR_SINGLE_DASHED_LINE},
+ {"doubleDashedLine", SEPARATOR_DOUBLE_DASHED_LINE},
+ {"shadowEtchedIn", SEPARATOR_SHADOW_ETCHED_IN},
+ {"shadowEtchedOut", SEPARATOR_SHADOW_ETCHED_OUT},
+ {"shadowEtchedInDash", SEPARATOR_SHADOW_ETCHED_IN_DASH},
+ {"shadowEtchedOutDash", SEPARATOR_SHADOW_ETCHED_OUT_DASH},
+ {"shadowDoubleEtchedIn", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN},
+ {"shadowDoubleEtchedOut", SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT},
+ {"shadowDoubleEtchedInDash", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH},
+ {"shadowDoubleEtchedOutDash", SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH},
+ {0,0}
+ };
+
+ int i;
+
+ label += 3;
+ for (i = 0; separator_names[i].name; ++i)
+ if (strcmp (label, separator_names[i].name) == 0)
+ {
+ separator_p = 1;
+ *type = separator_names[i].type;
+
+ /* If separator type is not supported under Motif,
+ use a similar one. */
+ if (motif_p && *type >= SEPARATOR_SHADOW_DOUBLE_ETCHED_IN)
+ *type -= 4;
+ break;
+ }
+ }
+ else if (strlen (label) > 3
+ && bcmp (label, "--", 2) == 0
+ && label[2] != '-')
+ {
+ /* Alternative, more Emacs-style names. */
+ static struct separator_table
+ {
+ char *name;
+ enum menu_separator type;
+ }
+ separator_names[] =
+ {
+ {"space", SEPARATOR_NO_LINE},
+ {"no-line", SEPARATOR_NO_LINE},
+ {"single-line", SEPARATOR_SINGLE_LINE},
+ {"double-line", SEPARATOR_DOUBLE_LINE},
+ {"single-dashed-line", SEPARATOR_SINGLE_DASHED_LINE},
+ {"double-dashed-line", SEPARATOR_DOUBLE_DASHED_LINE},
+ {"shadow-etched-in", SEPARATOR_SHADOW_ETCHED_IN},
+ {"shadow-etched-out", SEPARATOR_SHADOW_ETCHED_OUT},
+ {"shadow-etched-in-dash", SEPARATOR_SHADOW_ETCHED_IN_DASH},
+ {"shadow-etched-out-dash", SEPARATOR_SHADOW_ETCHED_OUT_DASH},
+ {"shadow-double-etched-in", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN},
+ {"shadow-double-etched-out", SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT},
+ {"shadow-double-etched-in-dash", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH},
+ {"shadow-double-etched-out-dash",SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH},
+ {0,0}
+ };
+
+ int i;
+
+ label += 2;
+ for (i = 0; separator_names[i].name; ++i)
+ if (strcmp (label, separator_names[i].name) == 0)
+ {
+ separator_p = 1;
+ *type = separator_names[i].type;
+
+ /* If separator type is not supported under Motif,
+ use a similar one. */
+ if (motif_p && *type >= SEPARATOR_SHADOW_DOUBLE_ETCHED_IN)
+ *type -= 4;
+ break;
+ }
+ }
+ else
+ {
+ /* Old-style separator, maybe. It's a separator if it contains
+ only dashes. */
+ while (*label == '-')
+ ++label;
+ separator_p = *label == 0;
+ *type = SEPARATOR_SHADOW_ETCHED_IN;
+ }
+
+ return separator_p;
+}
+
+/* arch-tag: 3d730f36-a441-4a71-9971-48ef3b5a4d9f
+ (do not change this comment) */