v10i078: contool -- replacement for cmdtool -C, Patch2, Part01/01
Chuck Musciano
chuck at melmac.harris-atd.com
Thu Nov 22 05:25:55 AEST 1990
Submitted-by: chuck at melmac.harris-atd.com (Chuck Musciano)
Posting-number: Volume 10, Issue 78
Archive-name: contool/patch2
Patch-To: contool: Volume 10, Issue 34-40 (10/29/90)
*** Makefile.orig Thu Nov 1 15:09:31 1990
--- Makefile Thu Nov 1 14:51:23 1990
***************
*** 8,13 ****
--- 8,16 ----
# Where to install the help file
HELPDIR = /usr/local/lib/help
+ # Mailer you use
+ MAILER = /usr/ucb/mail
+
# paths to be searched for icons
ICON_PATH = .:./icons:/usr/local/images:/usr/include/images
***************
*** 18,26 ****
LDFLAGS = -L$(OPENWINHOME)/lib
# Where your XView include files are installed
! CPPFLAGS = -I$(OPENWINHOME)/include
! CONTOOL = contool.o contool_ui.o error.o expand.o filters.o load.o load_icon.o logging.o misc.o parse.o props.o regexp.o store.o window_misc.o
OPTIONS = -O
--- 21,31 ----
LDFLAGS = -L$(OPENWINHOME)/lib
# Where your XView include files are installed
! CPPFLAGS = -I$(OPENWINHOME)/include -DMAILER=\"$(MAILER)\"
! CONTOOL = about.o busy.o contool.o contool_ui.o error.o expand.o filename_completion.o \
! filters.o load.o load_icon.o logging.o misc.o parse.o \
! pinned_menu_notify.o place_dialog.o props.o regexp.o send_mail.o store.o
OPTIONS = -O
***************
*** 50,55 ****
--- 55,64 ----
#dependencies
+ about.o: contool_ui.h manifest.h
+
+ busy.o: manifest.h
+
contool.o: manifest.h contool.h contool_ui.h icons/default_good.icon \
icons/default_bad.icon icons/default_flash.icon icons/mask.icon
***************
*** 59,70 ****
expand.o: manifest.h
filters.o: manifest.h contool.h contool_ui.h images/single.icon \
images/range.icon images/empty.icon
load.o: manifest.h contool.h contool_ui.h
! load_icon.o: manifest.h contool.h
logging.o: manifest.h contool.h contool_ui.h
--- 68,81 ----
expand.o: manifest.h
+ filename_completion.o: manifest.h
+
filters.o: manifest.h contool.h contool_ui.h images/single.icon \
images/range.icon images/empty.icon
load.o: manifest.h contool.h contool_ui.h
! load_icon.o: manifest.h
logging.o: manifest.h contool.h contool_ui.h
***************
*** 72,81 ****
parse.o: manifest.h contool.h lex.c
props.o: manifest.h contool.h contool_ui.h
regexp.o: manifest.h contool.h
! store.o: manifest.h contool.h contool_ui.h
! window_misc.o: manifest.h contool_ui.h
--- 83,96 ----
parse.o: manifest.h contool.h lex.c
+ pinned_menu_notify.o: manifest.h
+
+ place_dialog.o: manifest.h
+
props.o: manifest.h contool.h contool_ui.h
regexp.o: manifest.h contool.h
! send_mail.o: contool_ui.h manifest.h
! store.o: manifest.h contool.h contool_ui.h
*** Imakefile.orig Thu Nov 1 15:09:34 1990
--- Imakefile Thu Nov 1 14:51:22 1990
***************
*** 2,20 ****
HELPDIR = /usr/local/lib/help
LOCAL_LIBRARIES = -lxview -lolgx $(XLIB)
LDOPTIONS = -L$(OPENWINHOME)/lib
! CFLAGS = -O -I$(OPENWINHOME)/include
! SRCS = contool.c contool_ui.c error.c expand.c filters.c \
! load.c load_icon.c logging.c misc.c parse.y props.c \
! regexp.c store.c window_misc.c
! OBJS = contool.o contool_ui.o error.o expand.o filters.o \
! load.o load_icon.o logging.o misc.o parse.o props.o \
! regexp.o store.o window_misc.o
ComplexProgramTarget(contool)
--- 2,22 ----
HELPDIR = /usr/local/lib/help
+ MAILER = /usr/ucb/mail
+
LOCAL_LIBRARIES = -lxview -lolgx $(XLIB)
LDOPTIONS = -L$(OPENWINHOME)/lib
! CFLAGS = -O -I$(OPENWINHOME)/include -DMAILER=\"$(MAILER)\"
! SRCS = about.c busy.c contool.c contool_ui.c error.c expand.c filename_completion.c \
! filters.c load.c load_icon.c logging.c misc.c parse.y \
! pinned_menu_notify.c place_dialog.c props.c regexp.c send_mail.c store.c
! OBJS = about.o busy.o contool.o contool_ui.o error.o expand.o filename_completion.o \
! filters.o load.o load_icon.o logging.o misc.o parse.o \
! pinned_menu_notify.o place_dialog.o props.o regexp.o send_mail.o store.o
ComplexProgramTarget(contool)
*** README.orig Thu Nov 1 15:09:35 1990
--- README Thu Nov 1 13:39:35 1990
***************
*** 54,59 ****
--- 54,61 ----
HELPDIR Where the context-sensitive help file
will be stored.
+ MAILER The full path of your system mailer.
+
ICON_PATH Path to search (at runtime) for other
icon files. This path will only be used
if the user does not have the ICON_PATH
***************
*** 178,180 ****
--- 180,185 ----
Fixed handling of dialog boxes under
window managers other than olwm.
Add Imakefile.
+ 3.0b Fixed "tiny icon" bug.
+ Added "About contool..." dialog.
+ Source restructuring for maintainability.
*** contool.info.orig Thu Nov 1 15:09:37 1990
--- contool.info Thu Nov 1 13:47:28 1990
***************
*** 281,283 ****
--- 281,364 ----
#
:accept_store
The Store button writes the desired items to the configuration file. The entire file is overwritten with the data. Thus, a file containing properties and filters will be completely rewritten, even if you only write the filters to it.
+ #
+ :about_controls
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message1
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message5
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message6
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message7
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message8
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message9
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message10
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message15
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message11
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message12
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message13
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message14
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message16
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message17
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message18
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message19
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :message20
+ This window gives you some details about the development of contool, encourages you to correspond with the developer to improve future versions of contool, and delineates the restrictions placed on the contool source code.
+ #
+ :send_mail
+ Clicking this button will open another window in which you can compose and send mail to the developer of contool.
+ #
+ :mail_controls
+ This window allows you to send mail concerning contool to its developer. You are encouraged to send comments and suggestions in order to make contool a better tool.
+ #
+ :message21
+ This window allows you to send mail concerning contool to its developer. You are encouraged to send comments and suggestions in order to make contool a better tool.
+ #
+ :message22
+ This window allows you to send mail concerning contool to its developer. You are encouraged to send comments and suggestions in order to make contool a better tool.
+ #
+ :address
+ This choice item lets you select the address to which your mail will be sent. If your machine understands Internet-style addresses, you should use the first choice item. If you are a UUCP-based site, you should use the second item. If neither address works, use the third item to enter a valid address.
+ #
+ :other_address
+ This text field is used to enter an e-mail address to which your mail will be sent. It should only be used if the two default addresses do not work from your site.
+ #
+ :mail_controls1
+ This window allows you to send mail concerning contool to its developer. You are encouraged to send comments and suggestions in order to make contool a better tool.
+ #
+ :accept_send
+ Clicking this button will send your mail message to contool's developer.
+ #
+ :cancel_mail
+ Clicking this button cancels the message you were going to send.
*** about.c.orig Thu Nov 1 15:09:38 1990
--- about.c Thu Nov 1 11:46:52 1990
***************
*** 0 ****
--- 1,35 ----
+ /************************************************************************/
+ /* */
+ /* about.c display a little information window */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <xview/xview.h>
+ #include <xview/panel.h>
+ #include "contool_ui.h"
+
+ #include "manifest.h"
+
+ PUBLIC contool_base_objects *contool_base;
+
+ PRIVATE contool_about_objects *dialog = NULL;
+
+ /************************************************************************/
+ EXPORT Menu_item popup_about_contool(item, op)
+
+ Menu_item item;
+ Menu_generate op;
+
+ {
+ if (op == MENU_NOTIFY) {
+ if (dialog == NULL) {
+ dialog = contool_about_objects_initialize(NULL, contool_base->base);
+ place_dialog(contool_base->base, dialog->about);
+ }
+ xv_set(dialog->about, XV_SHOW, TRUE, NULL);
+ }
+ return item;
+ }
*** busy.c.orig Thu Nov 1 15:09:39 1990
--- busy.c Tue Oct 23 08:03:24 1990
***************
*** 0 ****
--- 1,65 ----
+ /************************************************************************/
+ /* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
+ /* */
+ /* Permission to use, copy, modify, and distribute this software */
+ /* and its documentation for any purpose and without fee is */
+ /* hereby granted, provided that the above copyright notice */
+ /* appear in all copies and that both that copyright notice and */
+ /* this permission notice appear in supporting documentation, and */
+ /* that the name of Chuck Musciano and Harris Corporation not be */
+ /* used in advertising or publicity pertaining to distribution */
+ /* of the software without specific, written prior permission. */
+ /* Chuck Musciano and Harris Corporation make no representations */
+ /* about the suitability of this software for any purpose. It is */
+ /* provided "as is" without express or implied warranty. This */
+ /* software may not be sold without the prior explicit permission */
+ /* of Harris Corporation. */
+ /************************************************************************/
+
+ /************************************************************************/
+ /* */
+ /* busy.c turn frame busy attribute on and off */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <xview/xview.h>
+ #include <xview/panel.h>
+
+ #include "manifest.h"
+
+ /************************************************************************/
+ PRIVATE set_busy(base, busy, skip)
+
+ Frame base;
+ int busy;
+ Frame skip;
+
+ { Frame subframe;
+ int i;
+
+ for (i = 1; subframe = (Frame) xv_get(base, FRAME_NTH_SUBFRAME, i); i++)
+ if (subframe != skip)
+ if (xv_get(subframe, XV_SHOW))
+ xv_set(subframe, FRAME_BUSY, busy, NULL);
+ xv_set(base, FRAME_BUSY, busy, NULL);
+ }
+
+ /************************************************************************/
+ EXPORT lets_get_busy(base, busy, skip)
+
+ Frame base;
+ int busy;
+ Frame skip;
+
+ { static int depth = 0;
+
+ if (busy) {
+ if (depth == 0)
+ set_busy(base, TRUE, skip);
+ depth++;
+ }
+ else if (depth > 0)
+ if (--depth == 0)
+ set_busy(base, FALSE, NULL);
+ }
*** contool.c.orig Thu Nov 1 15:09:40 1990
--- contool.c Thu Nov 1 11:46:51 1990
***************
*** 176,182 ****
else if ((cmd = popen(defaults.print_filter, "w")) == NULL)
error("Could not execute %s", defaults.print_filter);
else {
! xv_set(contool_base->base, FRAME_BUSY, TRUE, NULL);
size = (int) xv_get(contool_base->display, TEXTSW_LENGTH);
buf = (char *) malloc(size);
xv_get(contool_base->display, TEXTSW_CONTENTS, 0, buf, size);
--- 176,182 ----
else if ((cmd = popen(defaults.print_filter, "w")) == NULL)
error("Could not execute %s", defaults.print_filter);
else {
! lets_get_busy(contool_base->base, TRUE, NULL);
size = (int) xv_get(contool_base->display, TEXTSW_LENGTH);
buf = (char *) malloc(size);
xv_get(contool_base->display, TEXTSW_CONTENTS, 0, buf, size);
***************
*** 183,189 ****
if (fwrite(buf, 1, size, cmd) != size)
error("Could not write console contents to printer");
pclose(cmd);
! xv_set(contool_base->base, FRAME_BUSY, FALSE, NULL);
}
}
return item;
--- 183,190 ----
if (fwrite(buf, 1, size, cmd) != size)
error("Could not write console contents to printer");
pclose(cmd);
! free(buf);
! lets_get_busy(contool_base->base, FALSE, NULL);
}
}
return item;
***************
*** 258,266 ****
if (flash && flash != default_flash_icon)
xv_destroy(flash);
! good = (defaults.good_icon == NULL)? default_good_icon : load_icon(defaults.good_icon, msg);
! bad = (defaults.bad_icon == NULL)? default_bad_icon : load_icon(defaults.bad_icon, msg);
flash = (defaults.flash_icon == NULL)? default_flash_icon : load_icon(defaults.flash_icon, msg);
if (!blinking)
change_icon(good, good == default_good_icon);
--- 259,279 ----
if (flash && flash != default_flash_icon)
xv_destroy(flash);
! good = (defaults.good_icon == NULL)? default_good_icon : load_icon(defaults.good_icon, msg);
! if (good == NULL) {
! internal_error("Cannot load default \"All is well\" icon %s: %s", defaults.good_icon, msg);
! good = default_good_icon;
! }
! bad = (defaults.bad_icon == NULL)? default_bad_icon : load_icon(defaults.bad_icon, msg);
! if (bad == NULL) {
! internal_error("Cannot load default \"Check console\" icon %s: %s", defaults.bad_icon, msg);
! bad = default_bad_icon;
! }
flash = (defaults.flash_icon == NULL)? default_flash_icon : load_icon(defaults.flash_icon, msg);
+ if (flash == NULL) {
+ internal_error("Cannot load default \"Flash\" icon %s: %s", defaults.flash_icon, msg);
+ flash = default_flash_icon;
+ }
if (!blinking)
change_icon(good, good == default_good_icon);
***************
*** 267,273 ****
}
/************************************************************************/
! /* Now, filter handlers */
/************************************************************************/
/************************************************************************/
--- 280,286 ----
}
/************************************************************************/
! /* Now, filter handlers */
/************************************************************************/
/************************************************************************/
*** contool_ui.c.orig Thu Nov 1 15:09:42 1990
--- contool_ui.c Thu Nov 1 13:47:30 1990
***************
*** 33,38 ****
--- 33,39 ----
extern Menu_item start_logging();
extern Menu_item stop_logging();
extern Menu_item print_messages();
+ extern Menu_item popup_about_contool();
Xv_opaque obj;
obj = xv_create(XV_NULL, MENU_COMMAND_MENU,
***************
*** 62,67 ****
--- 63,73 ----
MENU_STRING, "Print",
MENU_GEN_PROC, print_messages,
NULL,
+ MENU_ITEM,
+ XV_KEY_DATA, INSTANCE, ip,
+ MENU_STRING, "About contool...",
+ MENU_GEN_PROC, popup_about_contool,
+ NULL,
MENU_DEFAULT, 2,
MENU_GEN_PIN_WINDOW, (Xv_opaque) ip[0], "File",
NULL);
***************
*** 307,313 ****
XV_KEY_DATA, INSTANCE, ip,
XV_WIDTH, 575,
XV_HEIGHT, 246,
! XV_LABEL, "Contool 3.0a",
FRAME_CLOSED, FALSE,
FRAME_SHOW_FOOTER, TRUE,
FRAME_SHOW_RESIZE_CORNER, TRUE,
--- 313,319 ----
XV_KEY_DATA, INSTANCE, ip,
XV_WIDTH, 575,
XV_HEIGHT, 246,
! XV_LABEL, "Contool 3.0b",
FRAME_CLOSED, FALSE,
FRAME_SHOW_FOOTER, TRUE,
FRAME_SHOW_RESIZE_CORNER, TRUE,
***************
*** 661,667 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 667,673 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 678,684 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 684,690 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 752,758 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 758,764 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 769,775 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 775,781 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 783,789 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 789,795 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 800,806 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 806,812 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 814,820 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 820,826 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 831,837 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 837,843 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 1683,1689 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 1689,1695 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 1700,1706 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 1706,1712 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 1841,1847 ****
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting file_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
--- 1847,1853 ----
caddr_t ip;
Xv_opaque owner;
{
! extern Panel_setting filename_completion();
Xv_opaque obj;
obj = xv_create(owner, PANEL_TEXT,
***************
*** 1858,1864 ****
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, file_completion,
NULL);
return obj;
}
--- 1864,1870 ----
PANEL_VALUE_DISPLAY_LENGTH, 35,
PANEL_VALUE_STORED_LENGTH, 256,
PANEL_READ_ONLY, FALSE,
! PANEL_NOTIFY_PROC, filename_completion,
NULL);
return obj;
}
***************
*** 1884,1889 ****
--- 1890,2715 ----
XV_HEIGHT, 20,
PANEL_LABEL_STRING, "Store",
PANEL_NOTIFY_PROC, store_filters,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Initialize an instance of object `about'.
+ */
+ contool_about_objects *
+ contool_about_objects_initialize(ip, owner)
+ contool_about_objects *ip;
+ Xv_opaque owner;
+ {
+ if (!ip && !(ip = (contool_about_objects *) calloc(1, sizeof (contool_about_objects))))
+ return (contool_about_objects *) NULL;
+ if (!ip->about)
+ ip->about = contool_about_about_create(ip, owner);
+ if (!ip->about_controls)
+ ip->about_controls = contool_about_about_controls_create(ip, ip->about);
+ if (!ip->message1)
+ ip->message1 = contool_about_message1_create(ip, ip->about_controls);
+ if (!ip->message5)
+ ip->message5 = contool_about_message5_create(ip, ip->about_controls);
+ if (!ip->message6)
+ ip->message6 = contool_about_message6_create(ip, ip->about_controls);
+ if (!ip->message7)
+ ip->message7 = contool_about_message7_create(ip, ip->about_controls);
+ if (!ip->message8)
+ ip->message8 = contool_about_message8_create(ip, ip->about_controls);
+ if (!ip->message9)
+ ip->message9 = contool_about_message9_create(ip, ip->about_controls);
+ if (!ip->message10)
+ ip->message10 = contool_about_message10_create(ip, ip->about_controls);
+ if (!ip->message15)
+ ip->message15 = contool_about_message15_create(ip, ip->about_controls);
+ if (!ip->message11)
+ ip->message11 = contool_about_message11_create(ip, ip->about_controls);
+ if (!ip->message12)
+ ip->message12 = contool_about_message12_create(ip, ip->about_controls);
+ if (!ip->message13)
+ ip->message13 = contool_about_message13_create(ip, ip->about_controls);
+ if (!ip->message14)
+ ip->message14 = contool_about_message14_create(ip, ip->about_controls);
+ if (!ip->message16)
+ ip->message16 = contool_about_message16_create(ip, ip->about_controls);
+ if (!ip->message17)
+ ip->message17 = contool_about_message17_create(ip, ip->about_controls);
+ if (!ip->message18)
+ ip->message18 = contool_about_message18_create(ip, ip->about_controls);
+ if (!ip->message19)
+ ip->message19 = contool_about_message19_create(ip, ip->about_controls);
+ if (!ip->message20)
+ ip->message20 = contool_about_message20_create(ip, ip->about_controls);
+ if (!ip->send_mail)
+ ip->send_mail = contool_about_send_mail_create(ip, ip->about_controls);
+ return ip;
+ }
+
+ /*
+ * Create object `about' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_about_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, FRAME_CMD,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_WIDTH, 509,
+ XV_HEIGHT, 392,
+ XV_LABEL, "Contool: About contool",
+ XV_SHOW, FALSE,
+ FRAME_SHOW_FOOTER, FALSE,
+ FRAME_SHOW_RESIZE_CORNER, FALSE,
+ FRAME_CMD_PUSHPIN_IN, TRUE,
+ NULL);
+ xv_set(xv_get(obj, FRAME_CMD_PANEL), WIN_SHOW, FALSE, NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `about_controls' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_about_controls_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:about_controls",
+ XV_X, 0,
+ XV_Y, 0,
+ XV_WIDTH, WIN_EXTEND_TO_EDGE,
+ XV_HEIGHT, WIN_EXTEND_TO_EDGE,
+ WIN_BORDER, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message1' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message1_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message1",
+ XV_X, 210,
+ XV_Y, 14,
+ XV_WIDTH, 85,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Contool 3.0b",
+ PANEL_LABEL_BOLD, TRUE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message5' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message5_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message5",
+ XV_X, 177,
+ XV_Y, 30,
+ XV_WIDTH, 152,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Copyright 1988 - 1990",
+ PANEL_LABEL_BOLD, TRUE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message6' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message6_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message6",
+ XV_X, 117,
+ XV_Y, 46,
+ XV_WIDTH, 274,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Chuck Musciano and Harris Corporation",
+ PANEL_LABEL_BOLD, TRUE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message7' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message7_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message7",
+ XV_X, 185,
+ XV_Y, 62,
+ XV_WIDTH, 135,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "All Rights Reserved",
+ PANEL_LABEL_BOLD, TRUE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message8' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message8_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message8",
+ XV_X, 14,
+ XV_Y, 94,
+ XV_WIDTH, 457,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Contool was written using Sun's Devguide interface builder and the XView",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message9' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message9_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message9",
+ XV_X, 14,
+ XV_Y, 110,
+ XV_WIDTH, 447,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "OPEN LOOK toolkit. It originated as a SunView application in early 1987,",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message10' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message10_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message10",
+ XV_X, 14,
+ XV_Y, 126,
+ XV_WIDTH, 464,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "was released into the public domain in 1988, and was ported to X Windows",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message15' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message15_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message15",
+ XV_X, 14,
+ XV_Y, 142,
+ XV_WIDTH, 51,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "in 1990.",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message11' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message11_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message11",
+ XV_X, 14,
+ XV_Y, 174,
+ XV_WIDTH, 460,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "I welcome comments, criticism, suggestions, and bug reports. Almost every",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message12' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message12_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message12",
+ XV_X, 14,
+ XV_Y, 190,
+ XV_WIDTH, 462,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "feature in this version of contool was added as the result of a user request. ",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message13' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message13_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message13",
+ XV_X, 14,
+ XV_Y, 206,
+ XV_WIDTH, 467,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "User feedback is the single best driving force in the evolution of my tools. I ",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message14' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message14_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message14",
+ XV_X, 14,
+ XV_Y, 222,
+ XV_WIDTH, 205,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "look forward to hearing from you!",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message16' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message16_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message16",
+ XV_X, 14,
+ XV_Y, 254,
+ XV_WIDTH, 481,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Contool has been placed in the public domain, but the copyright on the source",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message17' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message17_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message17",
+ XV_X, 14,
+ XV_Y, 270,
+ XV_WIDTH, 472,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "code is retained by myself and Harris Corporation, my employer. This means",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message18' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message18_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message18",
+ XV_X, 14,
+ XV_Y, 286,
+ XV_WIDTH, 460,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "that you can give the source code to anyone but you cannot sell any part of",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message19' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message19_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message19",
+ XV_X, 14,
+ XV_Y, 302,
+ XV_WIDTH, 455,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "the source code, nor can you incorporate any part of the source code into a",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message20' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_message20_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message20",
+ XV_X, 14,
+ XV_Y, 318,
+ XV_WIDTH, 219,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "product which is subsequently sold.",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `send_mail' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_about_send_mail_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ extern void popup_send_mail();
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_BUTTON,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:send_mail",
+ XV_X, 215,
+ XV_Y, 352,
+ XV_WIDTH, 78,
+ XV_HEIGHT, 20,
+ PANEL_LABEL_STRING, "Send Mail",
+ PANEL_NOTIFY_PROC, popup_send_mail,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Initialize an instance of object `mail'.
+ */
+ contool_mail_objects *
+ contool_mail_objects_initialize(ip, owner)
+ contool_mail_objects *ip;
+ Xv_opaque owner;
+ {
+ if (!ip && !(ip = (contool_mail_objects *) calloc(1, sizeof (contool_mail_objects))))
+ return (contool_mail_objects *) NULL;
+ if (!ip->mail)
+ ip->mail = contool_mail_mail_create(ip, owner);
+ if (!ip->mail_controls)
+ ip->mail_controls = contool_mail_mail_controls_create(ip, ip->mail);
+ if (!ip->message21)
+ ip->message21 = contool_mail_message21_create(ip, ip->mail_controls);
+ if (!ip->message22)
+ ip->message22 = contool_mail_message22_create(ip, ip->mail_controls);
+ if (!ip->address)
+ ip->address = contool_mail_address_create(ip, ip->mail_controls);
+ if (!ip->other_address)
+ ip->other_address = contool_mail_other_address_create(ip, ip->mail_controls);
+ if (!ip->message)
+ ip->message = contool_mail_message_create(ip, ip->mail);
+ if (!ip->mail_controls1)
+ ip->mail_controls1 = contool_mail_mail_controls1_create(ip, ip->mail);
+ if (!ip->accept_send)
+ ip->accept_send = contool_mail_accept_send_create(ip, ip->mail_controls1);
+ if (!ip->cancel_mail)
+ ip->cancel_mail = contool_mail_cancel_mail_create(ip, ip->mail_controls1);
+ return ip;
+ }
+
+ /*
+ * Create object `mail' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_mail_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, FRAME_CMD,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_WIDTH, 506,
+ XV_HEIGHT, 338,
+ XV_LABEL, "Contool: Send mail",
+ XV_SHOW, FALSE,
+ FRAME_SHOW_FOOTER, FALSE,
+ FRAME_SHOW_RESIZE_CORNER, FALSE,
+ FRAME_CMD_PUSHPIN_IN, FALSE,
+ NULL);
+ xv_set(xv_get(obj, FRAME_CMD_PANEL), WIN_SHOW, FALSE, NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `mail_controls' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_mail_controls_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:mail_controls",
+ XV_X, 0,
+ XV_Y, 0,
+ XV_WIDTH, WIN_EXTEND_TO_EDGE,
+ XV_HEIGHT, 92,
+ WIN_BORDER, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message21' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_message21_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message21",
+ XV_X, 14,
+ XV_Y, 14,
+ XV_WIDTH, 478,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "Your feedback is appreciated. To ensure that your message reaches me, check",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message22' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_message22_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_MESSAGE,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:message22",
+ XV_X, 14,
+ XV_Y, 30,
+ XV_WIDTH, 395,
+ XV_HEIGHT, 13,
+ PANEL_LABEL_STRING, "that the \"To\" address is valid for your site before clicking \"Send\".",
+ PANEL_LABEL_BOLD, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `address' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_address_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ extern int handle_address();
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_CHOICE, PANEL_DISPLAY_LEVEL, PANEL_CURRENT,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:address",
+ XV_X, 14,
+ XV_Y, 64,
+ XV_WIDTH, 278,
+ XV_HEIGHT, 23,
+ PANEL_VALUE_X, 43,
+ PANEL_VALUE_Y, 64,
+ PANEL_LAYOUT, PANEL_HORIZONTAL,
+ PANEL_CHOICE_NROWS, 1,
+ PANEL_LABEL_STRING, "To:",
+ PANEL_NOTIFY_PROC, handle_address,
+ PANEL_CHOICE_STRINGS,
+ "chuck at trantor.harris-atd.com",
+ "uunet!trantor.harris-atd.com!chuck",
+ "Other:",
+ 0,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `other_address' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_other_address_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_TEXT,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:other_address",
+ XV_X, 105,
+ XV_Y, 69,
+ XV_WIDTH, 385,
+ XV_HEIGHT, 15,
+ PANEL_VALUE_X, 114,
+ PANEL_VALUE_Y, 69,
+ PANEL_LAYOUT, PANEL_HORIZONTAL,
+ PANEL_VALUE_DISPLAY_LENGTH, 47,
+ PANEL_VALUE_STORED_LENGTH, 256,
+ PANEL_READ_ONLY, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `message' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_message_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, TEXTSW,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_X, 0,
+ XV_Y, 92,
+ XV_WIDTH, WIN_EXTEND_TO_EDGE,
+ XV_HEIGHT, 188,
+ OPENWIN_SHOW_BORDERS, TRUE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `mail_controls1' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_mail_controls1_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:mail_controls1",
+ XV_X, 0,
+ XV_Y, 280,
+ XV_WIDTH, WIN_EXTEND_TO_EDGE,
+ XV_HEIGHT, WIN_EXTEND_TO_EDGE,
+ WIN_BORDER, FALSE,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `accept_send' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_accept_send_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ extern void send_mail();
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_BUTTON,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:accept_send",
+ XV_X, 193,
+ XV_Y, 18,
+ XV_WIDTH, 48,
+ XV_HEIGHT, 20,
+ PANEL_LABEL_STRING, "Send",
+ PANEL_NOTIFY_PROC, send_mail,
+ NULL);
+ return obj;
+ }
+
+ /*
+ * Create object `cancel_mail' in the specified instance.
+
+ */
+ Xv_opaque
+ contool_mail_cancel_mail_create(ip, owner)
+ caddr_t ip;
+ Xv_opaque owner;
+ {
+ extern void cancel_mail();
+ Xv_opaque obj;
+
+ obj = xv_create(owner, PANEL_BUTTON,
+ XV_KEY_DATA, INSTANCE, ip,
+ XV_HELP_DATA, "contool:cancel_mail",
+ XV_X, 253,
+ XV_Y, 18,
+ XV_WIDTH, 59,
+ XV_HEIGHT, 20,
+ PANEL_LABEL_STRING, "Cancel",
+ PANEL_NOTIFY_PROC, cancel_mail,
NULL);
return obj;
}
*** contool_ui.h.orig Thu Nov 1 15:09:48 1990
--- contool_ui.h Thu Nov 1 13:47:26 1990
***************
*** 151,154 ****
--- 151,226 ----
extern Xv_opaque contool_store_store_type_create();
extern Xv_opaque contool_store_store_file_create();
extern Xv_opaque contool_store_accept_store_create();
+
+ typedef struct {
+ Xv_opaque about;
+ Xv_opaque about_controls;
+ Xv_opaque message1;
+ Xv_opaque message5;
+ Xv_opaque message6;
+ Xv_opaque message7;
+ Xv_opaque message8;
+ Xv_opaque message9;
+ Xv_opaque message10;
+ Xv_opaque message15;
+ Xv_opaque message11;
+ Xv_opaque message12;
+ Xv_opaque message13;
+ Xv_opaque message14;
+ Xv_opaque message16;
+ Xv_opaque message17;
+ Xv_opaque message18;
+ Xv_opaque message19;
+ Xv_opaque message20;
+ Xv_opaque send_mail;
+ } contool_about_objects;
+
+ extern contool_about_objects *contool_about_objects_initialize();
+
+ extern Xv_opaque contool_about_about_create();
+ extern Xv_opaque contool_about_about_controls_create();
+ extern Xv_opaque contool_about_message1_create();
+ extern Xv_opaque contool_about_message5_create();
+ extern Xv_opaque contool_about_message6_create();
+ extern Xv_opaque contool_about_message7_create();
+ extern Xv_opaque contool_about_message8_create();
+ extern Xv_opaque contool_about_message9_create();
+ extern Xv_opaque contool_about_message10_create();
+ extern Xv_opaque contool_about_message15_create();
+ extern Xv_opaque contool_about_message11_create();
+ extern Xv_opaque contool_about_message12_create();
+ extern Xv_opaque contool_about_message13_create();
+ extern Xv_opaque contool_about_message14_create();
+ extern Xv_opaque contool_about_message16_create();
+ extern Xv_opaque contool_about_message17_create();
+ extern Xv_opaque contool_about_message18_create();
+ extern Xv_opaque contool_about_message19_create();
+ extern Xv_opaque contool_about_message20_create();
+ extern Xv_opaque contool_about_send_mail_create();
+
+ typedef struct {
+ Xv_opaque mail;
+ Xv_opaque mail_controls;
+ Xv_opaque message21;
+ Xv_opaque message22;
+ Xv_opaque address;
+ Xv_opaque other_address;
+ Xv_opaque message;
+ Xv_opaque mail_controls1;
+ Xv_opaque accept_send;
+ Xv_opaque cancel_mail;
+ } contool_mail_objects;
+
+ extern contool_mail_objects *contool_mail_objects_initialize();
+
+ extern Xv_opaque contool_mail_mail_create();
+ extern Xv_opaque contool_mail_mail_controls_create();
+ extern Xv_opaque contool_mail_message21_create();
+ extern Xv_opaque contool_mail_message22_create();
+ extern Xv_opaque contool_mail_address_create();
+ extern Xv_opaque contool_mail_other_address_create();
+ extern Xv_opaque contool_mail_message_create();
+ extern Xv_opaque contool_mail_mail_controls1_create();
+ extern Xv_opaque contool_mail_accept_send_create();
+ extern Xv_opaque contool_mail_cancel_mail_create();
#endif
*** filename_completion.c.orig Thu Nov 1 15:09:50 1990
--- filename_completion.c Tue Oct 23 08:20:50 1990
***************
*** 0 ****
--- 1,52 ----
+ /************************************************************************/
+ /* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
+ /* */
+ /* Permission to use, copy, modify, and distribute this software */
+ /* and its documentation for any purpose and without fee is */
+ /* hereby granted, provided that the above copyright notice */
+ /* appear in all copies and that both that copyright notice and */
+ /* this permission notice appear in supporting documentation, and */
+ /* that the name of Chuck Musciano and Harris Corporation not be */
+ /* used in advertising or publicity pertaining to distribution */
+ /* of the software without specific, written prior permission. */
+ /* Chuck Musciano and Harris Corporation make no representations */
+ /* about the suitability of this software for any purpose. It is */
+ /* provided "as is" without express or implied warranty. This */
+ /* software may not be sold without the prior explicit permission */
+ /* of Harris Corporation. */
+ /************************************************************************/
+
+ /************************************************************************/
+ /* */
+ /* filename_completion.c completion handler for text items */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <xview/xview.h>
+ #include <xview/panel.h>
+
+ #include "manifest.h"
+
+ /************************************************************************/
+ EXPORT Panel_setting filename_completion(item, event)
+
+ Panel_item item;
+ Event *event;
+
+ { char *p, *expand_filename();
+
+ switch (event_action(event)) {
+ case '\n' :
+ case '\r' :
+ case ' ' : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
+ window_bell(xv_get(item, XV_OWNER));
+ else
+ xv_set(item, PANEL_VALUE, p, 0);
+ return(PANEL_NONE);
+ case '\t' : return(event_shift_is_down(event)? PANEL_PREVIOUS : PANEL_NEXT);
+ default : return(panel_text_notify(item, event));
+ }
+ }
*** load_icon.c.orig Thu Nov 1 15:09:55 1990
--- load_icon.c Thu Nov 1 09:07:38 1990
***************
*** 23,29 ****
#include <xview/icon_load.h>
#include "manifest.h"
! #include "contool.h"
PUBLIC char *getenv();
--- 23,32 ----
#include <xview/icon_load.h>
#include "manifest.h"
!
! #if !defined(ICON_PATH)
! #define ICON_PATH ".:./icons:/usr/local/images:/usr/include/images"
! #endif
PUBLIC char *getenv();
*** patchlevel.h.orig Thu Nov 1 15:10:00 1990
--- patchlevel.h Thu Nov 1 09:08:10 1990
***************
*** 2,8 ****
--- 2,12 ----
/* */
/* Patch Comments */
/* 0 Initial release for XView */
+ /* comp.sources.x: Volume 10, Issues 34-39 */
/* */
/* 1 Bug fixes; see README for details */
+ /* comp.sources.x: Volume 10, Issue 40 */
+ /* */
+ /* 2 Bug fixes; see README for details */
/* */
/************************************************************************/
*** pinned_menu_notify.c.orig Thu Nov 1 15:10:00 1990
--- pinned_menu_notify.c Tue Oct 23 08:03:27 1990
***************
*** 0 ****
--- 1,52 ----
+ /************************************************************************/
+ /* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
+ /* */
+ /* Permission to use, copy, modify, and distribute this software */
+ /* and its documentation for any purpose and without fee is */
+ /* hereby granted, provided that the above copyright notice */
+ /* appear in all copies and that both that copyright notice and */
+ /* this permission notice appear in supporting documentation, and */
+ /* that the name of Chuck Musciano and Harris Corporation not be */
+ /* used in advertising or publicity pertaining to distribution */
+ /* of the software without specific, written prior permission. */
+ /* Chuck Musciano and Harris Corporation make no representations */
+ /* about the suitability of this software for any purpose. It is */
+ /* provided "as is" without express or implied warranty. This */
+ /* software may not be sold without the prior explicit permission */
+ /* of Harris Corporation. */
+ /************************************************************************/
+
+ /************************************************************************/
+ /* */
+ /* pinned_menu_notify.c GUIDE callback for pinned menus */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <xview/xview.h>
+
+ #include "manifest.h"
+
+ /************************************************************************/
+ EXPORT void pinned_menu_notify(menu, item)
+
+ Menu menu;
+ Menu_item item;
+
+ { Xv_opaque pin_window = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
+ void (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
+ void (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
+
+ if (pin_window && xv_get(pin_window, XV_SHOW)) {
+ if (menu_notify)
+ (*menu_notify)(menu, MENU_NOTIFY);
+ if (item_notify)
+ (*item_notify)(item, MENU_NOTIFY);
+ if (item_notify)
+ (*item_notify)(item, MENU_NOTIFY_DONE);
+ if (menu_notify)
+ (*menu_notify)(menu, MENU_NOTIFY_DONE);
+ }
+ }
*** place_dialog.c.orig Thu Nov 1 15:10:01 1990
--- place_dialog.c Tue Oct 23 08:03:26 1990
***************
*** 0 ****
--- 1,65 ----
+ /************************************************************************/
+ /* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
+ /* */
+ /* Permission to use, copy, modify, and distribute this software */
+ /* and its documentation for any purpose and without fee is */
+ /* hereby granted, provided that the above copyright notice */
+ /* appear in all copies and that both that copyright notice and */
+ /* this permission notice appear in supporting documentation, and */
+ /* that the name of Chuck Musciano and Harris Corporation not be */
+ /* used in advertising or publicity pertaining to distribution */
+ /* of the software without specific, written prior permission. */
+ /* Chuck Musciano and Harris Corporation make no representations */
+ /* about the suitability of this software for any purpose. It is */
+ /* provided "as is" without express or implied warranty. This */
+ /* software may not be sold without the prior explicit permission */
+ /* of Harris Corporation. */
+ /************************************************************************/
+
+ /************************************************************************/
+ /* */
+ /* place_dialog.c position a dialog box at the right place */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <xview/xview.h>
+ #include <X11/Xutil.h>
+
+ #include "manifest.h"
+
+ /************************************************************************/
+ EXPORT void place_dialog(base, dialog)
+
+ Xv_opaque base;
+ Xv_opaque dialog;
+
+ { Rect br, dr, sr;
+ XWMHints *hints;
+
+ sr = *((Rect *) xv_get(base, WIN_SCREEN_RECT));
+ frame_get_rect(base, &br);
+ frame_get_rect(dialog, &dr);
+ if (rect_right(&br) + dr.r_width < sr.r_width) {
+ dr.r_left = rect_right(&br);
+ dr.r_top = br.r_top;
+ }
+ else if (dr.r_width <= br.r_left) {
+ dr.r_left = br.r_left - dr.r_width;
+ dr.r_top = br.r_top;
+ }
+ else {
+ dr.r_left = br.r_left + 32;
+ dr.r_top = br.r_top + 32;
+ }
+ frame_set_rect(dialog, &dr);
+
+ hints = XGetWMHints(xv_get(dialog, XV_DISPLAY), xv_get(dialog, XV_XID));
+ hints->flags |= StateHint;
+ hints->initial_state = NormalState;
+ XSetWMHints(xv_get(dialog, XV_DISPLAY), xv_get(dialog, XV_XID), hints);
+ XFree(hints);
+ }
+
*** send_mail.c.orig Thu Nov 1 15:10:04 1990
--- send_mail.c Thu Nov 1 13:39:36 1990
***************
*** 0 ****
--- 1,112 ----
+ /************************************************************************/
+ /* */
+ /* send_mail.c display a little information window */
+ /* */
+ /************************************************************************/
+
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <xview/xview.h>
+ #include <xview/panel.h>
+ #include <xview/textsw.h>
+ #include "contool_ui.h"
+
+ #include "manifest.h"
+
+ PUBLIC contool_base_objects *contool_base;
+
+ PRIVATE contool_mail_objects *dialog = NULL;
+
+ /************************************************************************/
+ EXPORT popup_send_mail(item, event)
+
+ Panel_item item;
+ Event *event;
+
+ {
+ if (dialog == NULL) {
+ dialog = contool_mail_objects_initialize(NULL, contool_base->base);
+ place_dialog(contool_base->base, dialog->mail);
+ xv_set(dialog->other_address, WIN_SHOW, FALSE, NULL);
+ }
+ xv_set(dialog->mail, XV_SHOW, TRUE, NULL);
+ xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
+ }
+
+ /************************************************************************/
+ EXPORT void handle_address(item, value, event)
+
+ Panel_item item;
+ int value;
+ Event *event;
+
+ {
+ if (value == 2) {
+ xv_set(dialog->other_address, WIN_SHOW, TRUE, NULL);
+ panel_paint(dialog->address, PANEL_NO_CLEAR);
+ panel_paint(dialog->other_address, PANEL_NO_CLEAR);
+ }
+ else {
+ xv_set(dialog->other_address, WIN_SHOW, FALSE, NULL);
+ panel_paint(dialog->address, PANEL_NO_CLEAR);
+ }
+ }
+
+ /************************************************************************/
+ EXPORT void send_mail(item, event)
+
+ Panel_item item;
+ Event *event;
+
+ { char cmd[1024], *buf;
+ int val, size;
+ FILE *pipe;
+
+ xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, 0);
+ val = (int) xv_get(dialog->address, PANEL_VALUE);
+ if (val != 2)
+ sprintf(cmd, "%s %s", MAILER, xv_get(dialog->address, PANEL_CHOICE_STRING, val));
+ else {
+ buf = (char *) xv_get(dialog->other_address, PANEL_VALUE);
+ if (is_empty(buf)) {
+ error("You must specify an alternate address before sending your message");
+ return;
+ }
+ else
+ sprintf(cmd, "%s %s", MAILER, buf);
+ }
+ lets_get_busy(contool_base->base, TRUE, NULL);
+ if ((pipe = popen(cmd, "w")) == NULL) {
+ error("Could not invoke \"%s\" to send mail", cmd);
+ return;
+ }
+ size = (int) xv_get(dialog->message, TEXTSW_LENGTH);
+ if (size == 0) {
+ error("Please type a message before sending the mail");
+ return;
+ }
+ buf = (char *) malloc(size);
+ xv_get(dialog->message, TEXTSW_CONTENTS, 0, buf, size);
+ fprintf(pipe, "Subject: Contool comment\n\n");
+ if (fwrite(buf, 1, size, pipe) != size) {
+ error("Could not write message to the mailer");
+ free(buf);
+ return;
+ }
+ pclose(pipe);
+ free(buf);
+ lets_get_busy(contool_base->base, FALSE, NULL);
+ xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
+ }
+
+ /************************************************************************/
+ EXPORT void cancel_mail(item, event)
+
+ Panel_item item;
+ Event *event;
+
+ {
+ textsw_reset(dialog->message, 0, 0);
+ xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, 0);
+ }
dan
----------------------------------------------------
O'Reilly && Associates argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
--
dan
----------------------------------------------------
O'Reilly && Associates argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
More information about the Comp.sources.x
mailing list