Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
129
cde/programs/dtcm/dtcm/DtCalendar.ad
Normal file
129
cde/programs/dtcm/dtcm/DtCalendar.ad
Normal file
@@ -0,0 +1,129 @@
|
||||
! $TOG: DtCalendar.ad /main/3 1998/08/10 15:45:00 mgreess $
|
||||
!######################################################################
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
|
||||
!# Novell, Inc.
|
||||
!######################################################################
|
||||
#include "Dt"
|
||||
!
|
||||
! DtCalendar - Application defaults file for CDE Calendar
|
||||
! Last updated: 30 Sep 1994
|
||||
!
|
||||
!------------------------------------
|
||||
! Mnemonics for Menu Items
|
||||
!------------------------------------
|
||||
! Menu Bar
|
||||
DtCalendar*menuBar.file.mnemonic: %|nls-1-#F#|
|
||||
DtCalendar*menuBar.edit.mnemonic: %|nls-2-#E#|
|
||||
DtCalendar*menuBar.view.mnemonic: %|nls-3-#V#|
|
||||
DtCalendar*menuBar.browse.mnemonic: %|nls-4-#B#|
|
||||
DtCalendar*menuBar.help.mnemonic: %|nls-5-#H#|
|
||||
! File menu
|
||||
DtCalendar*fileMenu.printCurrent.mnemonic: %|nls-6-#C#|
|
||||
DtCalendar*fileMenu.print.mnemonic: %|nls-7-#P#|
|
||||
DtCalendar*fileMenu.options.mnemonic: %|nls-8-#O#|
|
||||
DtCalendar*fileMenu.exit.mnemonic: %|nls-9-#x#|
|
||||
! Edit menu
|
||||
DtCalendar*editMenu.appt.mnemonic: %|nls-10-#A#|
|
||||
DtCalendar*editMenu.toDo.mnemonic: %|nls-11-#T#|
|
||||
! View menu
|
||||
DtCalendar*viewMenu.day.mnemonic: %|nls-12-#D#|
|
||||
DtCalendar*viewMenu.week.mnemonic: %|nls-13-#W#|
|
||||
DtCalendar*viewMenu.month.mnemonic: %|nls-14-#M#|
|
||||
DtCalendar*viewMenu.year.mnemonic: %|nls-15-#Y#|
|
||||
DtCalendar*viewMenu.apptList.mnemonic: %|nls-16-#A#|
|
||||
DtCalendar*viewMenu.toDoList.mnemonic: %|nls-17-#T#|
|
||||
DtCalendar*viewMenu.find.mnemonic: %|nls-18-#F#|
|
||||
DtCalendar*viewMenu.goTo.mnemonic: %|nls-19-#G#|
|
||||
DtCalendar*viewMenu.timeZone.mnemonic: %|nls-20-#Z#|
|
||||
! Browse menu
|
||||
DtCalendar*browseMenu.showOther.mnemonic: %|nls-21-#O#|
|
||||
DtCalendar*browseMenu.compare.mnemonic: %|nls-22-#C#|
|
||||
DtCalendar*browseMenu.editMenu.mnemonic: %|nls-23-#M#|
|
||||
! Help menu
|
||||
DtCalendar*helpMenu.overview.mnemonic: %|nls-24-#v#|
|
||||
DtCalendar*helpMenu.tasks.mnemonic: %|nls-25-#T#|
|
||||
DtCalendar*helpMenu.reference.mnemonic: %|nls-26-#R#|
|
||||
DtCalendar*helpMenu.onItem.mnemonic: %|nls-27-#O#|
|
||||
DtCalendar*helpMenu.using.mnemonic: %|nls-28-#U#|
|
||||
DtCalendar*helpMenu.about.mnemonic: %|nls-29-#A#|
|
||||
|
||||
!------------------------------------
|
||||
! Accelerator text
|
||||
!------------------------------------
|
||||
DtCalendar*day.acceleratorText: %|nls-30-#Ctrl+D#|
|
||||
DtCalendar*week.acceleratorText: %|nls-32-#Ctrl+W#|
|
||||
DtCalendar*month.acceleratorText: %|nls-34-#Ctrl+M#|
|
||||
DtCalendar*year.acceleratorText: %|nls-36-#Ctrl+Y#|
|
||||
DtCalendar*options.acceleratorText: %|nls-38-#Ctrl+I#|
|
||||
DtCalendar*appt.acceleratorText: %|nls-40-#Ctrl+A#|
|
||||
DtCalendar*toDo.acceleratorText: %|nls-42-#Ctrl+T#|
|
||||
DtCalendar*find.acceleratorText: %|nls-44-#Ctrl+F#|
|
||||
DtCalendar*print.acceleratorText: %|nls-46-#Ctrl+P#|
|
||||
DtCalendar*exit.acceleratorText: %|nls-48-#Alt+F4#|
|
||||
DtCalendar*onItem.accelerator: %|nls-50-#F1#|
|
||||
|
||||
!----------------------------------------------------
|
||||
! Accelerators for selected commands with text above
|
||||
!----------------------------------------------------
|
||||
DtCalendar*day.accelerator: %|nls-31-#Ctrl<Key>D#|
|
||||
DtCalendar*week.accelerator: %|nls-33-#Ctrl<Key>W#|
|
||||
DtCalendar*month.accelerator: %|nls-35-#Ctrl<Key>M#|
|
||||
DtCalendar*year.accelerator: %|nls-37-#Ctrl<Key>Y#|
|
||||
DtCalendar*options.accelerator: %|nls-39-#Ctrl<Key>I#|
|
||||
DtCalendar*appt.accelerator: %|nls-41-#Ctrl<Key>A#|
|
||||
DtCalendar*toDo.accelerator: %|nls-43-#Ctrl<Key>T#|
|
||||
DtCalendar*find.accelerator: %|nls-45-#Ctrl<Key>F#|
|
||||
DtCalendar*print.accelerator: %|nls-47-#Ctrl<Key>P#|
|
||||
DtCalendar*exit.accelerator: %|nls-49-#<Meta>F4#|
|
||||
DtCalendar*onItem.accelerator: %|nls-51-#<Key>F1#|
|
||||
|
||||
DtCalendar*fileMenu.tearOffModel: tear_off_disabled
|
||||
DtCalendar*editMenu.tearOffModel: tear_off_disabled
|
||||
DtCalendar*viewMenu.tearOffModel: tear_off_disabled
|
||||
DtCalendar*browseMenu.tearOffModel: tear_off_disabled
|
||||
DtCalendar*helpMenu.tearOffModel: tear_off_disabled
|
||||
|
||||
!------------------------------------
|
||||
! Programmable date formats
|
||||
!------------------------------------
|
||||
DtCalendar*XmMonthPanel.titleFormat: %|nls-52-#%B %Y#|
|
||||
DtCalendar*yearForm.XmMonthPanel.titleFormat: %|nls-53-#%B#|
|
||||
|
||||
!------------------------------------
|
||||
! Miscellaneous
|
||||
!------------------------------------
|
||||
DtCalendar*labelForm*fontList: %|nls-63-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
DtCalendar*XmMonthPanel*fontList: %|nls-60-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
DtCalendar*canvas*XmPushButton.fontList: %|nls-61-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
DtCalendar*XmMonthPanel.activeHeader: True
|
||||
DtCalendar*XmMonthPanel*recomputeSize: False
|
||||
DtCalendar*lastMonth.activeDays: True
|
||||
DtCalendar*thisMonth.activeDays: True
|
||||
DtCalendar*nextMonth.activeDays: True
|
||||
DtCalendar.iconFont: %|nls-62-#-dt-application-bold-r-normal-sans-*-180-*-*-p-*-*-*:#|
|
||||
|
||||
! Font family to use for DtCalendar's views: ``application'' for C locale
|
||||
! ``mincho'' for ja locale, etc.
|
||||
DtCalendar.applicationFontFamily: %|nls-64-#application#|
|
||||
|
||||
!------------------------------------
|
||||
! Images for toolbar buttons
|
||||
!------------------------------------
|
||||
! Removed for time being until problem with HP and IBM not reading these
|
||||
! is fixed
|
||||
! DtCalendar*XmForm.appt.labelType: pixmap
|
||||
! DtCalendar*XmForm.todo.labelType: pixmap
|
||||
! DtCalendar*XmForm.day.labelType: pixmap
|
||||
! DtCalendar*XmForm.month.labelType: pixmap
|
||||
! DtCalendar*XmForm.week.labelType: pixmap
|
||||
! DtCalendar*XmForm.year.labelType: pixmap
|
||||
! DtCalendar*XmForm.appt.labelPixmap: %|nls-54-#...C/DtCMapt.m.pm#|
|
||||
! DtCalendar*XmForm.todo.labelPixmap: %|nls-55-#...C/DtCMtdo.m.pm#|
|
||||
! DtCalendar*XmForm.day.labelPixmap: %|nls-56-#...C/DtCMday.m.pm#|
|
||||
! DtCalendar*XmForm.week.labelPixmap: %|nls-57-#...C/DtCMwk.m.pm#|
|
||||
! DtCalendar*XmForm.month.labelPixmap: %|nls-58-#...C/DtCMmth.m.pm#|
|
||||
! DtCalendar*XmForm.year.labelPixmap: %|nls-59-#...C/DtCMyr.m.pm#|
|
||||
|
||||
230
cde/programs/dtcm/dtcm/Dtcm.ad
Normal file
230
cde/programs/dtcm/dtcm/Dtcm.ad
Normal file
@@ -0,0 +1,230 @@
|
||||
! $TOG: Dtcm.ad /main/8 1998/08/10 15:44:34 mgreess $
|
||||
!
|
||||
! COMPONENT_NAME: desktop
|
||||
!
|
||||
! FUNCTIONS: none
|
||||
!
|
||||
! ORIGINS: 27,118,119,120,121
|
||||
!
|
||||
! This module contains IBM CONFIDENTIAL code. -- (IBM
|
||||
! Confidential Restricted when combined with the aggregated
|
||||
! modules for this product)
|
||||
! OBJECT CODE ONLY SOURCE MATERIALS
|
||||
!
|
||||
! (C) COPYRIGHT International Business Machines Corp. 1995
|
||||
! All Rights Reserved
|
||||
! US Government Users Restricted Rights - Use, duplication or
|
||||
! disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
!
|
||||
!######################################################################
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
|
||||
!# Novell, Inc.
|
||||
!######################################################################
|
||||
#include "Dt"
|
||||
!
|
||||
! Dtcm - Application defaults file for CDE Calendar
|
||||
! Last updated: 9 Dec 1994
|
||||
!
|
||||
!------------------------------------
|
||||
! Mnemonics for Menu Items
|
||||
!------------------------------------
|
||||
! Menu Bar
|
||||
Dtcm*menuBar.file.mnemonic: %|nls-1-#F#|
|
||||
Dtcm*menuBar.edit.mnemonic: %|nls-2-#E#|
|
||||
Dtcm*menuBar.view.mnemonic: %|nls-3-#V#|
|
||||
Dtcm*menuBar.browse.mnemonic: %|nls-4-#B#|
|
||||
Dtcm*menuBar.help.mnemonic: %|nls-5-#H#|
|
||||
! File menu
|
||||
Dtcm*fileMenu.printCurrent.mnemonic: %|nls-6-#C#|
|
||||
Dtcm*fileMenu.print.mnemonic: %|nls-7-#P#|
|
||||
Dtcm*fileMenu.options.mnemonic: %|nls-8-#O#|
|
||||
Dtcm*fileMenu.exit.mnemonic: %|nls-9-#x#|
|
||||
! Edit menu
|
||||
Dtcm*editMenu.appt.mnemonic: %|nls-10-#A#|
|
||||
Dtcm*editMenu.toDo.mnemonic: %|nls-11-#T#|
|
||||
! View menu
|
||||
Dtcm*viewMenu.day.mnemonic: %|nls-12-#D#|
|
||||
Dtcm*viewMenu.week.mnemonic: %|nls-13-#W#|
|
||||
Dtcm*viewMenu.month.mnemonic: %|nls-14-#M#|
|
||||
Dtcm*viewMenu.year.mnemonic: %|nls-15-#Y#|
|
||||
Dtcm*viewMenu.apptList.mnemonic: %|nls-16-#A#|
|
||||
Dtcm*viewMenu.toDoList.mnemonic: %|nls-17-#T#|
|
||||
Dtcm*viewMenu.find.mnemonic: %|nls-18-#F#|
|
||||
Dtcm*viewMenu.goTo.mnemonic: %|nls-19-#G#|
|
||||
Dtcm*viewMenu.timeZone.mnemonic: %|nls-20-#Z#|
|
||||
! Browse menu
|
||||
Dtcm*browseMenu.showOther.mnemonic: %|nls-21-#O#|
|
||||
Dtcm*browseMenu.compare.mnemonic: %|nls-22-#C#|
|
||||
Dtcm*browseMenu.editMenu.mnemonic: %|nls-23-#M#|
|
||||
! Help menu
|
||||
Dtcm*helpMenu.overview.mnemonic: %|nls-24-#v#|
|
||||
Dtcm*helpMenu.tasks.mnemonic: %|nls-25-#T#|
|
||||
Dtcm*helpMenu.reference.mnemonic: %|nls-26-#R#|
|
||||
Dtcm*helpMenu.onItem.mnemonic: %|nls-27-#O#|
|
||||
Dtcm*helpMenu.using.mnemonic: %|nls-28-#U#|
|
||||
Dtcm*helpMenu.about.mnemonic: %|nls-29-#A#|
|
||||
|
||||
!------------------------------------
|
||||
! Accelerator text
|
||||
!------------------------------------
|
||||
Dtcm*day.acceleratorText: %|nls-30-#Ctrl+D#|
|
||||
Dtcm*week.acceleratorText: %|nls-32-#Ctrl+W#|
|
||||
Dtcm*month.acceleratorText: %|nls-34-#Ctrl+M#|
|
||||
Dtcm*year.acceleratorText: %|nls-36-#Ctrl+Y#|
|
||||
Dtcm*options.acceleratorText: %|nls-38-#Ctrl+I#|
|
||||
Dtcm*appt.acceleratorText: %|nls-40-#Ctrl+A#|
|
||||
Dtcm*toDo.acceleratorText: %|nls-42-#Ctrl+T#|
|
||||
Dtcm*find.acceleratorText: %|nls-44-#Ctrl+F#|
|
||||
Dtcm*print.acceleratorText: %|nls-46-#Ctrl+P#|
|
||||
Dtcm*exit.acceleratorText: %|nls-48-#Alt+F4#|
|
||||
Dtcm*onItem.accelerator: %|nls-50-#F1#|
|
||||
|
||||
!----------------------------------------------------
|
||||
! Accelerators for selected commands with text above
|
||||
!----------------------------------------------------
|
||||
Dtcm*day.accelerator: %|nls-31-#Ctrl<Key>D#|
|
||||
Dtcm*week.accelerator: %|nls-33-#Ctrl<Key>W#|
|
||||
Dtcm*month.accelerator: %|nls-35-#Ctrl<Key>M#|
|
||||
Dtcm*year.accelerator: %|nls-37-#Ctrl<Key>Y#|
|
||||
Dtcm*options.accelerator: %|nls-39-#Ctrl<Key>I#|
|
||||
Dtcm*appt.accelerator: %|nls-41-#Ctrl<Key>A#|
|
||||
Dtcm*toDo.accelerator: %|nls-43-#Ctrl<Key>T#|
|
||||
Dtcm*find.accelerator: %|nls-45-#Ctrl<Key>F#|
|
||||
Dtcm*print.accelerator: %|nls-47-#Ctrl<Key>P#|
|
||||
Dtcm*exit.accelerator: %|nls-49-#Alt<key>F4#|
|
||||
Dtcm*onItem.accelerator: %|nls-51-#<Key>F1#|
|
||||
|
||||
Dtcm*fileMenu.tearOffModel: tear_off_disabled
|
||||
Dtcm*editMenu.tearOffModel: tear_off_disabled
|
||||
Dtcm*viewMenu.tearOffModel: tear_off_disabled
|
||||
Dtcm*browseMenu.tearOffModel: tear_off_disabled
|
||||
Dtcm*helpMenu.tearOffModel: tear_off_disabled
|
||||
|
||||
!------------------------------------
|
||||
! Programmable date formats
|
||||
!------------------------------------
|
||||
Dtcm*XmMonthPanel.titleFormat: %|nls-52-#%B %Y#|
|
||||
Dtcm*yearForm.XmMonthPanel.titleFormat: %|nls-53-#%B#|
|
||||
|
||||
!------------------------------------
|
||||
! Miscellaneous
|
||||
!------------------------------------
|
||||
Dtcm*labelForm*fontList: %|nls-63-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
Dtcm*XmMonthPanel*fontList: %|nls-60-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
Dtcm*canvas*XmPushButton.fontList: %|nls-61-#-dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:#|
|
||||
Dtcm*XmMonthPanel.activeHeader: True
|
||||
Dtcm*XmMonthPanel*recomputeSize: False
|
||||
Dtcm*lastMonth.activeDays: True
|
||||
Dtcm*thisMonth.activeDays: True
|
||||
Dtcm*nextMonth.activeDays: True
|
||||
Dtcm.iconFont: %|nls-62-#-dt-application-bold-r-normal-sans-*-180-*-*-p-*-*-*:#|
|
||||
|
||||
! Font family to use for Dtcm's views: ``application'' for C locale
|
||||
! ``mincho'' for ja locale, etc.
|
||||
Dtcm.applicationFontFamily: %|nls-64-#application#|
|
||||
|
||||
!------------------------------------
|
||||
! Images for toolbar buttons
|
||||
!------------------------------------
|
||||
! Removed for time being until problem with HP and IBM not reading these
|
||||
! is fixed
|
||||
! Dtcm*XmForm.appt.labelType: pixmap
|
||||
! Dtcm*XmForm.todo.labelType: pixmap
|
||||
! Dtcm*XmForm.day.labelType: pixmap
|
||||
! Dtcm*XmForm.month.labelType: pixmap
|
||||
! Dtcm*XmForm.week.labelType: pixmap
|
||||
! Dtcm*XmForm.year.labelType: pixmap
|
||||
! Dtcm*XmForm.appt.labelPixmap: %|nls-54-#...C/DtCMapt.m.pm#|
|
||||
! Dtcm*XmForm.todo.labelPixmap: %|nls-55-#...C/DtCMtdo.m.pm#|
|
||||
! Dtcm*XmForm.day.labelPixmap: %|nls-56-#...C/DtCMday.m.pm#|
|
||||
! Dtcm*XmForm.week.labelPixmap: %|nls-57-#...C/DtCMwk.m.pm#|
|
||||
! Dtcm*XmForm.month.labelPixmap: %|nls-58-#...C/DtCMmth.m.pm#|
|
||||
! Dtcm*XmForm.year.labelPixmap: %|nls-59-#...C/DtCMyr.m.pm#|
|
||||
!
|
||||
! The followings are added by IBM
|
||||
Dtcm.frame.outerPane.innerPane.upperForm.text_field_form.dataText.columns: %|nls-90-#IBM#|
|
||||
Dtcm*dssw_form_mgr.start_text.columns: %|nls-91-#IBM#|
|
||||
Dtcm*dssw_form_mgr.stop_text.columns: %|nls-92-#IBM#|
|
||||
Dtcm*dssw_form_mgr.what_text.columns: %|nls-93-#IBM#|
|
||||
Dtcm*repeat_popup_frame.form_mgr_text_field.columns: %|nls-94-#IBM#|
|
||||
Dtcm.frame.form.appt.columns: %|nls-95-#IBM#|
|
||||
Dtcm.frame.form.search_from.columns: %|nls-96-#IBM#|
|
||||
Dtcm.frame.form.search_to.columns: %|nls-97-#IBM#|
|
||||
Dtcm*dp_form_mgr.dp_loc_text.columns: %|nls-98-#IBM#|
|
||||
Dtcm*dp_form_mgr.dp_init_view_text.columns: %|nls-99-#IBM#|
|
||||
Dtcm*gap_form_mgr.gap_user_text.columns: %|nls-100-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_printer_text.columns: %|nls-101-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_directory_text.columns: %|nls-102-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_options_text.columns: %|nls-103-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_file_text.columns: %|nls-104-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_width_text.columns: %|nls-105-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_height_text.columns: %|nls-106-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_pos_left_text.columns: %|nls-107-#IBM#|
|
||||
Dtcm*pop_form_mgr.pop_pos_bottom_text.columns: %|nls-108-#IBM#|
|
||||
Dtcm*pop_form_mgr.unitsSpin.columns: %|nls-109-#IBM#|
|
||||
Dtcm*pop_form_mgr.copiesSpin.columns: %|nls-110-#IBM#|
|
||||
Dtcm*bfpm_form_mgr.beep_text.columns: %|nls-111-#IBM#|
|
||||
Dtcm*bfpm_form_mgr.flash_text.columns: %|nls-112-#IBM#|
|
||||
Dtcm*bfpm_form_mgr.popup_text.columns: %|nls-113-#IBM#|
|
||||
Dtcm*bfpm_form_mgr.mail_text.columns: %|nls-114-#IBM#|
|
||||
Dtcm*control.printerText.columns: %|nls-115-#IBM#|
|
||||
Dtcm*control.copiesSpin.columns: %|nls-116-#IBM#|
|
||||
Dtcm*control.fromText.columns: %|nls-117-#IBM#|
|
||||
Dtcm*control.toText.columns: %|nls-118-#IBM#|
|
||||
Dtcm*control.argsText.columns: %|nls-119-#IBM#|
|
||||
Dtcm*control.fileText.columns: %|nls-120-#IBM#|
|
||||
Dtcm*gap2_form_mgr.gap2_text_user_name.columns: %|nls-121-#IBM#|
|
||||
|
||||
!------------------------------------
|
||||
! Fonts for printing
|
||||
!------------------------------------
|
||||
! Day View
|
||||
Dtcm*dvpTitleFont: %|nls-122-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*dvpHeaderFont:%|nls-123-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*dvpApptFont: %|nls-124-#-dt-application-medium-r-normal-sans-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*dvpTimeFont: %|nls-125-#-dt-application-bold-r-normal-serif-0-100-0-0-p-0-iso8859-1:#|
|
||||
|
||||
! Week View
|
||||
Dtcm*wvpTitleFont: %|nls-126-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*wvpHeaderFont:%|nls-127-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*wvpApptFont: %|nls-128-#-dt-application-medium-r-normal-sans-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*wvpDayFont: %|nls-129-#-dt-application-bold-r-normal-serif-0-120-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*wvpBoxFont: %|nls-130-#-dt-application-bold-r-normal-serif-0-120-0-0-p-0-iso8859-1:#|
|
||||
|
||||
! Month View
|
||||
Dtcm*mvpTitleFont: %|nls-131-#-dt-application-bold-r-normal-serif-0-300-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpHeaderFont:%|nls-132-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpApptFont: %|nls-133-#-dt-application-medium-r-normal-sans-0-80-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpDayFont: %|nls-134-#-dt-application-bold-r-normal-serif-0-140-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpDateFont: %|nls-135-#-dt-application-bold-r-normal-serif-0-200-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpTinyTitleFont:%|nls-136-#-dt-application-bold-r-normal-serif-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*mvpTinyDayFont:%|nls-137-#-dt-application-medium-r-normal-serif-0-70-0-0-m-0-iso8859-1:#|
|
||||
Dtcm*mvpTinyDateFont:%|nls-138-#-dt-application-bold-r-normal-serif-0-70-0-0-p-0-iso8859-1:#|
|
||||
|
||||
! Year View
|
||||
Dtcm*yvpTitleFont: %|nls-139-#-dt-application-bold-r-normal-serif-0-[80 0 0 40]-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*yvpHeaderFont:%|nls-140-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*yvpTinyTitleFont:%|nls-141-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*yvpTinyDayFont:%|nls-142-#-dt-application-medium-r-normal-serif-0-120-0-0-m-0-iso8859-1:#|
|
||||
Dtcm*yvpTinyDateFont:%|nls-143-#-dt-application-bold-r-normal-serif-0-120-0-0-p-0-iso8859-1:#|
|
||||
|
||||
! Appt List View
|
||||
Dtcm*avpTitleFont: %|nls-144-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*avpHeaderFont:%|nls-145-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*avpApptFont: %|nls-146-#-dt-application-medium-r-normal-sans-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*avpItemFont: %|nls-147-#-dt-application-bold-r-normal-serif-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*avpTinyTitleFont:%|nls-148-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*avpTinyDayFont:%|nls-149-#-dt-application-medium-r-normal-serif-0-120-0-0-m-0-iso8859-1:#|
|
||||
Dtcm*avpTinyDateFont:%|nls-150-#-dt-application-bold-r-normal-serif-0-120-0-0-p-0-iso8859-1:#|
|
||||
|
||||
! To Do List View
|
||||
Dtcm*tvpTitleFont: %|nls-151-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*tvpHeaderFont:%|nls-152-#-dt-application-bold-r-normal-serif-0-90-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*tvpApptFont: %|nls-153-#-dt-application-medium-r-normal-sans-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*tvpItemFont: %|nls-154-#-dt-application-bold-r-normal-serif-0-100-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*tvpTinyTitleFont:%|nls-155-#-dt-application-bold-r-normal-serif-0-160-0-0-p-0-iso8859-1:#|
|
||||
Dtcm*tvpTinyDayFont:%|nls-156-#-dt-application-medium-r-normal-serif-0-120-0-0-m-0-iso8859-1:#|
|
||||
Dtcm*tvpTinyDateFont:%|nls-157-#-dt-application-bold-r-normal-serif-0-120-0-0-p-0-iso8859-1:#|
|
||||
119
cde/programs/dtcm/dtcm/Imakefile
Normal file
119
cde/programs/dtcm/dtcm/Imakefile
Normal file
@@ -0,0 +1,119 @@
|
||||
XCOMM $TOG: Imakefile /main/19 1998/04/09 11:46:13 mgreess $
|
||||
|
||||
#include <Threads.tmpl>
|
||||
|
||||
INCLUDES = -I. -I$(CSASRC) -I../libDtCmP -I$(DTHELPSRC)
|
||||
SYS_LIBRARIES = -lm $(ICONVSYSLIB)
|
||||
DTCMPLIB = ../libDtCmP/libDtCmP.a
|
||||
|
||||
DEPLIBS = $(DEPCSALIB) DepDtClientLibs
|
||||
LOCAL_LIBRARIES = ../libDtCmP/libDtCmP.a $(CSALIB) DtClientLibs
|
||||
SYS_LIBRARIES = DtClientSysLibs DtClientExtraLibs
|
||||
|
||||
OSMAJORVERSION = OSMajorVersion
|
||||
OSMINORVERSION = OSMinorVersion
|
||||
DEFINES = -DSVR4 -DREL="$(OSMAJORVERSION)$(OSMINORVERSION)" \
|
||||
-DRELMAJOR="$(OSMAJORVERSION)" -DRELMINOR="$(OSMINORVERSION)" \
|
||||
$(ICONV_INBUF_DEFINE)
|
||||
|
||||
#if defined(RsArchitecture) || defined(USLArchitecture) || defined(UXPArchitecture) || defined(LinuxArchitecture)
|
||||
TTY_LIBRARIES = $(LOCAL_LIBRARIES)
|
||||
#elif defined(AlphaArchitecture)
|
||||
TTY_LIBRARIES = $(DTCMPLIB) $(CSALIB) $(DTSVCLIB) $(XTOOLLIB) $(XLIB)
|
||||
#else
|
||||
TTY_LIBRARIES = $(DTCMPLIB) $(CSALIB) $(DTSVCLIB)
|
||||
#endif
|
||||
|
||||
#ifdef RsArchitecture
|
||||
EXTRA_LIBRARIES = -lrpcsvc -lPW -ldiag
|
||||
#endif
|
||||
|
||||
#ifdef HPArchitecture
|
||||
EXTRA_LIBRARIES = -lrpcsvc -lV3
|
||||
#endif
|
||||
|
||||
#ifdef SunArchitecture
|
||||
XCOMM Uncomment to build using Federated Naming Services. To activate
|
||||
XCOMM you must set the UseFNS resource to True before runnin dtcm.
|
||||
XCOMM #define UseFNS
|
||||
|
||||
#ifdef UseFNS
|
||||
EXTRA_DEFINES = -DFNS -DPOSIX_THREADS -DSunOS=$(OSMAJORVERSION)$(OSMINORVERSION)
|
||||
#else
|
||||
EXTRA_DEFINES = -DSunOS=$(OSMAJORVERSION)$(OSMINORVERSION)
|
||||
#endif
|
||||
|
||||
EXTRA_CCOPTIONS = -xstrconst -Xc -v
|
||||
EXTRA_LIBRARIES = $(FNS_EXTRA_LIBS)
|
||||
#endif
|
||||
|
||||
PROG1 = dtcm
|
||||
SRCS1 = MonthPanel.c RFCMIME.c about.c \
|
||||
alarm.c blist.c browser.c \
|
||||
calendarA.c cm_i18n.c cmtt.c \
|
||||
datefield.c dayglance.c deskset.c \
|
||||
dnd.c dssw.c editor.c \
|
||||
find.c fns.c font.c \
|
||||
format.c goto.c graphics.c \
|
||||
group_editor.c help.c i18nxlate.c \
|
||||
icon.c md5.c misc.c \
|
||||
monthglance.c namesvc.c print.c \
|
||||
props.c props_pu.c reminders.c \
|
||||
rfp.c select.c session.c \
|
||||
submit.c tempbr.c timezone.c \
|
||||
todo.c weekglance.c x_graphics.c \
|
||||
yearglance.c
|
||||
OBJS1 = \
|
||||
MonthPanel.o RFCMIME.o about.o \
|
||||
alarm.o blist.o browser.o \
|
||||
calendarA.o cm_i18n.o cmtt.o \
|
||||
datefield.o dayglance.o deskset.o \
|
||||
dnd.o dssw.o editor.o \
|
||||
find.o fns.o font.o \
|
||||
format.o goto.o graphics.o \
|
||||
group_editor.o help.o i18nxlate.o \
|
||||
icon.o md5.o misc.o \
|
||||
monthglance.o namesvc.o print.o \
|
||||
props.o props_pu.o reminders.o \
|
||||
rfp.o select.o session.o \
|
||||
submit.o tempbr.o timezone.o \
|
||||
todo.o weekglance.o x_graphics.o \
|
||||
yearglance.o
|
||||
|
||||
PROG2 = dtcm_delete
|
||||
SRCS2 = cm_delete.c
|
||||
OBJS2 = cm_delete.o
|
||||
|
||||
PROG3 = dtcm_insert
|
||||
SRCS3 = cm_insert.c
|
||||
OBJS3 = cm_insert.o
|
||||
|
||||
PROG4 = dtcm_lookup
|
||||
SRCS4 = cm_lookup.c
|
||||
OBJS4 = cm_lookup.o
|
||||
|
||||
PROG5 = dtcm_editor
|
||||
SRCS5 = datefield.c deskset.c dssw.c \
|
||||
dtcm_editor.c help.c misc.c \
|
||||
reminders.c rfp.c
|
||||
OBJS5 = datefield.o deskset.o dssw.o \
|
||||
dtcm_editor.o help.o misc.o \
|
||||
reminders.o rfp.o
|
||||
|
||||
PROGRAMS = $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG5)
|
||||
|
||||
ICONS = \
|
||||
busy.icon cmgr.icon \
|
||||
cmgrmask.icon compose.icon \
|
||||
compose.mask.icon contract_xbm \
|
||||
drag_mask_xbm drag_xbm \
|
||||
expand_xbm icon_pixmap_xbm \
|
||||
postup_xbm xm_error_xbm \
|
||||
xm_information_xbm xm_question_xbm \
|
||||
xm_warning_xbm
|
||||
|
||||
ComplexProgramTarget_1($(PROG1),$(LOCAL_LIBRARIES),)
|
||||
ComplexProgramTarget_2($(PROG2),$(TTY_LIBRARIES),)
|
||||
ComplexProgramTarget_3($(PROG3),$(TTY_LIBRARIES),)
|
||||
ComplexProgramTarget_4($(PROG4),$(TTY_LIBRARIES),)
|
||||
ComplexProgramTarget_5($(PROG5),$(LOCAL_LIBRARIES),)
|
||||
919
cde/programs/dtcm/dtcm/MonthPanel.c
Normal file
919
cde/programs/dtcm/dtcm/MonthPanel.c
Normal file
@@ -0,0 +1,919 @@
|
||||
/*********************************************************************************
|
||||
** MonthPanel.c
|
||||
**
|
||||
** $XConsortium: MonthPanel.c /main/7 1996/11/21 19:41:55 drk $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
/*
|
||||
* Month Panel widget implementation (class XmMonthPanel)
|
||||
*
|
||||
* The XmMonthPanel widget is rigged with the Motif widget binary
|
||||
* compatibility mechanism. All Motif-specific changes for this mechanism
|
||||
* are preceded by a comment including the string "MotifBc"
|
||||
*
|
||||
* For a description of the Motif widget binary compatibility mechanism
|
||||
* see the reference manual entry on XmResolvePartOffsets().
|
||||
*
|
||||
*/
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/ManagerP.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include "MonthPanelP.h"
|
||||
#include "timeops.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#define X_INCLUDE_TIME_H
|
||||
#include <X11/Xos_r.h>
|
||||
|
||||
/*
|
||||
* MotifBc - index value for this class is superclass' value + 1
|
||||
*/
|
||||
#ifdef MOTIF_BC
|
||||
#define XmMonthPanelIndex (XmManagerIndex + 1)
|
||||
#endif /* MOTIF_BC */
|
||||
|
||||
/*
|
||||
* MotifBc - dynamic offset tables
|
||||
*/
|
||||
#ifdef MOTIF_BC
|
||||
static XmOffsetPtr ipot; /* Instance part offset table */
|
||||
static XmOffsetPtr cpot; /* Constraint part offset table */
|
||||
#endif /* MOTIF_BC */
|
||||
|
||||
/*
|
||||
* MotifBc - macros for accessing instance and constraint fields
|
||||
*/
|
||||
#ifdef MOTIF_BC
|
||||
#define Year(w) XmField(w, ipot, XmMonthPanel, year, int)
|
||||
#define Month(w) XmField(w, ipot, XmMonthPanel, month, int)
|
||||
#define Callback(w) XmField(w, ipot, XmMonthPanel, callback, XtCallbackList)
|
||||
#define TitleFormat(w) XmField(w, ipot, XmMonthPanel, title_format, String)
|
||||
#define Header(w) XmField(w, ipot, XmMonthPanel, header, Widget)
|
||||
#define DayLabels(w) XmField(w, ipot, XmMonthPanel, day_labels, Widget *)
|
||||
#define Days(w) XmField(w, ipot, XmMonthPanel, days, Widget *)
|
||||
#endif /* MOTIF_BC */
|
||||
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
static void scale_components(XmMonthPanelWidget);
|
||||
|
||||
static void ClassPartInitialize(WidgetClass) ;
|
||||
static void Initialize(Widget, Widget, ArgList, Cardinal *) ;
|
||||
static void Redisplay(Widget, XEvent *, Region);
|
||||
static void DoLayout(XmMonthPanelWidget) ;
|
||||
static void Resize(Widget) ;
|
||||
static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *) ;
|
||||
static XtGeometryResult QueryProc(Widget, XtWidgetGeometry*, XtWidgetGeometry*);
|
||||
static XtGeometryResult GeometryManager( Widget, XtWidgetGeometry *, XtWidgetGeometry *);
|
||||
static void DayCallback(Widget, XtPointer, XtPointer);
|
||||
static void MonthCallback(Widget, XtPointer, XtPointer);
|
||||
static void set_header_string(XmMonthPanelWidget);
|
||||
static Boolean clipped(Widget);
|
||||
/******** End Static Function Declarations ********/
|
||||
|
||||
|
||||
/*
|
||||
* These arrays are implemented in calendarA.c. They are arrays
|
||||
* of the local strings for day names and month names. The day
|
||||
* arrays start from 0, the month array starts from 1; no particular
|
||||
* reason for this difference that I can see.
|
||||
*/
|
||||
extern char *days3[]; /* eg: "S" */
|
||||
extern char *months[]; /* eg: "January" */
|
||||
|
||||
/*
|
||||
* widget instance names for column header labels in panel
|
||||
*/
|
||||
static char *col_hdr[] = { "sunday", "monday", "tuesday", "wednesday",
|
||||
"thursday", "friday", "saturday" };
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Month Panel Resources *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static XtResource resources[] =
|
||||
{
|
||||
{ XmNyear, XmCYear, XmRInt, sizeof(int),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.year),
|
||||
XmRImmediate, (XtPointer)NULL },
|
||||
{ XmNmonth, XmCMonth, XmRInt, sizeof(int),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.month),
|
||||
XmRImmediate, (XtPointer)NULL },
|
||||
{ XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.callback),
|
||||
XmRImmediate, (XtPointer)NULL },
|
||||
{ XmNtitleFormat, XmCTitleFormat, XmRString, sizeof(char *),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.title_format),
|
||||
XtRString, (XtPointer)"%B %Y" },
|
||||
{ XmNactiveHeader, XmCActiveHeader, XmRBoolean, sizeof(Boolean),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.active_header),
|
||||
XtRImmediate, (XtPointer)False },
|
||||
{ XmNactiveDays, XmCActiveDays, XmRBoolean, sizeof(Boolean),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.active_days),
|
||||
XtRImmediate, (XtPointer)False },
|
||||
{ XmNshowPanelHeader, XmCShowPanelHeader, XmRBoolean, sizeof(Boolean),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.show_panel_header),
|
||||
XtRImmediate, (XtPointer)True },
|
||||
{ XmNshowColumnHeaders, XmCShowColumnHeaders, XmRBoolean, sizeof(Boolean),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.show_column_headers),
|
||||
XtRImmediate, (XtPointer)True },
|
||||
{ XmNshowSeparator, XmCShowSeparator, XmRBoolean, sizeof(Boolean),
|
||||
XtOffsetOf( struct _XmMonthPanelRec, month_panel.show_separator),
|
||||
XtRImmediate, (XtPointer)True }
|
||||
};
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Full class record constant
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
externaldef(xmmonthpanelclassrec) XmMonthPanelClassRec
|
||||
xmMonthPanelClassRec = {
|
||||
{
|
||||
/* core_class fields */
|
||||
/* superclass */ (WidgetClass) &xmManagerClassRec,
|
||||
/* class_name */ "XmMonthPanel",
|
||||
/* widget_size */ sizeof(XmMonthPanelRec),
|
||||
/* class_initialize */ NULL,
|
||||
/* class_partinit */ ClassPartInitialize,
|
||||
/* class_inited */ FALSE,
|
||||
/* initialize */ Initialize,
|
||||
/* Init hook */ NULL,
|
||||
/* realize */ XtInheritRealize,
|
||||
/* actions */ NULL,
|
||||
/* num_actions */ 0,
|
||||
/* resources */ resources,
|
||||
/* num_resources */ XtNumber(resources),
|
||||
/* xrm_class */ NULLQUARK,
|
||||
/* compress_motion */ TRUE,
|
||||
/* compress_exposure */ XtExposeCompressMaximal,
|
||||
/* compress_enterleave*/ TRUE,
|
||||
/* visible_interest */ FALSE,
|
||||
/* destroy */ NULL,
|
||||
/* resize */ Resize,
|
||||
/* expose */ Redisplay,
|
||||
/* set_values */ SetValues,
|
||||
/* set values hook */ NULL,
|
||||
/* set values almost */ XtInheritSetValuesAlmost,
|
||||
/* get values hook */ NULL,
|
||||
/* accept_focus */ NULL,
|
||||
/* Version */ XtVersion,
|
||||
/* PRIVATE cb list */ NULL,
|
||||
/* tm_table */ XtInheritTranslations,
|
||||
/* query_geometry */ XtInheritQueryGeometry,
|
||||
/* display_accelerator*/ NULL,
|
||||
/* extension */ NULL,
|
||||
},
|
||||
{
|
||||
/* composite_class fields */
|
||||
/* geometry_manager */ GeometryManager,
|
||||
/* change_managed */ XtInheritChangeManaged,
|
||||
/* insert_child */ XtInheritInsertChild,
|
||||
/* delete_child */ XtInheritDeleteChild, /* Inherit from superclass */
|
||||
/* Extension */ NULL,
|
||||
},{
|
||||
/* Constraint class Init */
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
|
||||
},
|
||||
/* Manager Class */
|
||||
{
|
||||
XtInheritTranslations, /* translations */
|
||||
NULL, /* get resources */
|
||||
0, /* num get_resources */
|
||||
NULL, /* get_cont_resources */
|
||||
0, /* num_get_cont_resources */
|
||||
XmInheritParentProcess, /* parent_process */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
{
|
||||
/* Month Panel class - none */
|
||||
/* mumble */ 0
|
||||
}
|
||||
};
|
||||
|
||||
externaldef(xmmonthpanelwidgetclass) WidgetClass
|
||||
xmMonthPanelWidgetClass = (WidgetClass)&xmMonthPanelClassRec;
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* ClassPartInitialize - Set up the fast subclassing. *
|
||||
* *
|
||||
************************************************************************/
|
||||
static void
|
||||
ClassPartInitialize( WidgetClass wc )
|
||||
{
|
||||
/*
|
||||
_XmFastSubclassInit (wc, XmMONTH_PANEL_BIT);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Initialize *
|
||||
* *
|
||||
************************************************************************/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args )
|
||||
{
|
||||
int i=0;
|
||||
Arg wargs[5];
|
||||
Widget header;
|
||||
XmString str;
|
||||
struct tm *tm_ret;
|
||||
time_t timer;
|
||||
Tick tmptick;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
XmMonthPanelWidget request = (XmMonthPanelWidget) rw ;
|
||||
XmMonthPanelWidget new_w = (XmMonthPanelWidget) nw ;
|
||||
|
||||
char buf[BUFSIZ];
|
||||
|
||||
new_w->month_panel.display_rows = 6; /* minimum to show all days */
|
||||
|
||||
/*
|
||||
* create and cache panel header ( eg. "January") (depends on format resource)
|
||||
*
|
||||
* Whether XmLabels or XmPushButton gadgets are used is selectable via
|
||||
* the boolean "activeDays" and "activeHeader" resource. True gets you buttons.
|
||||
*/
|
||||
|
||||
if (new_w->month_panel.active_header) {
|
||||
new_w->month_panel.header =
|
||||
XmCreatePushButtonGadget((Widget)new_w, "header", NULL, 0);
|
||||
XtAddCallback(new_w->month_panel.header, XmNactivateCallback,
|
||||
MonthCallback, NULL);
|
||||
new_w->month_panel.separator = (Widget) NULL;
|
||||
}
|
||||
else {
|
||||
new_w->month_panel.header =
|
||||
XmCreateLabelGadget((Widget)new_w, "header", NULL, 0);
|
||||
new_w->month_panel.separator =
|
||||
XmCreateSeparatorGadget((Widget)new_w, "separator", NULL, 0);
|
||||
/* Managing of separator is switchable */
|
||||
if (new_w->month_panel.show_separator) {
|
||||
XtManageChild(new_w->month_panel.separator);
|
||||
/* separator takes another row to display */
|
||||
(new_w->month_panel.display_rows)++;
|
||||
}
|
||||
}
|
||||
|
||||
/* set header label */
|
||||
|
||||
/*
|
||||
** Problem in set_header_string. It references month_panel.month
|
||||
** and month_panel.year, which aren't initialized in when it is called
|
||||
** in the Initialize function. Set them to today.
|
||||
*/
|
||||
time (&timer);
|
||||
tm_ret = _XLocaltime(&timer, localtime_buf);
|
||||
new_w->month_panel.month = tm_ret->tm_mon + 1;
|
||||
new_w->month_panel.year = 1900 + tm_ret->tm_year;
|
||||
|
||||
set_header_string(new_w);
|
||||
|
||||
/* Managing of header is switchable */
|
||||
if (new_w->month_panel.show_panel_header) {
|
||||
XtManageChild(new_w->month_panel.header);
|
||||
/* header takes another row to display */
|
||||
(new_w->month_panel.display_rows)++;
|
||||
}
|
||||
|
||||
/*
|
||||
* create and cache id's of, column header day names
|
||||
*/
|
||||
new_w->month_panel.day_labels =
|
||||
(Widget *) XtMalloc( 7 * sizeof(Widget) );
|
||||
for (i=0; i < 7; i++) {
|
||||
XmString str;
|
||||
Widget label;
|
||||
|
||||
/* I18N:next line: wrap the string & fetch from catalog */
|
||||
str = XmStringCreateLocalized(days3[i]);
|
||||
XtSetArg(wargs[0], XmNlabelString, str);
|
||||
label = XmCreateLabelGadget((Widget) new_w, col_hdr[i], wargs, 1);
|
||||
/* Managing of column headers is switchable */
|
||||
if (new_w->month_panel.show_column_headers)
|
||||
XtManageChild(label);
|
||||
new_w->month_panel.day_labels[i] = label; /* cache in panel inst. */
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
/* column headers take another row to display */
|
||||
if (new_w->month_panel.show_column_headers)
|
||||
(new_w->month_panel.display_rows)++;
|
||||
|
||||
/*
|
||||
* create and cache id's of, 31 buttons for days
|
||||
*/
|
||||
new_w->month_panel.days = (Widget *) XtMalloc( 31 * sizeof(Widget) );
|
||||
for (i=0; i < 31; i++) {
|
||||
char buf[BUFSIZ];
|
||||
XmString str;
|
||||
Widget btn;
|
||||
|
||||
sprintf(buf, "%d", i+1);
|
||||
str = XmStringCreateLocalized(buf);
|
||||
XtSetArg(wargs[0], XmNlabelString, str);
|
||||
sprintf(buf, "day%d", i+1);
|
||||
|
||||
/* choose between buttons or labels for day objects */
|
||||
if (new_w->month_panel.active_days) {
|
||||
btn = XmCreatePushButtonGadget((Widget)new_w, buf, wargs, 1);
|
||||
XtAddCallback(btn, XmNactivateCallback, DayCallback,
|
||||
(XtPointer)(i+1));
|
||||
}
|
||||
else {
|
||||
btn = XmCreateLabelGadget((Widget) new_w, buf, wargs, 1);
|
||||
}
|
||||
new_w->month_panel.days[i] = btn;/* cache id in panel instance */
|
||||
XmStringFree(str);
|
||||
}
|
||||
XtManageChildren((WidgetList)new_w->month_panel.days, 31);
|
||||
|
||||
/*
|
||||
* Set all these components to the appropriate size for the container
|
||||
* Then position them correctly.
|
||||
*/
|
||||
scale_components(new_w);
|
||||
|
||||
DoLayout(new_w);
|
||||
}
|
||||
|
||||
static void
|
||||
Redisplay(Widget w, XEvent *ev, Region region)
|
||||
{
|
||||
XmMonthPanelWidget panel = (XmMonthPanelWidget) w;
|
||||
|
||||
XmeRedisplayGadgets( w, ev, region) ;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* DoLayout - Layout the month panel. *
|
||||
* *
|
||||
************************************************************************/
|
||||
static void
|
||||
DoLayout( XmMonthPanelWidget mw )
|
||||
{
|
||||
XmMonthPanelPart *mpp = &(mw->month_panel);
|
||||
Dimension w = mw->core.width;
|
||||
Dimension h = mw->core.height;
|
||||
int col_w = (int) w/7;
|
||||
int row_h;
|
||||
Boolean tall_header;
|
||||
Position x=0;
|
||||
Position y=0;
|
||||
int days_in_month = monthlength(monthdayyear(mpp->month,1,mpp->year));
|
||||
int first = fdom(monthdayyear(mpp->month,1,mpp->year));
|
||||
Widget this_widget;
|
||||
int i=0;
|
||||
|
||||
if (!mw->month_panel.active_days && mw->month_panel.active_header) {
|
||||
tall_header = True;
|
||||
row_h = (int) h/(mpp->display_rows + 1);
|
||||
}
|
||||
else {
|
||||
tall_header = False;
|
||||
row_h = (int) h/(mpp->display_rows);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the variable buttons are correctly [un]managed.
|
||||
* (the "variable" buttons are those for 29th, 30th and 31st)
|
||||
*/
|
||||
for (i=28; i < 31; i++) {
|
||||
Widget this_widget = (mpp->days)[i];
|
||||
if (days_in_month > i) {
|
||||
if (!XtIsManaged(this_widget))
|
||||
XtManageChild(this_widget);
|
||||
}
|
||||
else {
|
||||
if (XtIsManaged(this_widget))
|
||||
XtUnmanageChild(this_widget);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* position the panel header
|
||||
*/
|
||||
XtMoveWidget(mpp->header, 0, 0);
|
||||
|
||||
/*
|
||||
* position the separator, if any
|
||||
*/
|
||||
if (mpp->separator != NULL) {
|
||||
if (tall_header)
|
||||
XtMoveWidget(mpp->separator,
|
||||
(Position) w/8, (Position) 2 * row_h);
|
||||
else
|
||||
XtMoveWidget(mpp->separator,
|
||||
(Position) w/8, (Position) row_h);
|
||||
}
|
||||
|
||||
/*
|
||||
* position the day labels
|
||||
*/
|
||||
x = (Position) 0;
|
||||
y = (Position) (mw->month_panel.display_rows -
|
||||
(tall_header ? 6 : 7)) * row_h;
|
||||
|
||||
i=0;
|
||||
while (i < 7) {
|
||||
this_widget = mw->month_panel.day_labels[i];
|
||||
XtMoveWidget(this_widget, x, y);
|
||||
x += col_w;
|
||||
i++;
|
||||
}
|
||||
|
||||
/*
|
||||
* position the day buttons
|
||||
*/
|
||||
x = (Position) first * col_w;
|
||||
y = (Position) (mw->month_panel.display_rows -
|
||||
(tall_header ? 5 : 6)) * row_h;
|
||||
|
||||
i=0;
|
||||
while (i < 31){
|
||||
this_widget = mw->month_panel.days[i];
|
||||
|
||||
/* don't bother with unmanaged buttons */
|
||||
if (XtIsManaged(this_widget))
|
||||
XtMoveWidget(this_widget, x, y);
|
||||
i++;
|
||||
|
||||
/* take new row after each 7 buttons */
|
||||
if ( ( (i+first) % 7 ) == 0 ) {
|
||||
x = 0;
|
||||
y += row_h;
|
||||
}
|
||||
else
|
||||
x += col_w;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* scale_components - Make all the labels, buttons correct size for this
|
||||
* size space.
|
||||
*
|
||||
* [4/12/94] - Check whether new size causes labels
|
||||
* to be clipped. If it does, set labelType
|
||||
* to PIXMAP. A suitable labelPixmap should be
|
||||
* set to indicate "label too small".
|
||||
************************************************************************/
|
||||
|
||||
static void
|
||||
scale_components(XmMonthPanelWidget mw) {
|
||||
|
||||
XmMonthPanelPart *mpp = &(mw->month_panel);
|
||||
Dimension w=mw->core.width;
|
||||
Dimension h=mw->core.height;
|
||||
int row_h;
|
||||
Boolean tall_header;
|
||||
int col_w = (int) w/7;
|
||||
int i=0;
|
||||
Widget this_widget;
|
||||
unsigned char ltype;
|
||||
Pixel fg, bg;
|
||||
Pixmap head_pm, col_head_pm, btn_pm;
|
||||
|
||||
if (!mw->month_panel.active_days && mw->month_panel.active_header) {
|
||||
tall_header = True;
|
||||
row_h = (int) h/(mpp->display_rows + 1);
|
||||
}
|
||||
else {
|
||||
tall_header = False;
|
||||
row_h = (int) h/(mpp->display_rows);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* get pixmap in colors needed - used to replace text when clipped.
|
||||
*
|
||||
* NOTE1: Don't need to release the pixmaps, because they come from
|
||||
* the Motif-owned image cache.
|
||||
*
|
||||
* NOTE2: setting the pixmaps should be in redisplay rather than
|
||||
* here - only done here because this is where labelType is toggled.
|
||||
******************************************************************/
|
||||
XtVaGetValues(XtParent(mw), XmNforeground, &fg, XmNbackground, &bg, NULL);
|
||||
head_pm = XmGetPixmap(XtScreen(mw), "slant_right", fg, bg);
|
||||
col_head_pm = XmGetPixmap(XtScreen(mw), "slant_left", fg, bg);
|
||||
btn_pm = XmGetPixmap(XtScreen(mw), "50_foreground", fg, bg);
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* This algorithm allocates equal header, label and button heights;
|
||||
* equal label and button widths; header spans container width.
|
||||
*********************************************************************/
|
||||
|
||||
/**************************
|
||||
* set panel header size
|
||||
**************************/
|
||||
|
||||
if (tall_header)
|
||||
XtResizeWidget(mpp->header, w, 2 * row_h, mpp->header->core.border_width);
|
||||
else
|
||||
XtResizeWidget(mpp->header, w, row_h, mpp->header->core.border_width);
|
||||
|
||||
if (clipped(mpp->header)) {
|
||||
XtVaSetValues(mpp->header,
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, head_pm,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
XtVaSetValues(mpp->header,
|
||||
XmNlabelType, XmSTRING,
|
||||
NULL);
|
||||
|
||||
/**************************
|
||||
* separator
|
||||
**************************/
|
||||
if (mpp->separator != NULL) {
|
||||
XtResizeWidget(mpp->separator, 3*(int)w/4, row_h, 0);
|
||||
}
|
||||
|
||||
/**************************
|
||||
* set column-heading label sizes
|
||||
**************************/
|
||||
for (i=0; i<7; i++) {
|
||||
this_widget = (mpp->day_labels)[i];
|
||||
XtResizeWidget(this_widget, col_w, row_h, 0);
|
||||
}
|
||||
/* display pixmap if clipped, string otherwise */
|
||||
this_widget = (mpp->day_labels)[6];
|
||||
XtVaGetValues(this_widget, XmNlabelType, <ype, NULL);
|
||||
if (clipped(this_widget)) {
|
||||
if (ltype == XmSTRING) {
|
||||
for (i=0; i<7; i++) {
|
||||
XtVaSetValues((mpp->day_labels)[i],
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, col_head_pm,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ltype == XmPIXMAP) {
|
||||
for (i=0; i<7; i++) {
|
||||
XtVaSetValues((mpp->day_labels)[i], XmNlabelType, XmSTRING, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************
|
||||
* Day buttons
|
||||
**************************/
|
||||
for (i=0; i<31; i++) {
|
||||
this_widget = (mpp->days)[i];
|
||||
XtResizeWidget(this_widget, col_w, row_h, 0);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* If any of the button labels are clipped, replace the
|
||||
* entire set with their pixmap equivalents. The labelPixmap
|
||||
* resource should be set to something that means "not big enough"
|
||||
* (like a dot!)
|
||||
* This check should really be done in above loop, but it
|
||||
* slows things down to catch the edge case (different fonts
|
||||
* in different labels, so this is thought "good enough".
|
||||
* 28th button picked at random for test - at least it's always a
|
||||
* 2-digit label.
|
||||
*************************************************************/
|
||||
this_widget = (mpp->days)[27];
|
||||
XtVaGetValues(this_widget, XmNlabelType, <ype, NULL);
|
||||
if (clipped(this_widget)) {
|
||||
if (ltype == XmSTRING) {
|
||||
for (i=0; i<31; i++) {
|
||||
XtVaSetValues((mpp->days)[i],
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, btn_pm,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ltype == XmPIXMAP) {
|
||||
for (i=0; i<31; i++) {
|
||||
XtVaSetValues((mpp->days)[i], XmNlabelType, XmSTRING, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine whether labelString requires more space
|
||||
* than its widget currently has. This information
|
||||
* can be used to display clipped information differently
|
||||
*/
|
||||
static Boolean
|
||||
clipped(Widget w)
|
||||
{
|
||||
XmString str;
|
||||
XmFontList fl;
|
||||
Dimension req_w, req_h, act_w, act_h, shd_w, hlt_w;
|
||||
|
||||
return(False);
|
||||
|
||||
XtVaGetValues(w,
|
||||
XmNlabelString, &str,
|
||||
XmNfontList, &fl,
|
||||
XmNhighlightThickness, &hlt_w,
|
||||
XmNshadowThickness, &shd_w,
|
||||
XmNwidth, &act_w,
|
||||
XmNheight, &act_h,
|
||||
NULL);
|
||||
|
||||
XmStringExtent(fl, str, &req_w, &req_h);
|
||||
|
||||
/* adjust actual width/height available for shadow and highlight */
|
||||
act_w -= ( (2*hlt_w) + (2*shd_w) );
|
||||
act_h -= ( (2*hlt_w) + (2*shd_w) );
|
||||
|
||||
if ((req_w > act_w) || (req_h > act_h))
|
||||
return (True);
|
||||
else
|
||||
return(False);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Recompute the size of the month panel. *
|
||||
* *
|
||||
************************************************************************/
|
||||
static void
|
||||
Resize( Widget wid )
|
||||
{
|
||||
XmMonthPanelWidget mw = (XmMonthPanelWidget) wid ;
|
||||
XmManagerWidgetClass super = (XmManagerWidgetClass) xmManagerWidgetClass;
|
||||
|
||||
scale_components(mw);
|
||||
DoLayout(mw);
|
||||
(*super->core_class.resize)((Widget) mw);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Geometry Manager
|
||||
* *
|
||||
***************************************************************************/
|
||||
static XtGeometryResult
|
||||
GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply )
|
||||
{
|
||||
return (XtGeometryYes);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* QueryProc (stub for now) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
static XtGeometryResult
|
||||
QueryProc( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply )
|
||||
{
|
||||
/* XmMonthPanelWidget mw = (XmMonthPanelWidget) w;*/
|
||||
return(XtGeometryYes);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/***************************************************************************
|
||||
* *
|
||||
* CalcSize (stub for now- to be called by QueryProc) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
static void
|
||||
CalcSize(XmMonthPanelWidget mw, Dimension *replyWidth , Dimension *replyHeight)
|
||||
{
|
||||
*replyWidth = mw->core.width;
|
||||
*replyHeight = mw->core.height;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* SetValues *
|
||||
* *
|
||||
************************************************************************/
|
||||
static Boolean
|
||||
SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args )
|
||||
{
|
||||
XmMonthPanelWidget current = (XmMonthPanelWidget) cw ;
|
||||
XmMonthPanelWidget request = (XmMonthPanelWidget) rw ;
|
||||
XmMonthPanelWidget new_w = (XmMonthPanelWidget) nw ;
|
||||
Boolean relayout = FALSE;
|
||||
Boolean new_date = FALSE;
|
||||
|
||||
if (request->month_panel.show_panel_header != current->month_panel.show_panel_header) {
|
||||
if (request->month_panel.show_panel_header) {
|
||||
XtManageChild(request->month_panel.header);
|
||||
(request->month_panel.display_rows)++;
|
||||
}
|
||||
else {
|
||||
XtUnmanageChild(request->month_panel.header);
|
||||
(request->month_panel.display_rows)--;
|
||||
}
|
||||
relayout = TRUE;
|
||||
}
|
||||
|
||||
if (request->month_panel.show_column_headers != current->month_panel.show_column_headers) {
|
||||
if (request->month_panel.show_column_headers) {
|
||||
int col=0;
|
||||
while (col < 7) {
|
||||
XtManageChild(request->month_panel.day_labels[col]);
|
||||
col++;
|
||||
}
|
||||
(request->month_panel.display_rows)++;
|
||||
}
|
||||
else {
|
||||
int col=0;
|
||||
while (col < 7) {
|
||||
XtUnmanageChild(request->month_panel.day_labels[col]);
|
||||
col++;
|
||||
}
|
||||
(request->month_panel.display_rows)--;
|
||||
}
|
||||
relayout = TRUE;
|
||||
}
|
||||
|
||||
if (request->month_panel.show_separator != current->month_panel.show_separator) {
|
||||
if (request->month_panel.show_separator) {
|
||||
XtManageChild(request->month_panel.separator);
|
||||
(request->month_panel.display_rows)++;
|
||||
}
|
||||
else {
|
||||
XtUnmanageChild(request->month_panel.separator);
|
||||
(request->month_panel.display_rows)--;
|
||||
}
|
||||
relayout = TRUE;
|
||||
}
|
||||
|
||||
if (request->month_panel.month != current->month_panel.month) {
|
||||
|
||||
/* range check - quietly force to nearest valid value */
|
||||
if (request->month_panel.month < 1)
|
||||
new_w->month_panel.month = 1;
|
||||
else if (request->month_panel.month > 12)
|
||||
new_w->month_panel.month = 12;
|
||||
|
||||
new_date = TRUE;
|
||||
}
|
||||
|
||||
if (request->month_panel.year != current->month_panel.year) {
|
||||
|
||||
/* range check - quietly force to nearest valid value */
|
||||
if (request->month_panel.year < 1)
|
||||
new_w->month_panel.year = 1970;
|
||||
else if (request->month_panel.year > 2037)
|
||||
new_w->month_panel.year = 2037;
|
||||
|
||||
new_date = TRUE;
|
||||
}
|
||||
|
||||
if ((request->core.width != current->core.width) ||
|
||||
(request->core.height != current->core.height)) {
|
||||
relayout = TRUE;
|
||||
}
|
||||
|
||||
if (strcmp(request->month_panel.title_format,
|
||||
new_w->month_panel.title_format) != 0) {
|
||||
set_header_string(new_w);
|
||||
}
|
||||
|
||||
if (new_date) {
|
||||
set_header_string(new_w);
|
||||
relayout = TRUE;
|
||||
}
|
||||
|
||||
if (relayout)
|
||||
DoLayout(new_w);
|
||||
|
||||
return (relayout);
|
||||
}
|
||||
|
||||
/*
|
||||
* set_header_string
|
||||
*
|
||||
* Sets label in month button of panel, according to the
|
||||
* setting of the titleFormat resource, which is assumed to
|
||||
* be a valid format string for stftime(3)
|
||||
*/
|
||||
static void
|
||||
set_header_string(XmMonthPanelWidget mw)
|
||||
{
|
||||
XmString str;
|
||||
struct tm *tm_ret;
|
||||
Tick tmptick;
|
||||
Arg wargs[3];
|
||||
char buf[BUFSIZ];
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
tmptick =
|
||||
monthdayyear(mw->month_panel.month, 1 ,mw->month_panel.year);
|
||||
tm_ret = _XLocaltime(&tmptick, localtime_buf);
|
||||
(void) strftime(buf, BUFSIZ, mw->month_panel.title_format, tm_ret);
|
||||
|
||||
str = XmStringCreateLocalized(buf);
|
||||
XtSetArg(wargs[0], XmNlabelString, str);
|
||||
XtSetValues(mw->month_panel.header, wargs, 1);
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* DayCallback is invoked from day button children.
|
||||
* It invokes MonthPanel's own callbac list, setting the type in the
|
||||
* callback struct to DAY_SELECTION, and the day field to the index of the
|
||||
* button that was pressed.
|
||||
*
|
||||
************************************************************************/
|
||||
static void DayCallback(Widget w, XtPointer client, XtPointer call)
|
||||
{
|
||||
XmMonthPanelWidget mp = (XmMonthPanelWidget) XtParent(w);
|
||||
XmMonthPanelCallbackStruct data;
|
||||
|
||||
data.type = DAY_SELECTION;
|
||||
data.day = (int) client;
|
||||
|
||||
XtCallCallbackList((Widget) mp, mp->month_panel.callback, &data);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* MonthCallback is invoked from the header button.
|
||||
* It invokes MonthPanel's own callback list, setting the type in the
|
||||
* callback struct to MONTH_SELECTION, and zeroing out the day field.
|
||||
************************************************************************/
|
||||
static void MonthCallback(Widget w, XtPointer client, XtPointer call)
|
||||
{
|
||||
XmMonthPanelWidget mp = (XmMonthPanelWidget) XtParent(w);
|
||||
XmMonthPanelCallbackStruct data;
|
||||
|
||||
data.type = MONTH_SELECTION;
|
||||
data.day = 0;
|
||||
|
||||
XtCallCallbackList((Widget) mp, mp->month_panel.callback, &data);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* XmCreateMonthPanel - convenience interface to XtCreateWidget. *
|
||||
* *
|
||||
************************************************************************/
|
||||
Widget
|
||||
XmCreateMonthPanel( Widget parent, char *name, ArgList args, Cardinal argCount )
|
||||
{
|
||||
|
||||
return ( XtCreateWidget( name,
|
||||
xmMonthPanelWidgetClass,
|
||||
parent,
|
||||
args,
|
||||
argCount ) );
|
||||
}
|
||||
92
cde/programs/dtcm/dtcm/MonthPanel.h
Normal file
92
cde/programs/dtcm/dtcm/MonthPanel.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*********************************************************************************
|
||||
** MonthPanel.h
|
||||
**
|
||||
** $XConsortium: MonthPanel.h /main/4 1995/11/03 10:16:43 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
/*
|
||||
* Month Panel widget public header file
|
||||
*/
|
||||
#ifndef _XmMonthPanel_h
|
||||
#define _XmMonthPanel_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef XmIsMonthPanel
|
||||
#define XmIsMonthPanel(w) XtIsSubclass(w, xmMonthPanelWidgetClass)
|
||||
#endif /* XmIsMonthPanel */
|
||||
|
||||
externalref WidgetClass xmMonthPanelWidgetClass;
|
||||
|
||||
typedef struct _XmMonthPanelClassRec * XmMonthPanelWidgetClass;
|
||||
typedef struct _XmMonthPanelRec * XmMonthPanelWidget;
|
||||
|
||||
typedef enum { MONTH_SELECTION, DAY_SELECTION } XmMonthPanelSelectionType;
|
||||
|
||||
typedef struct {
|
||||
XmMonthPanelSelectionType type;
|
||||
int day;
|
||||
} XmMonthPanelCallbackStruct;
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
extern Widget XmCreateMonthPanel(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList args,
|
||||
Cardinal argCount) ;
|
||||
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
/******** Resource Strings ********/
|
||||
#define XmNmonth "month"
|
||||
#define XmCMonth "Month"
|
||||
#define XmNyear "year"
|
||||
#define XmCYear "Year"
|
||||
#define XmNtitleFormat "titleFormat"
|
||||
#define XmCTitleFormat "TitleFormat"
|
||||
#define XmNactiveDays "activeDays"
|
||||
#define XmCActiveDays "ActiveDays"
|
||||
#define XmNactiveHeader "activeHeader"
|
||||
#define XmCActiveHeader "ActiveHeader"
|
||||
#define XmNshowPanelHeader "showPanelHeader"
|
||||
#define XmCShowPanelHeader "ShowPanelHeader"
|
||||
#define XmNshowColumnHeaders "showColumnHeaders"
|
||||
#define XmCShowColumnHeaders "ShowColumnHeaders"
|
||||
/*
|
||||
#define XmNshowSeparator "showSeparator"
|
||||
#define XmCShowSeparator "ShowSeparator"
|
||||
*/
|
||||
/******** End Resource Strings ********/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _XmMonthPanel_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
110
cde/programs/dtcm/dtcm/MonthPanelP.h
Normal file
110
cde/programs/dtcm/dtcm/MonthPanelP.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/*********************************************************************************
|
||||
** MonthPanelP.h
|
||||
**
|
||||
** $XConsortium: MonthPanelP.h /main/4 1995/11/03 10:16:54 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
/*
|
||||
* Month Panel widget private header file
|
||||
*/
|
||||
#ifndef _XmMonthPanelP_h
|
||||
#define _XmMonthPanelP_h
|
||||
|
||||
#include "MonthPanel.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* New fields for the MonthPanel widget class record */
|
||||
typedef struct {
|
||||
int mumble; /* No new procedures */
|
||||
} XmMonthPanelClassPart;
|
||||
|
||||
/******************************
|
||||
*
|
||||
* Class record declaration
|
||||
*
|
||||
******************************/
|
||||
typedef struct _XmMonthPanelClassRec {
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmMonthPanelClassPart month_panel_class;
|
||||
} XmMonthPanelClassRec;
|
||||
|
||||
externalref XmMonthPanelClassRec xmMonthPanelClassRec;
|
||||
|
||||
/************************************
|
||||
*
|
||||
* Month Panel instance structure.
|
||||
*
|
||||
************************************/
|
||||
typedef struct {
|
||||
/* resource fields */
|
||||
int year;
|
||||
int month;
|
||||
XtCallbackList callback;
|
||||
String title_format;
|
||||
Boolean active_header;
|
||||
Boolean active_days;
|
||||
Boolean show_panel_header;
|
||||
Boolean show_column_headers;
|
||||
Boolean show_separator;
|
||||
/* private fields */
|
||||
Widget header;
|
||||
Widget separator;
|
||||
Widget *day_labels;
|
||||
Widget *days;
|
||||
int display_rows;
|
||||
} XmMonthPanelPart;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Full instance record declaration *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
typedef struct _XmMonthPanelRec {
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmMonthPanelPart month_panel;
|
||||
} XmMonthPanelRec;
|
||||
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
|
||||
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _XmMonthPanelP_h */
|
||||
/* DON'T ADD STUFF AFTER THIS #endif */
|
||||
1543
cde/programs/dtcm/dtcm/RFCMIME.c
Normal file
1543
cde/programs/dtcm/dtcm/RFCMIME.c
Normal file
File diff suppressed because it is too large
Load Diff
22
cde/programs/dtcm/dtcm/RFCMIME.h
Normal file
22
cde/programs/dtcm/dtcm/RFCMIME.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* $XConsortium: RFCMIME.h /main/1 1995/11/03 10:17:13 rswiston $ */
|
||||
/*
|
||||
* COMPONENT_NAME: desktop
|
||||
*
|
||||
* FUNCTIONS: none
|
||||
*
|
||||
* ORIGINS: 119
|
||||
*
|
||||
* OBJECT CODE ONLY SOURCE MATERIALS
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
MIME_7BIT,
|
||||
MIME_8BIT,
|
||||
MIME_QPRINT,
|
||||
MIME_BASE64
|
||||
} Encoding;
|
||||
|
||||
typedef enum {
|
||||
CURRENT_TO_INTERNET,
|
||||
INTERNET_TO_CURRENT
|
||||
} Direction;
|
||||
756
cde/programs/dtcm/dtcm/about.c
Normal file
756
cde/programs/dtcm/dtcm/about.c
Normal file
@@ -0,0 +1,756 @@
|
||||
/* $TOG: about.c /main/7 1999/02/03 15:35:27 mgreess $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Dt/Dt.h>
|
||||
#include <EUSCompat.h>
|
||||
#include "calendar.h"
|
||||
#include "props_pu.h"
|
||||
#include "revision.h"
|
||||
|
||||
#include "icon_pixmap_xbm"
|
||||
|
||||
#ifdef CREDITS
|
||||
char *main_credits[] = {
|
||||
"Mary Hamilton",
|
||||
"Chris Kasso",
|
||||
"Martin Knutson",
|
||||
"Terre Layton",
|
||||
"Yvonne Tso",
|
||||
"J.F. Unson",
|
||||
"Janice Winsor",
|
||||
NULL
|
||||
};
|
||||
|
||||
char *also_credits[] = {
|
||||
"Brent Ayers",
|
||||
"David Curley",
|
||||
"Betty Deluco",
|
||||
"Lin-Chuan Lee",
|
||||
NULL
|
||||
};
|
||||
#endif /* CREDITS */
|
||||
|
||||
#define GAP 10
|
||||
#define TOG_GAP 10
|
||||
#define MAX_LABEL_SPACE 55
|
||||
#define XmUNSPECIFIED_ICON_SIZE 0
|
||||
#define DTCM_ABOUT "DtCMa"
|
||||
|
||||
extern Dimension ComputeMaxWidth(Widget, Widget, Widget, Widget);
|
||||
|
||||
static void close_about(Widget, XtPointer, XtPointer);
|
||||
static void destroy_about(Widget, XtPointer, XtPointer);
|
||||
static void do_credits(Widget, XtPointer, XtPointer);
|
||||
|
||||
extern String XmGetIconFileName(
|
||||
Screen *screen,
|
||||
String imageInstanceName,
|
||||
String imageClassName,
|
||||
String hostPrefix,
|
||||
unsigned int size) ;
|
||||
|
||||
/*
|
||||
* Create is popup the Calendar About dialog.
|
||||
*/
|
||||
void
|
||||
show_about(
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer cbs)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
XmString xstr = NULL;
|
||||
Dimension max_width, form_width;
|
||||
Pixmap image = 0;
|
||||
char buf[64],
|
||||
*image_filename;
|
||||
XmbTextItem text[1];
|
||||
Pixel fg, bg;
|
||||
Widget icon_label, main_form, sub_form, name_label,
|
||||
version_label, version_date, copyright_label,
|
||||
hp_label, ibm_label, novell_label, sun_label,
|
||||
separator, close_button, more_button, dialog,
|
||||
data_version_label, server_version_label;
|
||||
Display *dpy = XtDisplay(c->frame);
|
||||
Screen *screen = XtScreen(c->frame);
|
||||
struct tm tm;
|
||||
char *title;
|
||||
#if DTCM_INTERNAL_REV > 0
|
||||
char buf2[64];
|
||||
#endif
|
||||
|
||||
if (c->about_dialog) {
|
||||
XtPopup(c->about_dialog, XtGrabNone);
|
||||
XMapRaised(dpy, XtWindow(c->about_dialog));
|
||||
return;
|
||||
}
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 922, "About Calendar"));
|
||||
dialog = XtVaCreatePopupShell("about_dialog",
|
||||
xmDialogShellWidgetClass,
|
||||
c->frame,
|
||||
XmNtitle, title,
|
||||
XmNdeleteResponse, XmDESTROY,
|
||||
XmNallowShellResize, True,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
main_form =
|
||||
XtVaCreateWidget("about_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
dialog,
|
||||
XmNautoUnmanage, False,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNfractionBase, 4,
|
||||
XmNnoResize, True,
|
||||
NULL);
|
||||
|
||||
XtVaGetValues(main_form,
|
||||
XmNbackground, &bg,
|
||||
XmNforeground, &fg,
|
||||
NULL);
|
||||
|
||||
if ((image_filename = XmGetIconFileName(screen, NULL,
|
||||
DTCM_ABOUT, NULL,
|
||||
XmUNSPECIFIED_ICON_SIZE))) {
|
||||
image = XmGetPixmap(screen, image_filename, fg, bg);
|
||||
free(image_filename);
|
||||
}
|
||||
|
||||
|
||||
icon_label =
|
||||
XtVaCreateWidget("icon_label",
|
||||
xmLabelWidgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP,
|
||||
NULL);
|
||||
|
||||
if (!image || image == XmUNSPECIFIED_PIXMAP) {
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 917, "Missing\nGraphics"));
|
||||
XtVaSetValues(icon_label,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNborderWidth, 1,
|
||||
NULL);
|
||||
XmStringFree(xstr);
|
||||
} else {
|
||||
XtVaSetValues(icon_label,
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, image,
|
||||
NULL);
|
||||
}
|
||||
|
||||
sub_form =
|
||||
XtVaCreateWidget("sub_form",
|
||||
xmFormWidgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, icon_label,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNshadowThickness, 0,
|
||||
XmNshadowType, XmSHADOW_IN,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 340, "Calendar"));
|
||||
name_label =
|
||||
XtVaCreateWidget("about_name_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
sprintf(buf, "%s %d.%d.%d",
|
||||
catgets(c->DT_catd, 1, 671, "Version"),
|
||||
DtVERSION, DtREVISION, DtUPDATE_LEVEL);
|
||||
#if DTCM_INTERNAL_REV > 0
|
||||
strcpy(buf2, buf);
|
||||
sprintf(buf, "%s (%s %d)",
|
||||
buf2,
|
||||
catgets(c->DT_catd, 1, 672, "Revision"),
|
||||
DTCM_INTERNAL_REV);
|
||||
#endif
|
||||
|
||||
xstr = XmStringCreateLocalized(buf);
|
||||
version_label =
|
||||
XtVaCreateWidget("version_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, GAP,
|
||||
XmNtopWidget, name_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
sprintf(buf, "%s %d", catgets(c->DT_catd, 1, 967,
|
||||
"Calendar Server Version"),
|
||||
get_server_version(c->my_cal_handle));
|
||||
|
||||
xstr = XmStringCreateLocalized(buf);
|
||||
server_version_label =
|
||||
XtVaCreateWidget("server_version",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, version_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
sprintf(buf, "%s %d", catgets(c->DT_catd, 1, 968,
|
||||
"Calendar Data Version"),
|
||||
c->my_cal_version);
|
||||
|
||||
xstr = XmStringCreateLocalized(buf);
|
||||
data_version_label =
|
||||
XtVaCreateWidget("data_version",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, server_version_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
#if defined(DTCM_SHOW_ABOUT_COPYRIGHT)
|
||||
|
||||
tm.tm_sec = 0;
|
||||
tm.tm_min = 0;
|
||||
tm.tm_hour = 0;
|
||||
tm.tm_mday = 1;
|
||||
tm.tm_mon = DTCM_VERSION_MONTH - 1;
|
||||
tm.tm_year = DTCM_VERSION_YEAR - 1900;
|
||||
tm.tm_isdst = -1;
|
||||
|
||||
#ifdef _AIX
|
||||
sprintf( buf, "%s %d", months[tm.tm_mon + 1 ], tm.tm_year + 1900 );
|
||||
#else /* _AIX */
|
||||
strftime(buf, 64, "%B %Y", &tm);
|
||||
#endif /* _AIX */
|
||||
|
||||
xstr = XmStringCreateLocalized(buf);
|
||||
version_date =
|
||||
XtVaCreateWidget("version_date",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, data_version_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 674,
|
||||
"Copyright (c) 1993, 1994, 1995:"));
|
||||
copyright_label =
|
||||
XtVaCreateWidget("copyright_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, GAP,
|
||||
XmNtopWidget, version_date,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 675,
|
||||
"Hewlett-Packard Company"));
|
||||
hp_label =
|
||||
XtVaCreateWidget("hp_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, GAP,
|
||||
XmNtopWidget, copyright_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP * 2,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 676,
|
||||
"International Business Machines Corp."));
|
||||
ibm_label =
|
||||
XtVaCreateWidget("ibm_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, hp_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP * 2,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 677,
|
||||
"Novell, Inc."));
|
||||
novell_label =
|
||||
XtVaCreateWidget("novell_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, ibm_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP * 2,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 678,
|
||||
"Sun Microsystems, Inc."));
|
||||
sun_label =
|
||||
XtVaCreateWidget("sun_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, 0,
|
||||
XmNtopWidget, novell_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP * 2,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
#endif
|
||||
|
||||
#ifdef CREDITS
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 679, "More..."));
|
||||
more_button = XtVaCreateWidget("more_button",
|
||||
xmPushButtonGadgetClass,
|
||||
main_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNmarginWidth, 5,
|
||||
XmNtopAttachment, XmATTACH_NONE,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftOffset, GAP,
|
||||
XmNleftWidget, sub_form,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(more_button, XmNactivateCallback, do_credits,
|
||||
(XtPointer)image);
|
||||
#endif /* CREDITS */
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, GAP * 2,
|
||||
XmNtopWidget, sub_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 0,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close"));
|
||||
close_button = XtVaCreateWidget("close_button",
|
||||
xmPushButtonGadgetClass, main_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNmarginWidth, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNbottomOffset, GAP,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
|
||||
#ifdef CREDITS
|
||||
max_width = ComputeMaxWidth(more_button, close_button, NULL, NULL);
|
||||
#else
|
||||
max_width = ComputeMaxWidth(close_button, close_button, NULL, NULL);
|
||||
#endif /* CREDITS */
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(close_button, XmNactivateCallback, close_about, NULL);
|
||||
XtAddCallback(close_button, XmNdestroyCallback, destroy_about, NULL);
|
||||
|
||||
#ifdef CREDITS
|
||||
XtVaSetValues(more_button,
|
||||
XmNwidth, max_width,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, separator,
|
||||
XmNbottomOffset, GAP,
|
||||
NULL);
|
||||
#endif /* CREDITS */
|
||||
|
||||
ManageChildren(sub_form);
|
||||
ManageChildren(main_form);
|
||||
XtManageChild(main_form);
|
||||
|
||||
XtVaGetValues(main_form,
|
||||
XmNwidth, &form_width,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(close_button,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, form_width/2 - max_width/2,
|
||||
XmNwidth, max_width,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(main_form,
|
||||
XmNdefaultButton, close_button,
|
||||
XmNcancelButton, close_button,
|
||||
NULL);
|
||||
|
||||
XtPopup(dialog, XtGrabNone);
|
||||
|
||||
c->about_dialog = dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
close_about(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
XtPopdown(calendar->about_dialog);
|
||||
XtDestroyWidget(calendar->about_dialog);
|
||||
calendar->about_dialog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_about(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
calendar->about_dialog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_credits(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
calendar->credits_dialog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
close_credits(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
XtPopdown(calendar->credits_dialog);
|
||||
XtDestroyWidget(calendar->credits_dialog);
|
||||
calendar->credits_dialog = NULL;
|
||||
}
|
||||
|
||||
#ifdef CREDITS
|
||||
|
||||
/*
|
||||
* Create and popup the Credits dialog.
|
||||
*/
|
||||
static void
|
||||
do_credits(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Pixmap image = (Pixmap)client_data;
|
||||
Widget dialog, main_form, sub_form, separator, close_button,
|
||||
icon_label, title_label, label, parent, above_widget;
|
||||
XmString xstr = NULL;
|
||||
int i;
|
||||
Dimension button_width, dialog_width;
|
||||
char *title;
|
||||
|
||||
if (c->credits_dialog) {
|
||||
XtPopup(c->credits_dialog, XtGrabNone);
|
||||
return;
|
||||
}
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 681, "Calendar Contributors"));
|
||||
dialog = XtVaCreatePopupShell("contrib_dialog",
|
||||
xmDialogShellWidgetClass,
|
||||
c->frame,
|
||||
XmNtitle, title,
|
||||
XmNdeleteResponse, XmDESTROY,
|
||||
XmNallowShellResize, True,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
main_form =
|
||||
XtVaCreateWidget("credit_main_form",
|
||||
xmFormWidgetClass,
|
||||
dialog,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNnoResize, True,
|
||||
NULL);
|
||||
|
||||
icon_label =
|
||||
XtVaCreateWidget("icon_label",
|
||||
xmLabelWidgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, GAP,
|
||||
NULL);
|
||||
|
||||
if (!image || image == XmUNSPECIFIED_PIXMAP) {
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 918, "Missing\nGraphics"));
|
||||
XtVaSetValues(icon_label,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNborderWidth, 1,
|
||||
NULL);
|
||||
XmStringFree(xstr);
|
||||
} else {
|
||||
XtVaSetValues(icon_label,
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, image,
|
||||
NULL);
|
||||
}
|
||||
|
||||
sub_form =
|
||||
XtVaCreateWidget("credit_sub_form",
|
||||
xmFormWidgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, icon_label,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 682,
|
||||
"This application was brought to you by:"));
|
||||
title_label =
|
||||
XtVaCreateWidget("title_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
above_widget = title_label;
|
||||
|
||||
for (i = 0; main_credits[i]; i++) {
|
||||
xstr = XmStringCreateLocalized(main_credits[i]);
|
||||
label =
|
||||
XtVaCreateWidget("main_credit_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, above_widget,
|
||||
XmNtopOffset, 0,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 90,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
above_widget = label;
|
||||
XmStringFree(xstr);
|
||||
}
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 1002,
|
||||
"Also contributing:"));
|
||||
title_label =
|
||||
XtVaCreateWidget("title_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, above_widget,
|
||||
XmNtopOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
above_widget = title_label;
|
||||
|
||||
for (i = 0; also_credits[i]; i++) {
|
||||
xstr = XmStringCreateLocalized(also_credits[i]);
|
||||
label =
|
||||
XtVaCreateWidget("credit_label",
|
||||
xmLabelWidgetClass,
|
||||
sub_form,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, above_widget,
|
||||
XmNtopOffset, 0,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 90,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
above_widget = label;
|
||||
XmStringFree(xstr);
|
||||
}
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
main_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopOffset, GAP * 2,
|
||||
XmNtopWidget, sub_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 0,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close"));
|
||||
close_button = XtVaCreateWidget("close_button",
|
||||
xmPushButtonGadgetClass, main_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNmarginWidth, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNbottomOffset, GAP,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(close_button, XmNactivateCallback, close_credits, NULL);
|
||||
XtAddCallback(close_button, XmNdestroyCallback, destroy_credits, NULL);
|
||||
|
||||
ManageChildren(sub_form);
|
||||
ManageChildren(main_form);
|
||||
XtManageChild(main_form);
|
||||
|
||||
XtVaGetValues(dialog,
|
||||
XmNwidth, &dialog_width,
|
||||
NULL);
|
||||
XtVaGetValues(close_button,
|
||||
XmNwidth, &button_width,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(close_button,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, dialog_width/2 - button_width/2,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(main_form, XmNdefaultButton, close_button, NULL);
|
||||
XtVaSetValues(main_form, XmNcancelButton, close_button, NULL);
|
||||
|
||||
XtPopup(dialog, XtGrabNone);
|
||||
|
||||
c->credits_dialog = dialog;
|
||||
}
|
||||
|
||||
#endif /* CREDITS */
|
||||
679
cde/programs/dtcm/dtcm/alarm.c
Normal file
679
cde/programs/dtcm/dtcm/alarm.c
Normal file
@@ -0,0 +1,679 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** alarm.c
|
||||
**
|
||||
** $XConsortium: alarm.c /main/4 1995/12/04 14:15:43 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)alarm.c 1.50 95/07/27 Copyr 1991 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Dt/Wsm.h>
|
||||
#include <Dt/Session.h>
|
||||
#include "calendar.h"
|
||||
#include "alarm.h"
|
||||
#include "misc.h"
|
||||
#include "props_pu.h"
|
||||
#include "timeops.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef AIX
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
/* Structure used on a save session to see if a dt is iconic */
|
||||
typedef struct
|
||||
{
|
||||
int state;
|
||||
Window icon;
|
||||
} WM_STATE;
|
||||
|
||||
|
||||
|
||||
extern int debug;
|
||||
extern int submit_mail(
|
||||
const char * to, const char * subject, const char * body);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Functions external to alarm.c
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
extern void
|
||||
view_flasher(XtPointer client_data, XtIntervalId *interval_id) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Atom wmStateAtom, actualType;
|
||||
int actualFormat;
|
||||
unsigned long nitems, leftover;
|
||||
WM_STATE *wmState;
|
||||
|
||||
/* Getting the WM_STATE property to see if iconified or not */
|
||||
wmStateAtom = XInternAtom(XtDisplay(c->frame), "WM_STATE", False);
|
||||
|
||||
XGetWindowProperty (XtDisplay(c->frame), XtWindow(c->frame),
|
||||
wmStateAtom, 0L,
|
||||
(long)BUFSIZ, False, wmStateAtom, &actualType,
|
||||
&actualFormat, &nitems, &leftover,
|
||||
(unsigned char **) &wmState);
|
||||
|
||||
if (wmState->state == IconicState) {
|
||||
|
||||
XtVaSetValues(c->frame, XmNiconPixmap, NULL, NULL);
|
||||
if (c->view->flashes % 2) {
|
||||
if (c->icon && c->icon->icon && c->icon->icon_mask)
|
||||
XtVaSetValues(c->frame,
|
||||
XmNiconPixmap, c->icon->icon, NULL);
|
||||
} else {
|
||||
if (c->icon_inverted && c->icon_inverted->icon
|
||||
&& c->icon_inverted->icon_mask)
|
||||
XtVaSetValues(c->frame,
|
||||
XmNiconPixmap, c->icon_inverted->icon, NULL);
|
||||
}
|
||||
XFlush(c->xcontext->display);
|
||||
}
|
||||
else {
|
||||
XWindowAttributes window_attributes;
|
||||
|
||||
XGetWindowAttributes(c->xcontext->display,
|
||||
XtWindowOfObject(c->form),
|
||||
&window_attributes);
|
||||
|
||||
XFillRectangle(c->xcontext->display,
|
||||
XtWindowOfObject(c->form),
|
||||
c->xcontext->invert_gc,
|
||||
0, 0,
|
||||
window_attributes.width,
|
||||
window_attributes.height);
|
||||
XFlush(c->xcontext->display);
|
||||
}
|
||||
|
||||
c->view->flashes -= 1;
|
||||
if (c->view->flashes != 0)
|
||||
XtAppAddTimeOut(c->xcontext->app, 250, view_flasher, c);
|
||||
else {
|
||||
/* really nasty kludge code to force a complete repaint of
|
||||
the form. It is possible to have damage occur during
|
||||
the flashing feedback, and this can clean it up. */
|
||||
|
||||
XUnmapWindow(c->xcontext->display, XtWindowOfObject(c->form));
|
||||
XMapWindow(c->xcontext->display, XtWindowOfObject(c->form));
|
||||
|
||||
/* Make sure the correct icon is restored. */
|
||||
if (wmState->state == IconicState) {
|
||||
if (c->icon && c->icon->icon && c->icon->icon_mask)
|
||||
XtVaSetValues(c->frame,
|
||||
XmNiconPixmap, c->icon->icon, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
flash_it(XtPointer client_data, XtIntervalId *interval_id) {
|
||||
int i, j;
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
|
||||
if (c->view->flashes == 0) {
|
||||
c->view->flashes = 10;
|
||||
XtAppAddTimeOut(c->xcontext->app, 250, view_flasher, c);
|
||||
}
|
||||
|
||||
/* if the application is busy delivering a flash reminder,
|
||||
don't deliver another one. */
|
||||
}
|
||||
|
||||
extern void
|
||||
mail_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference *r) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
int hr;
|
||||
Lines *lines = NULL, *l = NULL;
|
||||
Props *p = (Props *)c->properties;
|
||||
Boolean pm;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
Dtcm_appointment *appt;
|
||||
char subbuf[BUFSIZ], bodybuf[BUFSIZ];
|
||||
char datebuf[200], startbuf[100], stopbuf[100];
|
||||
char whatbuf[BUFSIZ];
|
||||
char *to;
|
||||
CSA_return_code stat;
|
||||
Tick start, stop;
|
||||
char *addr_data = NULL;
|
||||
|
||||
appt = allocate_appt_struct(appt_read,
|
||||
c->general->version,
|
||||
CSA_ENTRY_ATTR_START_DATE_I,
|
||||
CSA_ENTRY_ATTR_SUMMARY_I,
|
||||
CSA_ENTRY_ATTR_ORGANIZER_I,
|
||||
CSA_X_DT_ENTRY_ATTR_SHOWTIME_I,
|
||||
CSA_ENTRY_ATTR_END_DATE_I,
|
||||
CSA_ENTRY_ATTR_MAIL_REMINDER_I,
|
||||
NULL);
|
||||
|
||||
stat = query_appt_struct(c->cal_handle, r->entry, appt);
|
||||
|
||||
backend_err_msg(c->frame, c->calname, stat,
|
||||
((Props_pu *)c->properties_pu)->xm_error_pixmap);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_appt_struct(&appt);
|
||||
return;
|
||||
}
|
||||
|
||||
/* compose to field */
|
||||
if (appt->mail->value->item.reminder_value->reminder_data.data == NULL ||
|
||||
(appt->mail->value->item.reminder_value->reminder_data.size == 0)) {
|
||||
/* empty recipient */
|
||||
if (debug)
|
||||
fprintf(stderr, catgets(c->DT_catd, 1, 1,
|
||||
"dtcm: empty recipient in mail reminder\n"));
|
||||
to = appt->author->value->item.calendar_user_value->user_name;
|
||||
} else {
|
||||
addr_data = calloc(appt->mail->value->item.reminder_value->reminder_data.size + 1, 1);
|
||||
strncpy(addr_data, (char *) appt->mail->value->item.reminder_value->reminder_data.data, appt->mail->value->item.reminder_value->reminder_data.size);
|
||||
to = addr_data;
|
||||
}
|
||||
|
||||
/* compose subject field */
|
||||
lines = text_to_lines(appt->what->value->item.string_value, 5);
|
||||
sprintf(subbuf, catgets(c->DT_catd, 1, 2, "Reminder- %s"),
|
||||
(lines) ? lines->s : "\0");
|
||||
|
||||
/* compose message body */
|
||||
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &start);
|
||||
format_tick(start, ORDER_MDY, SEPARATOR_SLASH, datebuf);
|
||||
|
||||
if (showtime_set(appt) && !magic_time(start)) {
|
||||
hr = hour(start);
|
||||
pm = (dt == HOUR12 && !adjust_hour(&hr)) ? True : False;
|
||||
if (dt == HOUR12) {
|
||||
sprintf(startbuf, "%2d:%02d %s", hr, minute(start),
|
||||
pm ? "pm" :
|
||||
"am");
|
||||
} else {
|
||||
sprintf(startbuf, "%02d%02d", hr, minute(start));
|
||||
}
|
||||
} else
|
||||
startbuf[0] = '\0';
|
||||
|
||||
if (showtime_set(appt) && !magic_time(start) && appt->end_time) {
|
||||
_csa_iso8601_to_tick(appt->end_time->value->\
|
||||
item.date_time_value, &stop);
|
||||
hr = hour(stop);
|
||||
pm = (dt == HOUR12 && !adjust_hour(&hr)) ? True : False;
|
||||
if (dt == HOUR12) {
|
||||
sprintf(stopbuf, "%2d:%02d %s", hr, minute(stop),
|
||||
pm ? catgets(c->DT_catd, 1, 3, "pm") :
|
||||
catgets(c->DT_catd, 1, 4, "am"));
|
||||
} else {
|
||||
sprintf(stopbuf, "%02d%02d", hr, minute(stop));
|
||||
}
|
||||
} else
|
||||
stopbuf[0] = '\0';
|
||||
|
||||
if (l = lines) {
|
||||
sprintf(whatbuf, "%s\n", l->s);
|
||||
l = l->next;
|
||||
} else
|
||||
whatbuf[0] = '\0';
|
||||
|
||||
while(l != NULL) {
|
||||
strcat(whatbuf, "\t\t");
|
||||
strcat(whatbuf, l->s);
|
||||
strcat(whatbuf, "\n");
|
||||
l = l->next;
|
||||
}
|
||||
if (lines)
|
||||
destroy_lines(lines);
|
||||
|
||||
if (stopbuf[0] != '\0') {
|
||||
sprintf(bodybuf, catgets(c->DT_catd, 1, 7, "\n\n\t** Calendar Appointment **\n\n\tDate:\t%s\n\tStart:\t%s\n\tEnd:\t%s\n\tWhat:\t%s"),
|
||||
datebuf, startbuf, stopbuf, whatbuf);
|
||||
} else {
|
||||
sprintf(bodybuf, catgets(c->DT_catd, 1, 1100, "\n\n\t** Calendar To Do Item **\n\n\tDue Date:\t%s\n\tTime Due:\t%s\n\tWhat:\t\t%s"),
|
||||
datebuf, startbuf, whatbuf);
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr, "to = `%s`\n", to);
|
||||
fprintf(stderr, "subject = `%s`\n", subbuf);
|
||||
fprintf(stderr, "body = `%s`\n", bodybuf);
|
||||
}
|
||||
|
||||
(void)submit_mail(to, subbuf, bodybuf);
|
||||
|
||||
free_appt_struct(&appt);
|
||||
|
||||
if (addr_data)
|
||||
free(addr_data);
|
||||
}
|
||||
|
||||
extern void
|
||||
open_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference *r) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
|
||||
postup_show_proc(c, r);
|
||||
}
|
||||
|
||||
extern void
|
||||
reminder_driver(XtPointer client_data, XtIntervalId *interval_id) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Tick run_tick;
|
||||
int i;
|
||||
|
||||
if (c->view->next_alarm_id != *interval_id || !c->view->next_alarm) {
|
||||
c->view->next_alarm_id = 0;
|
||||
reset_timer(c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* do not handle the reminder if the time it's to happen
|
||||
* is earlier than the current time
|
||||
*/
|
||||
_csa_iso8601_to_tick(c->view->next_alarm[0].run_time, &run_tick);
|
||||
if (now() >= run_tick) {
|
||||
|
||||
for (i = 0; i < c->view->next_alarm_count; i++) {
|
||||
if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_AUDIO_REMINDER)==0)
|
||||
ring_it(client_data, interval_id);
|
||||
else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_FLASHING_REMINDER)==0)
|
||||
flash_it(client_data, interval_id);
|
||||
else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_POPUP_REMINDER)==0)
|
||||
open_it(client_data, interval_id, &c->view->next_alarm[i]);
|
||||
else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_MAIL_REMINDER)==0)
|
||||
mail_it(client_data, interval_id, &c->view->next_alarm[i]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
c->view->next_alarm_id = 0;
|
||||
|
||||
reset_timer(c);
|
||||
}
|
||||
|
||||
extern void
|
||||
bell_ringer(XtPointer client_data, XtIntervalId *interval_id) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
XBell(c->xcontext->display, 50);
|
||||
c->view->rings -= 1;
|
||||
if (c->view->rings != 0)
|
||||
XtAppAddTimeOut(c->xcontext->app, 250, bell_ringer, c);
|
||||
}
|
||||
|
||||
extern void
|
||||
ring_it(XtPointer client_data, XtIntervalId *interval_id) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
|
||||
if (c->view->rings == 0) {
|
||||
c->view->rings = 5;
|
||||
XtAppAddTimeOut(c->xcontext->app, 250, bell_ringer, c);
|
||||
}
|
||||
|
||||
/* If the application is busy delivering a ring reminder
|
||||
don't deliver another one. */
|
||||
}
|
||||
|
||||
/*
|
||||
* Close dialog: pop down and destroy the dialog, and free
|
||||
* associated memory.
|
||||
*/
|
||||
static void
|
||||
close_cb(Widget w, XtPointer data, XtPointer ignore)
|
||||
{
|
||||
Widget shell = (Widget) data;
|
||||
|
||||
XtPopdown(shell);
|
||||
XtDestroyWidget(shell);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Functions to build and popup the postup reminder
|
||||
*/
|
||||
extern void
|
||||
postup_show_proc(Calendar *c, CSA_reminder_reference *r) {
|
||||
int start_hr, stop_hr;
|
||||
char text[BUFSIZ];
|
||||
time_t st, sp = 0;
|
||||
Lines *lines, *l = NULL;
|
||||
Props *p = (Props *)c->properties;
|
||||
Widget pu_frame, pu_base_form,
|
||||
pu_text_form, separator,
|
||||
pu_form, button_form, pu_date,
|
||||
pu_range, pu_image, pu_close, line, last_line;
|
||||
Boolean start_am, stop_am;
|
||||
XmString xmstr;
|
||||
CSA_return_code stat;
|
||||
DisplayType dis_t = get_int_prop(p, CP_DEFAULTDISP);
|
||||
OrderingType ord_t = get_int_prop(p, CP_DATEORDERING);
|
||||
SeparatorType sep_t = get_int_prop(p, CP_DATESEPARATOR);
|
||||
Dtcm_appointment *appt;
|
||||
char *title;
|
||||
|
||||
if (!c->postup)
|
||||
c->postup = XtAppCreateShell("calendar_postup", "Dtcm",
|
||||
xmDialogShellWidgetClass, c->xcontext->display,
|
||||
NULL, 0);
|
||||
|
||||
/*
|
||||
** Create the Motif objects
|
||||
*/
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 839, "Calendar : Reminder"));
|
||||
pu_frame = XtVaCreatePopupShell("pu_frame",
|
||||
topLevelShellWidgetClass, c->postup,
|
||||
XmNtitle, title,
|
||||
XmNmwmFunctions, MWM_FUNC_MOVE | MWM_FUNC_CLOSE,
|
||||
XmNdeleteResponse, XmDESTROY,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
pu_base_form = XtVaCreateWidget("pu_base_form",
|
||||
xmFormWidgetClass, pu_frame,
|
||||
NULL);
|
||||
|
||||
pu_text_form = XtVaCreateWidget("pu_test_form",
|
||||
xmFormWidgetClass, pu_base_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 1,
|
||||
XmNrightOffset, 1,
|
||||
XmNtopOffset, 1,
|
||||
NULL);
|
||||
|
||||
pu_image = XtVaCreateWidget("pu_image",
|
||||
xmLabelGadgetClass, pu_text_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 5,
|
||||
XmNlabelType, XmPIXMAP,
|
||||
XmNlabelPixmap, ((Props_pu *)c->properties_pu)->postup_pixmap,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("pu_form",
|
||||
xmFormWidgetClass, pu_base_form,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNbottomOffset, 2,
|
||||
XmNleftOffset, 1,
|
||||
XmNrightOffset, 1,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNfractionBase, 3,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close"));
|
||||
pu_close = XtVaCreateManagedWidget("close",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNrightPosition, 2,
|
||||
XmNbottomOffset, 1,
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
pu_base_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, pu_text_form,
|
||||
XmNtopOffset, 1,
|
||||
NULL);
|
||||
|
||||
|
||||
pu_form = XtVaCreateWidget("pu_form",
|
||||
xmFormWidgetClass, pu_text_form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 1,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, pu_image,
|
||||
XmNverticalSpacing, 10,
|
||||
NULL);
|
||||
|
||||
pu_date = XtVaCreateWidget("pu_date",
|
||||
xmLabelGadgetClass, pu_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
pu_range = XtVaCreateWidget("pu_range",
|
||||
xmLabelGadgetClass, pu_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, pu_date,
|
||||
XmNtopOffset, 8,
|
||||
NULL);
|
||||
|
||||
XtAddCallback(pu_close, XmNactivateCallback, close_cb, pu_frame);
|
||||
|
||||
appt = allocate_appt_struct(appt_read,
|
||||
c->general->version,
|
||||
CSA_ENTRY_ATTR_START_DATE_I,
|
||||
CSA_ENTRY_ATTR_END_DATE_I,
|
||||
CSA_ENTRY_ATTR_SUMMARY_I,
|
||||
CSA_X_DT_ENTRY_ATTR_SHOWTIME_I,
|
||||
NULL);
|
||||
stat = query_appt_struct(c->cal_handle, r->entry, appt);
|
||||
backend_err_msg(c->frame, c->calname, stat,
|
||||
((Props_pu *)c->properties_pu)->xm_error_pixmap);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_appt_struct(&appt);
|
||||
return;
|
||||
}
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &st);
|
||||
if (appt->end_time)
|
||||
_csa_iso8601_to_tick(appt->end_time->value->\
|
||||
item.date_time_value, &sp);
|
||||
l = lines = text_to_lines(appt->what->value->item.string_value, 5);
|
||||
last_line = 0;
|
||||
while (l) {
|
||||
xmstr = XmStringCreateLocalized(l->s);
|
||||
line = XtVaCreateWidget("text_line",
|
||||
xmLabelGadgetClass, pu_text_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, pu_form,
|
||||
XmNleftOffset, 15,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
if (last_line)
|
||||
XtVaSetValues(line,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, last_line,
|
||||
XmNtopOffset, 8,
|
||||
NULL);
|
||||
else
|
||||
XtVaSetValues(line,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 8,
|
||||
NULL);
|
||||
|
||||
last_line = line;
|
||||
l = l->next;
|
||||
}
|
||||
if (lines)
|
||||
destroy_lines(lines);
|
||||
|
||||
/*
|
||||
** Now fill in the correct information
|
||||
*/
|
||||
set_date_in_widget(st, pu_date, ord_t, sep_t);
|
||||
|
||||
if (!showtime_set(appt) || magic_time(st))
|
||||
text[0] = '\0';
|
||||
else {
|
||||
start_hr = hour(st);
|
||||
if (sp) stop_hr = hour(sp);
|
||||
if (dis_t == HOUR12) {
|
||||
start_am = adjust_hour(&start_hr);
|
||||
if (sp) {
|
||||
/* NL_COMMENT
|
||||
|
||||
Message 1087 : This message is used to form
|
||||
the alarm string that appears in the
|
||||
reminder popup. In the C locale it would
|
||||
look something like this:
|
||||
|
||||
``From 11:00am to 1:00pm''
|
||||
|
||||
In the printf conversion string the $n are:
|
||||
|
||||
$1 -> start hour
|
||||
$2 -> start minute
|
||||
$3 -> am or pm
|
||||
$4 -> stop hour
|
||||
$5 -> stop minute
|
||||
$6 -> am or pm
|
||||
|
||||
*/
|
||||
char *am = XtNewString(catgets(c->DT_catd,
|
||||
1, 4, "am"));
|
||||
char *pm = XtNewString(catgets(c->DT_catd,
|
||||
1, 3, "pm"));
|
||||
stop_am = adjust_hour(&stop_hr);
|
||||
sprintf(text, catgets(c->DT_catd, 1, 1087,
|
||||
"From %1$2d:%2$02d%3$s to %4$2d:%5$02d%6$s"),
|
||||
start_hr, minute(st),
|
||||
(start_am) ? am : pm,
|
||||
stop_hr, minute(sp),
|
||||
(stop_am) ? am : pm
|
||||
);
|
||||
XtFree(am);
|
||||
XtFree(pm);
|
||||
} else {
|
||||
/* NL_COMMENT
|
||||
|
||||
Message 1088 : This message is used to form
|
||||
the alarm string that appears in the
|
||||
reminder popup. It is used when an appt
|
||||
does not have and ``end'' time. In the
|
||||
C locale it would look something like this:
|
||||
|
||||
``11:00am''
|
||||
|
||||
In the printf conversion string the $n are:
|
||||
|
||||
$1 -> start hour
|
||||
$2 -> start minute
|
||||
$3 -> am or pm
|
||||
|
||||
*/
|
||||
char *meridian =
|
||||
XtNewString ((start_am) ?
|
||||
catgets(c->DT_catd, 1, 4, "am"):
|
||||
catgets(c->DT_catd, 1, 3, "pm"));
|
||||
|
||||
sprintf(text, catgets(c->DT_catd, 1, 1088,
|
||||
"%1$2d:%2$02d%3$s"),
|
||||
start_hr, minute(st), meridian
|
||||
);
|
||||
XtFree(meridian);
|
||||
}
|
||||
} else {
|
||||
if (sp) {
|
||||
/* NL_COMMENT
|
||||
|
||||
Message 1089 : This message is used to form
|
||||
the alarm string that appears in the
|
||||
reminder popup. This string is used when
|
||||
a user has asked that times be displayed
|
||||
in 24 hour format. In the C locale it
|
||||
would look something like this:
|
||||
|
||||
``From 0100 to 1600''
|
||||
|
||||
In the printf conversion string the $n are:
|
||||
|
||||
$1 -> start hour
|
||||
$2 -> start minute
|
||||
$3 -> stop hour
|
||||
$4 -> stop minute
|
||||
|
||||
*/
|
||||
sprintf(text, catgets(c->DT_catd, 1, 1089,
|
||||
"From %1$02d%2$02d to %3$02d%4$02d"),
|
||||
start_hr, minute(st), stop_hr,
|
||||
minute(sp));
|
||||
} else {
|
||||
/* NL_COMMENT
|
||||
|
||||
Message 1090 : This message is used to form
|
||||
the alarm string that appears in the
|
||||
reminder popup. This string is used when
|
||||
an appt does not have an end time and the
|
||||
user has asked that times be displayed
|
||||
in 24 hour format. In the C locale it
|
||||
would look something like this:
|
||||
|
||||
``1600''
|
||||
|
||||
In the printf conversion string the $n are:
|
||||
|
||||
$1 -> start hour
|
||||
$2 -> start minute
|
||||
|
||||
*/
|
||||
sprintf(text, catgets(c->DT_catd, 1, 1090,
|
||||
"%1$02d%2$02d"),
|
||||
start_hr, minute(st));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free_appt_struct(&appt);
|
||||
xmstr = XmStringCreateLocalized(text);
|
||||
XtVaSetValues(pu_range, XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
ManageChildren(pu_form);
|
||||
ManageChildren(pu_base_form);
|
||||
ManageChildren(pu_text_form);
|
||||
XtManageChild(pu_base_form);
|
||||
XtVaSetValues(button_form, XmNdefaultButton, pu_close, NULL);
|
||||
XtVaSetValues(button_form, XmNcancelButton, pu_close, NULL);
|
||||
XtPopup(pu_frame, XtGrabNone);
|
||||
DtWsmOccupyAllWorkspaces(c->xcontext->display, XtWindow(pu_frame));
|
||||
}
|
||||
45
cde/programs/dtcm/dtcm/alarm.h
Normal file
45
cde/programs/dtcm/dtcm/alarm.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** alarm.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)alarm.h 1.8 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: alarm.h /main/3 1995/11/03 10:17:51 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _ALARM_H
|
||||
#define _ALARM_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
|
||||
extern void compose P((Calendar*, CSA_reminder_reference *, char**));
|
||||
extern void flash_it P((XtPointer, XtIntervalId*));
|
||||
extern void mail_it P((XtPointer, XtIntervalId*, CSA_reminder_reference *));
|
||||
extern void open_it P((XtPointer, XtIntervalId*, CSA_reminder_reference *));
|
||||
extern void postup_show_proc P((Calendar*, CSA_reminder_reference *));
|
||||
extern void reminder_driver P((XtPointer, XtIntervalId*));
|
||||
extern void ring_it P((XtPointer, XtIntervalId*));
|
||||
extern void slp P((int x));
|
||||
|
||||
#endif
|
||||
814
cde/programs/dtcm/dtcm/blist.c
Normal file
814
cde/programs/dtcm/dtcm/blist.c
Normal file
@@ -0,0 +1,814 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** blist.c
|
||||
**
|
||||
** $TOG: blist.c /main/5 1999/02/08 17:02:59 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)blist.c 1.66 95/03/28 Copyr 1994 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include "browser.h"
|
||||
#include "calendar.h"
|
||||
#include "util.h"
|
||||
#include "misc.h"
|
||||
#include "timeops.h"
|
||||
#include "blist.h"
|
||||
#include "props.h"
|
||||
#include "help.h"
|
||||
|
||||
|
||||
static void
|
||||
bl_pending_change(Widget w, XtPointer data, XtPointer cbs) {
|
||||
Calendar *c = (Calendar *) data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
if (bl->bl_pending_message_up == False) {
|
||||
/* NL_COMMENT
|
||||
Attention Translator:
|
||||
|
||||
Message 841 is used in the Menu Editor's footer. The
|
||||
Menu Editor is accessed through the browse menu. The
|
||||
message is displayed when something is typed into the User
|
||||
Name field in the editor. If the translated footer message
|
||||
is too long it causes the menu editor to grow horizontally
|
||||
which we do not want. If you notice that the translated
|
||||
string causes the editor to grow horizontally please
|
||||
insert a newline (\n) character somewhere in the middle
|
||||
of the string so the footer will use two lines and the
|
||||
editor will grow vertically.
|
||||
*/
|
||||
set_message(bl->message, catgets(c->DT_catd, 1, 841, "Click on \"Add Name\" to add a name, \"Apply\" to commit changes."));
|
||||
bl->bl_pending_message_up = True;
|
||||
XtSetSensitive(bl->add_button, True);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_clear_pending_change(Browselist *bl) {
|
||||
|
||||
if (bl->bl_pending_message_up == True) {
|
||||
set_message(bl->message, " ");
|
||||
bl->bl_pending_message_up = False;
|
||||
XtSetSensitive(bl->add_button, False);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_list_is_changed(Browselist *bl) {
|
||||
|
||||
if (bl->bl_list_changed == False) {
|
||||
bl->bl_list_changed = True;
|
||||
XtSetSensitive(bl->ok_button, True);
|
||||
XtSetSensitive(bl->apply_button, True);
|
||||
XtSetSensitive(bl->reset_button, True);
|
||||
XtVaSetValues(bl->form, XmNdefaultButton, bl->apply_button, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_list_not_changed(Browselist *bl) {
|
||||
|
||||
bl->bl_list_changed = False;
|
||||
XtSetSensitive(bl->ok_button, False);
|
||||
XtSetSensitive(bl->apply_button, False);
|
||||
XtSetSensitive(bl->reset_button, False);
|
||||
XtVaSetValues(bl->form, XmNdefaultButton, bl->cancel_button, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_list_selection_cb(Widget w, XtPointer data, XtPointer cbs) {
|
||||
Calendar *c = (Calendar *) data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
int *pos_list, pos_cnt;
|
||||
|
||||
XmListGetSelectedPos(bl->browse_list, &pos_list, &pos_cnt);
|
||||
if (pos_cnt <= 0)
|
||||
XtSetSensitive(bl->remove_button, False);
|
||||
else
|
||||
XtSetSensitive(bl->remove_button, True);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the name from the UI and from the list if the calendar handle is NULL.
|
||||
* If the calendar handle is not null, tag it as deleted and it will be taken
|
||||
* care of later.
|
||||
*/
|
||||
static void
|
||||
blist_removenames(Widget widget, XtPointer client_data, XtPointer call_data) {
|
||||
int i, idx, valid_cnt, *pos_list, pos_cnt;
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
BlistData *bd = NULL;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
int rejected_name = 0;
|
||||
|
||||
set_message(bl->message, " ");
|
||||
XmListGetSelectedPos(bl->browse_list, &pos_list, &pos_cnt);
|
||||
if (pos_cnt <= 0) {
|
||||
set_message(bl->message, catgets(calendar->DT_catd, 1, 17,
|
||||
"Select a name to remove"));
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < pos_cnt; i++) {
|
||||
if (pos_list[i] == 1) {
|
||||
set_message(bl->message, catgets(calendar->DT_catd, 1,
|
||||
16, "You may not remove the default calendar"));
|
||||
rejected_name++;
|
||||
continue;
|
||||
}
|
||||
|
||||
XmListDeletePos(bl->browse_list, pos_list[i] - i + rejected_name);
|
||||
bd = (BlistData *)CmDataListGetData(bl->blist_data, pos_list[i]);
|
||||
|
||||
if (bd)
|
||||
{
|
||||
bd->tag = BLIST_DELETE;
|
||||
}
|
||||
}
|
||||
blist_clean(bl, False);
|
||||
bl_list_is_changed(bl);
|
||||
}
|
||||
|
||||
/*
|
||||
* Append the new name to the list and set the necessary tags. Note this only
|
||||
* adds the name to the linked list - not to the UI. Also, it won't add a
|
||||
* duplicate name.
|
||||
*/
|
||||
static int
|
||||
blist_name_append(Calendar *c, char *name, BlistTag t) {
|
||||
int i = 1;
|
||||
Boolean marked = False;
|
||||
int location = 2;
|
||||
BlistData *bd;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
char *defname;
|
||||
|
||||
|
||||
/* This while loop is doing double duty here. The primary
|
||||
purpose of the list is to find out if the name we're
|
||||
inserting is already in the list. While looping thru,
|
||||
the secondary purpose is to find the lexicographical
|
||||
position of the name relative to the current set of entries.
|
||||
The business about marked and location is related to that
|
||||
second purpose. */
|
||||
|
||||
while ((bd = (BlistData *)CmDataListGetData(bl->blist_data, i)) &&
|
||||
strcmp(bd->name, name) != 0)
|
||||
{
|
||||
if ((marked == False) && (strcoll(name, bd->name) < 0) &&
|
||||
(i != 1)) {
|
||||
location = i;
|
||||
marked = True;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
||||
if (bd) {
|
||||
/* Since the user may have hit the reset button, any items
|
||||
* that had been marked for deletion need to be made active.
|
||||
*/
|
||||
if (bd->tag == BLIST_DELETE)
|
||||
bd->tag = BLIST_ACTIVE;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* 2 special cases here. If the name is that of the calendar
|
||||
owner, it should always be at the head of the list. If the
|
||||
name wasn't maked against any of the people on the list,
|
||||
then it should be inserted at the end. */
|
||||
|
||||
defname = get_user_calendar();
|
||||
if (strcmp(defname, name) == 0) {
|
||||
location = 1;
|
||||
} else if (marked == False) {
|
||||
location = i;
|
||||
}
|
||||
free(defname);
|
||||
|
||||
bd = (BlistData *)ckalloc(sizeof(BlistData));
|
||||
bd->name = cm_strdup(name);
|
||||
bd->tag = t;
|
||||
bd->cal_handle = NULL;
|
||||
CmDataListAdd(bl->blist_data, (void *)bd, location);
|
||||
|
||||
return location;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for the add name button. This simply calls the blist_name_append
|
||||
* function and adds the name to the UI.
|
||||
*/
|
||||
static void
|
||||
blist_addname(Widget widget, XtPointer client_data, XtPointer cbs) {
|
||||
char *new_name, *end_ptr, buf[MAXNAMELEN];
|
||||
XEvent *e = ((XmAnyCallbackStruct *)cbs)->event;
|
||||
XmString xmstr;
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
int insert_location;
|
||||
|
||||
|
||||
XtVaSetValues(bl->form, XmNresizePolicy, XmRESIZE_NONE, NULL);
|
||||
bl_clear_pending_change(bl);
|
||||
bl_list_is_changed(bl);
|
||||
set_message(bl->message, " ");
|
||||
new_name = XmTextFieldGetString(bl->username);
|
||||
|
||||
/* crush out leading white space for the name
|
||||
comparison/insert process */
|
||||
|
||||
while ((*new_name == ' ') || (*new_name == '\t'))
|
||||
new_name++;
|
||||
|
||||
/* compress off trailing whitespace */
|
||||
|
||||
end_ptr = new_name;
|
||||
while (*end_ptr)
|
||||
end_ptr++;
|
||||
while ((end_ptr > new_name) &&
|
||||
((*(end_ptr - 1) == ' ') || (*(end_ptr - 1) == '\t')))
|
||||
end_ptr--;
|
||||
|
||||
*end_ptr = NULL;
|
||||
|
||||
|
||||
if (blank_buf(new_name)) {
|
||||
set_message(bl->message, catgets(c->DT_catd, 1, 603,
|
||||
"Type a name to add in the User Name field"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (embedded_blank(new_name)) {
|
||||
set_message(bl->message, catgets(c->DT_catd, 1, 684,
|
||||
"User Names may not have embedded blanks or tabs"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ((insert_location = blist_name_append(c, new_name, BLIST_INSERT)) != -1) {
|
||||
xmstr = XmStringCreateLocalized(new_name);
|
||||
XmListAddItem(bl->browse_list, xmstr, insert_location);
|
||||
XmStringFree(xmstr);
|
||||
cm_select_text(bl->username, e->xbutton.time);
|
||||
} else {
|
||||
sprintf(buf, "%s %s", new_name,
|
||||
catgets(c->DT_catd, 1, 604, "is already in the list"));
|
||||
set_message(bl->message, buf);
|
||||
}
|
||||
XtVaSetValues(bl->form, XmNresizePolicy, XmRESIZE_ANY, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This sends the new list of names to the properties database. Note it ignores
|
||||
* items that have been tagged for deletion.
|
||||
*/
|
||||
static void
|
||||
blist_write_list(Browselist *bl, Props *p) {
|
||||
int i, len = 0;
|
||||
char *buf;
|
||||
BlistData *bd;
|
||||
|
||||
/*
|
||||
* First pass, count the number of bytes we're going to need
|
||||
*/
|
||||
for (i = 1; i <= bl->blist_data->count; i++) {
|
||||
bd = (BlistData *)CmDataListGetData(bl->blist_data, i);
|
||||
if (bd && bd->name && bd->tag != BLIST_DELETE)
|
||||
len += cm_strlen(bd->name) + 2; /* one for spacing */
|
||||
}
|
||||
if (len <= 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We have names, so build the string, making sure to exclude items
|
||||
* tagged for delete.
|
||||
*/
|
||||
buf = (char *)ckalloc(len);
|
||||
memset(buf, '\0', len);
|
||||
for (i = 1; i <= bl->blist_data->count; i++) {
|
||||
bd = (BlistData *)CmDataListGetData(bl->blist_data, i);
|
||||
if (bd && bd->name && bd->tag != BLIST_DELETE) {
|
||||
cm_strcat(buf, bd->name);
|
||||
cm_strcat(buf, " ");
|
||||
bd->tag = BLIST_ACTIVE;
|
||||
}
|
||||
}
|
||||
set_char_prop(p, CP_DAYCALLIST, buf);
|
||||
save_props(p);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for the OK button - will write the list to the properties
|
||||
* database, will update the browse menu on the main menu, and will update the
|
||||
* menu on the multi browser if it's up.
|
||||
*/
|
||||
static void
|
||||
blist_ok(Widget widget, XtPointer client_data, XtPointer call_data) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
Browser *b = (Browser *)c->browser;
|
||||
Props *p = (Props *)c->properties;
|
||||
|
||||
bl_clear_pending_change(bl);
|
||||
bl_list_not_changed(bl);
|
||||
set_message(bl->message, " ");
|
||||
blist_write_list(bl, p);
|
||||
|
||||
XtVaSetValues(c->browse_button, XmNsubMenuId, NULL, NULL);
|
||||
update_browse_menu_names(c);
|
||||
XtVaSetValues(c->browse_button, XmNsubMenuId, c->browse_menu, NULL);
|
||||
if (b && b->frame)
|
||||
browser_reset_list(c);
|
||||
|
||||
XtPopdown(bl->frame);
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for the apply button - will write the list to the properties
|
||||
* database, will update the browse menu on the main menu, and will update the
|
||||
* menu on the multi browser if it's up.
|
||||
*/
|
||||
static void
|
||||
blist_apply(Widget widget, XtPointer client_data, XtPointer call_data) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
Browser *b = (Browser *)c->browser;
|
||||
Props *p = (Props *)c->properties;
|
||||
|
||||
bl_clear_pending_change(bl);
|
||||
bl_list_not_changed(bl);
|
||||
set_message(bl->message, " ");
|
||||
blist_write_list(bl, p);
|
||||
|
||||
XtVaSetValues(c->browse_button, XmNsubMenuId, NULL, NULL);
|
||||
update_browse_menu_names(c);
|
||||
XtVaSetValues(c->browse_button, XmNsubMenuId, c->browse_menu, NULL);
|
||||
if (b && b->frame)
|
||||
browser_reset_list(c);
|
||||
}
|
||||
|
||||
static void
|
||||
blist_cancel_cb(Widget widget, XtPointer client_data, XtPointer call_data) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
blist_reset(c);
|
||||
|
||||
XtPopdown(bl->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
blist_reset_cb(Widget widget, XtPointer client_data, XtPointer call_data) {
|
||||
Calendar *c = (Calendar *)client_data;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
blist_reset(c);
|
||||
}
|
||||
|
||||
extern void
|
||||
blist_init_names(Calendar *c) {
|
||||
char *name, *namelist;
|
||||
Props *p = (Props*)c->properties;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
if (!bl->blist_data)
|
||||
bl->blist_data = CmDataListCreate();
|
||||
|
||||
/*
|
||||
* Make sure the default calendar is in list
|
||||
*/
|
||||
name = get_user_calendar();
|
||||
blist_name_append(c, name, BLIST_ACTIVE);
|
||||
free(name);
|
||||
|
||||
/*
|
||||
* Make sure user's calendar is in list
|
||||
*/
|
||||
blist_name_append(c, c->calname, BLIST_ACTIVE);
|
||||
|
||||
/* make sure the intiial view name is in the list. */
|
||||
|
||||
blist_name_append(c, get_char_prop(p, CP_DEFAULTCAL), BLIST_ACTIVE);
|
||||
|
||||
namelist = cm_strdup(get_char_prop(p, CP_DAYCALLIST));
|
||||
if (namelist == NULL || *namelist == NULL )
|
||||
return;
|
||||
|
||||
name = strtok(namelist, " ");
|
||||
while (name) {
|
||||
blist_name_append(c, name, BLIST_ACTIVE);
|
||||
name = strtok(NULL, " ");
|
||||
}
|
||||
free(namelist);
|
||||
}
|
||||
|
||||
extern void
|
||||
blist_init_ui(Calendar *c) {
|
||||
int i;
|
||||
XmString xmstr;
|
||||
BlistData *bd;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
XtVaSetValues(bl->form, XmNresizePolicy, XmRESIZE_NONE, NULL);
|
||||
XmListDeleteAllItems(bl->browse_list);
|
||||
for (i = 1; i <= bl->blist_data->count; i++) {
|
||||
bd = (BlistData *)CmDataListGetData(bl->blist_data, i);
|
||||
if (bd && bd->name && bd->tag != BLIST_DELETE) {
|
||||
xmstr = XmStringCreateLocalized(bd->name);
|
||||
if (!XmListItemExists(bl->browse_list, xmstr))
|
||||
XmListAddItem(bl->browse_list, xmstr, 0);
|
||||
XmStringFree(xmstr);
|
||||
}
|
||||
}
|
||||
XmTextFieldSetString(bl->username, "");
|
||||
XtVaSetValues(bl->form, XmNresizePolicy, XmRESIZE_ANY, NULL);
|
||||
}
|
||||
|
||||
extern void
|
||||
blist_clean(Browselist *bl, Boolean clean_all) {
|
||||
int i, left_cnt = 1, cnt;
|
||||
BlistData *bd;
|
||||
|
||||
if (NULL == bl->blist_data) return;
|
||||
|
||||
cnt = bl->blist_data->count;
|
||||
for (i = 1; i <= cnt; i++) {
|
||||
bd = (BlistData *)CmDataListGetData(bl->blist_data, left_cnt);
|
||||
if (bd && bd->cal_handle == NULL &&
|
||||
(clean_all || bd->tag != BLIST_ACTIVE)) {
|
||||
if (bd->name)
|
||||
free(bd->name);
|
||||
CmDataListDeletePos(bl->blist_data, left_cnt, True);
|
||||
} else
|
||||
++left_cnt;
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
blist_reset(Calendar *c) {
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
|
||||
blist_clean(bl, True);
|
||||
blist_init_names(c);
|
||||
blist_init_ui(c);
|
||||
bl_clear_pending_change(bl);
|
||||
bl_list_not_changed(bl);
|
||||
XtSetSensitive(bl->remove_button, False);
|
||||
}
|
||||
|
||||
static void
|
||||
blist_quit_handler(Widget w, XtPointer cdata, XtPointer data) {
|
||||
Browselist *bl = (Browselist *)cdata;
|
||||
|
||||
XtPopdown(w);
|
||||
}
|
||||
|
||||
extern void
|
||||
make_browselist(Calendar *c)
|
||||
{
|
||||
int ac;
|
||||
Arg args[15];
|
||||
XmString label_str;
|
||||
Widget separator,
|
||||
button_form;
|
||||
Browselist *bl = (Browselist *)c->browselist;
|
||||
Dimension label_width;
|
||||
char *title;
|
||||
|
||||
if (!bl)
|
||||
return;
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 963,
|
||||
"Calendar : Menu Editor"));
|
||||
bl->frame = XtVaCreatePopupShell("menu_editor_frame",
|
||||
xmDialogShellWidgetClass, c->frame,
|
||||
XmNdeleteResponse, XmDO_NOTHING,
|
||||
XmNtitle, title,
|
||||
XmNallowShellResize, True,
|
||||
XmNmappedWhenManaged, False,
|
||||
NULL);
|
||||
setup_quit_handler(bl->frame, blist_quit_handler, (caddr_t)bl);
|
||||
XtFree(title);
|
||||
|
||||
bl->form = XtVaCreateWidget("menu_editor_form",
|
||||
xmFormWidgetClass, bl->frame,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 5,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 410, "User Name:"));
|
||||
bl->username_label = XtVaCreateWidget("name_label",
|
||||
xmLabelGadgetClass, bl->form,
|
||||
XmNlabelString, label_str,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(args[ac], XmNorientation, XmVERTICAL); ++ac;
|
||||
XtSetArg(args[ac], XmNpacking, XmPACK_COLUMN); ++ac;
|
||||
XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ++ac;
|
||||
XtSetArg(args[ac], XmNtopOffset, 6); ++ac;
|
||||
XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ++ac;
|
||||
XtSetArg(args[ac], XmNrightOffset, 5); ++ac;
|
||||
bl->edit_rc_mgr = XmCreateRowColumn(bl->form, "edit_rc_mgr", args, ac);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 686, "Add Name"));
|
||||
bl->add_button = XtVaCreateWidget("add_button",
|
||||
xmPushButtonWidgetClass, bl->edit_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->add_button, XmNactivateCallback,
|
||||
blist_addname, (XtPointer)c);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 687, "Remove Name"));
|
||||
bl->remove_button = XtVaCreateWidget("remove_button",
|
||||
xmPushButtonWidgetClass, bl->edit_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->remove_button, XmNactivateCallback,
|
||||
blist_removenames, (XtPointer)c);
|
||||
ManageChildren(bl->edit_rc_mgr);
|
||||
|
||||
XtVaGetValues(bl->username_label, XmNwidth, &label_width, NULL);
|
||||
|
||||
bl->username = XtVaCreateWidget("username",
|
||||
xmTextFieldWidgetClass, bl->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, label_width + 15,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, bl->edit_rc_mgr,
|
||||
XmNrightOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 5,
|
||||
XmNcolumns, 40,
|
||||
NULL);
|
||||
XtAddCallback(bl->username, XmNactivateCallback, blist_addname,
|
||||
(XtPointer)c);
|
||||
XtAddCallback(bl->username, XmNvalueChangedCallback,
|
||||
bl_pending_change, (XtPointer)c);
|
||||
|
||||
XtVaSetValues(bl->username_label,
|
||||
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNbottomWidget, bl->username,
|
||||
XmNbottomOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, bl->username,
|
||||
XmNrightOffset, 5,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 688, "Browse Menu Items"));
|
||||
bl->list_label = XtVaCreateWidget("list_label",
|
||||
xmLabelWidgetClass, bl->form,
|
||||
XmNlabelString, label_str,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, bl->username,
|
||||
XmNtopOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
bl->message = XtVaCreateWidget("message_text",
|
||||
xmLabelGadgetClass,
|
||||
bl->form,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNbottomOffset, 5,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("menu_editor_button_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
bl->form,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 5,
|
||||
XmNhorizontalSpacing, 5,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, bl->message,
|
||||
XmNbottomOffset, 5,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK"));
|
||||
bl->ok_button = XtVaCreateWidget("ok_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 0,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 1,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->ok_button, XmNactivateCallback, blist_ok,
|
||||
(XtPointer)c);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 460, "Apply"));
|
||||
bl->apply_button = XtVaCreateWidget("apply_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 2,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->apply_button, XmNactivateCallback, blist_apply,
|
||||
(XtPointer)c);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 691, "Reset"));
|
||||
bl->reset_button = XtVaCreateWidget("reset_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 2,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->reset_button, XmNactivateCallback,
|
||||
blist_reset_cb, (XtPointer)c);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 923, "Cancel"));
|
||||
bl->cancel_button = XtVaCreateWidget("cancel_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 3,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 4,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->cancel_button, XmNactivateCallback, blist_cancel_cb,
|
||||
(XtPointer)c);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help"));
|
||||
bl->help_button = XtVaCreateWidget("help_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 4,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 5,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(bl->help_button, XmNactivateCallback,
|
||||
(XtCallbackProc)help_cb, MENU_EDITOR_HELP_BUTTON);
|
||||
XtAddCallback(bl->form, XmNhelpCallback,
|
||||
(XtCallbackProc)help_cb, (XtPointer) MENU_EDITOR_HELP_BUTTON);
|
||||
|
||||
ManageChildren(button_form);
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
bl->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button_form,
|
||||
XmNbottomOffset, 5,
|
||||
NULL);
|
||||
ac = 0;
|
||||
XtSetArg(args[ac], XmNvisibleItemCount, 8); ++ac;
|
||||
XtSetArg(args[ac], XmNselectionPolicy, XmMULTIPLE_SELECT); ++ac;
|
||||
XtSetArg(args[ac], XmNdoubleClickInterval, 5); ++ac;
|
||||
bl->browse_list = (Widget)XmCreateScrolledList(bl->form, "browse_list",
|
||||
args, ac);
|
||||
bl->browse_list_sw = XtParent(bl->browse_list);
|
||||
|
||||
XtVaSetValues(bl->browse_list_sw,
|
||||
XmNvisualPolicy, XmVARIABLE,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, bl->list_label,
|
||||
XmNtopOffset, 5,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, bl->list_label,
|
||||
XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNrightWidget, bl->username,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, separator,
|
||||
XmNbottomOffset, 5,
|
||||
XmNwidth, 50,
|
||||
NULL);
|
||||
XtManageChild(bl->browse_list);
|
||||
|
||||
XtAddCallback(bl->browse_list, XmNmultipleSelectionCallback,
|
||||
bl_list_selection_cb, (XtPointer)c);
|
||||
|
||||
ManageChildren(bl->form);
|
||||
XtManageChild(bl->form);
|
||||
|
||||
/*
|
||||
* Set default button
|
||||
*/
|
||||
XtVaSetValues(bl->form, XmNcancelButton, bl->cancel_button, NULL);
|
||||
XmProcessTraversal(bl->username, XmTRAVERSE_CURRENT);
|
||||
XtVaSetValues(bl->form, XmNinitialFocus, bl->username, NULL);
|
||||
|
||||
/*
|
||||
* For storing the list of names
|
||||
*/
|
||||
if (!bl->blist_data)
|
||||
bl->blist_data = CmDataListCreate();
|
||||
}
|
||||
|
||||
extern void
|
||||
show_browselist(Calendar *c) {
|
||||
Browselist *bl;
|
||||
|
||||
if (c->browselist == NULL)
|
||||
c->browselist = (caddr_t)ckalloc(sizeof(Browselist));
|
||||
bl = (Browselist *)c->browselist;
|
||||
|
||||
if (!bl->frame)
|
||||
make_browselist(c);
|
||||
blist_reset(c);
|
||||
XtVaSetValues(bl->frame, XmNmappedWhenManaged, True, NULL);
|
||||
/*
|
||||
* Set default button
|
||||
*/
|
||||
XtVaSetValues(bl->form, XmNcancelButton, bl->cancel_button, NULL);
|
||||
XmProcessTraversal(bl->username, XmTRAVERSE_CURRENT);
|
||||
XtVaSetValues(bl->form, XmNinitialFocus, bl->username, NULL);
|
||||
|
||||
XtPopup(bl->frame, XtGrabNone);
|
||||
set_message(bl->message, "\0");
|
||||
}
|
||||
|
||||
95
cde/programs/dtcm/dtcm/blist.h
Normal file
95
cde/programs/dtcm/dtcm/blist.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** blist.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)blist.h 1.19 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: blist.h /main/3 1995/11/03 10:18:18 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _BLIST_H
|
||||
#define _BLIST_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "util.h"
|
||||
|
||||
/*
|
||||
* The list of names we can typically browse is used in three spots - the
|
||||
* browse list editor, the multi browser (compare calendars), and the main
|
||||
* window to build the browse menu.
|
||||
*
|
||||
* The list of names actually is a list of the BlistData structures. The
|
||||
* multi browser uses the cal_handle item and therefore, we can't delete the
|
||||
* entry from this list until the multi browser is no longer using that pointer.
|
||||
*/
|
||||
typedef enum {
|
||||
BLIST_INSERT, BLIST_DELETE, BLIST_ACTIVE
|
||||
} BlistTag;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
BlistTag tag;
|
||||
CSA_session_handle cal_handle;
|
||||
unsigned int user_access;
|
||||
int version;
|
||||
Paint_cache *cache;
|
||||
int cache_size;
|
||||
} BlistData;
|
||||
|
||||
typedef struct {
|
||||
Widget button_rc_mgr;
|
||||
Widget edit_rc_mgr;
|
||||
Widget frame;
|
||||
Widget form;
|
||||
Widget username;
|
||||
Widget username_label;
|
||||
Widget add_button;
|
||||
Widget list_label;
|
||||
Widget browse_list;
|
||||
Widget browse_list_sw;
|
||||
Widget remove_button;
|
||||
Widget ok_button;
|
||||
Widget apply_button;
|
||||
Widget reset_button;
|
||||
Widget cancel_button;
|
||||
Widget help_button;
|
||||
Widget message;
|
||||
CmDataList *blist_data;
|
||||
Boolean bl_pending_message_up;
|
||||
Boolean bl_list_changed;
|
||||
} Browselist;
|
||||
|
||||
typedef struct browser_state {
|
||||
char *cname;
|
||||
Pixmap *glyph;
|
||||
struct browser_state *next;
|
||||
} BrowserState;
|
||||
|
||||
extern void blist_clean P((Browselist*, Boolean));
|
||||
extern void blist_init_names P((Calendar*));
|
||||
extern void blist_init_ui P((Calendar*));
|
||||
extern void blist_reset P((Calendar*));
|
||||
extern void make_browselist P((Calendar*));
|
||||
extern void show_browselist P((Calendar*));
|
||||
|
||||
#endif
|
||||
1722
cde/programs/dtcm/dtcm/browser.c
Normal file
1722
cde/programs/dtcm/dtcm/browser.c
Normal file
File diff suppressed because it is too large
Load Diff
112
cde/programs/dtcm/dtcm/browser.h
Normal file
112
cde/programs/dtcm/dtcm/browser.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** browser.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)browser.h 1.15 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: browser.h /main/3 1995/11/03 10:18:46 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _BROWSER_H
|
||||
#define _BROWSER_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "timeops.h"
|
||||
#include "calendar.h"
|
||||
|
||||
typedef struct {
|
||||
Widget frame;
|
||||
Widget outer_pane;
|
||||
Widget inner_pane;
|
||||
Widget upper_form;
|
||||
Widget lower_form;
|
||||
Widget action;
|
||||
Widget cancel;
|
||||
Widget canvas;
|
||||
Widget edit_list;
|
||||
Widget helpbutton;
|
||||
Widget list_label;
|
||||
Widget browse_list;
|
||||
Widget browse_list_sw;
|
||||
Widget bgoto;
|
||||
Widget gotomenu;
|
||||
Widget schedule;
|
||||
Widget mail;
|
||||
Widget message_text;
|
||||
caddr_t current_selection;
|
||||
Widget box;
|
||||
Widget datetext;
|
||||
Widget datefield;
|
||||
Tick date;
|
||||
int col_sel;
|
||||
int row_sel;
|
||||
Tick begin_week_tick;
|
||||
int canvas_w;
|
||||
int canvas_h;
|
||||
int chart_width;
|
||||
int chart_height;
|
||||
int boxh;
|
||||
int boxw;
|
||||
int chart_x;
|
||||
int chart_y;
|
||||
Tick begin_day_tick;
|
||||
Tick end_day_tick;
|
||||
Tick begin_hr_tick;
|
||||
Tick end_hr_tick;
|
||||
new_XContext *xcontext;
|
||||
char *multi_array;
|
||||
int segs_in_array;
|
||||
Pixmap busy_icon;
|
||||
Boolean add_to_array;
|
||||
} Browser;
|
||||
|
||||
#define BOX_SEG 4
|
||||
#define MINS_IN_SEG (60/BOX_SEG)
|
||||
|
||||
#define MB_GOTO 0
|
||||
#define MB_PREVWEEK 1
|
||||
#define MB_THISWEEK 2
|
||||
#define MB_NEXTWEEK 3
|
||||
#define MB_PREVMONTH 4
|
||||
#define MB_NEXTMONTH 5
|
||||
|
||||
extern void br_display P((Calendar*));
|
||||
extern Boolean browser_exists P(());
|
||||
extern void browser_reset_list P((Calendar*));
|
||||
extern Boolean browser_showing P(());
|
||||
extern void make_browser P(());
|
||||
extern void mb_draw_chartgrid P(());
|
||||
extern void mb_draw_appts P(());
|
||||
extern void mb_update_segs P(());
|
||||
extern void mb_update_busyicon P(());
|
||||
extern void mb_init_blist P(());
|
||||
extern void mb_init_canvas P(());
|
||||
extern void mb_deregister_names P(());
|
||||
extern void mb_refresh_canvas P(());
|
||||
extern void sched_proc P(());
|
||||
extern void set_default_reminders P(());
|
||||
extern void set_default_scope_plus P(());
|
||||
extern void set_default_what P(());
|
||||
extern void mb_refigure_chart P((Calendar *));
|
||||
|
||||
#endif
|
||||
18
cde/programs/dtcm/dtcm/busy.icon
Normal file
18
cde/programs/dtcm/dtcm/busy.icon
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
|
||||
*/
|
||||
0xFFFF,
|
||||
0xFFFF,
|
||||
0xFC3F,
|
||||
0xF00F,
|
||||
0xE027,
|
||||
0xE067,
|
||||
0xC0C3,
|
||||
0xC183,
|
||||
0xC183,
|
||||
0xC0C3,
|
||||
0xE067,
|
||||
0xE027,
|
||||
0xF00F,
|
||||
0xFC3F,
|
||||
0xFFFF,
|
||||
0xFFFF,
|
||||
369
cde/programs/dtcm/dtcm/calendar.h
Normal file
369
cde/programs/dtcm/dtcm/calendar.h
Normal file
@@ -0,0 +1,369 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** calendar.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)calendar.h 1.59 95/02/16 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $TOG: calendar.h /main/5 1999/02/08 17:00:18 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _CALENDAR_H
|
||||
#define _CALENDAR_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <csa.h>
|
||||
#include <nl_types.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include "ansi_c.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "props.h"
|
||||
|
||||
/* from gettext.h */
|
||||
|
||||
#define MSGFILE_ERROR "SUNW_DESKSET_CM_ERR"
|
||||
#define MSGFILE_LABEL "SUNW_DESKSET_CM_LABEL"
|
||||
#define MSGFILE_MESSAGE "SUNW_DESKSET_CM_MSG"
|
||||
|
||||
/* from graphics.h */
|
||||
|
||||
#define DARKGREY 1
|
||||
#define DIMGREY 2
|
||||
#define GREY 3
|
||||
#define LIGHTGREY 4
|
||||
#define RED 5
|
||||
#define MIDGREY 150
|
||||
|
||||
#define FAKE_MONOCHROME 1
|
||||
|
||||
#define DTCM_CAT "dtcm"
|
||||
|
||||
typedef enum {gr_solid, gr_short_dotted, gr_dotted,
|
||||
gr_dot_dashed, gr_short_dashed,
|
||||
gr_long_dashed, gr_odd_dashed} GR_Line_Style;
|
||||
|
||||
typedef enum {gr_mono, gr_color} GR_depth;
|
||||
|
||||
typedef enum {BOLD, MEDIUM} Font_Weight;
|
||||
|
||||
typedef enum {
|
||||
yearGlance, monthGlance, weekGlance, dayGlance
|
||||
} Glance;
|
||||
|
||||
typedef enum {
|
||||
RENDER_REPAINT, RENDER_CLEAR_FIRST, RENDER_UNMAP
|
||||
} Render_Type;
|
||||
|
||||
typedef struct {Tick start_time;
|
||||
Tick end_time;
|
||||
int show_time;
|
||||
char *summary;} Paint_cache;
|
||||
|
||||
typedef struct {
|
||||
Pixel foreground; /* X Default Foreground Color */
|
||||
Pixel background; /* X Default Background Color */
|
||||
XID xid; /* XID */
|
||||
Pixel hilight_color; /* Default hilight color */
|
||||
/*Drawable drawable;*/ /* X Drawable */
|
||||
XtAppContext app;
|
||||
Display *display; /* X Display */
|
||||
|
||||
/*
|
||||
* gc is a general purpose GC which is configured on the fly for
|
||||
* infrequent operations. For frequent operations we use one of
|
||||
* the pre-configured GCs which we never change.
|
||||
*/
|
||||
GC gc; /* X Graphics Context */
|
||||
XGCValues *gcvals; /* X Graphics Context Values */
|
||||
GC draw_gc; /* GC for drawing */
|
||||
GC clear_gc; /* GC for clearing */
|
||||
GC invert_gc; /* GC for inverting */
|
||||
|
||||
int screen_depth; /* screen depth */
|
||||
XColor colorcell_del[RED+1];/* rgb colors */
|
||||
} new_XContext;
|
||||
|
||||
typedef enum {
|
||||
main_win, browser, tempbrowser
|
||||
} WindowType;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int nwks;
|
||||
int boxh;
|
||||
int boxw;
|
||||
int winw;
|
||||
int winh;
|
||||
int outside_margin;
|
||||
int inside_margin;
|
||||
int topoffset;
|
||||
time_t date;
|
||||
time_t olddate;
|
||||
Glance glance;
|
||||
caddr_t day_info; /* in dayglance.c */
|
||||
caddr_t week_info; /* in weekglance.c */
|
||||
caddr_t month_info; /* in monthglance.c */
|
||||
caddr_t year_info; /* in yearglance.c */
|
||||
char* current_calendar; /* in calendarA.c */
|
||||
CSA_reminder_reference *next_alarm; /* in appt.c */
|
||||
CSA_uint32 next_alarm_count;
|
||||
int rings; /* number of rings to do in reminder */
|
||||
int flashes; /* number of flashes to do in reminder */
|
||||
XtIntervalId next_alarm_id;
|
||||
caddr_t current_selection; /* in select.c */
|
||||
char* wm_cmdstr; /* WM_COMMAND format
|
||||
version of argv list */
|
||||
int wm_cmdstrlen; /* Size of the wm_cmdstr
|
||||
buffer */
|
||||
char *sessionfile; /* file name (if any)
|
||||
provided by -session
|
||||
parameter */
|
||||
XrmDatabase sessiondb; /* X database that is
|
||||
constructed by the
|
||||
session file */
|
||||
|
||||
|
||||
} View;
|
||||
|
||||
typedef struct _Cal_Font {
|
||||
XmFontType cf_type;
|
||||
union {
|
||||
XFontStruct *cf_font;
|
||||
XFontSet cf_fontset;
|
||||
} f;
|
||||
} Cal_Font;
|
||||
|
||||
typedef struct {
|
||||
Cal_Font *labelfont;
|
||||
Cal_Font *viewfont;
|
||||
Cal_Font *boldfont;
|
||||
Cal_Font *iconfont;
|
||||
Cal_Font *userfont;
|
||||
} Cal_Fonts;
|
||||
|
||||
typedef struct {
|
||||
Widget panel;
|
||||
Widget button1; /* unused */
|
||||
Widget button2; /* view button */
|
||||
Widget button3; /* edit button */
|
||||
Widget button4; /* browse button*/
|
||||
Widget button5; /* print button */
|
||||
Widget button6; /* unused */
|
||||
Widget button7; /* unused */
|
||||
Widget button8; /* prev button */
|
||||
Widget button9; /* today button */
|
||||
Widget button10; /* next button */
|
||||
Widget menu_bar;
|
||||
} Items;
|
||||
|
||||
typedef struct {
|
||||
int rc_ts; /* timestamp of rc file: browse */
|
||||
int version; /* version of cm */
|
||||
WindowType last_canvas_touched; /* either browser or main */
|
||||
} General;
|
||||
|
||||
/*
|
||||
* Datatype for application-defined resources. This is filled in by Xt during
|
||||
* XtVaAppInitialize (for the cmdline args) and during XtGetApplicationResources
|
||||
* for the app-defaults values. An instance of this is carried around in
|
||||
* calendar->app_data to provide access to properties data.
|
||||
*
|
||||
* Historical note: old properties (.desksetdefaults) should be mapped into
|
||||
* this, and (if they need to be written out) taken form this.
|
||||
*/
|
||||
typedef struct {
|
||||
String default_view;
|
||||
String default_calendar;
|
||||
String default_printer;
|
||||
String labelfont;
|
||||
XmFontList labelfontlist;
|
||||
XmFontList viewfontlist;
|
||||
XmFontList boldfontlist;
|
||||
XmFontList iconfontlist;
|
||||
String userfont;
|
||||
XmFontList userfontlist;
|
||||
String systemfont;
|
||||
XmFontList systemfontlist;
|
||||
String app_font_family;
|
||||
String session_file;
|
||||
Boolean debug;
|
||||
} DtCmAppResources, *DtCmAppResourcesPtr;
|
||||
|
||||
typedef struct {
|
||||
unsigned int icon_width;
|
||||
unsigned int icon_height;
|
||||
unsigned int icon_depth;
|
||||
Pixmap icon;
|
||||
Pixmap icon_mask;
|
||||
} IconInfo;
|
||||
|
||||
typedef struct {
|
||||
nl_catd DT_catd; /* catgets file descriptor */
|
||||
CSA_session_handle cal_handle; /* browsing calendar rpc connection */
|
||||
unsigned int user_access; /* access wrt current viewing cal */
|
||||
CSA_session_handle my_cal_handle; /* my calendar's rpc connection */
|
||||
unsigned int my_access;
|
||||
int my_cal_version; /* my calendar rpc connection version */
|
||||
Widget frame;
|
||||
Widget panel;
|
||||
Items *items;
|
||||
General *general; /* stuff general to the calendar */
|
||||
Widget form; /* main container */
|
||||
Widget toolbar; /* frame for toolbar */
|
||||
Widget canvas; /* main canvas for graphics*/
|
||||
Widget menu_bar; /* top of menu hierarchy */
|
||||
Widget browse_menu; /* cached for quick access */
|
||||
Widget browse_button; /* for updating browse menu */
|
||||
Widget message_text; /* status at foot of main window */
|
||||
Widget previous; /* arrow to step back in time */
|
||||
Widget today; /* button to jump to "now" */
|
||||
Widget next; /* arrow to step forward in time */
|
||||
Widget radio; /* container for toolbar scope btns */
|
||||
Widget day_scope; /* scope buttns in tool bar */
|
||||
Widget week_scope;
|
||||
Widget month_scope;
|
||||
Widget year_scope;
|
||||
Widget appt_btn; /* Quick access to appt editor */
|
||||
Widget todo_btn; /* Quick access to todo editor */
|
||||
Widget todo_edit_menu; /* Menu access to todo editor */
|
||||
Widget todo_view_menu; /* Menu access to todo list */
|
||||
Widget month1; /* month panels in day view */
|
||||
Widget month2;
|
||||
Widget month3;
|
||||
Widget postup; /* in alarm.c */
|
||||
Widget mainhelpdialog;
|
||||
Widget about_dialog;
|
||||
Widget credits_dialog;
|
||||
View *view; /* cached info about current display */
|
||||
DtCmAppResourcesPtr app_data; /* Xt-populated, listed above */
|
||||
caddr_t properties; /* in props.c */
|
||||
caddr_t properties_pu; /* in props_pu.c */
|
||||
caddr_t editor; /* in editor.c */
|
||||
caddr_t geditor; /* in group_editor.c */
|
||||
caddr_t browser; /* in browser.c */
|
||||
caddr_t browselist; /* in blist.c */
|
||||
caddr_t todo; /* in todo.c */
|
||||
caddr_t alist; /* in alist.c */
|
||||
caddr_t print_opts; /* in printer.c */
|
||||
caddr_t user; /* calendar driver */
|
||||
char* calname; /* calendar name */
|
||||
new_XContext *xcontext; /* XID, Display, GC, GCVals */
|
||||
caddr_t find; /* in find.c */
|
||||
caddr_t goTo; /* in goto.c */
|
||||
caddr_t tempbr; /* in tempbr.c */
|
||||
caddr_t mail; /* in mail.c */
|
||||
caddr_t timezone; /* in timezone.c */
|
||||
caddr_t print_data; /* in print.c - valid when dialog up */
|
||||
char *tt_procid; /* Tooltalk process id, used for
|
||||
tooltalk intiialization */
|
||||
Paint_cache *paint_cache;
|
||||
int paint_cache_size;
|
||||
Cal_Fonts *fonts;
|
||||
IconInfo *icon;
|
||||
IconInfo *icon_inverted;
|
||||
} Calendar;
|
||||
|
||||
extern Calendar *calendar;
|
||||
extern int _csa_iso8601_to_tick(char *, time_t*);
|
||||
extern int _csa_tick_to_iso8601(time_t, char *);
|
||||
|
||||
#define MAXBUFLEN 4096
|
||||
|
||||
#define CMS_VERS_2 2
|
||||
#define CMS_VERS_3 3
|
||||
#define CMS_VERS_4 4
|
||||
|
||||
/* define to figure out if two XRectangle structures intersect each other */
|
||||
|
||||
#define myrect_intersectsrect(r1,r2) \
|
||||
((int)(r1)->x<=(int)(r2)->x+(int)(r2)->width && \
|
||||
(int)(r1)->y<=(int)(r2)->y+(int)(r2)->height && \
|
||||
(int)(r2)->x<=(int)(r1)->x+(int)(r1)->width && \
|
||||
(int)(r2)->y<=(int)(r1)->y+(int)(r1)->height)
|
||||
|
||||
|
||||
extern void cache_dims P((Calendar*, Dimension,
|
||||
Dimension));
|
||||
extern char* cm_get_relname P(());
|
||||
extern Boolean in_range P((time_t, time_t, time_t));
|
||||
extern int report_err P((char*));
|
||||
extern void reset_alarm P((Calendar*));
|
||||
extern CSA_return_code reset_timer P((Calendar*));
|
||||
extern CSA_return_code paint_canvas P((Calendar*, XRectangle*,
|
||||
Render_Type));
|
||||
extern void switch_it P((Calendar*, char*,
|
||||
WindowType));
|
||||
extern int yyyerror P((char*));
|
||||
extern void gr_clear_area P((new_XContext*, int, int,
|
||||
Dimension, Dimension));
|
||||
extern void gr_clear_box P((new_XContext*, int, int, int,
|
||||
int));
|
||||
extern void gr_make_grayshade P((new_XContext*, int, int, int,
|
||||
int, int));
|
||||
extern void gr_make_gray P((new_XContext*, int, int, int,
|
||||
int, int));
|
||||
extern void gr_make_rgbcolor P((new_XContext*, Colormap, int,
|
||||
int, int, int, int, int,
|
||||
int));
|
||||
extern int gr_nchars P((int, char*, Cal_Font *));
|
||||
extern void gr_draw_rgb_box P((new_XContext*, int, int, int,
|
||||
int, int, int, Colormap));
|
||||
extern void gr_dissolve_box P((new_XContext*, int, int, int,
|
||||
int, int));
|
||||
extern int gr_center P((int, char*, Cal_Font *));
|
||||
extern void gr_text P((new_XContext*, int, int,
|
||||
Cal_Font *, char*,
|
||||
XRectangle*));
|
||||
extern void gr_text_rgb P((new_XContext*, int, int,
|
||||
Cal_Font *, char*, Pixel,
|
||||
Colormap, XRectangle*));
|
||||
extern void gr_draw_line P((new_XContext*, int, int, int,
|
||||
int, GR_Line_Style,
|
||||
XRectangle*));
|
||||
extern void gr_draw_box P((new_XContext*, int, int, int,
|
||||
int, XRectangle*));
|
||||
extern void gr_draw_glyph P((new_XContext*, new_XContext*,
|
||||
Pixmap, int, int, int, int));
|
||||
extern void gr_set_clip_rectangles P((new_XContext*, int, int,
|
||||
XRectangle*, int, int));
|
||||
extern void gr_clear_clip_rectangles P((new_XContext*));
|
||||
extern Boolean gr_init P((new_XContext*, Widget));
|
||||
extern new_XContext *gr_create_xcontext P((Calendar*, Widget, GR_depth,
|
||||
XtAppContext));
|
||||
extern Boolean today_inrange P((Calendar*, time_t));
|
||||
extern void update_browse_menu_names P((Calendar*));
|
||||
extern char* get_user_calendar P(());
|
||||
extern void destroy_paint_cache P((Paint_cache *, int));
|
||||
extern void invalidate_cache P((Calendar *));
|
||||
|
||||
extern CSA_return_code allocate_paint_cache P((CSA_entry_handle *, int, Paint_cache **));
|
||||
|
||||
extern Boolean fontlist_to_font P((XmFontList, Cal_Font *));
|
||||
extern void CalTextExtents P((Cal_Font *, char *, int,
|
||||
int *, int *, int *, int *));
|
||||
extern void CalDrawString P((Display *, Drawable,
|
||||
Cal_Font *, GC, int, int,
|
||||
char *, int));
|
||||
extern void CalFontExtents P((Cal_Font *,
|
||||
XFontSetExtents *));
|
||||
#endif
|
||||
12
cde/programs/dtcm/dtcm/calendar.tpl
Normal file
12
cde/programs/dtcm/dtcm/calendar.tpl
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
** Calendar Appointment **
|
||||
|
||||
Date: |>mm/dd/yy<|
|
||||
Start: |>hh:mm pm<|
|
||||
Stop: |>hh:mm pm<|
|
||||
Repeat: |>frequency<|
|
||||
For: |>scope<|
|
||||
What: |>line 1<|
|
||||
|>line 2<|
|
||||
|
||||
3404
cde/programs/dtcm/dtcm/calendarA.c
Normal file
3404
cde/programs/dtcm/dtcm/calendarA.c
Normal file
File diff suppressed because it is too large
Load Diff
204
cde/programs/dtcm/dtcm/cm_admin.c
Normal file
204
cde/programs/dtcm/dtcm/cm_admin.c
Normal file
@@ -0,0 +1,204 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_lookup.c
|
||||
**
|
||||
** $XConsortium: cm_admin.c /main/5 1996/07/09 14:48:00 drk $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cm_lookup.c 1.21 94/08/05 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <nl_types.h>
|
||||
#include <locale.h>
|
||||
#include "cm_tty.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#ifdef FNS
|
||||
#include "dtfns.h"
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
typedef enum {archive, restore} Admin_mode;
|
||||
|
||||
static Admin_mode Mode = archive;
|
||||
static char cm_target[MAXPATHLEN];
|
||||
static char cm_start[MAXPATHLEN];
|
||||
static char cm_end[MAXPATHLEN];
|
||||
static char cm_file[MAXPATHLEN];
|
||||
static int Delete = B_FALSE;
|
||||
static FILE *input_stream = stdin;
|
||||
static FILE *output_stream = stdout;
|
||||
|
||||
int debug = 0;
|
||||
static nl_catd DT_catd;
|
||||
|
||||
static char**
|
||||
grab(char**argv, /* command line arguments */
|
||||
char *buf, /* buffer for keyed data */
|
||||
char stop_key)
|
||||
{
|
||||
if (!argv || !*argv) return(argv);
|
||||
cm_strcpy (buf,*argv++);
|
||||
while(argv && *argv) {
|
||||
if (*(*argv) == stop_key) break;
|
||||
cm_strcat(buf," ");
|
||||
cm_strcat(buf,*argv++);
|
||||
}
|
||||
argv--;
|
||||
return(argv);
|
||||
}
|
||||
|
||||
static void
|
||||
usage_msg() {
|
||||
fprintf(stderr,catgets(DT_catd, 1, 696, "Usage:\n\tdtcm_admin [ -d ] [ -a action ] [ -c calendar ][ -s <mm/dd/yy> ] [ -e <mm/dd/yy> ] [-f filename]\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
cm_args(int argc, char **argv)
|
||||
{
|
||||
|
||||
while (++argv && *argv) {
|
||||
switch(*(*argv+1)) {
|
||||
case 'a':
|
||||
++argv;
|
||||
if (strcmp(*argv, "archive") == 0)
|
||||
Mode = archive;
|
||||
else if (strcmp(*argv, "restore") == 0)
|
||||
Mode = restore;
|
||||
else {
|
||||
fprintf(stderr,catgets(DT_catd, 1, 697, "You have specified an unsupported administration operation \"%s\".\n"), *argv);
|
||||
usage_msg();
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
argv = grab(++argv,cm_target,'-');
|
||||
break;
|
||||
case 's':
|
||||
argv = grab(++argv,cm_start,'-');
|
||||
break;
|
||||
case 'e':
|
||||
argv = grab(++argv,cm_end,'-');
|
||||
break;
|
||||
case 'f':
|
||||
argv = grab(++argv,cm_file,'-');
|
||||
break;
|
||||
case 'd':
|
||||
Delete = B_TRUE;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
usage_msg();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int cnt;
|
||||
char *target = NULL, *date = NULL, *view = NULL,
|
||||
*uname, *loc;
|
||||
Props *p = NULL;
|
||||
CSA_session_handle c_handle;
|
||||
CSA_entry_handle *list;
|
||||
CSA_calendar_user csa_user;
|
||||
CSA_return_code stat;
|
||||
#ifdef FNS
|
||||
char buf[256];
|
||||
#endif
|
||||
|
||||
init_time();
|
||||
setlocale(LC_ALL, "");
|
||||
DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE);
|
||||
cm_tty_load_props(&p);
|
||||
cm_args(argc,argv); /* parse command line */
|
||||
|
||||
target = (cm_strlen(cm_target)) ? cm_target : cm_get_credentials();
|
||||
#ifdef FNS
|
||||
dtfns_init();
|
||||
if (cmfns_use_fns(p)) {
|
||||
cmfns_lookup_calendar(target, buf, sizeof(buf));
|
||||
target = buf;
|
||||
}
|
||||
#endif
|
||||
uname = cm_target2name(target);
|
||||
loc = cm_target2location(target);
|
||||
|
||||
/* check to see if the file name parameter makes sense */
|
||||
|
||||
if (cm_file[0]) {
|
||||
if (Mode == archive) {
|
||||
if ((output_stream = fopen(cm_file, "w")) == NULL) {
|
||||
fprintf(stderr, catgets(DT_catd, 1, 698, "\nCould not open output file \"%s\"\n"), cm_file);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Mode == restore) {
|
||||
if ((input_stream = fopen(cm_file, "r")) == NULL) {
|
||||
fprintf(stderr, catgets(DT_catd, 1, 699, "\nCould not open input file \"%s\"\n"), cm_file);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
csa_user.user_name = target;
|
||||
csa_user.user_type = 0;
|
||||
csa_user.calendar_user_extensions = NULL;
|
||||
csa_user.calendar_address = target;
|
||||
stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL);
|
||||
|
||||
if (stat != CSA_SUCCESS) {
|
||||
char *format = XtNewString(catgets(DT_catd, 1, 208,
|
||||
"\nCould not open calendar \"%s\"\n"));
|
||||
fprintf(stderr, format,
|
||||
target ? target : catgets(DT_catd, 1, 209, "UNKNOWN"));
|
||||
XtFree(format);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
csa_logoff(c_handle, NULL);
|
||||
props_clean_up(p);
|
||||
free(p);
|
||||
free(uname);
|
||||
free(loc);
|
||||
return 0;
|
||||
}
|
||||
190
cde/programs/dtcm/dtcm/cm_delete.c
Normal file
190
cde/programs/dtcm/dtcm/cm_delete.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_delete.c
|
||||
**
|
||||
** $TOG: cm_delete.c /main/7 1998/04/20 12:48:43 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cm_delete.c 1.29 95/03/17 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <csa.h>
|
||||
#include <nl_types.h>
|
||||
#include <locale.h>
|
||||
#include <Dt/Dt.h>
|
||||
#include <Dt/EnvControlP.h>
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "cm_tty.h"
|
||||
#ifdef FNS
|
||||
#include "dtfns.h"
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
int debug = 0;
|
||||
static nl_catd DT_catd;
|
||||
static char cm_target[256] = ""; /* target for table (user@host) */
|
||||
static char cm_date[256] = ""; /* appointment date */
|
||||
static char cm_view[16] = "day"; /* view span (day,week,month) */
|
||||
static int cm_today = 0; /* today's date (in epoch time) */
|
||||
static int cm_index = 0; /* index to change/delete */
|
||||
|
||||
static char**
|
||||
grab(char**argv, /* command line arguments */
|
||||
char *buf, /* buffer for keyed data */
|
||||
char stop_key)
|
||||
{
|
||||
if (!argv || !*argv) return(argv);
|
||||
cm_strcpy (buf,*argv++);
|
||||
while(argv && *argv) {
|
||||
if (*(*argv) == stop_key) break;
|
||||
cm_strcat(buf," ");
|
||||
cm_strcat(buf,*argv++);
|
||||
}
|
||||
argv--;
|
||||
return(argv);
|
||||
}
|
||||
|
||||
static void
|
||||
cm_args(int argc, char **argv)
|
||||
{
|
||||
|
||||
while (++argv && *argv) {
|
||||
switch(*(*argv+1)) {
|
||||
case 't':
|
||||
case 'c':
|
||||
argv = grab(++argv,cm_target,'-');
|
||||
break;
|
||||
case 'd':
|
||||
argv = grab(++argv,cm_date,'-');
|
||||
break;
|
||||
case 'v':
|
||||
argv = grab(++argv,cm_view,'-');
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,catgets(DT_catd, 1, 187, "Usage:\n\tdtcm_delete [-c calendar] [-d <mm/dd/yy>] [-v view]\n"));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int cnt;
|
||||
char index[10], *target = NULL, *date = NULL, *view = NULL,
|
||||
*uname, *loc;
|
||||
Props *p = NULL;
|
||||
CSA_entry_handle *list;
|
||||
CSA_session_handle c_handle;
|
||||
CSA_return_code stat;
|
||||
CSA_calendar_user csa_user;
|
||||
int version;
|
||||
#ifdef FNS
|
||||
char buf[256];
|
||||
#endif
|
||||
|
||||
init_time();
|
||||
setlocale(LC_ALL, "");
|
||||
_DtEnvControl(DT_ENV_SET); /* set up environment variables */
|
||||
DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE);
|
||||
cm_tty_load_props(&p);
|
||||
cm_args(argc,argv); /* parse command line */
|
||||
target = (cm_strlen(cm_target)) ? cm_target : cm_get_credentials();
|
||||
|
||||
#ifdef FNS
|
||||
dtfns_init();
|
||||
if (cmfns_use_fns(p)) {
|
||||
cmfns_lookup_calendar(target, buf, sizeof(buf));
|
||||
target = buf;
|
||||
}
|
||||
#endif
|
||||
if (cm_strlen(cm_date)) date = cm_date;
|
||||
if (cm_strlen(cm_view)) view = cm_view;
|
||||
|
||||
uname = cm_target2name(target);
|
||||
loc = cm_target2location(target);
|
||||
|
||||
csa_user.user_name = target;
|
||||
csa_user.user_type = 0;
|
||||
csa_user.calendar_user_extensions = NULL;
|
||||
csa_user.calendar_address = target;
|
||||
stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL);
|
||||
|
||||
if (stat != CSA_SUCCESS) {
|
||||
char *format = strdup(catgets(DT_catd, 1, 188,
|
||||
"\nCould not open calendar %s\n"));
|
||||
fprintf(stderr, format,
|
||||
target ? target : catgets(DT_catd, 1, 189, "UNKNOWN"));
|
||||
free(format);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(1);
|
||||
}
|
||||
version = get_data_version(c_handle);
|
||||
|
||||
while (!cm_index) {
|
||||
if ((cnt = cm_tty_lookup(DT_catd, c_handle, version, date,
|
||||
view, &list, p)) <= 0) {
|
||||
csa_logoff(c_handle, NULL);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(0);
|
||||
}
|
||||
fprintf(stdout, catgets(DT_catd, 1, 190,
|
||||
"Item to delete (number)? "));
|
||||
fgets(index, 9, stdin);
|
||||
fprintf(stdout,"\n\n");
|
||||
if (*index < '0' || *index > '9') {
|
||||
csa_free(list);
|
||||
break;
|
||||
}
|
||||
cm_index = atoi(index);
|
||||
if (cnt >= cm_index)
|
||||
cm_tty_delete(DT_catd, c_handle, version,
|
||||
cm_index - 1, list);
|
||||
memset(index, '\0', 10);
|
||||
csa_free(list);
|
||||
cm_index = 0;
|
||||
}
|
||||
|
||||
csa_logoff(c_handle, NULL);
|
||||
props_clean_up(p);
|
||||
free(p);
|
||||
free(uname);
|
||||
free(loc);
|
||||
return 0;
|
||||
}
|
||||
395
cde/programs/dtcm/dtcm/cm_i18n.c
Normal file
395
cde/programs/dtcm/dtcm/cm_i18n.c
Normal file
@@ -0,0 +1,395 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_i18n.c
|
||||
**
|
||||
** $TOG: cm_i18n.c /main/9 1998/04/01 17:26:31 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
/*
|
||||
|
||||
This include has been left out for the moment because of a
|
||||
definition of the symbol "single" in rtable4.h. This
|
||||
should be fixed in the future.
|
||||
|
||||
#include <floatingpoint.h>
|
||||
*/
|
||||
#include <locale.h>
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
#include <Xm/Xm.h>
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "cm_i18n.h"
|
||||
#include "deskset.h"
|
||||
/*
|
||||
#include "gettext.h"
|
||||
*/
|
||||
|
||||
#include <langinfo.h>
|
||||
/* Iconv not defined for linux. Use the EUSCompat stubs instead. */
|
||||
#if !defined(linux)
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
#include <EUSCompat.h>
|
||||
|
||||
char *fontset1[2];
|
||||
char *fontset2[2];
|
||||
int use_octal = FALSE;
|
||||
|
||||
|
||||
int
|
||||
is_comment(char line[MAX_LINE_LEN])
|
||||
{
|
||||
char ch[2];
|
||||
|
||||
strncpy(ch, line, 1);
|
||||
if ( strcmp((char *)ch, COMMENT_SYMBOL) == 0 ) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
match_locale(char *locale, char line[MAX_LINE_LEN])
|
||||
{
|
||||
char loc[MAX_LINE_LEN];
|
||||
|
||||
if ( !isalpha(line[0]) ) {
|
||||
return 0;
|
||||
}
|
||||
(void) sscanf(line, "%s", loc);
|
||||
if ( strcmp(loc, locale) == 0 ) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code was very similar to what was developped for dtmail's
|
||||
* conversion mechanism. See libDtMail/RFC/RFCMIME.C ! Have fun !
|
||||
*/
|
||||
#define WORKSIZE 1024
|
||||
static void *_i18nwork1 = NULL;
|
||||
static unsigned long _i18nsize1 = 0;
|
||||
static int shouldAlloc1 = ~0;
|
||||
static int isFirstCall = ~0;
|
||||
static iconv_t CD = (iconv_t)-1;
|
||||
static int amI_932 = ~0;
|
||||
|
||||
#ifdef ICONV_INBUF_CONST
|
||||
# define ICONV_INBUF_TYPE const char **
|
||||
#else
|
||||
# define ICONV_INBUF_TYPE char **
|
||||
#endif
|
||||
|
||||
void _converter_( void *from, unsigned long from_len,
|
||||
void **to, unsigned long *to_len )
|
||||
{
|
||||
char *InBuf;
|
||||
size_t InBytesLeft;
|
||||
char *OutBuf = NULL;
|
||||
size_t OutBytesLeft = 0;
|
||||
size_t _OutBytesLeft = 0;
|
||||
size_t iconv_ret;
|
||||
size_t converted_num = 0;
|
||||
|
||||
*to = NULL;
|
||||
*to_len = 0;
|
||||
|
||||
if ( shouldAlloc1 ) {
|
||||
/* Obtain work area */
|
||||
_i18nwork1 = (size_t *)malloc( WORKSIZE );
|
||||
if ( !_i18nwork1 ) {
|
||||
_i18nwork1 = NULL;
|
||||
return;
|
||||
}
|
||||
_i18nsize1 = WORKSIZE;
|
||||
shouldAlloc1 = 0;
|
||||
}
|
||||
#ifdef _AIX
|
||||
if ( isFirstCall ) {
|
||||
if ( ( CD = iconv_open( "IBM-eucJP", "IBM-932" ) ) == (iconv_t)-1 )
|
||||
return; /* no converter */
|
||||
amI_932 = !strncasecmp( "IBM-932", nl_langinfo( CODESET ), 7 );
|
||||
isFirstCall = 0;
|
||||
}
|
||||
#endif /* _AIX */
|
||||
|
||||
if ( ( !amI_932 ) || ( CD == (iconv_t)-1 ) )
|
||||
return;
|
||||
|
||||
InBuf = (char *)from;
|
||||
InBytesLeft = from_len;
|
||||
OutBytesLeft = _i18nsize1;
|
||||
OutBuf = (char *)_i18nwork1;
|
||||
|
||||
while( 1 ) {
|
||||
/*
|
||||
* InBuf
|
||||
* v
|
||||
* +----------------------------+
|
||||
* | | | |
|
||||
* +----------------------------+
|
||||
* <-------------------------->
|
||||
* InBytesLeft
|
||||
*
|
||||
* |
|
||||
* | iconv()
|
||||
* V
|
||||
* (_i18nwork1)
|
||||
* OutBuf
|
||||
* v
|
||||
* +----------------------------+
|
||||
* | | | |
|
||||
* +----------------------------+
|
||||
* <-------------------------->
|
||||
* InBytesLeft
|
||||
*/
|
||||
|
||||
iconv_ret = iconv( CD, (ICONV_INBUF_TYPE)&InBuf, &InBytesLeft,
|
||||
&OutBuf, &OutBytesLeft );
|
||||
if ( iconv_ret == 0 ) {
|
||||
/* iconv done
|
||||
* InBuf
|
||||
* v
|
||||
* +----------------------------+
|
||||
* |XXXXXXXXXXXXXXXXXXXXXXXXXXXX|
|
||||
* +----------------------------+
|
||||
*
|
||||
* InBytesLeft=0
|
||||
*
|
||||
* (_i18nwork1)
|
||||
* | OutBuf
|
||||
* V v
|
||||
* +----------------------------+
|
||||
* |XXXXXXXXXXXXXXXXX| | | |
|
||||
* +----------------------------+
|
||||
* <---------------> <-------->
|
||||
* converted_num OutBytesLeft
|
||||
*/
|
||||
converted_num = (unsigned long)((char *)OutBuf-(char *)_i18nwork1);
|
||||
*to = (void *)_i18nwork1;
|
||||
*to_len = (unsigned long)converted_num;
|
||||
break;
|
||||
} else {
|
||||
if ( errno == E2BIG ) {
|
||||
/* Overflow. still data is left.
|
||||
* InBuf
|
||||
* v
|
||||
* +----------------------------+
|
||||
* |XXXXXXXXXXXXXX| | | |
|
||||
* +----------------------------+
|
||||
* <----------->
|
||||
* InBytesLeft
|
||||
*
|
||||
* (_i18nwork1)
|
||||
* | OutBuf
|
||||
* V v
|
||||
* +----------------------------+
|
||||
* |XXXXXXXXXXXXXXXXXXXXXXXXXXX |
|
||||
* +----------------------------+
|
||||
* <------------------------->
|
||||
* converted_num OutBytesLeft=?
|
||||
*/
|
||||
void *_p;
|
||||
|
||||
/* Check how many converted already. */
|
||||
|
||||
converted_num =
|
||||
(unsigned long)((char *)OutBuf - (char *)_i18nwork1);
|
||||
_i18nsize1 += WORKSIZE;
|
||||
_p = realloc( _i18nwork1, _i18nsize1 );
|
||||
if ( !_p ) {
|
||||
*to = NULL;
|
||||
*to_len = 0;
|
||||
free( _i18nwork1 );
|
||||
_i18nwork1 = NULL;
|
||||
_i18nsize1 = 0;
|
||||
shouldAlloc1 = ~0;
|
||||
break;
|
||||
} else {
|
||||
_i18nwork1 = _p;
|
||||
OutBuf = (char *)((char*)_i18nwork1 + converted_num);
|
||||
OutBytesLeft += WORKSIZE;
|
||||
}
|
||||
} else {
|
||||
*to = NULL;
|
||||
*to_len = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* NULL terminate
|
||||
*/
|
||||
if ( _i18nsize1 > converted_num ) {
|
||||
((char *)_i18nwork1)[converted_num] = '\0';
|
||||
} else { /* _i18nsize1 == converted_num */
|
||||
void *_p;
|
||||
|
||||
_i18nsize1++;
|
||||
_p = realloc( _i18nwork1, _i18nsize1 );
|
||||
|
||||
if ( !_p ) {
|
||||
*to = NULL;
|
||||
*to_len = 0;
|
||||
free( _i18nwork1 );
|
||||
_i18nwork1 = NULL;
|
||||
_i18nsize1 = 0;
|
||||
shouldAlloc1 = ~0;
|
||||
} else {
|
||||
_i18nwork1 = _p;
|
||||
((char *)_i18nwork1)[converted_num] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* The following routine is specific to using FMapType 3 composite fonts
|
||||
* in postscript. Kanji, Asian specific?
|
||||
*/
|
||||
char *
|
||||
euc_to_octal(char *srcStr)
|
||||
{
|
||||
int inKanji = FALSE;
|
||||
char buf[64];
|
||||
static char dstStr[512];
|
||||
int i;
|
||||
int len = cm_strlen(srcStr);
|
||||
|
||||
#ifdef SVR4
|
||||
memset(dstStr, 0, sizeof(dstStr));
|
||||
#else
|
||||
bzero(dstStr, sizeof(dstStr));
|
||||
#endif /* SVR4 */
|
||||
for (i = 0; i < len; i++) {
|
||||
if (inKanji) {
|
||||
if (!isEUC(srcStr[i])) {
|
||||
inKanji = FALSE;
|
||||
/* NOT NEEDED FOR FMapType 4 (or 5)
|
||||
cm_strcat(dstStr, "\\377\\000");
|
||||
*/
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isEUC(srcStr[i])) {
|
||||
inKanji = TRUE;
|
||||
/* NOT NEEDED FOR FMapType 4 (or 5)
|
||||
cm_strcat(dstStr, "\\377\\001");
|
||||
*/
|
||||
}
|
||||
}
|
||||
if (inKanji) {
|
||||
sprintf(buf, "\\%3.3o\\%3.3o", srcStr[i] & 0xff, srcStr[i+1] & 0xff);
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
sprintf(buf, "%c", srcStr[i]);
|
||||
}
|
||||
cm_strcat(dstStr, buf);
|
||||
}
|
||||
return dstStr;
|
||||
}
|
||||
|
||||
|
||||
/* This routine should be in libdeskset.
|
||||
* This routine uses fconvert() to avoid locale conversion.
|
||||
*/
|
||||
/* 310 characters are the minimum needed to accommodate any double-precision
|
||||
* value + 1 null terminator.
|
||||
*/
|
||||
#define DBL_SIZE 311
|
||||
/*
|
||||
* Returns a null terminated formatted string.
|
||||
* If error is encountered, such as malloc() failed, then return NULL.
|
||||
* The caller of this function should beware that the return value is
|
||||
* a static buffer declared within this function and the value of it may
|
||||
* change.
|
||||
*/
|
||||
char *
|
||||
cm_printf(double value, int decimal_pt)
|
||||
{
|
||||
int sign = 0;
|
||||
int deci_pt = 0;
|
||||
int buf_cnt = 0;
|
||||
int formatted_cnt = 0;
|
||||
int buf_len = 0;
|
||||
char *buf = NULL;
|
||||
static char *formatted = NULL;
|
||||
|
||||
if ( formatted != NULL ) {
|
||||
free(formatted);
|
||||
formatted = NULL;
|
||||
}
|
||||
if ( (value == (double)0) && (decimal_pt == 0) ) {
|
||||
formatted = (char *)cm_strdup("0");
|
||||
return formatted;
|
||||
}
|
||||
if ( (buf = (char *)malloc(DBL_SIZE + decimal_pt)) == NULL ) {
|
||||
return (char *)NULL;
|
||||
}
|
||||
if ( (formatted = (char *)calloc(1, DBL_SIZE + decimal_pt)) == NULL ) {
|
||||
free(buf);
|
||||
return (char *)NULL;
|
||||
}
|
||||
#ifdef SunOS
|
||||
fconvert(value, decimal_pt, &deci_pt, &sign, buf);
|
||||
#else
|
||||
/* this version, available on the HP and AIX machine is not reentrant. */
|
||||
|
||||
strcpy(buf, fcvt(value, decimal_pt, &deci_pt, &sign));
|
||||
#endif
|
||||
if ( sign ) {
|
||||
strcpy(formatted, "-");
|
||||
}
|
||||
buf_len = deci_pt + decimal_pt;
|
||||
if ( deci_pt ) {
|
||||
strncat(formatted, buf, deci_pt);
|
||||
} else { /* zero */
|
||||
strcat(formatted, "0");
|
||||
}
|
||||
if ( deci_pt == buf_len ) {
|
||||
strcat(formatted, "\0");
|
||||
free(buf);
|
||||
return formatted;
|
||||
}
|
||||
strcat(formatted, ".");
|
||||
for ( formatted_cnt = strlen(formatted), buf_cnt = deci_pt; buf_cnt < buf_len; buf_cnt++, formatted_cnt++ ) {
|
||||
formatted[formatted_cnt] = buf[buf_cnt];
|
||||
}
|
||||
formatted[formatted_cnt] = '\0';
|
||||
free(buf);
|
||||
return formatted;
|
||||
}
|
||||
79
cde/programs/dtcm/dtcm/cm_i18n.h
Normal file
79
cde/programs/dtcm/dtcm/cm_i18n.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_i18n.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)cm_i18n.h 1.7 94/12/22 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: cm_i18n.h /main/4 1996/11/07 17:00:36 drk $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _FILENAME
|
||||
#define _FILENAME
|
||||
#endif
|
||||
|
||||
/* CM font file description:
|
||||
*
|
||||
* Each line cannot exceed MAX_LINE_LEN.
|
||||
* File format is as follows:
|
||||
* <Locale name> <fontset1_fontname1> <fontset2_fontname1>
|
||||
* <fontset1_fontname2> <fontset2_fontname2>
|
||||
* Line starts at left most margin.
|
||||
* Categories separated by space(s).
|
||||
* Comment lines start with an '%'
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_LINE_LEN 128
|
||||
#define MAX_FONT_LEN 40
|
||||
#define COMMENT_SYMBOL "%"
|
||||
#define CHAR_SIZE sizeof(char)
|
||||
#define isEUC(c) ((c) & 0x80 ? TRUE : FALSE)
|
||||
|
||||
/* cm_get_fonts()'s return values */
|
||||
#define OPEN_FAIL -1
|
||||
#define NO_LOCALE_ENTRY -2
|
||||
#define EXTRACT_FAIL -3
|
||||
#define OKAY 1
|
||||
#define NO_I18N_HEADER 2
|
||||
|
||||
extern char *fontset1[];
|
||||
extern char *fontset2[];
|
||||
extern int use_default_fonts;
|
||||
extern int use_octal;
|
||||
|
||||
extern int cm_get_fonts(/* char * */);
|
||||
extern void ps_i18n_header(/* FILE *, Frame */);
|
||||
extern char *euc_to_octal(/* char * */);
|
||||
extern char *cm_get_i18n_date(/* Frame, char * */);
|
||||
extern char *cm_printf();
|
||||
|
||||
int is_comment();
|
||||
int match_locale();
|
||||
|
||||
extern int cm_get_fonts P((char *));
|
||||
extern int is_comment P((char[MAX_LINE_LEN]));
|
||||
extern int match_locale P((char *, char[MAX_LINE_LEN]));
|
||||
extern void ps_i18n_header P((FILE *, Widget));
|
||||
extern char* euc_to_octal P((char *));
|
||||
extern char* cm_get_i18n_date P((Widget, char *));
|
||||
extern char* cm_printf P((double, int));
|
||||
355
cde/programs/dtcm/dtcm/cm_insert.c
Normal file
355
cde/programs/dtcm/dtcm/cm_insert.c
Normal file
@@ -0,0 +1,355 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_insert.c
|
||||
**
|
||||
** $TOG: cm_insert.c /main/8 1998/04/20 13:08:52 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cm_insert.c 1.31 95/05/19 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <nl_types.h>
|
||||
#include <locale.h>
|
||||
#include "util.h"
|
||||
#include "getdate.h"
|
||||
#include "timeops.h"
|
||||
#include "props.h"
|
||||
#include "cm_tty.h"
|
||||
#ifdef FNS
|
||||
#include "dtfns.h"
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
#include <Dt/Dt.h>
|
||||
#include <Dt/EnvControlP.h>
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
int debug = 0;
|
||||
static nl_catd DT_catd;
|
||||
static char cm_target[256] = ""; /* target for table (user@host) */
|
||||
static int cm_today = 0; /* today's date (in epoch time) */
|
||||
static char cm_date[256] = ""; /* appointment date */
|
||||
static char cm_view[16] = "day"; /* view span (day,week,month) */
|
||||
static char cm_start[16] = ""; /* start time for appointment list*/
|
||||
static char cm_end[16] = ""; /* end time for appointment list */
|
||||
static char cm_repeatstr[256] = "One Time";/* repeat period */
|
||||
static char cm_for[256] = ""; /* number of repeats */
|
||||
static char cm_what[1024] = "Appointment";
|
||||
/* what appointment is about */
|
||||
static char cm_appt_file[1024] = "";
|
||||
/* file to find an appointment template in */
|
||||
static int cm_repeat = 0; /* how often to repeat this */
|
||||
static int cm_flash = 0; /* flash reminder */
|
||||
static int cm_beep = 0; /* beep reminder */
|
||||
static int cm_open = 0; /* open reminder */
|
||||
static int cm_mail = 0; /* mail reminder */
|
||||
|
||||
static void cm_args(); /* parse command line */
|
||||
|
||||
static char**
|
||||
grab(char **argv, /* command line arguments */
|
||||
char *buf, /* buffer for keyed data */
|
||||
char stop_key)
|
||||
{
|
||||
if (!argv || !*argv) return(argv);
|
||||
cm_strcpy (buf,*argv++);
|
||||
while(argv && *argv) {
|
||||
if (*(*argv) == stop_key) break;
|
||||
cm_strcat(buf," ");
|
||||
cm_strcat(buf,*argv++);
|
||||
}
|
||||
argv--;
|
||||
return(argv);
|
||||
}
|
||||
|
||||
static void
|
||||
cm_args(int argc, char **argv)
|
||||
{
|
||||
|
||||
while (++argv && *argv) {
|
||||
switch(*(*argv+1)) {
|
||||
case 't':
|
||||
case 'c':
|
||||
argv = grab(++argv,cm_target,'-');
|
||||
break;
|
||||
case 'd':
|
||||
argv = grab(++argv,cm_date,'-');
|
||||
break;
|
||||
case 'v':
|
||||
argv = grab(++argv,cm_view,'-');
|
||||
break;
|
||||
case 's':
|
||||
argv = grab(++argv,cm_start,'-');
|
||||
break;
|
||||
case 'e':
|
||||
argv = grab(++argv,cm_end,'-');
|
||||
break;
|
||||
case 'w':
|
||||
argv = grab(++argv,cm_what,'-');
|
||||
break;
|
||||
case 'a':
|
||||
argv = grab(++argv,cm_appt_file,'-');
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, catgets(DT_catd, 1, 191, "Usage:\n\tdtcm_insert [ -c calendar ] [-d <mm/dd/yy>] [ -v view ]\n"));
|
||||
fprintf(stderr, catgets(DT_catd, 1, 192, " [-w what string] [-s <HH:MMam/pm>] [-e <HH:MMam/pm>]\n"));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
prompt_for_line(char *prompt, char *defval, char *buffer)
|
||||
{
|
||||
char input_buf[1024];
|
||||
|
||||
printf(prompt, defval);
|
||||
|
||||
*input_buf = '\0';
|
||||
fgets (input_buf, sizeof(input_buf), stdin);
|
||||
if (strlen(input_buf) && input_buf[strlen(input_buf)-1] == '\n')
|
||||
input_buf[strlen(input_buf)-1] = '\0';
|
||||
|
||||
if (input_buf[0] && (input_buf[0] != '\n'))
|
||||
cm_strcpy(buffer, input_buf);
|
||||
else
|
||||
cm_strcpy(buffer, defval);
|
||||
}
|
||||
|
||||
static void
|
||||
prompt_for_insert(Props *p) {
|
||||
char date_str[BUFSIZ], what_buffer[BUFSIZ], buf[BUFSIZ], *timecopy;
|
||||
int index, next, valid = FALSE;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
format_tick(now(), get_int_prop(p, CP_DATEORDERING),
|
||||
get_int_prop(p, CP_DATESEPARATOR), date_str);
|
||||
|
||||
printf(catgets(DT_catd, 1, 193, "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n"));
|
||||
prompt_for_line(catgets(DT_catd, 1, 194,
|
||||
"Calendar (%s): "), cm_get_credentials(), cm_target);
|
||||
prompt_for_line(catgets(DT_catd, 1, 195,
|
||||
"Date (%s): "), date_str, cm_date);
|
||||
while (valid != TRUE)
|
||||
{
|
||||
format_time(now(), dt, cm_start);
|
||||
prompt_for_line(catgets(DT_catd, 1, 196,
|
||||
"Start (%s): "), cm_start, cm_start);
|
||||
if (cm_start && cm_start[0])
|
||||
{
|
||||
timecopy = (char *)cm_strdup(cm_start);
|
||||
if (valid_time(p, timecopy))
|
||||
valid = TRUE;
|
||||
else
|
||||
printf(catgets(DT_catd, 1, 197, "You have entered an invalid time. Please try again:\n"));
|
||||
free(timecopy);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buf, "%s %s", date_str, cm_start);
|
||||
next = (int) cm_getdate(buf, NULL);
|
||||
next = next + hrsec;
|
||||
|
||||
format_time(next, dt, cm_end);
|
||||
if (cm_start && cm_start[0])
|
||||
prompt_for_line(
|
||||
catgets(DT_catd, 1, 198, "End (%s): "), cm_end, cm_end);
|
||||
else
|
||||
prompt_for_line(
|
||||
catgets(DT_catd, 1, 199, "End (%s): "), "None", cm_end);
|
||||
|
||||
strcpy(cm_repeatstr, catgets(DT_catd, 1, 200, "One Time"));
|
||||
|
||||
prompt_for_line(catgets(DT_catd, 1, 201,
|
||||
"Repeat (%s): "), cm_repeatstr, cm_repeatstr);
|
||||
|
||||
if (strcmp(cm_repeatstr, catgets(DT_catd, 1, 200, "One Time"))) {
|
||||
sprintf(buf, catgets(DT_catd, 1, 203, "no default"));
|
||||
prompt_for_line(
|
||||
catgets(DT_catd, 1, 204, "For (%s): "), buf, cm_for);
|
||||
}
|
||||
|
||||
printf(catgets(DT_catd, 1, 205,
|
||||
"What (you may enter up to 5 lines, use ^D to finish):\n"));
|
||||
cm_what[0] = NULL;
|
||||
for (index = 0; index < 5; index++)
|
||||
{
|
||||
*what_buffer = '\0';
|
||||
fgets (what_buffer, sizeof(what_buffer), stdin);
|
||||
if (strlen(what_buffer) &&
|
||||
what_buffer[strlen(what_buffer)-1] == '\n')
|
||||
what_buffer[strlen(what_buffer)-1] = '\0';
|
||||
|
||||
if (what_buffer[0] == '\000')
|
||||
break;
|
||||
else
|
||||
{
|
||||
strcat(cm_what, what_buffer);
|
||||
strcat(cm_what, "\\n");
|
||||
}
|
||||
memset(what_buffer, '\000', 256);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int cnt, status = 0;
|
||||
char *date = NULL, *view = NULL, *target = NULL,
|
||||
*start = NULL, *end = NULL, *repeat = NULL,
|
||||
*numrepeat = NULL, *what = NULL, *uname, *loc;
|
||||
Props *p = NULL;
|
||||
CSA_entry_handle *list;
|
||||
CSA_session_handle c_handle;
|
||||
CSA_return_code stat;
|
||||
CSA_calendar_user csa_user;
|
||||
DisplayType dt;
|
||||
int version;
|
||||
char date_str[256];
|
||||
#ifdef FNS
|
||||
char buf[256];
|
||||
#endif
|
||||
|
||||
init_time();
|
||||
_DtEnvControl(DT_ENV_SET); /* set up environment variables */
|
||||
setlocale(LC_ALL, "");
|
||||
DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE);
|
||||
cm_tty_load_props(&p);
|
||||
dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
#ifdef FNS
|
||||
dtfns_init();
|
||||
#endif
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
cm_args(argc,argv); /* parse command line */
|
||||
if (cm_strlen(cm_target))
|
||||
target = cm_target;
|
||||
else
|
||||
target = cm_get_credentials();
|
||||
#ifdef FNS
|
||||
if (cmfns_use_fns(p)) {
|
||||
cmfns_lookup_calendar(target, buf, sizeof(buf));
|
||||
target = buf;
|
||||
}
|
||||
#endif
|
||||
uname = cm_target2name(target);
|
||||
loc = cm_target2location(target);
|
||||
|
||||
csa_user.user_name = target;
|
||||
csa_user.user_type = 0;
|
||||
csa_user.calendar_user_extensions = NULL;
|
||||
csa_user.calendar_address = target;
|
||||
stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
char *format = cm_strdup(catgets(DT_catd, 1, 206,
|
||||
"\nCould not open calendar %s\n"));
|
||||
fprintf(stderr, format,
|
||||
target ? target :
|
||||
catgets(DT_catd, 1, 209, "UNKNOWN"));
|
||||
free(format);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(1);
|
||||
}
|
||||
version = get_data_version(c_handle);
|
||||
if (!cm_date[0])
|
||||
format_tick(now(), get_int_prop(p, CP_DATEORDERING),
|
||||
get_int_prop(p, CP_DATESEPARATOR), cm_date);
|
||||
if (cm_strlen(cm_date)) date = cm_date;
|
||||
if (cm_strlen(cm_view)) view = cm_view;
|
||||
if (cm_strlen(cm_start)) start = cm_start;
|
||||
|
||||
if (!cm_end[0] && cm_start[0]) {
|
||||
format_time((int)cm_getdate(cm_start, NULL) + hrsec,
|
||||
dt, cm_end);
|
||||
}
|
||||
|
||||
if (cm_strlen(cm_end)) end = cm_end;
|
||||
if (cm_strlen(cm_repeatstr)) repeat = cm_repeatstr;
|
||||
if (cm_strlen(cm_for)) numrepeat = cm_for;
|
||||
if (cm_strlen(cm_what)) what = cm_what;
|
||||
if (!cm_appt_file[0])
|
||||
status = cm_tty_insert(DT_catd, c_handle, version,
|
||||
date, start, end, repeat, numrepeat,
|
||||
what, NULL, p);
|
||||
else
|
||||
status = cm_tty_insert(DT_catd, c_handle, version, date,
|
||||
start, end, repeat, numrepeat,
|
||||
what, cm_appt_file, p);
|
||||
} else {
|
||||
prompt_for_insert(p);
|
||||
if (cm_strlen(cm_target)) target = cm_target;
|
||||
uname = cm_target2name(target);
|
||||
loc = cm_target2location(target);
|
||||
|
||||
csa_user.user_name = target;
|
||||
csa_user.user_type = 0;
|
||||
csa_user.calendar_user_extensions = NULL;
|
||||
csa_user.calendar_address = target;
|
||||
stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL);
|
||||
if (stat !=CSA_SUCCESS) {
|
||||
char *format = cm_strdup(catgets(DT_catd, 1, 206,
|
||||
"\nCould not open calendar %s\n"));
|
||||
fprintf(stderr, format,
|
||||
target ? target :
|
||||
catgets(DT_catd, 1, 209, "UNKNOWN"));
|
||||
free(format);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(1);
|
||||
}
|
||||
version = get_data_version(c_handle);
|
||||
if (cm_strlen(cm_date)) date = cm_date;
|
||||
if (cm_strlen(cm_view)) view = cm_view;
|
||||
if (cm_strlen(cm_start)) start = cm_start;
|
||||
if (cm_strlen(cm_end)) end = cm_end;
|
||||
if (cm_strlen(cm_repeatstr)) repeat = cm_repeatstr;
|
||||
if (cm_strlen(cm_for)) numrepeat = cm_for;
|
||||
if (cm_strlen(cm_what)) what = cm_what;
|
||||
status = cm_tty_insert(DT_catd, c_handle, version, date,
|
||||
start, end, repeat, numrepeat, what, NULL, p);
|
||||
}
|
||||
if ((cnt = cm_tty_lookup(DT_catd, c_handle, version, date, view,
|
||||
&list, p)) > 0)
|
||||
csa_free(list);
|
||||
csa_logoff(c_handle, NULL);
|
||||
props_clean_up(p);
|
||||
free(p);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(status);
|
||||
}
|
||||
164
cde/programs/dtcm/dtcm/cm_lookup.c
Normal file
164
cde/programs/dtcm/dtcm/cm_lookup.c
Normal file
@@ -0,0 +1,164 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cm_lookup.c
|
||||
**
|
||||
** $TOG: cm_lookup.c /main/8 1998/04/21 10:21:26 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cm_lookup.c 1.30 95/03/08 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <nl_types.h>
|
||||
#include <locale.h>
|
||||
#include "cm_tty.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#ifdef FNS
|
||||
#include "dtfns.h"
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
#include <Dt/Dt.h>
|
||||
#include <Dt/EnvControlP.h>
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
int debug = 0;
|
||||
static char cm_target[256] = ""; /* target for table (user@host) */
|
||||
static char cm_date[256] = ""; /* appointment date */
|
||||
static char cm_view[16] = ""; /* view span (day,week,month) */
|
||||
static nl_catd DT_catd;
|
||||
|
||||
static char**
|
||||
grab(char**argv, /* command line arguments */
|
||||
char *buf, /* buffer for keyed data */
|
||||
char stop_key)
|
||||
{
|
||||
if (!argv || !*argv) return(argv);
|
||||
cm_strcpy (buf,*argv++);
|
||||
while(argv && *argv) {
|
||||
if (*(*argv) == stop_key) break;
|
||||
cm_strcat(buf," ");
|
||||
cm_strcat(buf,*argv++);
|
||||
}
|
||||
argv--;
|
||||
return(argv);
|
||||
}
|
||||
|
||||
static void
|
||||
cm_args(int argc, char **argv)
|
||||
{
|
||||
|
||||
while (++argv && *argv) {
|
||||
switch(*(*argv+1)) {
|
||||
case 't':
|
||||
case 'c':
|
||||
argv = grab(++argv,cm_target,'-');
|
||||
break;
|
||||
case 'd':
|
||||
argv = grab(++argv,cm_date,'-');
|
||||
break;
|
||||
case 'v':
|
||||
argv = grab(++argv,cm_view,'-');
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,catgets(DT_catd, 1, 207, "Usage:\n\tdtcm_lookup [ -c calendar ][ -d <mm/dd/yy> ] [ -v view ]\n"));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int cnt;
|
||||
char *target = NULL, *date = NULL, *view = NULL,
|
||||
*uname, *loc;
|
||||
Props *p = NULL;
|
||||
CSA_session_handle c_handle;
|
||||
CSA_entry_handle *list;
|
||||
CSA_return_code stat;
|
||||
CSA_calendar_user csa_user;
|
||||
int version;
|
||||
#ifdef FNS
|
||||
char buf[256];
|
||||
#endif
|
||||
|
||||
init_time();
|
||||
_DtEnvControl(DT_ENV_SET); /* set up environment variables */
|
||||
setlocale(LC_ALL, "");
|
||||
DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE);
|
||||
cm_tty_load_props(&p);
|
||||
cm_args(argc,argv); /* parse command line */
|
||||
|
||||
target = (cm_strlen(cm_target)) ? cm_target : cm_get_credentials();
|
||||
#ifdef FNS
|
||||
dtfns_init();
|
||||
if (cmfns_use_fns(p)) {
|
||||
cmfns_lookup_calendar(target, buf, sizeof(buf));
|
||||
target = buf;
|
||||
}
|
||||
#endif
|
||||
uname = cm_target2name(target);
|
||||
loc = cm_target2location(target);
|
||||
|
||||
csa_user.user_name = target;
|
||||
csa_user.user_type = 0;
|
||||
csa_user.calendar_user_extensions = NULL;
|
||||
csa_user.calendar_address = target;
|
||||
stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL);
|
||||
|
||||
if (stat != CSA_SUCCESS) {
|
||||
char *format = cm_strdup(catgets(DT_catd, 1, 208,
|
||||
"\nCould not open calendar \"%s\"\n"));
|
||||
fprintf(stderr, format,
|
||||
target ? target : catgets(DT_catd, 1, 209, "UNKNOWN"));
|
||||
free(format);
|
||||
free(uname);
|
||||
free(loc);
|
||||
exit(1);
|
||||
}
|
||||
version = get_data_version(c_handle);
|
||||
if (cm_strlen(cm_date)) date = cm_date;
|
||||
if (cm_strlen(cm_view)) view = cm_view;
|
||||
|
||||
if ((cnt = cm_tty_lookup(DT_catd, c_handle, version, date, view,
|
||||
&list, p)) > 0)
|
||||
csa_free(list);
|
||||
csa_logoff(c_handle, NULL);
|
||||
props_clean_up(p);
|
||||
free(p);
|
||||
free(uname);
|
||||
free(loc);
|
||||
return 0;
|
||||
}
|
||||
66
cde/programs/dtcm/dtcm/cmgr.icon
Normal file
66
cde/programs/dtcm/dtcm/cmgr.icon
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0400, 0x0000,
|
||||
0x0000, 0x0280, 0x0A00, 0x0000,
|
||||
0x0007, 0xFEFF, 0xFBFF, 0x8000,
|
||||
0x0007, 0xFEFF, 0xFBFF, 0xC000,
|
||||
0x0007, 0x8280, 0x0A0F, 0xC000,
|
||||
0x0006, 0x02A0, 0x0A83, 0xC000,
|
||||
0x0007, 0xFEFF, 0xFBFF, 0xC000,
|
||||
0x0008, 0x0290, 0x0A40, 0xC000,
|
||||
0x0008, 0x02A8, 0x0AA0, 0xC000,
|
||||
0x0008, 0x06D0, 0x1B40, 0xC000,
|
||||
0x0008, 0x06E0, 0x1B80, 0xD000,
|
||||
0x0008, 0x07C0, 0x1F00, 0xE800,
|
||||
0x0008, 0x0380, 0x0E00, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x0000, 0xD000,
|
||||
0x0008, 0x0000, 0x0000, 0xE800,
|
||||
0x0008, 0x0000, 0x00FF, 0xD000,
|
||||
0x0008, 0x0000, 0x0081, 0xE800,
|
||||
0x0008, 0x0000, 0x0082, 0xD000,
|
||||
0x0008, 0x0000, 0x0084, 0xE800,
|
||||
0x0008, 0x0000, 0x0088, 0xD000,
|
||||
0x0008, 0x0000, 0x0090, 0xE800,
|
||||
0x0008, 0x0000, 0x00A0, 0xD000,
|
||||
0x0008, 0x0000, 0x00C0, 0xE800,
|
||||
0x0008, 0x0000, 0x0080, 0xD000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xA800,
|
||||
0x0001, 0x5555, 0x5555, 0x5000,
|
||||
0x0002, 0xAAAA, 0xAAAA, 0xA800,
|
||||
0x0001, 0x5555, 0x5555, 0x5000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
66
cde/programs/dtcm/dtcm/cmgrmask.icon
Normal file
66
cde/programs/dtcm/dtcm/cmgrmask.icon
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0400, 0x0000,
|
||||
0x0000, 0x0380, 0x0E00, 0x0000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0x8000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xC000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xE800,
|
||||
0x000F, 0xFFFF, 0xFFFF, 0xD000,
|
||||
0x0007, 0xFFFF, 0xFFFF, 0xA800,
|
||||
0x0001, 0x5555, 0x5555, 0x5000,
|
||||
0x0002, 0xAAAA, 0xAAAA, 0xA800,
|
||||
0x0001, 0x5555, 0x5555, 0x5000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
295
cde/programs/dtcm/dtcm/cmtt.c
Normal file
295
cde/programs/dtcm/dtcm/cmtt.c
Normal file
@@ -0,0 +1,295 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cmtt.c
|
||||
**
|
||||
** $TOG: cmtt.c /main/4 1999/09/20 10:29:41 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cmtt.c 1.13 95/05/01 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
#include <EUSCompat.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <Xm/XmAll.h>
|
||||
#include <Tt/tttk.h>
|
||||
#include <Dt/UserMsg.h>
|
||||
#include "calendar.h"
|
||||
#include "props.h"
|
||||
#include "misc.h"
|
||||
#include "cmfns.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
static Tt_message load_cb();
|
||||
|
||||
#ifdef FNS_DEMO
|
||||
static const char *ptype = "Sun_DtCm";
|
||||
|
||||
static void
|
||||
cm_iconic(
|
||||
Widget win,
|
||||
int iconic)
|
||||
|
||||
{
|
||||
if (iconic) {
|
||||
XIconifyWindow(XtDisplay(win),
|
||||
XtWindow(win),
|
||||
XScreenNumberOfScreen(XtScreen(win)));
|
||||
} else {
|
||||
XtPopup(win, XtGrabNone);
|
||||
XMapWindow(XtDisplay(win), XtWindow(win));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
OKCB (Widget dialog, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
XtUnmanageChild((Widget) client_data);
|
||||
}
|
||||
|
||||
void
|
||||
DieFromToolTalkError(Calendar *c, char *errfmt, Tt_status status)
|
||||
{
|
||||
Arg args[10];
|
||||
Widget dialog, dialogShell;
|
||||
char *errmsg, *statmsg, *title;
|
||||
XmString xms_errmsg, xms_ok, xms_title;
|
||||
int n;
|
||||
|
||||
if (! tt_is_err(status)) return;
|
||||
|
||||
statmsg = tt_status_message(status);
|
||||
errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2);
|
||||
sprintf(errmsg, errfmt, statmsg);
|
||||
|
||||
xms_ok = XmStringCreateLocalized(catgets(c->DT_catd, 2, 3, "OK"));
|
||||
xms_errmsg = XmStringCreateLocalized(errmsg);
|
||||
xms_title = XmStringCreateLocalized(catgets(c->DT_catd, 2, 1,
|
||||
"Calendar - Warning"));
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNokLabelString, xms_ok); n++;
|
||||
XtSetArg(args[n], XmNdialogTitle, xms_title); n++;
|
||||
XtSetArg(args[n], XmNmessageString, xms_errmsg); n++;
|
||||
XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++;
|
||||
|
||||
dialog = XmCreateWarningDialog(c->frame, "IconEditorError", args, n);
|
||||
XtAddCallback(dialog, XmNokCallback, OKCB, (XtPointer) dialog);
|
||||
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
|
||||
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
|
||||
|
||||
/*
|
||||
* Disable the frame menu from dialog since we don't want the user
|
||||
* to be able to close dialogs with the frame menu
|
||||
*/
|
||||
dialogShell = XtParent(dialog);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmwmDecorations, MWM_DECOR_ALL | MWM_DECOR_MENU); n++;
|
||||
XtSetValues(dialogShell, args, n);
|
||||
XtManageChild(dialog);
|
||||
XtRealizeWidget(dialogShell);
|
||||
|
||||
_DtSimpleError("Dtcm", DtWarning, NULL, errmsg);
|
||||
|
||||
XtFree(errmsg);
|
||||
XmStringFree(xms_ok);
|
||||
XmStringFree(xms_errmsg);
|
||||
XmStringFree(xms_title);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize tooltalk. Can be called multiple times: the first call
|
||||
* initializes tooltalk, subsequent calls are no-ops.
|
||||
*
|
||||
* Returns
|
||||
* -1 Error. Tooltalk not initialized
|
||||
* 0 Tooltalk already initialized
|
||||
* 1 Tooltalk succussfully intialized
|
||||
*/
|
||||
Tt_status
|
||||
cmtt_init(
|
||||
char *toolname,
|
||||
Calendar *c,
|
||||
XtAppContext context,
|
||||
Widget shell)
|
||||
|
||||
{
|
||||
int ttfd;
|
||||
Tt_status status;
|
||||
char *ttenv;
|
||||
char *session;
|
||||
|
||||
if (c->tt_procid) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ttenv = (char *)getenv("TT_SESSION");
|
||||
if (!ttenv || strlen(ttenv) == 0) {
|
||||
session = tt_X_session(XDisplayString(c->xcontext->display));
|
||||
tt_default_session_set(session);
|
||||
tt_free(session);
|
||||
}
|
||||
|
||||
c->tt_procid = ttdt_open(&ttfd, toolname, "SunSoft", "%I", 1);
|
||||
status = tt_ptr_error(c->tt_procid);
|
||||
if (tt_is_err(status)) {
|
||||
c->tt_procid = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef FNS_DEMO
|
||||
/*
|
||||
* Declare our ptype, and register the callback to handle
|
||||
* Edit/Display/Compose requests
|
||||
*/
|
||||
status = ttmedia_ptype_declare(ptype, 0, load_cb, (void *)c, 1);
|
||||
if (tt_is_err(status)) {
|
||||
fprintf(stderr, "cmtt_init could not declare ptype: %s\n",
|
||||
tt_status_message(status));
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
ttdt_session_join(0, NULL, shell, c, 1);
|
||||
|
||||
XtAppAddInput(context, ttfd, (XtPointer)XtInputReadMask,
|
||||
tttk_Xt_input_handler, c->tt_procid);
|
||||
|
||||
/* Process the message that started us, if any */
|
||||
tttk_Xt_input_handler( 0, 0, 0 );
|
||||
|
||||
return TT_OK;
|
||||
}
|
||||
|
||||
#ifdef FNS_DEMO
|
||||
static Tt_message
|
||||
contract_cb(
|
||||
Tt_message msg,
|
||||
Tttk_op op,
|
||||
Widget shell,
|
||||
void *clientdata,
|
||||
Tt_message contract)
|
||||
{
|
||||
|
||||
DP(("contract_cb(msg=%d, op=%d, shell=%d, data=%d, cntrct=%d)\n",
|
||||
msg, op, shell, clientdata, contract));
|
||||
|
||||
switch (op) {
|
||||
case TTDT_QUIT:
|
||||
case TTDT_GET_STATUS:
|
||||
case TTDT_PAUSE:
|
||||
case TTDT_RESUME:
|
||||
break;
|
||||
}
|
||||
/* For now do nothing */
|
||||
return msg;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle Edit, Display and Compose requests
|
||||
*/
|
||||
static Tt_message
|
||||
load_cb(
|
||||
Tt_message msg,
|
||||
void *clientdata,
|
||||
Tttk_op op,
|
||||
Tt_status diagnosis,
|
||||
unsigned char *contents,
|
||||
int len,
|
||||
char *file,
|
||||
char *docname
|
||||
)
|
||||
|
||||
{
|
||||
Tt_status status;
|
||||
char *p;
|
||||
char addr_buf[256];
|
||||
Calendar *c;
|
||||
Tt_pattern *contract_pats;
|
||||
|
||||
DP(("load_cb(msg=%d, op=%d, diag=%d, contents=%d, len=%d, file=%s, \
|
||||
docname=%s, data=%d)\n",
|
||||
msg, op, diagnosis, contents, len, file ? file : "<nil>",
|
||||
docname ? docname : "<nil>", clientdata));
|
||||
|
||||
c = (Calendar *)clientdata;
|
||||
|
||||
if (diagnosis != TT_OK) {
|
||||
if (tt_message_status(msg) == TT_WRN_START_MESSAGE) {
|
||||
/*
|
||||
* Error in start message! we may want to exit
|
||||
* here, but for now let toolkit handle error
|
||||
*/
|
||||
return msg;
|
||||
}
|
||||
|
||||
/* Let toolkit handle the error */
|
||||
return msg;
|
||||
}
|
||||
|
||||
contract_pats = ttdt_message_accept(msg, contract_cb, clientdata,
|
||||
c->frame, 1, 1);
|
||||
|
||||
if ((status = tt_ptr_error(contract_pats)) != TT_OK) {
|
||||
fprintf(stderr, "dtcm: load_cb could not accept message: %s\n",
|
||||
tt_status_message(status));
|
||||
} else {
|
||||
/*
|
||||
tttk_patterns_destroy(contract_pats);
|
||||
*/
|
||||
}
|
||||
|
||||
if (file != NULL) {
|
||||
p = file;
|
||||
} else if (len > 0) {
|
||||
p = (char *)contents;
|
||||
} else {
|
||||
tttk_message_fail( msg, TT_DESKTOP_ENODATA, 0, 1 );
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
if (p) {
|
||||
if (cmfns_lookup_calendar(p, addr_buf, sizeof(addr_buf)) == 1) {
|
||||
cm_iconic(c->frame, 0);
|
||||
switch_it(c, addr_buf, main_win);
|
||||
}
|
||||
}
|
||||
|
||||
tt_message_reply(msg);
|
||||
|
||||
tt_free((caddr_t)contents);
|
||||
tt_free(file);
|
||||
tt_free(docname);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
42
cde/programs/dtcm/dtcm/cmtt.h
Normal file
42
cde/programs/dtcm/dtcm/cmtt.h
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cmtt.h
|
||||
**
|
||||
** $TOG: cmtt.h /main/4 1999/09/20 10:30:18 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
|
||||
/* @(#)cmtt.h 1.6 94/11/07 SMI */
|
||||
|
||||
/*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _CM_TT_H
|
||||
#define _CM_TT_H
|
||||
|
||||
extern Tt_status cmtt_init(char *, Calendar *, XtAppContext, Widget);
|
||||
extern void DieFromToolTalkError(Widget, char*, Tt_status);
|
||||
|
||||
#endif /* _CM_TT_H */
|
||||
51
cde/programs/dtcm/dtcm/common.h
Normal file
51
cde/programs/dtcm/dtcm/common.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** common.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)common.h 1.6 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: common.h /main/3 1995/11/03 10:21:02 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
|
||||
#if LATER
|
||||
typedef struct {
|
||||
int data_version;
|
||||
char* target;
|
||||
} Cdata;
|
||||
|
||||
extern Cdata *get_cdata P(());
|
||||
extern void free_cd_from_blist P(());
|
||||
#endif
|
||||
extern void reset_values P(());
|
||||
extern void backup_values P(());
|
||||
extern void blist_write_names P(());
|
||||
extern Boolean duplicate_cd P(());
|
||||
extern char *get_appt_str P(());
|
||||
extern void common_update_lists P(());
|
||||
|
||||
#endif
|
||||
66
cde/programs/dtcm/dtcm/compose.icon
Normal file
66
cde/programs/dtcm/dtcm/compose.icon
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
|
||||
*/
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x00FF,0xF000,0x0000,
|
||||
0x0000,0x01FF,0xF800,0x0000,
|
||||
0x0000,0x0380,0x1C00,0x0000,
|
||||
0x0000,0x0740,0x2E00,0x0000,
|
||||
0x0000,0x0E20,0x5700,0x0000,
|
||||
0x0000,0x1C10,0xA380,0x0000,
|
||||
0x0000,0x3809,0x41C0,0x0000,
|
||||
0x0000,0x7006,0x80E0,0x0000,
|
||||
0x0000,0xE000,0x0070,0x0000,
|
||||
0x000F,0xC000,0x003F,0xC000,
|
||||
0x000F,0xFFFF,0xFFFF,0xC000,
|
||||
0x000D,0x0000,0x0002,0xC000,
|
||||
0x000C,0x8000,0x0005,0xD000,
|
||||
0x001C,0x4000,0x000A,0xE000,
|
||||
0x003C,0x2000,0x0014,0xD000,
|
||||
0x0074,0x1000,0x0028,0xE000,
|
||||
0x00E4,0x0800,0x0050,0xF000,
|
||||
0x00E4,0x0400,0x00A0,0xF800,
|
||||
0x0074,0x0200,0x0140,0xDC00,
|
||||
0x003C,0x0100,0x0280,0xAE00,
|
||||
0x001C,0x0080,0x0500,0xC600,
|
||||
0x000C,0x0240,0x0B00,0xAE00,
|
||||
0x000C,0x0420,0x1480,0xDC00,
|
||||
0x000C,0x0810,0x2840,0xBA00,
|
||||
0x000C,0x1008,0x5020,0xF400,
|
||||
0x000C,0x2004,0xA010,0xE800,
|
||||
0x000C,0x4003,0x4008,0xD000,
|
||||
0x000C,0x8000,0x0004,0xE000,
|
||||
0x000D,0x0000,0x0002,0xD000,
|
||||
0x000F,0xFFFF,0xFFFF,0xE000,
|
||||
0x000F,0xFF55,0x555F,0xD000,
|
||||
0x0002,0xABAA,0xAABA,0xA000,
|
||||
0x0005,0x55D5,0x5575,0x5000,
|
||||
0x0002,0xAAE0,0x00EA,0xA000,
|
||||
0x0005,0x5570,0x01D5,0x5000,
|
||||
0x0002,0xAAB8,0x03AA,0xA000,
|
||||
0x0000,0x001C,0x0740,0x0000,
|
||||
0x0000,0x000E,0x0E80,0x0000,
|
||||
0x0000,0x0007,0x1D00,0x0000,
|
||||
0x0000,0x0003,0xBA00,0x0000,
|
||||
0x0000,0x0001,0xF400,0x0000,
|
||||
0x0000,0x0000,0xE800,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000
|
||||
66
cde/programs/dtcm/dtcm/compose.mask.icon
Normal file
66
cde/programs/dtcm/dtcm/compose.mask.icon
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
|
||||
*/
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x00FF,0xF000,0x0000,
|
||||
0x0000,0x01FF,0xF800,0x0000,
|
||||
0x0000,0x03FF,0xFC00,0x0000,
|
||||
0x0000,0x07FF,0xFE00,0x0000,
|
||||
0x0000,0x0FFF,0xFF00,0x0000,
|
||||
0x0000,0x1FFF,0xFF80,0x0000,
|
||||
0x0000,0x3FFF,0xFFC0,0x0000,
|
||||
0x0000,0x7FFF,0xFFE0,0x0000,
|
||||
0x0000,0xFFFF,0xFFF0,0x0000,
|
||||
0x000F,0xFFFF,0xFFFF,0xC000,
|
||||
0x000F,0xFFFF,0xFFFF,0xC000,
|
||||
0x000F,0xFFFF,0xFFFF,0xC000,
|
||||
0x000F,0xFFFF,0xFFFF,0xD000,
|
||||
0x001F,0xFFFF,0xFFFF,0xE000,
|
||||
0x003F,0xFFFF,0xFFFF,0xD000,
|
||||
0x007F,0xFFFF,0xFFFF,0xE000,
|
||||
0x00FF,0xFFFF,0xFFFF,0xF000,
|
||||
0x00FF,0xFFFF,0xFFFF,0xF800,
|
||||
0x007F,0xFFFF,0xFFFF,0xFC00,
|
||||
0x003F,0xFFFF,0xFFFF,0xFE00,
|
||||
0x001F,0xFFFF,0xFFFF,0xFE00,
|
||||
0x000F,0xFFFF,0xFFFF,0xFE00,
|
||||
0x000F,0xFFFF,0xFFFF,0xFC00,
|
||||
0x000F,0xFFFF,0xFFFF,0xFA00,
|
||||
0x000F,0xFFFF,0xFFFF,0xF400,
|
||||
0x000F,0xFFFF,0xFFFF,0xE800,
|
||||
0x000F,0xFFFF,0xFFFF,0xD000,
|
||||
0x000F,0xFFFF,0xFFFF,0xE000,
|
||||
0x000F,0xFFFF,0xFFFF,0xD000,
|
||||
0x000F,0xFFFF,0xFFFF,0xE000,
|
||||
0x000F,0xFFFF,0xFFFF,0xD000,
|
||||
0x0002,0xABFF,0xFFFA,0xA000,
|
||||
0x0005,0x55FF,0xFFF5,0x5000,
|
||||
0x0002,0xAAFF,0xFFEA,0xA000,
|
||||
0x0005,0x557F,0xFFD5,0x5000,
|
||||
0x0002,0xAABF,0xFFAA,0xA000,
|
||||
0x0000,0x001F,0xFF40,0x0000,
|
||||
0x0000,0x000F,0xFE80,0x0000,
|
||||
0x0000,0x0007,0xFD00,0x0000,
|
||||
0x0000,0x0003,0xFA00,0x0000,
|
||||
0x0000,0x0001,0xF400,0x0000,
|
||||
0x0000,0x0000,0xE800,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000
|
||||
5
cde/programs/dtcm/dtcm/contract_xbm
Normal file
5
cde/programs/dtcm/dtcm/contract_xbm
Normal file
@@ -0,0 +1,5 @@
|
||||
/* $XConsortium: contract_xbm /main/2 1995/07/19 16:48:52 drk $ */
|
||||
#define contract_xbm_width 8
|
||||
#define contract_xbm_height 9
|
||||
static unsigned char contract_xbm_bits[] = {
|
||||
0xff, 0x7e, 0x3c, 0x18, 0x00, 0x18, 0x3c, 0x7e, 0xff};
|
||||
96
cde/programs/dtcm/dtcm/datefield.c
Normal file
96
cde/programs/dtcm/dtcm/datefield.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** datefield.c
|
||||
**
|
||||
** $XConsortium: datefield.c /main/3 1995/11/03 10:21:12 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)datefield.c 1.7 94/11/07 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include "util.h"
|
||||
#include "datefield.h"
|
||||
#include "misc.h"
|
||||
|
||||
/*
|
||||
** Returns a date string the parser can handle
|
||||
*/
|
||||
extern char*
|
||||
get_date_from_widget(Tick t, Widget w, OrderingType order,
|
||||
SeparatorType separator) {
|
||||
char *date = NULL;
|
||||
WidgetClass wc;
|
||||
static char buf[80];
|
||||
|
||||
memset(buf, '\0', 80);
|
||||
|
||||
if (!w)
|
||||
format_tick(t, order, separator, buf);
|
||||
else {
|
||||
wc = XtClass(w);
|
||||
if (wc == xmTextWidgetClass)
|
||||
date = XmTextGetString(w);
|
||||
else if (wc == xmTextFieldWidgetClass)
|
||||
date = XmTextFieldGetString(w);
|
||||
else
|
||||
return NULL;
|
||||
|
||||
if (!date || *date == '\0')
|
||||
format_tick(t, order, separator, buf);
|
||||
else if (!datestr2mdy(date, order, separator, buf)) {
|
||||
XtFree(date);
|
||||
return NULL;
|
||||
}
|
||||
if (date)
|
||||
XtFree(date);
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
extern void
|
||||
set_date_in_widget(Tick t, Widget w, OrderingType order,
|
||||
SeparatorType separator) {
|
||||
char buf[80];
|
||||
XmString xmstr;
|
||||
WidgetClass wc = XtClass(w);
|
||||
|
||||
format_tick(t, order, separator, buf);
|
||||
if (wc == xmLabelGadgetClass || wc == xmLabelWidgetClass) {
|
||||
xmstr = XmStringCreateLocalized(buf);
|
||||
XtVaSetValues(w, XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
} else if (wc == xmTextWidgetClass)
|
||||
XmTextSetString(w, buf);
|
||||
else if (wc == xmTextFieldWidgetClass)
|
||||
XmTextFieldSetString(w, buf);
|
||||
}
|
||||
46
cde/programs/dtcm/dtcm/datefield.h
Normal file
46
cde/programs/dtcm/dtcm/datefield.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** datefield.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)datefield.h 1.5 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: datefield.h /main/3 1995/11/03 10:21:26 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DATEFIELD_H
|
||||
#define _DATEFIELD_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "ansi_c.h"
|
||||
#include "props.h"
|
||||
#include "timeops.h"
|
||||
|
||||
/*
|
||||
** External function declaration
|
||||
*/
|
||||
extern char *get_date_from_widget P((Tick, Widget, OrderingType,
|
||||
SeparatorType));
|
||||
extern void set_date_in_widget P((Tick, Widget, OrderingType,
|
||||
SeparatorType));
|
||||
|
||||
#endif
|
||||
1263
cde/programs/dtcm/dtcm/dayglance.c
Normal file
1263
cde/programs/dtcm/dtcm/dayglance.c
Normal file
File diff suppressed because it is too large
Load Diff
76
cde/programs/dtcm/dtcm/dayglance.h
Normal file
76
cde/programs/dtcm/dtcm/dayglance.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** dayglance.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)dayglance.h 1.11 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: dayglance.h /main/5 1996/04/12 14:58:09 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DAYGLANCE_H
|
||||
#define _DAYGLANCE_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "props.h"
|
||||
|
||||
#define MOBOX_AREA_WIDTH (int)(c->view->winw*.4)
|
||||
#define APPT_AREA_WIDTH (c->view->winw-MOBOX_AREA_WIDTH-2)
|
||||
#define HRBOX_MARGIN 30
|
||||
|
||||
typedef struct dayglance {
|
||||
int mobox_height1;
|
||||
int mobox_height2;
|
||||
int mobox_height3;
|
||||
int month1; /* tick in 1st mo */
|
||||
int month1_y;
|
||||
int month2; /* tick in 2nd mo */
|
||||
int month2_y;
|
||||
int month3; /* tick in 3rd mo */
|
||||
int month3_y;
|
||||
int col_w; /* width of month box col */
|
||||
int row_h; /* height of month box row */
|
||||
int mobox_width; /* width of month box row */
|
||||
int day_selected;
|
||||
int day_selected_x;
|
||||
int day_selected_y;
|
||||
int day_selected_x2;
|
||||
int day_selected_y2;
|
||||
Widget panel_form;
|
||||
Widget *month_panels;
|
||||
} Day;
|
||||
|
||||
extern void init_dayview P((Calendar*));
|
||||
extern void day_button P((Widget, XtPointer, XtPointer));
|
||||
extern void init_mo P((Calendar*));
|
||||
extern void monthbox_datetoxy P((Calendar*));
|
||||
extern void monthbox_xytodate P((Calendar*, int x, int y));
|
||||
extern void paint_dayview P((Calendar*, Boolean,
|
||||
XRectangle*, Boolean));
|
||||
extern void paint_day P((Calendar*));
|
||||
extern void print_day_range P((Calendar*, Tick, Tick));
|
||||
extern void day_event P((XEvent*));
|
||||
extern int morning P((int));
|
||||
extern void paint_day_header P((Calendar *, Tick, void *));
|
||||
extern void cleanup_after_dayview P((Calendar *));
|
||||
#endif
|
||||
260
cde/programs/dtcm/dtcm/deskset.c
Normal file
260
cde/programs/dtcm/dtcm/deskset.c
Normal file
@@ -0,0 +1,260 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** deskset.c
|
||||
**
|
||||
** $TOG: deskset.c /main/4 1999/02/03 15:35:56 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)deskset.c 1.11 94/12/22 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#ifndef SVR4
|
||||
#include <strings.h>
|
||||
#endif /* SVR4 */
|
||||
#include <ctype.h>
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Dt/Dt.h>
|
||||
#include "deskset.h"
|
||||
#include "revision.h"
|
||||
|
||||
#define DS_TITLE_LINE_HEIGHT 25
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function: ds_relname
|
||||
**
|
||||
** Description: Return revision name.
|
||||
**
|
||||
** Parameters: None
|
||||
**
|
||||
** Returns: Revision name (char *)
|
||||
**
|
||||
******************************************************************************/
|
||||
extern char *
|
||||
ds_relname()
|
||||
{
|
||||
static char buf[MAXNAMELEN];
|
||||
|
||||
sprintf(buf, "Version %d.%d.%d Revision %d",
|
||||
DtVERSION, DtREVISION, DtUPDATE_LEVEL,
|
||||
DTCM_INTERNAL_REV);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: ds_position_popup
|
||||
*
|
||||
* Description: Position a popup relative to the parent frame
|
||||
* making sure it doesn't go off of the screen.
|
||||
*
|
||||
* Parameters: base Popup's parent widget
|
||||
* popup Popup widget
|
||||
* location_op Where you would like the popup to
|
||||
* appear. Location_op may be any
|
||||
* the following:
|
||||
*
|
||||
* DS_POPUP_LEFT Place the popup to the left of base with the tops flush
|
||||
* DS_POPUP_RIGHT Place the popup to the right of base with the tops flush
|
||||
* DS_POPUP_ABOVE Place the popup above base with the left edges flush
|
||||
* DS_POPUP_BELOW Place the popup below base with the left edges flush
|
||||
* DS_POPUP_LOR Place the popup either to the left or right of base
|
||||
* depending on which side has the most space.
|
||||
* DS_POPUP_AOF Place the popup either above or below base
|
||||
* depending on which side has the most space.
|
||||
* DS_POPUP_CENTERED Center popup within baseframe
|
||||
*
|
||||
* Returns: 0 Could not get screen size
|
||||
* 1 All is well
|
||||
*/
|
||||
extern int
|
||||
ds_position_popup(Widget base, Widget popup, ds_location_op location_op) {
|
||||
int bh, bw, bx, by, ph, pw, px, py ;
|
||||
int screen_width, screen_height ;
|
||||
Position base_x, base_y, popup_x, popup_y ;
|
||||
Dimension base_width, base_height, popup_width, popup_height ;
|
||||
|
||||
XtVaGetValues(base,
|
||||
XmNx, &base_x,
|
||||
XmNy, &base_y,
|
||||
XmNwidth, &base_width,
|
||||
XmNheight, &base_height,
|
||||
0) ;
|
||||
bx = (int) base_x ;
|
||||
by = (int) base_y ;
|
||||
bw = (int) base_width ;
|
||||
bh = (int) base_height ;
|
||||
|
||||
XtVaGetValues(popup,
|
||||
XmNx, &popup_x,
|
||||
XmNy, &popup_y,
|
||||
XmNwidth, &popup_width,
|
||||
XmNheight, &popup_height,
|
||||
0) ;
|
||||
|
||||
px = (int) popup_x ;
|
||||
py = (int) popup_y ;
|
||||
pw = (int) popup_width ;
|
||||
ph = (int) popup_height ;
|
||||
|
||||
ds_get_screen_size(popup, &screen_width, &screen_height) ;
|
||||
|
||||
if (location_op == DS_POPUP_LOR)
|
||||
{
|
||||
if (bx >= screen_width - bw - bx) location_op = DS_POPUP_LEFT ;
|
||||
else location_op = DS_POPUP_RIGHT ;
|
||||
}
|
||||
else if (location_op == DS_POPUP_AOB)
|
||||
{
|
||||
if (by > screen_height - bh - by) location_op = DS_POPUP_ABOVE ;
|
||||
else location_op = DS_POPUP_BELOW ;
|
||||
}
|
||||
|
||||
switch (location_op)
|
||||
{
|
||||
case DS_POPUP_RIGHT : px = bx + bw + 5 ;
|
||||
py = by - DS_TITLE_LINE_HEIGHT ;
|
||||
break ;
|
||||
case DS_POPUP_LEFT : px = bx - pw - 5 ;
|
||||
py = by - DS_TITLE_LINE_HEIGHT ;
|
||||
break ;
|
||||
case DS_POPUP_ABOVE : px = bx - 5 ;
|
||||
py = by - ph - 10 ;
|
||||
break ;
|
||||
case DS_POPUP_BELOW : px = bx - 5 ;
|
||||
py = by + bh + 5 ;
|
||||
break ;
|
||||
case DS_POPUP_CENTERED :
|
||||
default : px = bx + (bw - pw) / 2 ;
|
||||
py = by + (bh - ph) / 2 ;
|
||||
}
|
||||
ds_force_popup_on_screen(popup, &px, &py) ;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Function: ds_force_popup_on_screen
|
||||
*
|
||||
* Description: Make sure that the specified widget appears entirely
|
||||
* on the screen.
|
||||
*
|
||||
* You specify the x and y where you would like the
|
||||
* popup to appear. If this location would cause any
|
||||
* portion of the popup to appear off of the screen
|
||||
* then the routine makes the minimum adjustments
|
||||
* necessary to move it onto the screen.
|
||||
*
|
||||
* NOTE: The following coordinates must be specified
|
||||
* relative to the screen origin *not* the
|
||||
* parent widget!
|
||||
*
|
||||
* Parameters: popup_x_p Pointer to x location where you would
|
||||
* like the popup to appear. If the popup
|
||||
* is moved this is updated to reflect
|
||||
* the new position.
|
||||
* popup_y_p Pointer to y location where you would
|
||||
* like the popup to appear. If the popup
|
||||
* is moved this is updated to reflect
|
||||
* the new position.
|
||||
*
|
||||
* popup Popup`s widget.
|
||||
*
|
||||
* Returns: TRUE The popup was moved
|
||||
* FALSE The popup was not moved
|
||||
*/
|
||||
extern int
|
||||
ds_force_popup_on_screen(Widget popup, int *popup_x_p, int *popup_y_p) {
|
||||
Dimension popup_width, popup_height ;
|
||||
Position left, top ;
|
||||
int popup_x, popup_y ;
|
||||
int n, rcode, screen_width, screen_height ;
|
||||
|
||||
popup_x = *popup_x_p ;
|
||||
popup_y = *popup_y_p ;
|
||||
|
||||
/* Get the screen size */
|
||||
|
||||
ds_get_screen_size(popup, &screen_width, &screen_height) ;
|
||||
|
||||
XtVaGetValues(popup,
|
||||
XmNwidth, &popup_width,
|
||||
XmNheight, &popup_height,
|
||||
0) ;
|
||||
|
||||
/* Make sure frame does not go off side of screen */
|
||||
|
||||
n = popup_x + (int) popup_width ;
|
||||
if (n > screen_width) popup_x -= (n - screen_width) ;
|
||||
else if (popup_x < 0) popup_x = 0 ;
|
||||
|
||||
/* Make sure frame doen't go off top or bottom */
|
||||
|
||||
n = popup_y + (int) popup_height ;
|
||||
if (n > screen_height) popup_y -= n - screen_height ;
|
||||
else if (popup_y < 0) popup_y = 0 ;
|
||||
|
||||
/* Set location and return */
|
||||
|
||||
left = (Position) popup_x ;
|
||||
top = (Position) popup_y ;
|
||||
XtVaSetValues(popup,
|
||||
XmNx, left,
|
||||
XmNy, top,
|
||||
0) ;
|
||||
|
||||
if (popup_x != *popup_x_p || popup_y != *popup_y_p) rcode = TRUE ;
|
||||
else rcode = FALSE ;
|
||||
*popup_x_p = popup_x ;
|
||||
*popup_y_p = popup_y ;
|
||||
return(rcode) ;
|
||||
}
|
||||
|
||||
|
||||
/* Function: ds_get_screen_size
|
||||
*
|
||||
* Description: Get the width and height of the screen in pixels
|
||||
*
|
||||
* Parameters: width_p Pointer to an integer to place width
|
||||
* height_p Pointer to an integer to place height
|
||||
*
|
||||
* Returns: None.
|
||||
*/
|
||||
extern void
|
||||
ds_get_screen_size(Widget widget, int *width_p, int *height_p) {
|
||||
Display *dpy = XtDisplay(widget) ;
|
||||
int screen = DefaultScreen(dpy) ;
|
||||
|
||||
*width_p = DisplayWidth(dpy, screen) ;
|
||||
*height_p = DisplayHeight(dpy, screen) ;
|
||||
}
|
||||
59
cde/programs/dtcm/dtcm/deskset.h
Normal file
59
cde/programs/dtcm/dtcm/deskset.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** deskset.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)deskset.h 1.6 94/12/22 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: deskset.h /main/3 1995/11/03 10:22:50 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DESKSET_H
|
||||
#define _DESKSET_H
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "ansi_c.h"
|
||||
|
||||
/*
|
||||
** Location ops for ds_position_popup().
|
||||
*/
|
||||
typedef enum {
|
||||
DS_POPUP_RIGHT, /* Place popup to right of baseframe */
|
||||
DS_POPUP_LEFT, /* Place popup to left of baseframe */
|
||||
DS_POPUP_ABOVE, /* Place popup above baseframe */
|
||||
DS_POPUP_BELOW, /* Place popup below baseframe */
|
||||
DS_POPUP_LOR, /* Place popup to right or left of baseframe */
|
||||
DS_POPUP_AOB, /* Place popup above or below baseframe */
|
||||
DS_POPUP_CENTERED /* Center popup within baseframe */
|
||||
} ds_location_op;
|
||||
|
||||
/*
|
||||
** Function declarations.
|
||||
*/
|
||||
extern int ds_force_popup_on_screen P((Widget, int*, int*)) ;
|
||||
extern void ds_get_screen_size P((Widget, int*, int*)) ;
|
||||
extern int ds_position_popup P((Widget, Widget,
|
||||
ds_location_op)) ;
|
||||
extern char *ds_relname P(());
|
||||
|
||||
#endif
|
||||
1032
cde/programs/dtcm/dtcm/dnd.c
Normal file
1032
cde/programs/dtcm/dtcm/dnd.c
Normal file
File diff suppressed because it is too large
Load Diff
61
cde/programs/dtcm/dtcm/dnd.h
Normal file
61
cde/programs/dtcm/dtcm/dnd.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** dnd.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)dnd.h 1.9 94/11/07 Copyr 1993 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: dnd.h /main/4 1996/04/15 13:24:16 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DND_H
|
||||
#define _DND_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
|
||||
typedef enum {SingleEditorList,
|
||||
SingleEditorIcon,
|
||||
GroupEditorList,
|
||||
GroupEditorIcon,
|
||||
TodoEditorList,
|
||||
TodoEditorIcon,
|
||||
StandAloneEditor } EditorType;
|
||||
|
||||
typedef struct {
|
||||
Calendar *calendar;
|
||||
EditorType editor_type;
|
||||
caddr_t editor;
|
||||
char *data;
|
||||
} DragContext;
|
||||
|
||||
#define DRAG_THRESHOLD 4
|
||||
|
||||
|
||||
extern void cm_register_drop_site P((Calendar *c, Widget w));
|
||||
extern void ApptDragStart P((Widget, XEvent *, Calendar *,
|
||||
EditorType));
|
||||
extern void TranslationDragStart P((Widget, XEvent *, String *,
|
||||
Cardinal *));
|
||||
extern void DtcmProcessPress P((Widget, XEvent *, String *,
|
||||
Cardinal *));
|
||||
|
||||
#endif
|
||||
15
cde/programs/dtcm/dtcm/drag_mask_xbm
Normal file
15
cde/programs/dtcm/dtcm/drag_mask_xbm
Normal file
@@ -0,0 +1,15 @@
|
||||
/* $XConsortium: drag_mask_xbm /main/2 1995/07/19 16:49:00 drk $ */
|
||||
#define drag_mask_xbm_width 32
|
||||
#define drag_mask_xbm_height 32
|
||||
static unsigned char drag_mask_xbm_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x3f,
|
||||
0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f,
|
||||
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f,
|
||||
0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f,
|
||||
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f,
|
||||
0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f,
|
||||
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, 0x3f,
|
||||
0xff, 0xff, 0xff, 0x5f, 0xfe, 0xff, 0xff, 0x3f, 0x54, 0x55, 0x55, 0x55,
|
||||
0xa8, 0xaa, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00};
|
||||
15
cde/programs/dtcm/dtcm/drag_xbm
Normal file
15
cde/programs/dtcm/dtcm/drag_xbm
Normal file
@@ -0,0 +1,15 @@
|
||||
/* $XConsortium: drag_xbm /main/2 1995/07/19 16:49:11 drk $ */
|
||||
#define drag_xbm_width 32
|
||||
#define drag_xbm_height 32
|
||||
static unsigned char drag_xbm_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfd, 0xf7, 0x9f,
|
||||
0x01, 0x01, 0x04, 0xc8, 0x01, 0x05, 0x14, 0x74, 0x81, 0x05, 0x16, 0x3a,
|
||||
0x81, 0x05, 0x16, 0x59, 0x01, 0x03, 0x8c, 0x2c, 0x01, 0x00, 0x40, 0x56,
|
||||
0x01, 0x00, 0x20, 0x33, 0x01, 0x2b, 0x96, 0x51, 0x01, 0x22, 0xc9, 0x38,
|
||||
0x01, 0x12, 0x65, 0x55, 0x01, 0x7f, 0xb2, 0x3a, 0x01, 0x00, 0x59, 0x55,
|
||||
0x19, 0x80, 0xac, 0x30, 0x59, 0x55, 0x56, 0x50, 0x01, 0x20, 0x0b, 0x30,
|
||||
0x19, 0x90, 0x05, 0x50, 0x59, 0xd5, 0xaa, 0x32, 0x01, 0x68, 0x01, 0x50,
|
||||
0x19, 0x18, 0x00, 0x30, 0x59, 0x45, 0x55, 0x51, 0x01, 0x00, 0x00, 0x30,
|
||||
0x01, 0x00, 0x00, 0x50, 0xfe, 0xff, 0xff, 0x3f, 0x54, 0x55, 0x55, 0x55,
|
||||
0xa8, 0xaa, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00};
|
||||
973
cde/programs/dtcm/dtcm/dssw.c
Normal file
973
cde/programs/dtcm/dtcm/dssw.c
Normal file
@@ -0,0 +1,973 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** dssw.c
|
||||
**
|
||||
** $XConsortium: dssw.c /main/7 1996/10/14 16:06:20 barstow $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)dssw.c 1.58 95/08/07 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdlib.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/ToggleB.h>
|
||||
#include "dssw.h"
|
||||
#include "misc.h"
|
||||
#include "getdate.h"
|
||||
#include "props_pu.h"
|
||||
#include "util.h"
|
||||
#ifdef SVR4
|
||||
#include <sys/param.h>
|
||||
#endif /* SVR4 */
|
||||
|
||||
extern Dimension ComputeMaxWidth(Widget, Widget, Widget, Widget);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Static functions visible to dssw.c only
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void
|
||||
dssw_get_non_times(DSSW *dssw, time_t t) {
|
||||
char *str;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
OrderingType ot = get_int_prop(p, CP_DATEORDERING);
|
||||
SeparatorType st = get_int_prop(p, CP_DATESEPARATOR);
|
||||
|
||||
cm_strcpy(dssw->date_val,
|
||||
get_date_from_widget(t, dssw->date_text, ot, st));
|
||||
|
||||
str = XmTextGetString(dssw->what_text);
|
||||
strcpy(dssw->what_val, str);
|
||||
XtFree(str);
|
||||
}
|
||||
|
||||
static void
|
||||
dssw_set_non_times(DSSW *dssw, time_t t) {
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
OrderingType ot = get_int_prop(p, CP_DATEORDERING);
|
||||
SeparatorType st = get_int_prop(p, CP_DATESEPARATOR);
|
||||
|
||||
set_date_in_widget(t, dssw->date_text, ot, st);
|
||||
XmTextSetString(dssw->what_text, dssw->what_val);
|
||||
}
|
||||
|
||||
/*
|
||||
** Callback from start time and stop time to set text fields accordingly
|
||||
*/
|
||||
static void
|
||||
dssw_set_start_hour(Widget w, XtPointer client_data, XtPointer cbs) {
|
||||
int start_hrs, stop_hrs, dur, start_mins, stop_mins;
|
||||
long user_data;
|
||||
DSSW *dssw = (DSSW *)client_data;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
XtVaGetValues(w, XmNuserData, &user_data, NULL);
|
||||
|
||||
if (user_data == NO_TIME) {
|
||||
sprintf(dssw->start_val.val, "\0");
|
||||
sprintf(dssw->stop_val.val, "\0");
|
||||
dssw->start_val.block = dssw->stop_val.block = TIME_AM;
|
||||
} else if (user_data == ALL_DAY) {
|
||||
if (dt == HOUR12) {
|
||||
sprintf(dssw->start_val.val, "12:00");
|
||||
sprintf(dssw->stop_val.val, "11:59");
|
||||
} else {
|
||||
sprintf(dssw->start_val.val, "0000");
|
||||
sprintf(dssw->stop_val.val, "2359");
|
||||
}
|
||||
dssw->start_val.block = TIME_AM;
|
||||
dssw->stop_val.block = TIME_PM;
|
||||
} else {
|
||||
start_hrs = user_data / hrsec;
|
||||
dur = get_int_prop(p, CP_APPTDURATION) * minsec;
|
||||
stop_hrs = (user_data + dur) / hrsec;
|
||||
start_mins = (user_data - (start_hrs * hrsec)) / minsec;
|
||||
stop_mins = ((user_data + dur) - (stop_hrs * hrsec)) / minsec;
|
||||
stop_hrs = stop_hrs % 24;
|
||||
|
||||
if (dt == HOUR12) {
|
||||
dssw->start_val.block =
|
||||
(adjust_hour(&start_hrs)) ? TIME_AM : TIME_PM;
|
||||
dssw->stop_val.block =
|
||||
(adjust_hour(&stop_hrs)) ? TIME_AM : TIME_PM;
|
||||
sprintf(dssw->start_val.val, "%2d:%02d",
|
||||
start_hrs, start_mins);
|
||||
sprintf(dssw->stop_val.val, "%2d:%02d",
|
||||
stop_hrs, stop_mins);
|
||||
} else {
|
||||
dssw->start_val.block =
|
||||
(start_hrs > 12) ? TIME_PM : TIME_AM;
|
||||
dssw->stop_val.block =
|
||||
(stop_hrs > 12) ? TIME_PM : TIME_AM;
|
||||
sprintf(dssw->start_val.val, "%02d%02d",
|
||||
start_hrs, start_mins);
|
||||
sprintf(dssw->stop_val.val, "%02d%02d",
|
||||
stop_hrs, stop_mins);
|
||||
}
|
||||
}
|
||||
set_dssw_times(dssw);
|
||||
}
|
||||
|
||||
static void
|
||||
dssw_set_stop_hour(Widget w, XtPointer client_data, XtPointer cbs) {
|
||||
long user_data;
|
||||
int hrs, mins;
|
||||
DSSW *dssw = (DSSW *)client_data;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
get_dssw_times(dssw);
|
||||
XtVaGetValues(w, XmNuserData, &user_data, NULL);
|
||||
|
||||
if (user_data == NO_TIME) {
|
||||
sprintf(dssw->stop_val.val, "\0");
|
||||
dssw->stop_val.block = TIME_AM;
|
||||
} else {
|
||||
hrs = user_data / hrsec;
|
||||
mins = (user_data - (hrs * hrsec)) / minsec;
|
||||
|
||||
if (dt == HOUR12) {
|
||||
dssw->stop_val.block =
|
||||
(adjust_hour(&hrs)) ? TIME_AM : TIME_PM;
|
||||
sprintf(dssw->stop_val.val, "%2d:%02d", hrs, mins);
|
||||
} else {
|
||||
dssw->stop_val.block = (hrs > 12) ? TIME_PM : TIME_AM;
|
||||
sprintf(dssw->stop_val.val, "%02d%02d", hrs, mins);
|
||||
}
|
||||
}
|
||||
set_dssw_times(dssw);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** External functions
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
extern void
|
||||
set_dssw_menus(DSSW *dssw, Props *p) {
|
||||
|
||||
set_time_submenu(dssw->dssw_form_mgr, dssw->start_menu, p,
|
||||
dssw_set_start_hour, (XtPointer)dssw,
|
||||
dssw->show_notime_selection, dssw->show_allday_selection,
|
||||
&dssw->start_menu_widget_list, &dssw->start_menu_widget_count);
|
||||
|
||||
set_time_submenu(dssw->dssw_form_mgr, dssw->stop_menu, p,
|
||||
dssw_set_stop_hour, (XtPointer)dssw, dssw->show_notime_selection, False,
|
||||
&dssw->stop_menu_widget_list, &dssw->stop_menu_widget_count);
|
||||
|
||||
set_dssw_defaults(dssw, calendar->view->date, True);
|
||||
|
||||
}
|
||||
|
||||
#define GAP 5
|
||||
|
||||
extern void
|
||||
build_dssw(
|
||||
DSSW *dssw,
|
||||
Calendar *c,
|
||||
Widget parent,
|
||||
Boolean show_notime,
|
||||
Boolean show_allday)
|
||||
{
|
||||
Props *p;
|
||||
DisplayType dt;
|
||||
Arg args[20];
|
||||
int n;
|
||||
Dimension max_left_label_width;
|
||||
Widget child[2];
|
||||
XmString label_str;
|
||||
Dimension highest, widest;
|
||||
Widget prev, curr;
|
||||
Dimension _toLabel, _toText, _toMenu, _toRC;
|
||||
|
||||
dssw->cal = c;
|
||||
dssw->parent = parent;
|
||||
p = (Props *)c->properties;
|
||||
|
||||
dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
dssw->show_notime_selection = show_notime;
|
||||
dssw->show_allday_selection = show_allday;
|
||||
|
||||
/*
|
||||
** One form manager for the widget
|
||||
*/
|
||||
dssw->dssw_form_mgr = XtVaCreateWidget("dssw_form_mgr",
|
||||
xmFormWidgetClass, parent,
|
||||
XmNautoUnmanage, False,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 828, "Date:"));
|
||||
dssw->date_label = XtVaCreateWidget("date_label",
|
||||
xmLabelGadgetClass, dssw->dssw_form_mgr,
|
||||
XmNlabelString, label_str,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 829, "Start:"));
|
||||
dssw->start_label = XtVaCreateWidget("start_label",
|
||||
xmLabelGadgetClass, dssw->dssw_form_mgr,
|
||||
XmNlabelString, label_str,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 832, "End:"));
|
||||
dssw->stop_label = XtVaCreateWidget("stop_label",
|
||||
xmLabelGadgetClass, dssw->dssw_form_mgr,
|
||||
XmNlabelString, label_str,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 835, "What:"));
|
||||
dssw->what_label = XtVaCreateWidget("what_label",
|
||||
xmLabelGadgetClass, dssw->dssw_form_mgr,
|
||||
XmNlabelString, label_str,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
dssw->date_text = XtVaCreateWidget("date_text",
|
||||
xmTextWidgetClass, dssw->dssw_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNmaxLength, DATE_LEN - 1,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
** Radio button behavior for AM/PM selection for start time
|
||||
*/
|
||||
dssw->start_text = XtVaCreateWidget("start_text",
|
||||
xmTextWidgetClass, dssw->dssw_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNmaxLength, START_STOP_LEN - 1,
|
||||
NULL);
|
||||
|
||||
dssw->start_menu = create_start_stop_time_menu(dssw->dssw_form_mgr,
|
||||
NULL, dssw_set_start_hour, (XtPointer)dssw, p, show_notime,
|
||||
show_allday, &dssw->start_menu_widget_list,
|
||||
&dssw->start_menu_widget_count);
|
||||
|
||||
XtVaSetValues(dssw->start_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
dssw->start_ampm_rc_mgr = XtVaCreateWidget("start_ampm_rc_mgr",
|
||||
xmRowColumnWidgetClass, dssw->dssw_form_mgr,
|
||||
XmNpacking, XmPACK_COLUMN,
|
||||
XmNorientation, XmHORIZONTAL,
|
||||
XmNradioBehavior, True,
|
||||
XmNisHomogeneous, True,
|
||||
XmNentryClass, xmToggleButtonGadgetClass,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 830, "AM"));
|
||||
child[0] = dssw->start_am = XtVaCreateWidget("start_am",
|
||||
xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNsensitive, (dt == HOUR12) ? True : False,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 831, "PM"));
|
||||
child[1] = dssw->start_pm = XtVaCreateWidget("start_pm",
|
||||
xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNsensitive, (dt == HOUR12) ? True : False,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
XtManageChildren(child, 2);
|
||||
|
||||
/*
|
||||
** Last and near the end, the stop stuff
|
||||
** Radio button behavior for AM/PM selection for stop time
|
||||
*/
|
||||
dssw->stop_text = XtVaCreateWidget("stop_text",
|
||||
xmTextWidgetClass, dssw->dssw_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNmaxLength, START_STOP_LEN - 1,
|
||||
NULL);
|
||||
|
||||
dssw->stop_menu = create_start_stop_time_menu(dssw->dssw_form_mgr,
|
||||
NULL, dssw_set_stop_hour, (XtPointer)dssw, p, show_notime,
|
||||
False, &dssw->stop_menu_widget_list,
|
||||
&dssw->stop_menu_widget_count);
|
||||
|
||||
XtVaSetValues(dssw->stop_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
dssw->stop_ampm_rc_mgr = XtVaCreateWidget("stop_ampm_rc_mgr",
|
||||
xmRowColumnWidgetClass, dssw->dssw_form_mgr,
|
||||
XmNpacking, XmPACK_COLUMN,
|
||||
XmNorientation, XmHORIZONTAL,
|
||||
XmNradioBehavior, True,
|
||||
XmNisHomogeneous, True,
|
||||
XmNentryClass, xmToggleButtonGadgetClass,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 833, "AM"));
|
||||
child[0] = dssw->stop_am = XtVaCreateWidget("stop_am",
|
||||
xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNsensitive, (dt == HOUR12) ? True : False,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 834, "PM"));
|
||||
child[1] = dssw->stop_pm = XtVaCreateWidget("stop_pm",
|
||||
xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr,
|
||||
XmNlabelString, label_str,
|
||||
XmNsensitive, (dt == HOUR12) ? True : False,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
XtManageChildren(child, 2);
|
||||
|
||||
|
||||
/*
|
||||
** Finally the what text field
|
||||
*/
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT), n++;
|
||||
/* XtSetArg(args[n], XmNscrollVertical, True), n++; */
|
||||
XtSetArg(args[n], XmNscrollHorizontal, False), n++;
|
||||
XtSetArg(args[n], XmNscrollingPolicy, XmAUTOMATIC), n++;
|
||||
XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmAS_NEEDED), n++;
|
||||
XtSetArg(args[n], XmNrows, 3), n++;
|
||||
XtSetArg(args[n], XmNmaxLength, WHAT_LEN - 1), n++;
|
||||
|
||||
dssw->what_text = XmCreateScrolledText(dssw->dssw_form_mgr,
|
||||
"what_text", args, n);
|
||||
|
||||
dssw->what_scrollwindow = XtParent(dssw->what_text);
|
||||
XtManageChild(dssw->what_text);
|
||||
|
||||
/*
|
||||
* Do a layout
|
||||
*/
|
||||
_i18n_WidestWidget( 4, &prev, &max_left_label_width,
|
||||
dssw->date_label, dssw->start_label, dssw->stop_label,
|
||||
dssw->what_label );
|
||||
_toText = max_left_label_width + 2 * GAP;
|
||||
|
||||
/*
|
||||
* dssw->date_label, dssw->date_text
|
||||
*/
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->date_label );
|
||||
_toLabel = _toText - GAP - widest;
|
||||
_i18n_HighestWidgetAdjust( 2, &curr, &highest, dssw->date_label,
|
||||
dssw->date_text );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->date_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toLabel,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->date_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* dssw->start_label, dssw->start_text, dssw->start_menu,
|
||||
* dssw->start_ampm_rc_mgr
|
||||
*/
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->start_label );
|
||||
_toLabel = _toText - GAP - widest;
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->start_text );
|
||||
_toMenu = _toText + widest + GAP;
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->start_menu );
|
||||
_toRC = _toMenu + widest + GAP;
|
||||
_i18n_HighestWidgetAdjust( 4, &curr, &highest, dssw->start_label,
|
||||
dssw->start_text, dssw->start_menu, dssw->start_ampm_rc_mgr );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, GAP,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->start_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toLabel,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->start_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->start_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toMenu,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->start_ampm_rc_mgr,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toRC,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* dssw->stop_label, dssw->stop_text, dssw->stop_menu,
|
||||
* dssw->stop_ampm_rc_mgr
|
||||
*/
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_label );
|
||||
_toLabel = _toText - GAP - widest;
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_text );
|
||||
_toMenu = _toText + widest + GAP;
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_menu );
|
||||
_toRC = _toMenu + widest + GAP;
|
||||
_i18n_HighestWidgetAdjust( 4, &curr, &highest, dssw->stop_label,
|
||||
dssw->stop_text, dssw->stop_menu, dssw->stop_ampm_rc_mgr );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, GAP,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->stop_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toLabel,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->stop_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->stop_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toMenu,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->stop_ampm_rc_mgr,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toRC,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* dssw->what_label, dssw->what_scrollwindow
|
||||
*/
|
||||
_i18n_WidestWidget( 1, &curr, &widest, dssw->what_label );
|
||||
_toLabel = _toText - GAP - widest;
|
||||
XtVaSetValues( dssw->what_label,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toLabel,
|
||||
NULL );
|
||||
XtVaSetValues( dssw->what_scrollwindow,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, GAP,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
** This function will consume form values and stuff them into an appointment.
|
||||
*/
|
||||
extern Boolean
|
||||
dssw_form_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t)
|
||||
{
|
||||
return dssw_form_flags_to_appt(dssw, a, name, t, (int *)NULL);
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int *flagsP)
|
||||
{
|
||||
time_t start_tick, stop_tick;
|
||||
char ampm_buf[BUFSIZ], buf[BUFSIZ];
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
Props_pu *pu = (Props_pu *)dssw->cal->properties_pu;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
int flags = 0;
|
||||
|
||||
if (flagsP == (int *)NULL)
|
||||
flagsP = &flags;
|
||||
|
||||
/*
|
||||
** If neither start nor end times exist, then the start time is set
|
||||
** to 3:41am (magic time) and the end time to 3:41 plus one minute.
|
||||
*/
|
||||
get_dssw_vals(dssw, t);
|
||||
if (blank_buf(dssw->date_val)) {
|
||||
editor_err_msg(dssw->parent, name, MISSING_DATE,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!blank_buf(dssw->start_val.val)) {
|
||||
if (!valid_time(p, dssw->start_val.val)) {
|
||||
if (a->type->value->item.sint32_value == CSA_TYPE_TODO)
|
||||
editor_err_msg(dssw->parent, name,
|
||||
INVALID_TIME_DUE,
|
||||
pu->xm_error_pixmap);
|
||||
else
|
||||
editor_err_msg(dssw->parent, name,
|
||||
INVALID_START,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (dt == HOUR12) {
|
||||
/* am and pm should not be translated. They are only
|
||||
* used in the date parsing code and never shown to
|
||||
* the user.
|
||||
*/
|
||||
if (dssw->start_val.block == TIME_AM)
|
||||
sprintf(ampm_buf, "am");
|
||||
else
|
||||
sprintf(ampm_buf, "pm");
|
||||
} else
|
||||
ampm_buf[0] = '\0';
|
||||
|
||||
sprintf(buf, "%s %s%s",
|
||||
dssw->date_val, dssw->start_val.val, ampm_buf);
|
||||
|
||||
if (!blank_buf(dssw->stop_val.val)
|
||||
&& !valid_time(p, dssw->stop_val.val)) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_STOP,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
} else if (!blank_buf(dssw->stop_val.val)) {
|
||||
editor_err_msg(dssw->parent, name, MISSING_START,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
} else
|
||||
sprintf(buf, "%s 3:41am", dssw->date_val);
|
||||
|
||||
start_tick = cm_getdate(buf, NULL);
|
||||
if(start_tick < 0) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_DATE,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (blank_buf(dssw->what_val) && blank_buf(dssw->start_val.val)
|
||||
&& blank_buf(dssw->stop_val.val)) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_NOTIME_APPT,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
a->time->value->item.date_time_value = (char *) malloc(BUFSIZ);
|
||||
_csa_tick_to_iso8601(start_tick, a->time->value->item.date_time_value);
|
||||
a->what->value->item.string_value = (char *)cm_strdup(dssw->what_val);
|
||||
a->show_time->value->item.sint32_value = True;
|
||||
|
||||
if (!blank_buf(dssw->stop_val.val)) {
|
||||
if (dt == HOUR12) {
|
||||
/* am and pm should not be translated. They are only
|
||||
* used in the date parsing code and never shown to
|
||||
* the user.
|
||||
*/
|
||||
if (dssw->stop_val.block == TIME_AM)
|
||||
sprintf(ampm_buf, "am");
|
||||
else
|
||||
sprintf(ampm_buf, "pm");
|
||||
} else
|
||||
ampm_buf[0] = '\0';
|
||||
|
||||
sprintf(buf, "%s %s%s", dssw->date_val,
|
||||
dssw->stop_val.val, ampm_buf);
|
||||
if ((stop_tick = cm_getdate(buf, NULL)) <= 0) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_DATE,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
if (stop_tick < start_tick) {
|
||||
if (*flagsP == 0)
|
||||
{
|
||||
char *title = XtNewString(catgets(calendar->DT_catd, 1, 248,
|
||||
"Calendar : Schedule Appointment"));
|
||||
char *ident1 = XtNewString(catgets(calendar->DT_catd, 1,
|
||||
923, "Cancel"));
|
||||
char *ident2 = XtNewString(catgets(calendar->DT_catd, 1,
|
||||
250, "Next Day"));
|
||||
sprintf(buf, "%s", catgets(calendar->DT_catd, 1, 247,
|
||||
"This appointment has an end time earlier than\nits begin time. Do you want to\nschedule it into the next day?"));
|
||||
*flagsP = dialog_popup(dssw->parent,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, buf,
|
||||
BUTTON_IDENT, -1, ident1,
|
||||
BUTTON_IDENT, DSSW_NEXT_DAY, ident2,
|
||||
DIALOG_IMAGE, pu->xm_question_pixmap,
|
||||
NULL);
|
||||
XtFree(ident2);
|
||||
XtFree(ident1);
|
||||
XtFree(title);
|
||||
}
|
||||
switch (*flagsP) {
|
||||
case DSSW_NEXT_DAY:
|
||||
stop_tick += daysec;
|
||||
break;
|
||||
|
||||
default:
|
||||
*flagsP = 0;
|
||||
return False;
|
||||
}
|
||||
}
|
||||
|
||||
a->end_time->value->item.date_time_value = (char *) malloc(BUFSIZ);
|
||||
_csa_tick_to_iso8601(stop_tick, a->end_time->value->item.date_time_value);
|
||||
} else if (blank_buf(dssw->start_val.val)) {
|
||||
a->end_time->value->item.date_time_value = (char *) malloc(BUFSIZ);
|
||||
_csa_tick_to_iso8601(start_tick + minsec, a->end_time->value->item.date_time_value);
|
||||
a->show_time->value->item.sint32_value = False;
|
||||
} else {
|
||||
free(a->end_time->value);
|
||||
a->end_time->value = NULL;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
/*
|
||||
** This function will consume form values and stuff them into an appointment.
|
||||
*/
|
||||
extern Boolean
|
||||
dssw_form_to_todo(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t)
|
||||
{
|
||||
time_t start_tick, stop_tick;
|
||||
char ampm_buf[BUFSIZ], buf[BUFSIZ];
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
Props_pu *pu = (Props_pu *)dssw->cal->properties_pu;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
get_dssw_vals(dssw, t);
|
||||
/*
|
||||
* Todo does not have end time. So to distinguish between this
|
||||
* and the editor, zero this out.
|
||||
*/
|
||||
sprintf(dssw->stop_val.val, "\0");
|
||||
if (blank_buf(dssw->date_val)) {
|
||||
editor_err_msg(dssw->parent, name, MISSING_DATE,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!blank_buf(dssw->start_val.val)) {
|
||||
if (!valid_time(p, dssw->start_val.val)) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_TIME,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (dt == HOUR12) {
|
||||
if (dssw->start_val.block == TIME_AM)
|
||||
sprintf(ampm_buf, "am");
|
||||
else
|
||||
sprintf(ampm_buf, "pm");
|
||||
} else
|
||||
ampm_buf[0] = '\0';
|
||||
|
||||
sprintf(buf, "%s %s%s",
|
||||
dssw->date_val, dssw->start_val.val, ampm_buf);
|
||||
|
||||
/*
|
||||
* No check here for stop time.
|
||||
*/
|
||||
} else {
|
||||
editor_err_msg(dssw->parent, name, MISSING_TIME,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
start_tick = cm_getdate(buf, NULL);
|
||||
if(start_tick < 0) {
|
||||
editor_err_msg(dssw->parent, name, INVALID_DATE,
|
||||
pu->xm_error_pixmap);
|
||||
return False;
|
||||
}
|
||||
|
||||
a->time->value->item.date_time_value = (char *) malloc(BUFSIZ);
|
||||
_csa_tick_to_iso8601(start_tick, a->time->value->item.date_time_value);
|
||||
a->what->value->item.string_value = (char *)cm_strdup(dssw->what_val);
|
||||
a->show_time->value->item.sint32_value = True;
|
||||
|
||||
free(a->end_time->value);
|
||||
a->end_time->value = NULL;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** The next two functions will take appointment values and stuff them into
|
||||
** a form.
|
||||
*/
|
||||
extern Boolean
|
||||
dssw_appt_to_form(DSSW *dssw, CSA_entry_handle entry) {
|
||||
Boolean ret_val;
|
||||
CSA_return_code stat;
|
||||
Dtcm_appointment *appt;
|
||||
|
||||
appt = allocate_appt_struct(appt_read,
|
||||
dssw->cal->general->version,
|
||||
CSA_ENTRY_ATTR_START_DATE_I,
|
||||
CSA_ENTRY_ATTR_SUMMARY_I,
|
||||
CSA_ENTRY_ATTR_END_DATE_I,
|
||||
CSA_X_DT_ENTRY_ATTR_SHOWTIME_I,
|
||||
NULL);
|
||||
stat = query_appt_struct(dssw->cal->cal_handle, entry, appt);
|
||||
backend_err_msg(dssw->cal->frame, dssw->cal->view->current_calendar,
|
||||
stat, ((Props_pu *)dssw->cal->properties_pu)->xm_error_pixmap);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_appt_struct(&appt);
|
||||
return False;
|
||||
}
|
||||
|
||||
ret_val = dssw_attrs_to_form(dssw, appt);
|
||||
free_appt_struct(&appt);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
dssw_attrs_to_form(DSSW *dssw, Dtcm_appointment *appt) {
|
||||
int start_hr, stop_hr;
|
||||
char *what;
|
||||
time_t tick, end_tick = 0;
|
||||
Boolean showtime;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &tick);
|
||||
showtime = showtime_set(appt);
|
||||
if (appt->end_time)
|
||||
_csa_iso8601_to_tick(appt->end_time->value->item.\
|
||||
date_time_value, &end_tick);
|
||||
what = appt->what->value->item.string_value;
|
||||
|
||||
/*
|
||||
** Set the date, start, stop, and what fields
|
||||
*/
|
||||
if (!showtime || magic_time(tick)) {
|
||||
dssw->start_val.val[0] = '\0';
|
||||
dssw->stop_val.val[0] = '\0';
|
||||
} else {
|
||||
if ((start_hr = hour(tick)) < 12)
|
||||
dssw->start_val.block = TIME_AM;
|
||||
else
|
||||
dssw->start_val.block = TIME_PM;
|
||||
|
||||
if (dt == HOUR12) {
|
||||
if (start_hr == 0)
|
||||
start_hr = 12;
|
||||
else if (start_hr > 12)
|
||||
start_hr -= 12;
|
||||
sprintf(dssw->start_val.val, "%2d:%02d", start_hr,
|
||||
minute(tick));
|
||||
} else
|
||||
sprintf(dssw->start_val.val, "%02d%02d", start_hr,
|
||||
minute(tick));
|
||||
|
||||
if (end_tick) {
|
||||
if ((stop_hr = hour(end_tick)) < 12)
|
||||
dssw->stop_val.block = TIME_AM;
|
||||
else
|
||||
dssw->stop_val.block = TIME_PM;
|
||||
|
||||
if (dt == HOUR12) {
|
||||
if (stop_hr == 0)
|
||||
stop_hr = 12;
|
||||
else if (stop_hr > 12)
|
||||
stop_hr -= 12;
|
||||
sprintf(dssw->stop_val.val, "%2d:%02d", stop_hr,
|
||||
minute(end_tick));
|
||||
} else
|
||||
sprintf(dssw->stop_val.val, "%02d%02d", stop_hr,
|
||||
minute(end_tick));
|
||||
} else {
|
||||
/* no end time */
|
||||
sprintf(dssw->stop_val.val, "\0");
|
||||
dssw->stop_val.block = TIME_AM;
|
||||
}
|
||||
}
|
||||
|
||||
/* limit the size of the text pulled out of the appointment. */
|
||||
|
||||
if (what) {
|
||||
strncpy(dssw->what_val, what, WHAT_LEN - 1);
|
||||
dssw->what_val[WHAT_LEN-1] = NULL;
|
||||
}
|
||||
|
||||
set_dssw_vals(dssw, tick);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
extern void
|
||||
get_dssw_times(DSSW *dssw) {
|
||||
char *str;
|
||||
|
||||
str = XmTextGetString(dssw->start_text);
|
||||
strcpy(dssw->start_val.val, str);
|
||||
XtFree(str);
|
||||
dssw->start_val.block =
|
||||
XmToggleButtonGetState(dssw->start_am) ? TIME_AM : TIME_PM;
|
||||
|
||||
str = XmTextGetString(dssw->stop_text);
|
||||
strcpy(dssw->stop_val.val, str);
|
||||
XtFree(str);
|
||||
dssw->stop_val.block =
|
||||
XmToggleButtonGetState(dssw->stop_am) ? TIME_AM : TIME_PM;
|
||||
}
|
||||
|
||||
extern void
|
||||
get_dssw_vals(DSSW *dssw, Tick t) {
|
||||
dssw_get_non_times(dssw, t);
|
||||
get_dssw_times(dssw);
|
||||
}
|
||||
|
||||
extern void
|
||||
set_dssw_times(DSSW *dssw) {
|
||||
XmString xmstr;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
XtVaSetValues(dssw->start_text, XmNvalue, dssw->start_val.val,
|
||||
NULL);
|
||||
XtVaSetValues(dssw->stop_text, XmNvalue, dssw->stop_val.val,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(dssw->start_val.val);
|
||||
XtVaSetValues(XmOptionButtonGadget(dssw->start_menu),
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
xmstr = XmStringCreateLocalized(dssw->stop_val.val);
|
||||
XtVaSetValues(XmOptionButtonGadget(dssw->stop_menu),
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
if (dt == HOUR12) {
|
||||
if (dssw->start_val.block == TIME_AM)
|
||||
XmToggleButtonSetState(dssw->start_am, True, True);
|
||||
else
|
||||
XmToggleButtonSetState(dssw->start_pm, True, True);
|
||||
if (dssw->stop_val.block == TIME_AM)
|
||||
XmToggleButtonSetState(dssw->stop_am, True, True);
|
||||
else
|
||||
XmToggleButtonSetState(dssw->stop_pm, True, True);
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
load_dssw_times(DSSW *dssw, Tick start, Tick stop, Boolean set_no_time) {
|
||||
char buf[10];
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt;
|
||||
|
||||
/*
|
||||
* If start and stop times were specified, do the right thing to the
|
||||
* dssw widget
|
||||
*/
|
||||
dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
if (set_no_time == True){
|
||||
strcpy(dssw->start_val.val, " ");
|
||||
strcpy(dssw->stop_val.val, " ");
|
||||
return;
|
||||
}
|
||||
|
||||
if (start > 0) {
|
||||
format_time(start, dt, buf);
|
||||
if (dt == HOUR12) {
|
||||
strncpy(dssw->start_val.val, buf, 5);
|
||||
dssw->start_val.val[5] = '\0';
|
||||
dssw->start_val.block = (buf[5] == 'a') ?
|
||||
TIME_AM : TIME_PM;
|
||||
} else {
|
||||
strcpy(dssw->start_val.val, buf);
|
||||
dssw->start_val.block = TIME_AM;
|
||||
}
|
||||
}
|
||||
if (stop > 0) {
|
||||
format_time(stop, dt, buf);
|
||||
if (dt == HOUR12) {
|
||||
strncpy(dssw->stop_val.val, buf, 5);
|
||||
dssw->stop_val.val[5] = '\0';
|
||||
dssw->stop_val.block = (buf[5] == 'a') ?
|
||||
TIME_AM : TIME_PM;
|
||||
} else {
|
||||
strcpy(dssw->stop_val.val, buf);
|
||||
dssw->stop_val.block = TIME_AM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
set_dssw_vals(DSSW *dssw, Tick t) {
|
||||
dssw_set_non_times(dssw, t);
|
||||
set_dssw_times(dssw);
|
||||
}
|
||||
|
||||
extern void
|
||||
set_dssw_defaults(DSSW *dssw, Tick t, Boolean set_times) {
|
||||
int appt_beg, appt_end, beg_hr, end_hr;
|
||||
Props *p = (Props *)dssw->cal->properties;
|
||||
DisplayType dt;
|
||||
Time_scope_menu_op dur_scope;
|
||||
|
||||
if (set_times) {
|
||||
dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
appt_beg = get_int_prop(p, CP_APPTBEGIN);
|
||||
beg_hr = appt_beg / minsec;
|
||||
appt_end = get_int_prop(p, CP_APPTDURATION) + appt_beg;
|
||||
end_hr = appt_end / minsec;
|
||||
end_hr = end_hr % 24;
|
||||
|
||||
if (dt == HOUR12) {
|
||||
dssw->start_val.block = (adjust_hour(&beg_hr)) ?
|
||||
TIME_AM : TIME_PM;
|
||||
dssw->stop_val.block = (adjust_hour(&end_hr)) ?
|
||||
TIME_AM : TIME_PM;
|
||||
sprintf(dssw->start_val.val, "%2d:%02d",
|
||||
beg_hr, appt_beg % minsec);
|
||||
sprintf(dssw->stop_val.val, "%2d:%02d",
|
||||
end_hr, appt_end % minsec);
|
||||
} else {
|
||||
sprintf(dssw->start_val.val, "%02d%02d",
|
||||
beg_hr, appt_beg % minsec);
|
||||
sprintf(dssw->stop_val.val, "%02d%02d",
|
||||
end_hr, appt_end % minsec);
|
||||
dssw->start_val.block = dssw->stop_val.block = TIME_AM;
|
||||
}
|
||||
}
|
||||
dssw->what_val[0] = '\0';
|
||||
|
||||
set_dssw_vals(dssw, t);
|
||||
}
|
||||
119
cde/programs/dtcm/dtcm/dssw.h
Normal file
119
cde/programs/dtcm/dtcm/dssw.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** dssw.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)dssw.h 1.18 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: dssw.h /main/4 1996/05/23 11:18:54 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DSSW_H
|
||||
#define _DSSW_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
|
||||
#define DATE_LEN 100
|
||||
#define START_STOP_LEN 6
|
||||
#define WHAT_LEN 256
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** DSSW enumerated types
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef enum {
|
||||
TIME_AM,
|
||||
TIME_PM
|
||||
} Time_block_op;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** DSSW structures
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
char val[START_STOP_LEN];
|
||||
Time_block_op block;
|
||||
} Time_val;
|
||||
|
||||
typedef struct {
|
||||
Calendar *cal;
|
||||
Widget date_label;
|
||||
Widget date_text;
|
||||
char date_val[DATE_LEN];
|
||||
Widget dssw_form_mgr;
|
||||
Widget parent;
|
||||
Widget start_am;
|
||||
Widget start_ampm_rc_mgr;
|
||||
Widget start_label;
|
||||
Widget start_menu;
|
||||
Widget *start_menu_widget_list;
|
||||
int start_menu_widget_count;
|
||||
Widget start_pm;
|
||||
Widget start_text;
|
||||
Time_val start_val;
|
||||
Widget stop_am;
|
||||
Widget stop_ampm_rc_mgr;
|
||||
Widget stop_label;
|
||||
Widget stop_menu;
|
||||
Widget *stop_menu_widget_list;
|
||||
int stop_menu_widget_count;
|
||||
Widget stop_pm;
|
||||
Widget stop_text;
|
||||
Time_val stop_val;
|
||||
Widget what_label;
|
||||
Widget what_text;
|
||||
Widget what_scrollwindow;
|
||||
char what_val[WHAT_LEN];
|
||||
Boolean show_notime_selection;
|
||||
Boolean show_allday_selection;
|
||||
} DSSW;
|
||||
|
||||
/* form-to-appt flags */
|
||||
#define DSSW_NEXT_DAY 1
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** DSSW external function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void build_dssw P((DSSW*, Calendar*, Widget, Boolean, Boolean));
|
||||
extern Boolean dssw_appt_to_form P((DSSW*, CSA_entry_handle));
|
||||
extern Boolean dssw_attrs_to_form P((DSSW*, Dtcm_appointment*));
|
||||
extern Boolean dssw_form_to_appt P((DSSW*, Dtcm_appointment*, char*,
|
||||
Tick));
|
||||
extern Boolean dssw_form_flags_to_appt P((DSSW*, Dtcm_appointment*, char*,
|
||||
Tick, int *));
|
||||
extern Boolean dssw_form_to_todo P((DSSW*, Dtcm_appointment*, char*,
|
||||
Tick));
|
||||
extern void load_dssw_times P((DSSW*, Tick, Tick, Boolean));
|
||||
extern void get_dssw_times P((DSSW*));
|
||||
extern void get_dssw_vals P((DSSW*, Tick));
|
||||
extern void set_dssw_defaults P((DSSW*, Tick, Boolean));
|
||||
extern void set_dssw_times P((DSSW*));
|
||||
extern void set_dssw_vals P((DSSW*, Tick));
|
||||
extern void set_dssw_menus P((DSSW*, Props *));
|
||||
|
||||
#endif
|
||||
971
cde/programs/dtcm/dtcm/dtcm.msg
Normal file
971
cde/programs/dtcm/dtcm/dtcm.msg
Normal file
@@ -0,0 +1,971 @@
|
||||
$ $TOG: dtcm.msg /main/9 1999/09/20 10:31:13 mgreess $
|
||||
|
||||
$quote "
|
||||
|
||||
|
||||
$set 1
|
||||
1 "dtcm: empty recipient in mail reminder\n"
|
||||
2 "Reminder- %s"
|
||||
3 "pm"
|
||||
4 "am"
|
||||
7 "\n\n\t** Calendar Appointment **\n\n\tDate:\t%s\n\tStart:\t%s\n\tEnd:\t%s\n\tWhat:\t%s"
|
||||
16 "You may not remove the default calendar"
|
||||
17 "Select a name to remove"
|
||||
20 "Invalid Date In Go To Field."
|
||||
21 "Edit List..."
|
||||
22 "Browse Menu Items"
|
||||
23 "Prev Week"
|
||||
24 "This Week"
|
||||
25 "Next Week"
|
||||
26 "Prev Month"
|
||||
27 "Next Month"
|
||||
28 "Go To:"
|
||||
29 "Schedule..."
|
||||
30 "Mail..."
|
||||
31 "Calendar Displayed"
|
||||
32 "Calendars Displayed"
|
||||
33 "Day"
|
||||
34 "Week"
|
||||
35 "Month"
|
||||
36 "Year"
|
||||
37 "Time Zone..."
|
||||
38 "Appointment List..."
|
||||
40 "View"
|
||||
41 "Find..."
|
||||
42 "Go to Date..."
|
||||
65 "File"
|
||||
68 "Print Current View"
|
||||
69 "Print..."
|
||||
72 "Options..."
|
||||
73 "Exit"
|
||||
74 "Appointment..."
|
||||
76 "Edit"
|
||||
77 "Help"
|
||||
79 "Tasks..."
|
||||
80 "Reference..."
|
||||
82 "Using Help..."
|
||||
84 "Show Other Calendar..."
|
||||
85 "Compare Calendars..."
|
||||
86 "Menu Editor..."
|
||||
87 "Browse"
|
||||
88 "Today"
|
||||
89 "in quit_handler\n"
|
||||
90 "Error opening Calendar file"
|
||||
91 "rpc.cmsd is not responding for your user name.\nMake sure the inetd process is running and the entry\nin inetd.conf for rpc.cmsd is correct for your host."
|
||||
92 "User name"
|
||||
93 "Host"
|
||||
94 "Calendar : Error"
|
||||
95 "Continue"
|
||||
108 "No Calendar Location specified for"
|
||||
109 "No location specified; add a hostname to the\nInitial Calendar View in Properties/Display Settings. If\nyou ran Calendar (dtcm) with the -c option, verify you specified a hostname."
|
||||
110 "Calendar : Error - Help"
|
||||
113 "Calendar"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message 113 : ``Calendar'' is used in the main titlebar
|
||||
$ of the tool: Calendar : user@host.
|
||||
$ */
|
||||
114 "January"
|
||||
115 "February"
|
||||
116 "March"
|
||||
117 "April"
|
||||
118 "May"
|
||||
119 "June"
|
||||
120 "July"
|
||||
121 "August"
|
||||
122 "September"
|
||||
123 "October"
|
||||
124 "November"
|
||||
125 "December"
|
||||
126 "Jan"
|
||||
127 "Feb"
|
||||
128 "Mar"
|
||||
129 "Apr"
|
||||
130 "May"
|
||||
131 "Jun"
|
||||
132 "Jul"
|
||||
133 "Aug"
|
||||
134 "Sep"
|
||||
135 "Oct"
|
||||
136 "Nov"
|
||||
137 "Dec"
|
||||
138 "Sun"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ The strings (message number 138-144) are abbreviations to
|
||||
$ the days of the week:
|
||||
$
|
||||
$ Sun --> Sunday
|
||||
$ Mon --> Monday
|
||||
$ Tue --> Tuesday
|
||||
$ Wed --> Wednesday
|
||||
$ Thu --> Thursday
|
||||
$ Fri --> Friday
|
||||
$ Sat --> Saturday
|
||||
$ Sun --> Sunday
|
||||
$
|
||||
$ */
|
||||
139 "Mon"
|
||||
140 "Tue"
|
||||
141 "Wed"
|
||||
142 "Thu"
|
||||
143 "Fri"
|
||||
144 "Sat"
|
||||
146 "Sunday"
|
||||
147 "Monday"
|
||||
148 "Tuesday"
|
||||
149 "Wednesday"
|
||||
150 "Thursday"
|
||||
151 "Friday"
|
||||
152 "Saturday"
|
||||
154 "S"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ The strings (message number 154-160, 168) are one letter
|
||||
$ abbreviations to the days of the week:
|
||||
$
|
||||
$ S --> Sunday (message 154)
|
||||
$ M --> Monday
|
||||
$ T --> Tuesday
|
||||
$ W --> Wednesday
|
||||
$ T --> Thursday
|
||||
$ F --> Friday
|
||||
$ S --> Saturday (message 160)
|
||||
$
|
||||
$ */
|
||||
155 "M"
|
||||
156 "T"
|
||||
157 "W"
|
||||
158 "T"
|
||||
159 "F"
|
||||
160 "S"
|
||||
170 "SUN"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ The strings (message number 170-176) are abbreviations to
|
||||
$ the days of the week:
|
||||
$
|
||||
$ SUN --> Sunday
|
||||
$ MON --> Monday
|
||||
$ TUE --> Tuesday
|
||||
$ WED --> Wednesday
|
||||
$ THU --> Thursday
|
||||
$ FRI --> Friday
|
||||
$ SAT --> Saturday
|
||||
$
|
||||
$ */
|
||||
171 "MON"
|
||||
172 "TUE"
|
||||
173 "WED"
|
||||
174 "THU"
|
||||
175 "FRI"
|
||||
176 "SAT"
|
||||
178 "You Are Already Browsing %s"
|
||||
186 "Calendar (dtcm) and rpc.cmsd versions are different."
|
||||
187 "Usage:\n\tdtcm_delete [-c calendar] [-d <mm/dd/yy>] [-v view]\n"
|
||||
188 "\nCould not open calendar %s\n"
|
||||
189 "UNKNOWN"
|
||||
190 "Item to delete (number)? "
|
||||
191 "Usage:\n\tdtcm_insert [ -c calendar ] [-d <mm/dd/yy>] [ -v view ]\n"
|
||||
192 " [-w what string] [-s <HH:MMam/pm>] [-e <HH:MMam/pm>]\n"
|
||||
193 "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n"
|
||||
194 "Calendar (%s): "
|
||||
195 "Date (%s): "
|
||||
196 "Start (%s): "
|
||||
197 "You have entered an invalid time. Please try again:\n"
|
||||
198 "End (%s): "
|
||||
199 "End (%s): "
|
||||
200 "One Time"
|
||||
201 "Repeat (%s): "
|
||||
203 "no default"
|
||||
204 "For (%s): "
|
||||
205 "What (you may enter up to 5 lines, use ^D to finish):\n"
|
||||
206 "\nCould not open calendar %s\n"
|
||||
207 "Usage:\n\tdtcm_lookup [ -c calendar ][ -d <mm/dd/yy> ] [ -v view ]\n"
|
||||
208 "\nCould not open calendar \"%s\"\n"
|
||||
209 "UNKNOWN"
|
||||
210 "The appointment will be scheduled in the calendar\nyou are currently browsing. Do you still want to schedule it?"
|
||||
211 "Schedule in"
|
||||
212 "Calendar : Schedule Appointment"
|
||||
214 "Appointment scheduled: %s"
|
||||
218 "Invalid DATE specified"
|
||||
219 "Invalid START time specified"
|
||||
220 "Invalid END time specified"
|
||||
221 "Empty or missing DATE field"
|
||||
222 "Empty or missing START field"
|
||||
223 "Empty or missing WHAT field"
|
||||
224 "REPEAT and FOR field mismatch"
|
||||
225 "Schedule appointment was cancelled."
|
||||
226 "Internal error scheduling appointment."
|
||||
230 "Calendar : Error - Drag Appointment"
|
||||
231 "Select an appointment and DRAG again."
|
||||
236 "CalendarAppointment"
|
||||
237 "XCreateBitmapFromData() failed for bitmap.\n"
|
||||
238 "XCreateBitmapFromData() failed for mask.\n"
|
||||
239 "DragStart returned NULL.\n"
|
||||
247 "This appointment has an end time earlier than\nits begin time. Do you want to\nschedule it into the next day?"
|
||||
248 "Calendar : Schedule Appointment"
|
||||
250 "Next Day"
|
||||
251 "Author"
|
||||
252 "Calendar : Appointment Editor - Delete"
|
||||
253 "Select an appointment and DELETE again."
|
||||
256 "Internal error selecting appointment.\nAppointment was not deleted."
|
||||
258 "Calendar : Appointment Editor - Change"
|
||||
259 "Select an appointment and CHANGE again."
|
||||
268 "This appointment is part of a repeating series.\nDo you want to change ...?"
|
||||
270 "This One Only"
|
||||
271 "Forward"
|
||||
272 "All"
|
||||
274 "This appointment is part of a repeating series.\nDo you want to delete ...?"
|
||||
279 "Calendar : Appointment Editor"
|
||||
280 "Calendar : Error - Appointment List"
|
||||
281 "Sorry, no appointments to list. "
|
||||
283 "Calendar : Find"
|
||||
284 "Find:"
|
||||
285 "Find"
|
||||
290 "Specify Appt String to Match."
|
||||
291 "Appointment Not Found."
|
||||
292 "%d matches found"
|
||||
293 "Date:"
|
||||
294 "Go To"
|
||||
297 "Please type in a date"
|
||||
298 "You are already viewing %s"
|
||||
299 "Invalid Date"
|
||||
300 "Author"
|
||||
304 "Mail..."
|
||||
305 "Calendar : Error - Group Appointment Editor"
|
||||
306 "Select a calendar and INSERT again."
|
||||
314 "Calendar : Group Appointment Editor - Delete"
|
||||
315 "Select a calendar and DELETE again."
|
||||
329 "Calendar : Group Appointment Editor - Change"
|
||||
330 "Select a calendar and CHANGE again."
|
||||
340 "Calendar"
|
||||
341 "Access"
|
||||
342 "Insert"
|
||||
343 "Change"
|
||||
348 "Insert Permission"
|
||||
349 "Calendar : Group Appointment Editor"
|
||||
350 "Selection Error, cannot continue\n"
|
||||
352 "You must select a component within your application."
|
||||
353 "No Time"
|
||||
354 "All Day"
|
||||
355 "Unable to open callog file.\nOperation was cancelled. Calendar"
|
||||
356 "Per user request, Operation was cancelled.\nCalendar"
|
||||
357 "Invalid value in DATE field.\nOperation was cancelled. Calendar"
|
||||
358 "Invalid value in START field.\nOperation was cancelled. Calendar"
|
||||
359 "Invalid value in END field.\nOperation was cancelled. Calendar"
|
||||
360 "You must provide a DATE value.\nOperation was cancelled. Calendar"
|
||||
361 "You must provide a START value.\nOperation was cancelled. Calendar"
|
||||
362 "You must provide a WHAT value.\nOperation was cancelled. Calendar"
|
||||
363 "Invalid or mismatched REPEAT and FOR values.\nOperation was cancelled. Calendar"
|
||||
364 "Calendar : Error - Editor"
|
||||
367 "Calendar already exists.\nOperation was cancelled. Calendar"
|
||||
368 "Calendar does not exist.\nOperation was cancelled. Calendar"
|
||||
370 "Authorization error. Permission denied.\nOperation was cancelled. Calendar"
|
||||
378 "Memory allocation error - not enough memory.\nOperation was cancelled. Calendar"
|
||||
383 "Unknown error.\nOperation was cancelled. Calendar"
|
||||
386 "That appointment has an end time earlier than its begin time.\nDo you want to schedule it into the next day?"
|
||||
389 "Next Day"
|
||||
390 "Privacy:"
|
||||
391 "User Calendar Location:"
|
||||
392 "Day Boundaries:"
|
||||
393 "Begin:"
|
||||
394 "End:"
|
||||
395 "Hour Display:"
|
||||
396 "12 Hour"
|
||||
397 "24 Hour"
|
||||
398 "Default View:"
|
||||
399 "Year"
|
||||
400 "Month"
|
||||
401 "Week"
|
||||
402 "Day"
|
||||
403 "Initial Calendar View:"
|
||||
405 "Please select at least one permission. "
|
||||
408 "Please select a name first. "
|
||||
410 "User Name:"
|
||||
411 "Add Name"
|
||||
412 "Permissions"
|
||||
413 "Permissions"
|
||||
414 "Remove Name"
|
||||
415 "B = Browse I = Insert D = Delete"
|
||||
416 "Permissions:"
|
||||
417 "Browse"
|
||||
419 "Delete"
|
||||
420 "Destination:"
|
||||
421 "Printer"
|
||||
422 "File"
|
||||
423 "Printer:"
|
||||
424 "Directory:"
|
||||
425 "Options:"
|
||||
426 "File:"
|
||||
427 "Width:"
|
||||
428 "Height:"
|
||||
429 "Position:"
|
||||
430 "Inches from left"
|
||||
431 "Inches from bottom"
|
||||
432 "Units:"
|
||||
433 "Copies:"
|
||||
434 "Include:"
|
||||
435 "Show Time and Text Appts"
|
||||
436 "Show Time Only Appts"
|
||||
437 "Show Nothing Appts"
|
||||
438 "Date Ordering:"
|
||||
439 "MM | DD | YY"
|
||||
440 "DD | MM | YY"
|
||||
441 "YY | MM | DD"
|
||||
442 "Date Separator:"
|
||||
443 "Blank"
|
||||
445 "An error occurred writing to ~/.desksetdefaults.\nMake sure you have permission to write to this file."
|
||||
448 "An error occurred reading from ~/.desksetdefaults.\nMake sure you have permission to read this file."
|
||||
450 "Calendar : Options - Help"
|
||||
451 "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog."
|
||||
452 "Save"
|
||||
454 "Calendar : Error - Options"
|
||||
458 "Calendar : Options"
|
||||
459 "Category:"
|
||||
460 "Apply"
|
||||
464 "ps_open_file(): need to specify dir or file\n"
|
||||
465 "ps_open_file(): Invalid Directory %s\n"
|
||||
466 "w+"
|
||||
467 "ps_open_file(): unable to open file %s\n"
|
||||
468 "Page"
|
||||
469 "Day view by Calendar Manager"
|
||||
470 "Morning"
|
||||
471 "Afternoon"
|
||||
473 "To Do List by Calendar Manager"
|
||||
474 "Appt List by Calendar Manager"
|
||||
475 "Page"
|
||||
476 "of"
|
||||
477 "Month view by Calendar Manager"
|
||||
479 "Page"
|
||||
480 "Sun"
|
||||
481 "Mon"
|
||||
482 "Tue"
|
||||
483 "Wed"
|
||||
484 "Thu"
|
||||
485 "Fri"
|
||||
486 "Sat"
|
||||
487 "ps_init_printer(): cannot open postscript prolog file: %s\n"
|
||||
489 " Page"
|
||||
490 "Week view by Calendar Manager"
|
||||
491 "M"
|
||||
492 "T"
|
||||
493 "W"
|
||||
494 "T"
|
||||
495 "F"
|
||||
496 "S"
|
||||
497 "S"
|
||||
505 "Sat"
|
||||
506 "Sun"
|
||||
507 "Year view by Calendar Manager"
|
||||
523 "To Do List: Year of %d"
|
||||
524 "Appt List: Year of %d"
|
||||
525 "To Do List: %s"
|
||||
526 "Appt List: %s"
|
||||
527 "To Do List: Week of %s"
|
||||
528 "Appt List: Week of %s"
|
||||
529 "To Do List: %s"
|
||||
530 "Appt List: %s"
|
||||
531 "Every %d %s"
|
||||
532 "Calendar : Repeat Every"
|
||||
533 "Repeat Every:"
|
||||
534 "Occurs:"
|
||||
535 "For:"
|
||||
536 "Privacy:"
|
||||
537 "Calendar : Editor - Schedule Appointment"
|
||||
538 "Would you like to schedule this appointment as the last\nweek of the month or the 4th week of the month?"
|
||||
540 "Last Week"
|
||||
541 "4th Week"
|
||||
542 "Every %d %s"
|
||||
543 "Every %d %s"
|
||||
544 "Every %d %s"
|
||||
559 "Browsing %s..."
|
||||
560 "Calendar : Show Other Calendar"
|
||||
562 "Show"
|
||||
565 "Author"
|
||||
566 "Calendar : Error - To Do Editor"
|
||||
567 "Select a To Do and DELETE again."
|
||||
570 "Internal error selecting To Do.\nTo Do was not deleted."
|
||||
573 "This To Do is part of a repeating series.\nDo you want to delete ...?"
|
||||
579 "This To Do is part of a repeating series.\nDo you want to change ...?"
|
||||
585 "Select a To Do and CHANGE again."
|
||||
590 "Due Date:"
|
||||
591 "Calendar : To Do Editor"
|
||||
596 "Monday %d"
|
||||
597 "Tuesday %d"
|
||||
598 "Wednesday %d"
|
||||
599 "Thursday %d"
|
||||
600 "Friday %d"
|
||||
601 "Saturday %d"
|
||||
602 "Sunday %d"
|
||||
603 "Type a name to add in the User Name field"
|
||||
604 "is already in the list"
|
||||
607 "Internal error registering calendar name."
|
||||
610 "Internal error retrieving calendar name."
|
||||
612 "Overview..."
|
||||
613 "About Calendar..."
|
||||
619 "Please enter a calendar name in the format: <user>@<hostname>"
|
||||
620 "Unknown calendar. Calendar name needed: <name>%s"
|
||||
622 "Unknown calendar. Hostname needed: %s@<hostname>"
|
||||
623 "Calendar does not display dates prior to January 1, 1970"
|
||||
624 "Calendar does not display dates after December 31, 2037"
|
||||
625 "Less"
|
||||
626 "More"
|
||||
627 "Drag Appt"
|
||||
628 "Time What"
|
||||
631 "%d match found"
|
||||
632 "Please select an appointment from the list to show"
|
||||
633 "Calendar Selected"
|
||||
634 "Calendars Selected"
|
||||
641 "Server failed to get network address\nfor the specified location: invalid hostname."
|
||||
642 "rpc.cmsd daemon is not registered.\nPlease verify rpc.cmsd is installed correctly on your system."
|
||||
643 "Couldn't access calendar. Calendar"
|
||||
644 "Appointment Times:"
|
||||
645 "Duration:"
|
||||
646 "Minutes"
|
||||
647 "Looking up %s..."
|
||||
648 "SunDex"
|
||||
649 "Calendar : Time Zone"
|
||||
650 "My Time"
|
||||
652 "Custom Time"
|
||||
653 "GMT"
|
||||
654 "Hours"
|
||||
655 "OK"
|
||||
659 "Time Zone:"
|
||||
671 "Version"
|
||||
672 "Revision"
|
||||
674 "Copyright (c) 1993, 1994, 1995:"
|
||||
675 "Hewlett-Packard Company"
|
||||
676 "International Business Machines Corp."
|
||||
677 "Novell, Inc."
|
||||
678 "Sun Microsystems, Inc."
|
||||
679 "More..."
|
||||
680 "Close"
|
||||
681 "Calendar Contributors"
|
||||
682 "This application was brought to you by:"
|
||||
684 "User Names may not have embedded blanks or tabs"
|
||||
686 "Add Name"
|
||||
687 "Remove Name"
|
||||
688 "Browse Menu Items"
|
||||
691 "Reset"
|
||||
696 "Usage:\n\tdtcm_admin [ -d ] [ -a action ] [ -c calendar ][ -s <mm/dd/yy> ] [ -e <mm/dd/yy> ] [-f filename]\n"
|
||||
697 "You have specified an unsupported administration operation \"%s\".\n"
|
||||
698 "\nCould not open output file \"%s\"\n"
|
||||
699 "\nCould not open input file \"%s\"\n"
|
||||
700 "Discard"
|
||||
703 "context"
|
||||
704 "Year of %d"
|
||||
705 "%s"
|
||||
706 "Week of %s"
|
||||
707 "%s"
|
||||
708 "This appointment repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to change it?"
|
||||
711 "This appointment repeats in an unknown fashion. All occurrences will be deleted\nDo you still wish to delete it?"
|
||||
713 "You must choose a begin date before the end date."
|
||||
714 "There are no appointments in the list. You must find one before showing an appointment."
|
||||
715 "Calendar : Go to Date"
|
||||
721 "Others See Time And Text"
|
||||
722 "Others See Time Only"
|
||||
723 "Others See Nothing"
|
||||
724 "No Time appointments must have a WHAT value specified.\nOperation was cancelled. Calendar"
|
||||
725 "Calendar Entry does not exist.\nOperation was cancelled. Calendar"
|
||||
727 "Your request timed out\nPlease verify rpc.cmsd is installed correctly on your system."
|
||||
728 "Calendar : Print"
|
||||
729 "Printer Name:"
|
||||
730 "Copies:"
|
||||
731 "From:"
|
||||
732 "To:"
|
||||
733 " Print Command Options:"
|
||||
734 "Print to file:"
|
||||
735 "Print"
|
||||
736 "Calendar : Error - Print"
|
||||
738 "Access List:"
|
||||
739 "Access Rights:"
|
||||
740 "Add"
|
||||
743 "Public:"
|
||||
744 "Semiprivate:"
|
||||
745 "Private:"
|
||||
749 "Name and Access Rights must be set to add an item to the Access List."
|
||||
750 "Calendar : Error - Access List and Permissions"
|
||||
751 "This entry already exists in the Access List. Do you wish to change it?"
|
||||
756 "Name and Access rights must be set to change an item in the Access List"
|
||||
758 "midnight"
|
||||
759 "value"
|
||||
760 "value"
|
||||
762 "Editor Defaults"
|
||||
763 "Display Settings"
|
||||
764 "Access List and Permissions"
|
||||
765 "Printer Settings"
|
||||
766 "Date Format"
|
||||
772 "You may not save a blank User Calendar Location\nor one that contains blanks.\nYour properties settings have not been saved."
|
||||
773 "You may not save a blank Initial Calendar View\nor one that contains blanks.\nYour properties settings have not been saved."
|
||||
774 "ps_open_file(): print to file requires file name\n"
|
||||
775 "You must specify a reminder advance\nOperation was cancelled. Calendar"
|
||||
776 "A reminder advance may not contain an embedded blank\nOperation was cancelled. Calendar"
|
||||
777 "Advance values must be a number with an optional sign\nOperation was cancelled. Calendar"
|
||||
778 "Calendar : To Do List - Help"
|
||||
783 "Pending"
|
||||
784 "Completed"
|
||||
789 "To Do Type:"
|
||||
790 "context"
|
||||
791 "This To Do repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to delete it?"
|
||||
797 "To Do"
|
||||
798 "Time Due:"
|
||||
802 "Delete"
|
||||
803 "Clear"
|
||||
806 "Year of %d"
|
||||
807 "%s"
|
||||
808 "Week of %s"
|
||||
809 "%s"
|
||||
810 "Please enter a start date after 1/1/1970"
|
||||
811 "Malformed start date"
|
||||
812 "Please enter an end date before 1/1/2038"
|
||||
813 "Malformed end date"
|
||||
814 "You must enter a date after 1969 and before 2038"
|
||||
816 "Days"
|
||||
817 "Weeks"
|
||||
818 "Months"
|
||||
819 "The Duration value must be an integer with no sign.\nYour properties settings have not been saved."
|
||||
820 "The start value must be a valid time.\nYour properties settings have not been saved."
|
||||
$ 821 "You have specified an illegal print width value.\nYour properties settings have not been saved."
|
||||
$ "print width" has been replaced by "right margin".
|
||||
821 "You have specified an illegal right margin value.\nYour properties settings have not been saved."
|
||||
$ 822 "You have specified an illegal print height value.\nYour properties settings have not been saved."
|
||||
$ "print height" has been replaced by "bottom margin".
|
||||
822 "You have specified an illegal bottom margin value.\nYour properties settings have not been saved."
|
||||
825 "Days"
|
||||
826 "Weeks"
|
||||
827 "Months"
|
||||
828 "Date:"
|
||||
829 "Start:"
|
||||
830 "AM"
|
||||
831 "PM"
|
||||
832 "End:"
|
||||
833 "AM"
|
||||
834 "PM"
|
||||
835 "What:"
|
||||
836 "Frequency"
|
||||
837 "Calendar : Error - To Do Editor"
|
||||
839 "Calendar : Reminder"
|
||||
841 "Click on \"Add Name\" to add a name, \"Apply\" to commit changes."
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ Message 841 is used in the Menu Editor's footer. The
|
||||
$ Menu Editor is accessed through the browse menu. The
|
||||
$ message is displayed when something is typed into the User
|
||||
$ Name field in the editor. If the translated footer message
|
||||
$ is too long it causes the menu editor to grow horizontally
|
||||
$ which we do not want. If you notice that the translated
|
||||
$ string causes the editor to grow horizontally please
|
||||
$ insert a newline (\n) character somewhere in the middle
|
||||
$ of the string so the footer will use two lines and the
|
||||
$ editor will grow vertically.
|
||||
$ */
|
||||
842 "The information transferred did not\ncontain any appointments."
|
||||
843 "Drag and Drop operation failed."
|
||||
844 "Unable to locate the transferred information."
|
||||
845 "Drag and Drop operation Failed\nInternal consistency error."
|
||||
846 "Save"
|
||||
848 "Date"
|
||||
849 "Time"
|
||||
850 "What"
|
||||
851 "Show Appointment"
|
||||
852 "One Time"
|
||||
853 "Daily"
|
||||
854 "Weekly"
|
||||
855 "Every Two Weeks"
|
||||
856 "Monthly By Date"
|
||||
857 "Monthly By Weekday"
|
||||
858 "Yearly"
|
||||
859 "Monday Thru Friday"
|
||||
860 "Mon, Wed, Fri"
|
||||
861 "Tuesday, Thursday"
|
||||
862 "Repeat Every..."
|
||||
863 "2"
|
||||
864 "3"
|
||||
865 "4"
|
||||
866 "5"
|
||||
867 "6"
|
||||
868 "7"
|
||||
869 "8"
|
||||
870 "9"
|
||||
871 "10"
|
||||
872 "11"
|
||||
873 "12"
|
||||
874 "13"
|
||||
875 "14"
|
||||
876 "forever"
|
||||
877 "Mins"
|
||||
878 "Hrs"
|
||||
879 "Days"
|
||||
881 "Internal Error #1: Invalid calendar/entry handle.\nOperation was cancelled. Calendar"
|
||||
882 "Internal Error #2: Invalid session handle.\nOperation was cancelled. Calendar"
|
||||
883 "Internal Error #3: Invalid data value.\nOperation was cancelled. Calendar"
|
||||
884 "Internal Error #4: Value specified for a read-only attribute.\nOperation was cancelled. Calendar"
|
||||
885 "Internal Error #5: Incorrect data type specified for an attribute value.\nOperation was cancelled. Calendar"
|
||||
886 "Internal Error #6: Specified attribute is not supported on this calendar version.\nOperation was cancelled. Calendar"
|
||||
887 "Internal Error #7: Specified function is not supported on this calendar version.\nOperation was cancelled. Calendar"
|
||||
888 "Internal Error #8: Invalid operator specified.\nOperation was cancelled. Calendar"
|
||||
890 "Calendar : Error - Services"
|
||||
892 "The dates for printing must be between 1969 and 2038."
|
||||
894 "Malformed \"From\" date"
|
||||
896 "Malformed \"To\" date"
|
||||
898 "The \"To\" date for printing must be after the \"From\" date for printing"
|
||||
899 "To Do List Beginning: %s"
|
||||
900 "Appt List Beginning: %s"
|
||||
901 "Repeat Every ..."
|
||||
902 "Monday Thru Friday"
|
||||
903 "Mon, Wed, Fri"
|
||||
906 "Drag To Do"
|
||||
907 "No space left for calendar file.\nOperation was cancelled. Calendar"
|
||||
908 "You may not set a blank reminder value.\nYour properties settings have not been saved."
|
||||
909 "You may not set a reminder value with an embedded blank.\nYour properties settings have not been saved."
|
||||
910 "Reminder values must be a number with an optional sign.\nYour properties settings have not been saved."
|
||||
$ 911 "You have specified an illegal position from left offset value.\nYour properties settings have not been saved."
|
||||
$ "position from left offset" has been changed to "left margin".
|
||||
911 "You have specified an illegal left margin value.\nYour properties settings have not been saved."
|
||||
$ 912 "You have specified an illegal position from right offset value.\nYour properties settings have not been saved."
|
||||
$ "position from right offset" has been changed to "top margin".
|
||||
912 "You have specified an illegal top margin value.\nYour properties settings have not been saved."
|
||||
913 "A To Do item must have text in the first line of the What item."
|
||||
914 "Calendar : Error - Editor"
|
||||
916 "The Duration value must be less than 24 hours.\nYour properties settings have not been saved."
|
||||
917 "Missing\nGraphics"
|
||||
918 "Missing\nGraphics"
|
||||
919 "Calendar"
|
||||
920 "displayed."
|
||||
921 "Couldn't access calendar: "
|
||||
922 "About Calendar"
|
||||
923 "Cancel"
|
||||
963 "Calendar : Menu Editor"
|
||||
964 "On Item"
|
||||
965 "To Do List..."
|
||||
966 "To Do..."
|
||||
967 "Calendar Server Version"
|
||||
968 "Calendar Data Version"
|
||||
969 "Calendar : Error - Repeat Every"
|
||||
970 "The Repeat Every value must be an integer with no sign."
|
||||
971 "Time Calendar"
|
||||
972 "What"
|
||||
973 "Search all"
|
||||
974 "Search from"
|
||||
975 "to"
|
||||
976 "Report Type:"
|
||||
977 "Day View"
|
||||
978 "Week View"
|
||||
979 "Month View"
|
||||
980 "Year View"
|
||||
981 "Appointment List"
|
||||
982 "To Do List"
|
||||
983 "User Name"
|
||||
984 "This appointment is part of a repeating series.\nDo you want to insert appointment ...?"
|
||||
985 "Reminders"
|
||||
986 "Beep"
|
||||
987 "Flash"
|
||||
988 "Popup"
|
||||
989 "Mail"
|
||||
990 "Mail To:"
|
||||
992 "%A, %B %e, %Y"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ This string is used in the calendar day view. In the C locale
|
||||
$ it has the form:
|
||||
$
|
||||
$ Monday, January 16, 1995
|
||||
$
|
||||
$ strftime conversion string: "%A, %B %e, %Y" is used.
|
||||
$
|
||||
$ Use the appropriate strftime conversion for your locale.
|
||||
$ */
|
||||
993 "Week Starting %A, %B %e, %Y"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ This string is used in the calendar week view. In the C locale
|
||||
$ it has the form:
|
||||
$
|
||||
$ Monday, January 16, 1995
|
||||
$
|
||||
$ strftime conversion string: "%A, %B %e, %Y" is used. The string
|
||||
$ will be used in a label that looks like this:
|
||||
$
|
||||
$ Week Starting Monday, January 16, 1995
|
||||
$
|
||||
$ Use the appropriate strftime conversion for your locale.
|
||||
$ */
|
||||
994 "days"
|
||||
995 "weeks"
|
||||
996 "biweeks"
|
||||
997 "months"
|
||||
998 "years"
|
||||
1002 "Also contributing:"
|
||||
1003 "This appointment is in a calendar owned by someone else.\nDo you want to change it anyway ?"
|
||||
1004 "This appointment is in a calendar owned by someone else.\nDo you want to delete it anyway ?"
|
||||
1005 "Delete from"
|
||||
1006 "Change in"
|
||||
1007 "Internal error selecting appointment.\nAppointment was not changed."
|
||||
1008 "Calendar Appointment : Help"
|
||||
1009 "Internal error selecting To Do.\nTo Do was not changed."
|
||||
1010 "Calendar : Compare Calendars"
|
||||
1011 "Invalid value in the \"Time Due\" field.\nOperation was cancelled. Calendar"
|
||||
1012 "Calendar : To Do List"
|
||||
1042 "Insert Access Denied: "
|
||||
1043 "Delete Access Denied: "
|
||||
1044 "Lookup Access Denied: "
|
||||
1045 "Cancelled for"
|
||||
1046 "Appointment Cancelled\n"
|
||||
1047 "This appointment: '%s' has an end\n"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ The following four messages (1047-1050) will be printed to stdout
|
||||
$ and can have the following two forms:
|
||||
$
|
||||
$ "This appointment: '<appt text>' has an end
|
||||
$ time earlier than its begin time. Do you
|
||||
$ want to schedule it into the next day? [Y/N] "
|
||||
$
|
||||
$ or
|
||||
$
|
||||
$ "This appointment has an end
|
||||
$ time earlier than its begin time. Do you
|
||||
$ want to schedule it into the next day? [Y/N] "
|
||||
$
|
||||
$ The text <appt text> and [Y/N] should not be translated.
|
||||
$
|
||||
$ */
|
||||
1048 "This appointment has an end\n"
|
||||
1049 "time earlier than its begin time. Do you\n"
|
||||
1050 "want to schedule it into the next day? [Y/N] "
|
||||
1051 "The appointment '%s' is part of a repeating series. "
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message numbers 1051-1057 are printed to stdout and
|
||||
$ should appear like:
|
||||
$
|
||||
$ "The appointment '<appt text>' is part of a repeating series. Do you want to:
|
||||
$ 1. Delete all of them
|
||||
$ 2. Delete this on only
|
||||
$ 3. Delete forward
|
||||
$ 4. Cancel
|
||||
$ Option [1-4]: "
|
||||
$
|
||||
$ */
|
||||
1052 "Do you want to:"
|
||||
1053 "\n\t1. Delete all of them"
|
||||
1054 "\n\t2. Delete this one only"
|
||||
1055 "\n\t3. Delete forward"
|
||||
1056 "\n\t4. Cancel"
|
||||
1057 "\n\tOption [1-4]: "
|
||||
1058 "Invalid Date specified.\n"
|
||||
1059 "Invalid Start time specified.\n"
|
||||
1060 "Invalid Stop time specified.\n"
|
||||
1061 "Empty or missing Date field.\n"
|
||||
1062 "Empty or missing Start field.\n"
|
||||
1063 "Empty or missing What field.\n"
|
||||
1064 "Repeat and For field mismatch.\n"
|
||||
1065 "Insert appointment was cancelled\n"
|
||||
1066 "Appointment was not inserted."
|
||||
1067 "Invalid date specified:"
|
||||
1068 "Appointments for"
|
||||
1069 "No Appointments for"
|
||||
1070 "Calendar : Error - Compare Calendars"
|
||||
1072 "Calendar : Error - Browse"
|
||||
1073 "Calendar : Error - Drag and Drop"
|
||||
1074 "Calendar Appointment"
|
||||
1075 "Calendar : Error - Change Appointment"
|
||||
1076 "Calendar : Help"
|
||||
1078 "Calendar : Access List and Permissions - Add"
|
||||
1079 "Calendar : Error - Editor Settings"
|
||||
1083 "Calendar : Error - Display Settings"
|
||||
1085 "Calendar : Error - Printer Settings"
|
||||
1086 "Calendar : Appointment List"
|
||||
1087 "From %1$2d:%2$02d%3$s to %4$2d:%5$02d%6$s"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message 1087 : This message is used to form
|
||||
$ the alarm string that appears in the
|
||||
$ reminder popup. In the C locale it would
|
||||
$ look something like this:
|
||||
$
|
||||
$ ``From 11:00am to 1:00pm''
|
||||
$
|
||||
$ In the printf conversion string the $n are:
|
||||
$
|
||||
$ $1 -> start hour
|
||||
$ $2 -> start minute
|
||||
$ $3 -> am or pm
|
||||
$ $4 -> stop hour
|
||||
$ $5 -> stop minute
|
||||
$ $6 -> am or pm
|
||||
$
|
||||
$ */
|
||||
1088 "%1$2d:%2$02d%3$s"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message 1088 : This message is used to form
|
||||
$ the alarm string that appears in the
|
||||
$ reminder popup. It is used when an appt
|
||||
$ does not have and ``end'' time. In the
|
||||
$ C locale it would look something like this:
|
||||
$
|
||||
$ ``11:00am''
|
||||
$
|
||||
$ In the printf conversion string the $n are:
|
||||
$
|
||||
$ $1 -> start hour
|
||||
$ $2 -> start minute
|
||||
$ $3 -> am or pm
|
||||
$
|
||||
$ */
|
||||
1089 "From %1$02d%2$02d to %3$02d%4$02d"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message 1089 : This message is used to form
|
||||
$ the alarm string that appears in the
|
||||
$ reminder popup. This string is used when
|
||||
$ a user has asked that times be displayed
|
||||
$ in 24 hour format. In the C locale it
|
||||
$ would look something like this:
|
||||
$
|
||||
$ ``From 0100 to 1600''
|
||||
$
|
||||
$ In the printf conversion string the $n are:
|
||||
$
|
||||
$ $1 -> start hour
|
||||
$ $2 -> start minute
|
||||
$ $3 -> stop hour
|
||||
$ $4 -> stop minute
|
||||
$
|
||||
$ */
|
||||
1090 "%1$02d%2$02d"
|
||||
$ /* NL_COMMENT
|
||||
$
|
||||
$ Message 1090 : This message is used to form
|
||||
$ the alarm string that appears in the
|
||||
$ reminder popup. This string is used when
|
||||
$ an appt does not have an end time and the
|
||||
$ user has asked that times be displayed
|
||||
$ in 24 hour format. In the C locale it
|
||||
$ would look something like this:
|
||||
$
|
||||
$ ``1600''
|
||||
$
|
||||
$ In the printf conversion string the $n are:
|
||||
$
|
||||
$ $1 -> start hour
|
||||
$ $2 -> start minute
|
||||
$
|
||||
$ */
|
||||
1091 "%B, %Y"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ This string is used in the calendar month view. In the C locale
|
||||
$ it has the form:
|
||||
$
|
||||
$ July, 1995
|
||||
$
|
||||
$ strftime conversion string: "%B, %Y" is used.
|
||||
$
|
||||
$ Use the appropriate strftime conversion for your locale.
|
||||
$ */
|
||||
1092 "%Y"
|
||||
$ /* NL_COMMENT
|
||||
$ Attention Translator:
|
||||
$
|
||||
$ This string is used in the calendar year view. In the C locale
|
||||
$ it has the form:
|
||||
$
|
||||
$ 1995
|
||||
$
|
||||
$ strftime conversion string: "%Y" is used.
|
||||
$
|
||||
$ Use the appropriate strftime conversion for your locale.
|
||||
$ */
|
||||
$ /* NL_COMMENT
|
||||
$ The following message were added because message numbers from
|
||||
$ IBM and Sunsoft conflicted - they both used the same message number
|
||||
$ for different messages. The IBM message number was changed as
|
||||
$ follows:
|
||||
$
|
||||
$ 1100 was 978 from IBM
|
||||
$ 1101 was 979 from IBM.
|
||||
$ 1102 was 981 from IBM.
|
||||
$ 1103 was 982 from IBM.
|
||||
$ 1104 was 985 from IBM.
|
||||
$ 1105 was 986 from IBM.
|
||||
$ */
|
||||
1100 "\n\n\t** Calendar To Do Item **\n\n\tDue Date:\t%s\n\tTime Due:\t%s\n\tWhat:\t\t%s"
|
||||
1101 "Insert Appointment"
|
||||
1102 "Insert To Do"
|
||||
1103 "This To Do is part of a repeating series.\nDo you want to insert the item ...?"
|
||||
1104 "Invalid value in TIME DUE field.\nOperation was cancelled. Calendar"
|
||||
1105 "You must provide a TIME DUE value.\nOperation was cancelled. Calendar"
|
||||
$ Message numbers 1106-1110 represent choices for the content of
|
||||
$ left and right headers and footers on the printed page. These
|
||||
$ items are displayed in option menus in the "Printer Settings..."
|
||||
$ category of the "Options..." dialog.
|
||||
1106 "Date"
|
||||
1107 "User Id"
|
||||
1108 "Page Number"
|
||||
1109 "Report Type"
|
||||
1110 "None"
|
||||
$ Message 1111 is placed in the title bar of an error dialog if an
|
||||
$ error is encountered when the user invokes "Setup..." from the
|
||||
$ "Print..." dialog box. Message 1112 is the text displayed in
|
||||
$ that error dialog.
|
||||
1111 "Calendar : Error - Print Setup"
|
||||
1112 "Print Dialog Manager (PDM) error - setup failed."
|
||||
$ Message 1113 is the error message displayed if the user selects
|
||||
$ "Print" from the "Print..." dialog box while an invalid printer
|
||||
$ name is specified.
|
||||
1113 "Invalid Printer or Print Server specified."
|
||||
$ Message 1114 is placed in the title bar of an error dialog if an
|
||||
$ error is encountered when the user invokes "Print" from the
|
||||
$ "Print..." dialog box with the "Print to File" toggle selected.
|
||||
$ Message 1115 is the text displayed in that error dialog.
|
||||
1114 "Calendar : Error - Print To File"
|
||||
1115 "Error - unable to print to file."
|
||||
$ Message 1116 is placed in the title bar of an information dialog
|
||||
$ if the operation completes successfully when the user invokes "Print"
|
||||
$ from the "Print..." dialog box with the "Print to File" toggle
|
||||
$ selected. Message 1117 is the text displayed in that information dialog.
|
||||
1116 "Calendar : Print To File"
|
||||
1117 "Print to file has completed."
|
||||
$ Message 1118 is placed in the title bar of a warning dialog if a
|
||||
$ font cannot be found during the "Print" operation. Message 1119
|
||||
$ is the text displayed in that warning dialog; the %s will be replaced
|
||||
$ by the name of the font.
|
||||
1118 "Calendar : Warning - Print"
|
||||
1119 "Warning - Unable to load font %s."
|
||||
$
|
||||
$ Message 1120 appears in an error dialog when an appointment cannot
|
||||
$ be scheduled.
|
||||
1120 "The event cannot be scheduled in the given time frame.\nThe operation was cancelled."
|
||||
$
|
||||
$ Message 1121 is placed in the title bar of a warning dialog if a
|
||||
$ print job fails because the Print Server returns BadAlloc. Message
|
||||
$ 1122 is the text displayed in that warning dialog.
|
||||
1121 "Calendar : Print Server Error"
|
||||
1122 "Print job failed.\n\nThe X Print Server is temporarily out of resources."
|
||||
|
||||
|
||||
$set 2
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** Message set for DieFromToolTalkError Dialog
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ These are the messages for the ToolTalk error dialog
|
||||
$ "-NEW"
|
||||
1 Calendar - Warning
|
||||
$ "-NEW"
|
||||
2 "Could not connect to ToolTalk:\n%s\n"
|
||||
$ "-NEW"
|
||||
3 OK
|
||||
$ "-NEW"
|
||||
4 "Calendar : Appointment Editor - Warning"
|
||||
53
cde/programs/dtcm/dtcm/dtcm.ptypes
Normal file
53
cde/programs/dtcm/dtcm/dtcm.ptypes
Normal file
@@ -0,0 +1,53 @@
|
||||
ptype Dt_AppointmentEditor {
|
||||
start "dtcm_editor";
|
||||
handle:
|
||||
session Display( in DT_APPOINTMENT contents ) => start opnum = 1;
|
||||
session Display( in DT_APPOINTMENT contents,
|
||||
in messageID counterfoil ) => start opnum = 2;
|
||||
session Display( in DT_APPOINTMENT contents,
|
||||
in title docName ) => start opnum = 3;
|
||||
session Display( in DT_APPOINTMENT contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 4;
|
||||
session Edit( inout DT_APPOINTMENT contents ) => start opnum = 101;
|
||||
session Edit( inout DT_APPOINTMENT contents,
|
||||
in messageID counterfoil ) => start opnum = 102;
|
||||
session Edit( inout DT_APPOINTMENT contents,
|
||||
in title docName ) => start opnum = 103;
|
||||
session Edit( inout DT_APPOINTMENT contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 104;
|
||||
session Edit( out DT_APPOINTMENT contents ) => start opnum = 201;
|
||||
session Edit( out DT_APPOINTMENT contents,
|
||||
in messageID counterfoil ) => start opnum = 202;
|
||||
session Edit( out DT_APPOINTMENT contents,
|
||||
in title docName ) => start opnum = 203;
|
||||
session Edit( out DT_APPOINTMENT contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 204;
|
||||
|
||||
session Display( in Sun_CM_Appointment contents ) => start opnum = 1001;
|
||||
session Display( in Sun_CM_Appointment contents,
|
||||
in messageID counterfoil ) => start opnum = 1002;
|
||||
session Display( in Sun_CM_Appointment contents,
|
||||
in title docName ) => start opnum = 1003;
|
||||
session Display( in Sun_CM_Appointment contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 1004;
|
||||
session Edit( inout Sun_CM_Appointment contents ) => start opnum = 1101;
|
||||
session Edit( inout Sun_CM_Appointment contents,
|
||||
in messageID counterfoil ) => start opnum = 1102;
|
||||
session Edit( inout Sun_CM_Appointment contents,
|
||||
in title docName ) => start opnum = 1103;
|
||||
session Edit( inout Sun_CM_Appointment contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 1104;
|
||||
session Edit( out Sun_CM_Appointment contents ) => start opnum = 1201;
|
||||
session Edit( out Sun_CM_Appointment contents,
|
||||
in messageID counterfoil ) => start opnum = 1202;
|
||||
session Edit( out Sun_CM_Appointment contents,
|
||||
in title docName ) => start opnum = 1203;
|
||||
session Edit( out Sun_CM_Appointment contents,
|
||||
in messageID counterfoil,
|
||||
in title docName ) => start opnum = 1204;
|
||||
}
|
||||
1327
cde/programs/dtcm/dtcm/dtcm_editor.c
Normal file
1327
cde/programs/dtcm/dtcm/dtcm_editor.c
Normal file
File diff suppressed because it is too large
Load Diff
1944
cde/programs/dtcm/dtcm/editor.c
Normal file
1944
cde/programs/dtcm/dtcm/editor.c
Normal file
File diff suppressed because it is too large
Load Diff
119
cde/programs/dtcm/dtcm/editor.h
Normal file
119
cde/programs/dtcm/dtcm/editor.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** editor.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)editor.h 1.12 94/03/03 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: editor.h /main/4 1996/05/23 11:18:40 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _EDITOR_H
|
||||
#define _EDITOR_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
#include "misc.h"
|
||||
#include "dssw.h"
|
||||
#include "rfp.h"
|
||||
#include "reminders.h"
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Editor structures
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
int appt_count;
|
||||
CSA_entry_handle *appt_head;
|
||||
Widget appt_list;
|
||||
Widget appt_list_sw;
|
||||
Widget base_form_mgr;
|
||||
Calendar *cal;
|
||||
Widget change_button;
|
||||
Widget clear_button;
|
||||
Widget close_button;
|
||||
Widget delete_button;
|
||||
Boolean doing_drag;
|
||||
Pixmap drag_bitmap;
|
||||
Widget drag_icon;
|
||||
Widget drag_source;
|
||||
Pixmap drag_mask;
|
||||
DSSW dssw;
|
||||
int dsswFlags;
|
||||
Boolean editor_is_up;
|
||||
Boolean editor_view_is_up;
|
||||
Widget expand_ui_button;
|
||||
Widget frame;
|
||||
Widget help_button;
|
||||
int initialX;
|
||||
int initialY;
|
||||
Widget insert_button;
|
||||
Widget list_label;
|
||||
Widget message_text;
|
||||
Reminders reminders;
|
||||
RFP rfp;
|
||||
int rfpFlags;
|
||||
Widget separator1;
|
||||
Widget separator2;
|
||||
Widget view_form_mgr;
|
||||
Widget view_frame;
|
||||
Widget view_form;
|
||||
Widget view_list_label;
|
||||
Widget view_list;
|
||||
Widget view_sw_mgr;
|
||||
Widget view_cancel_button;
|
||||
Widget view_help_button;
|
||||
Glance view_list_glance;
|
||||
Tick view_list_date;
|
||||
} Editor;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Editor external function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void add_to_appt_list P((CSA_entry_handle, Editor*));
|
||||
extern void add_all_appt P((Editor*));
|
||||
extern void build_editor_list P((Editor*, Tick, Glance, CSA_entry_handle**,
|
||||
CSA_uint32*));
|
||||
extern int build_editor_view P((Editor*, Glance, Boolean));
|
||||
extern Boolean editor_change P((Dtcm_appointment*, CSA_entry_handle,
|
||||
CSA_entry_handle*, Calendar*));
|
||||
extern void editor_clean_up P((Editor*));
|
||||
extern Boolean editor_created P((Editor*));
|
||||
extern Boolean editor_delete P((CSA_entry_handle, Calendar*));
|
||||
extern Boolean editor_insert P((Dtcm_appointment*, CSA_entry_handle*,
|
||||
Calendar*));
|
||||
extern CSA_entry_handle editor_nth_appt P((Editor*, int));
|
||||
extern Boolean editor_showing P((Editor*));
|
||||
extern Boolean editor_view_showing P((Editor*));
|
||||
extern void get_editor_vals P((Editor*));
|
||||
extern void set_editor_defaults P((Editor*, Tick, Tick, Boolean));
|
||||
extern void set_editor_title P((Editor*, char *));
|
||||
extern void set_editor_vals P((Editor*, Tick, Tick));
|
||||
extern void show_editor P((Calendar*, Tick, Tick, Boolean));
|
||||
extern void show_editor_view P((Calendar*, Glance));
|
||||
extern void e_make_editor P((Calendar*));
|
||||
|
||||
#endif
|
||||
5
cde/programs/dtcm/dtcm/expand_xbm
Normal file
5
cde/programs/dtcm/dtcm/expand_xbm
Normal file
@@ -0,0 +1,5 @@
|
||||
/* $XConsortium: expand_xbm /main/2 1995/07/19 16:49:21 drk $ */
|
||||
#define expand_xbm_width 8
|
||||
#define expand_xbm_height 9
|
||||
static unsigned char expand_xbm_bits[] = {
|
||||
0x18, 0x3c, 0x7e, 0xff, 0x00, 0xff, 0x7e, 0x3c, 0x18};
|
||||
127
cde/programs/dtcm/dtcm/fallback.h
Normal file
127
cde/programs/dtcm/dtcm/fallback.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** fallbacks.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)misc.h 1.12 94/02/17 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $TOG: fallback.h /main/4 1998/08/10 15:45:25 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _FALLBACKS_H
|
||||
#define _FALLBACKS_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/*
|
||||
* Table of fallback resources.
|
||||
*
|
||||
* This is specified in the <fallback_resources> argument to XtAppInitialize
|
||||
* (calendarA.c), and tells Xt some basic resources to use if it can't load
|
||||
* an app-defaults file.
|
||||
*/
|
||||
|
||||
String fallback_resources[] = {
|
||||
/* Mnemonics for Menu Items */
|
||||
/* Menu Bar */
|
||||
"Dtcm*menuBar.file.mnemonic: F",
|
||||
"Dtcm*menuBar.edit.mnemonic: E",
|
||||
"Dtcm*menuBar.view.mnemonic: V",
|
||||
"Dtcm*menuBar.browse.mnemonic: B",
|
||||
"Dtcm*menuBar.help.mnemonic: H",
|
||||
/* File menu */
|
||||
"Dtcm*fileMenu.printCurrent.mnemonic: C",
|
||||
"Dtcm*fileMenu.print.mnemonic: P",
|
||||
"Dtcm*fileMenu.options.mnemonic: O",
|
||||
"Dtcm*fileMenu.exit.mnemonic: x",
|
||||
/* Edit menu */
|
||||
"Dtcm*editMenu.appt.mnemonic: A",
|
||||
"Dtcm*editMenu.toDo.mnemonic: T",
|
||||
/* View menu */
|
||||
"Dtcm*viewMenu.day.mnemonic: D",
|
||||
"Dtcm*viewMenu.week.mnemonic: W",
|
||||
"Dtcm*viewMenu.month.mnemonic: M",
|
||||
"Dtcm*viewMenu.year.mnemonic: Y",
|
||||
"Dtcm*viewMenu.apptList.mnemonic: A",
|
||||
"Dtcm*viewMenu.toDoList.mnemonic: T",
|
||||
"Dtcm*viewMenu.find.mnemonic: F",
|
||||
"Dtcm*viewMenu.goTo.mnemonic: G",
|
||||
"Dtcm*viewMenu.timeZone.mnemonic: Z",
|
||||
/* Browse menu */
|
||||
"Dtcm*browseMenu.showOther.mnemonic: O",
|
||||
"Dtcm*browseMenu.compare.mnemonic: C",
|
||||
"Dtcm*browseMenu.editMenu.mnemonic: M",
|
||||
/* Help menu */
|
||||
"Dtcm*helpMenu.overview.mnemonic: O",
|
||||
"Dtcm*helpMenu.tasks.mnemonic: T",
|
||||
"Dtcm*helpMenu.reference.mnemonic: R",
|
||||
"Dtcm*helpMenu.onItem.mnemonic: I",
|
||||
"Dtcm*helpMenu.using.mnemonic: U",
|
||||
"Dtcm*helpMenu.about.mnemonic: A",
|
||||
/* Accelerators for selected commands */
|
||||
"Dtcm*day.accelerator: Ctrl<Key>D",
|
||||
"Dtcm*week.accelerator: Ctrl<Key>W",
|
||||
"Dtcm*month.accelerator: Ctrl<Key>M",
|
||||
"Dtcm*year.accelerator: Ctrl<Key>Y",
|
||||
"Dtcm*options.accelerator: Ctrl<Key>I",
|
||||
"Dtcm*appt.accelerator: Ctrl<Key>A",
|
||||
"Dtcm*toDo.accelerator: Ctrl<Key>T",
|
||||
"Dtcm*find.accelerator: Ctrl<Key>F",
|
||||
"Dtcm*print.accelerator: Ctrl<Key>P",
|
||||
"Dtcm*exit.accelerator: Alt<Key>F4",
|
||||
"Dtcm*onItem.accelerator: <Key>F1",
|
||||
/* Accelerator Text for above */
|
||||
"Dtcm*day.acceleratorText: Ctrl+D",
|
||||
"Dtcm*week.acceleratorText: Ctrl+W",
|
||||
"Dtcm*month.acceleratorText: Ctrl+M",
|
||||
"Dtcm*year.acceleratorText: Ctrl+Y",
|
||||
"Dtcm*options.acceleratorText: Ctrl+I",
|
||||
"Dtcm*appt.acceleratorText: Ctrl+A",
|
||||
"Dtcm*toDo.acceleratorText: Ctrl+T",
|
||||
"Dtcm*find.acceleratorText: Ctrl+F",
|
||||
"Dtcm*print.acceleratorText: Ctrl+P",
|
||||
"Dtcm*exit.acceleratorText: Alt+F4",
|
||||
"Dtcm*onItem.acceleratorText: F1",
|
||||
/* Tear-offs */
|
||||
"Dtcm*fileMenu.tearOffModel: tear_off_disabled",
|
||||
"Dtcm*editMenu.tearOffModel: tear_off_disabled",
|
||||
"Dtcm*viewMenu.tearOffModel: tear_off_disabled",
|
||||
"Dtcm*browseMenu.tearOffModel: tear_off_disabled",
|
||||
"Dtcm*helpMenu.tearOffModel: tear_off_disabled",
|
||||
/* Programmable date formats */
|
||||
"Dtcm*XmMonthPanel.titleFormat: %B %Y",
|
||||
"Dtcm*yearForm.XmMonthPanel.titleFormat: %B",
|
||||
/* Miscellaneous */
|
||||
"Dtcm*XmMonthPanel*fontList: -dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:",
|
||||
"Dtcm*canvas*XmPushButton.fontList: -dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:",
|
||||
"Dtcm*labelForm*fontList: -dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-*:",
|
||||
"Dtcm*XmMonthPanel.activeHeader: True",
|
||||
"Dtcm*XmMonthPanel*recomputeSize: False",
|
||||
"Dtcm*lastMonth.activeDays: True",
|
||||
"Dtcm*thisMonth.activeDays: True",
|
||||
"Dtcm*nextMonth.activeDays: True",
|
||||
"Dtcm.iconFont: -dt-application-bold-r-normal-sans-*-180-*-*-p-*-*-*:",
|
||||
"Dtcm.applicationFontFamily: application",
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif
|
||||
848
cde/programs/dtcm/dtcm/find.c
Normal file
848
cde/programs/dtcm/dtcm/find.c
Normal file
@@ -0,0 +1,848 @@
|
||||
/* $XConsortium: find.c /main/9 1996/11/21 19:42:36 drk $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <csa.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
#include "calendar.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "find.h"
|
||||
#include "format.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
#include "editor.h"
|
||||
#include "select.h"
|
||||
#include "help.h"
|
||||
#include "getdate.h"
|
||||
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#define X_INCLUDE_TIME_H
|
||||
#include <X11/Xos_r.h>
|
||||
|
||||
static void layout_labels(Widget, Widget, Widget, Widget);
|
||||
|
||||
extern caddr_t
|
||||
make_find(c)
|
||||
Calendar *c;
|
||||
{
|
||||
Find *f;
|
||||
Widget separator1, separator2, button_form;
|
||||
XmString xmstr;
|
||||
OrderingType ot = get_int_prop((Props *)c->properties,
|
||||
CP_DATEORDERING);
|
||||
SeparatorType sep = get_int_prop((Props *)c->properties,
|
||||
CP_DATESEPARATOR);
|
||||
Tick cursor, begin_range, end_range;
|
||||
char buffer[50];
|
||||
int i;
|
||||
void find_appts(), show_appt(), f_cancel_cb(),
|
||||
f_searchrange_cb(), f_searchall_cb();
|
||||
Arg args[3];
|
||||
Dimension highest;
|
||||
Widget highest_label;
|
||||
char *title;
|
||||
|
||||
if (c->find == NULL) {
|
||||
c->find = (caddr_t)ckalloc(sizeof(Find));
|
||||
f = (Find*)c->find;
|
||||
}
|
||||
else
|
||||
f = (Find*)c->find;
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 283, "Calendar : Find"));
|
||||
f->frame = XtVaCreatePopupShell("frame",
|
||||
xmDialogShellWidgetClass,
|
||||
c->frame,
|
||||
XmNtitle, title,
|
||||
XmNallowShellResize, True,
|
||||
XmNmappedWhenManaged, False,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
f->form = XtVaCreateWidget("form",
|
||||
xmFormWidgetClass,
|
||||
f->frame,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 4,
|
||||
XmNmarginWidth, 0,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 284, "Find:"));
|
||||
f->apptstr_label = XtVaCreateWidget("label",
|
||||
xmLabelWidgetClass,
|
||||
f->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 10,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 15,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
f->apptstr = XtVaCreateWidget("appt",
|
||||
xmTextWidgetClass,
|
||||
f->form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 10,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->apptstr_label,
|
||||
NULL);
|
||||
|
||||
f->search_rc_mgr = XtVaCreateWidget("search_rc_mgr",
|
||||
xmRowColumnWidgetClass,
|
||||
f->form,
|
||||
XmNpacking, XmPACK_COLUMN,
|
||||
XmNorientation, XmVERTICAL,
|
||||
XmNradioBehavior, True,
|
||||
XmNisHomogeneous, True,
|
||||
XmNentryClass, xmToggleButtonGadgetClass,
|
||||
XmNmarginWidth, 0,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, f->apptstr,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, f->apptstr,
|
||||
XmNleftOffset, 0,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 973, "Search all"));
|
||||
f->search_all = XtVaCreateWidget("searchAll",
|
||||
xmToggleButtonGadgetClass,
|
||||
f->search_rc_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNuserData, f,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(f->search_all, XmNvalueChangedCallback, f_searchall_cb,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 974, "Search from"));
|
||||
f->search_range = XtVaCreateWidget("searchrange",
|
||||
xmToggleButtonGadgetClass,
|
||||
f->search_rc_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNuserData, f,
|
||||
XmNset, True,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(f->search_range, XmNvalueChangedCallback,
|
||||
f_searchrange_cb, NULL);
|
||||
|
||||
f->search_set = search_range;
|
||||
|
||||
/* default beginning of range query to 6 months ago */
|
||||
|
||||
cursor = now();
|
||||
for (i = 0; i < 6; i++)
|
||||
cursor = prevmonth_exactday(cursor);
|
||||
|
||||
format_tick(cursor, ot, sep, buffer);
|
||||
|
||||
f->search_from = XtVaCreateWidget("search_from",
|
||||
xmTextWidgetClass,
|
||||
f->form,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->search_rc_mgr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, f->apptstr,
|
||||
XmNtopOffset, 30,
|
||||
XmNuserData, c,
|
||||
XmNvalue, buffer,
|
||||
NULL);
|
||||
XtSetSensitive(f->search_from, True);
|
||||
|
||||
|
||||
/* default end of range query to 6 from now */
|
||||
|
||||
cursor = now();
|
||||
for (i = 0; i < 6; i++)
|
||||
cursor = nextmonth_exactday(cursor);
|
||||
|
||||
format_tick(cursor, ot, sep, buffer);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 975, "to"));
|
||||
f->search_tolabel = XtVaCreateWidget("tolabel",
|
||||
xmLabelWidgetClass,
|
||||
f->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->search_from,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, f->apptstr,
|
||||
XmNtopOffset, 35,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
f->search_to = XtVaCreateWidget("search_to",
|
||||
xmTextWidgetClass,
|
||||
f->form,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->search_tolabel,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, f->apptstr,
|
||||
XmNtopOffset, 30,
|
||||
XmNrightOffset, 10,
|
||||
XmNuserData, c,
|
||||
XmNvalue, buffer,
|
||||
NULL);
|
||||
XtSetSensitive(f->search_to, True);
|
||||
|
||||
separator1 = XtVaCreateWidget("separator1",
|
||||
xmSeparatorGadgetClass,
|
||||
f->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, f->search_rc_mgr,
|
||||
XmNtopOffset, 5,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 848, "Date"));
|
||||
f->date_label = XtVaCreateWidget("finddatelabel",
|
||||
xmLabelWidgetClass,
|
||||
f->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator1,
|
||||
XmNtopOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 10,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 849, "Time"));
|
||||
f->time_label = XtVaCreateWidget("findtimelabel",
|
||||
xmLabelWidgetClass,
|
||||
f->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator1,
|
||||
XmNtopOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->date_label,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 850, "What"));
|
||||
f->what_label = XtVaCreateWidget("findwhatlabel",
|
||||
xmLabelWidgetClass,
|
||||
f->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator1,
|
||||
XmNtopOffset, 10,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, f->time_label,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
f->find_message = XtVaCreateWidget("message",
|
||||
xmLabelGadgetClass, f->form,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 10,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("print_button_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
f->form,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 5,
|
||||
XmNhorizontalSpacing, 0,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, f->find_message,
|
||||
XmNbottomOffset, 5,
|
||||
NULL);
|
||||
|
||||
separator2 = XtVaCreateWidget("separator1",
|
||||
xmSeparatorGadgetClass,
|
||||
f->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button_form,
|
||||
XmNbottomOffset, 5,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 285, "Find"));
|
||||
f->find_button = XtVaCreateWidget("findbutton",
|
||||
xmPushButtonGadgetClass,
|
||||
button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 0,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 1,
|
||||
XmNrightOffset, 0,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNshowAsDefault, 0,
|
||||
NULL);
|
||||
XtAddCallback(f->find_button, XmNactivateCallback, find_appts, NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 851, "Show Appointment"));
|
||||
f->show_button = XtVaCreateWidget("show",
|
||||
xmPushButtonGadgetClass,
|
||||
button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNrightOffset, 0,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
XtAddCallback(f->show_button, XmNactivateCallback, show_appt, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close"));
|
||||
f->cancel_button = XtVaCreateWidget("cancel",
|
||||
xmPushButtonGadgetClass,
|
||||
button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 3,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 4,
|
||||
XmNrightOffset, 0,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
XtAddCallback(f->cancel_button, XmNactivateCallback, f_cancel_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help"));
|
||||
f->help_button = XtVaCreateWidget("help",
|
||||
xmPushButtonGadgetClass,
|
||||
button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 4,
|
||||
XmNleftOffset, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 5,
|
||||
XmNrightOffset, 0,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XtAddCallback(f->help_button, XmNactivateCallback,
|
||||
(XtCallbackProc)help_cb, FIND_HELP_BUTTON);
|
||||
XtAddCallback(f->form, XmNhelpCallback,
|
||||
(XtCallbackProc)help_cb, (XtPointer) FIND_HELP_BUTTON);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
XtSetArg(args[0], XmNlistSizePolicy, XmCONSTANT);
|
||||
XtSetArg(args[1], XmNvisibleItemCount, 5);
|
||||
XtSetArg(args[2], XmNscrollBarDisplayPolicy, XmSTATIC);
|
||||
|
||||
f->find_list = (Widget)XmCreateScrolledList(f->form,
|
||||
"find_list", args, 3);
|
||||
f->find_list_sw = XtParent(f->find_list);
|
||||
|
||||
_i18n_HighestWidget(3,&highest_label, &highest,
|
||||
f->date_label, f->time_label, f->what_label);
|
||||
|
||||
XtVaSetValues(f->find_list_sw,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, highest_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 10,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 10,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, separator2,
|
||||
XmNbottomOffset, 10,
|
||||
XmNlistSizePolicy, XmCONSTANT,
|
||||
NULL);
|
||||
|
||||
XtManageChild(f->find_list);
|
||||
|
||||
XtAddCallback(f->find_list, XmNdefaultActionCallback, show_appt, NULL);
|
||||
|
||||
layout_labels(f->date_label, f->time_label,
|
||||
f->what_label, f->find_list);
|
||||
|
||||
/* set default button */
|
||||
XtVaSetValues(button_form,
|
||||
XmNdefaultButton, f->find_button,
|
||||
XmNcancelButton, f->cancel_button,
|
||||
NULL);
|
||||
XtVaSetValues(f->form,
|
||||
XmNdefaultButton, f->find_button,
|
||||
XmNcancelButton, f->cancel_button,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
XtManageChild(f->apptstr_label);
|
||||
XtManageChild(f->apptstr);
|
||||
XtManageChild(f->search_rc_mgr);
|
||||
XtManageChild(f->search_all);
|
||||
XtManageChild(f->search_range);
|
||||
XtManageChild(f->search_from);
|
||||
XtManageChild(f->search_to);
|
||||
XtManageChild(f->search_tolabel);
|
||||
XtManageChild(separator1);
|
||||
XtManageChild(f->date_label);
|
||||
XtManageChild(f->time_label);
|
||||
XtManageChild(f->what_label);
|
||||
XtManageChild(f->find_message);
|
||||
XtManageChild(button_form);
|
||||
XtManageChild(separator2);
|
||||
XtManageChild(f->find_list);
|
||||
XtManageChild(f->find_button);
|
||||
XtManageChild(f->show_button);
|
||||
XtManageChild(f->cancel_button);
|
||||
XtManageChild(f->help_button);
|
||||
*/
|
||||
ManageChildren(f->search_rc_mgr);
|
||||
ManageChildren(button_form);
|
||||
ManageChildren(f->form);
|
||||
XtManageChild(f->form);
|
||||
XtVaSetValues(f->frame, XmNmappedWhenManaged, True, NULL);
|
||||
XtRealizeWidget(f->frame);
|
||||
|
||||
XtPopup(f->frame, XtGrabNone);
|
||||
|
||||
return(caddr_t)f;
|
||||
}
|
||||
|
||||
static Tick
|
||||
f_get_searchdate(Widget widget, Props *p)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
OrderingType ot;
|
||||
SeparatorType st;
|
||||
char *buf;
|
||||
Tick new_date;
|
||||
|
||||
ot = get_int_prop(p, CP_DATEORDERING);
|
||||
st = get_int_prop(p, CP_DATESEPARATOR);
|
||||
buf = get_date_from_widget(c->view->date, widget, ot, st);
|
||||
|
||||
new_date = (Tick) cm_getdate(buf, NULL);
|
||||
|
||||
return(new_date);
|
||||
}
|
||||
|
||||
void
|
||||
f_searchall_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Find *f;
|
||||
XmToggleButtonCallbackStruct *state =
|
||||
(XmToggleButtonCallbackStruct *) call_data;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &f, NULL);
|
||||
|
||||
if (state->set)
|
||||
f->search_set = search_all;
|
||||
XtSetSensitive(f->search_to, False);
|
||||
XtSetSensitive(f->search_from, False);
|
||||
}
|
||||
|
||||
void
|
||||
f_searchrange_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Find *f;
|
||||
XmToggleButtonCallbackStruct *state =
|
||||
(XmToggleButtonCallbackStruct *) call_data;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &f, NULL);
|
||||
|
||||
if (state->set)
|
||||
f->search_set = search_range;
|
||||
XtSetSensitive(f->search_to, True);
|
||||
XtSetSensitive(f->search_from, True);
|
||||
}
|
||||
|
||||
static void
|
||||
fmt_time_what(
|
||||
Dtcm_appointment *appt,
|
||||
char *buf,
|
||||
DisplayType display)
|
||||
{
|
||||
int hr, mn;
|
||||
time_t tick;
|
||||
Lines *lines;
|
||||
Boolean am;
|
||||
struct tm *tm;
|
||||
char tmp[16];
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
if(!appt || !buf) return;
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hr = tm->tm_hour;
|
||||
mn = tm->tm_min;
|
||||
if (showtime_set(appt) && !magic_time(tick)) {
|
||||
if (display == HOUR12) {
|
||||
am = adjust_hour(&hr);
|
||||
sprintf(tmp, "%2d:%02d%s ", hr, mn, am ? "a" : "p");
|
||||
}
|
||||
else
|
||||
sprintf(tmp, "%02d%02d ", hr, mn);
|
||||
|
||||
sprintf(buf, "%8s", tmp);
|
||||
} else
|
||||
sprintf(buf, "%8s", "");
|
||||
|
||||
lines = text_to_lines(appt->what->value->item.string_value, 1);
|
||||
if (lines != NULL && lines->s != NULL) {
|
||||
(void) cm_strcat(buf, lines->s);
|
||||
destroy_lines(lines);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
find_appts(widget, client_data, cbs)
|
||||
Widget widget;
|
||||
XtPointer client_data;
|
||||
XmPushButtonCallbackStruct *cbs;
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Props *p = (Props*)c->properties;
|
||||
OrderingType ot = get_int_prop(p, CP_DATEORDERING);
|
||||
DisplayType dt = get_int_prop(p, CP_DEFAULTDISP);
|
||||
SeparatorType sep = get_int_prop(p, CP_DATESEPARATOR);
|
||||
Find *f = (Find*)c->find;
|
||||
int mos, i, j, range_count;
|
||||
char *location;
|
||||
Dimension w, h;
|
||||
char what_buf[WHAT_LEN+1], buf[WHAT_LEN+1], buf2[WHAT_LEN+1], message[40], *astr;
|
||||
XmString buf_str;
|
||||
int num_items, mo, last_match_total = 0, match_total = 0;
|
||||
pr_pos xy;
|
||||
Tick end_of_time, start, stop;
|
||||
Tick_list *ptr, *next_ptr, *tail_ptr, *new_tick;
|
||||
CSA_session_handle cal = NULL;
|
||||
CSA_return_code stat;
|
||||
CSA_entry_handle *entries = NULL;
|
||||
CSA_enum *ops;
|
||||
CSA_attribute *range_attrs;
|
||||
CSA_uint32 num_entries;
|
||||
Dtcm_appointment *appt;
|
||||
int comparison_length;
|
||||
Tick real_eot = get_eot();
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
astr = XmTextGetString(f->apptstr);
|
||||
|
||||
if (astr == NULL || *astr == NULL) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 290, "Specify Appt String to Match."));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
XmListDeleteAllItems(f->find_list);
|
||||
set_message(f->find_message, " ");
|
||||
ptr = f->ticks;
|
||||
while (ptr != NULL) {
|
||||
next_ptr = ptr->next;
|
||||
free(ptr);
|
||||
ptr = next_ptr;
|
||||
}
|
||||
f->ticks = NULL;
|
||||
|
||||
if (f->search_set == search_all) {
|
||||
end_of_time = real_eot;
|
||||
start = get_bot();
|
||||
}
|
||||
else {
|
||||
|
||||
start = f_get_searchdate(f->search_from, p);
|
||||
|
||||
if (start == DATE_BBOT)
|
||||
start = get_bot();
|
||||
else if (start == DATE_AEOT) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 810, "Please enter a start date after 1/1/1970"));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
else if (start <= 0) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 811, "Malformed start date"));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
end_of_time = f_get_searchdate(f->search_to, p);
|
||||
|
||||
if (end_of_time == DATE_AEOT)
|
||||
end_of_time = real_eot;
|
||||
else if (end_of_time == DATE_BBOT) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 812, "Please enter an end date before 1/1/2038"));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
else if (end_of_time <= 0) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 813, "Malformed end date"));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (start >= end_of_time) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 713, "You must choose a begin date before the end date."));
|
||||
set_message(f->find_message, message);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((end_of_time < 0) || (end_of_time > real_eot))
|
||||
end_of_time = real_eot;
|
||||
}
|
||||
|
||||
stop = start + (4 * wksec);
|
||||
|
||||
if (stop > end_of_time)
|
||||
stop = end_of_time;
|
||||
|
||||
comparison_length = cm_strlen(astr);
|
||||
|
||||
appt = allocate_appt_struct(appt_read,
|
||||
c->general->version,
|
||||
CSA_ENTRY_ATTR_START_DATE_I,
|
||||
CSA_ENTRY_ATTR_SUMMARY_I,
|
||||
CSA_X_DT_ENTRY_ATTR_SHOWTIME_I,
|
||||
NULL);
|
||||
|
||||
_DtTurnOnHourGlass(f->frame);
|
||||
for (; stop <= end_of_time;) {
|
||||
setup_range(&range_attrs, &ops, &range_count, start, stop,
|
||||
CSA_TYPE_EVENT, NULL, B_FALSE, c->general->version);
|
||||
stat = csa_list_entries(c->cal_handle, range_count, range_attrs, ops, &num_entries, &entries, NULL);
|
||||
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_range(&range_attrs, &ops, range_count);
|
||||
_DtTurnOffHourGlass(f->frame);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_entries; i++) {
|
||||
stat = query_appt_struct(c->cal_handle, entries[i], appt);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_appt_struct(&appt);
|
||||
csa_free(entries);
|
||||
_DtTurnOffHourGlass(f->frame);
|
||||
return;
|
||||
}
|
||||
|
||||
for (j = 0; appt->what->value->item.string_value[j] != NULL; j++)
|
||||
if (strncasecmp(astr, &(appt->what->value->item.string_value[j]),
|
||||
comparison_length) == 0) {
|
||||
new_tick = (Tick_list *) ckalloc(sizeof(Tick_list));
|
||||
if (new_tick == NULL) {
|
||||
free_appt_struct(&appt);
|
||||
free_range(&range_attrs, &ops, range_count);
|
||||
csa_free(entries);
|
||||
_DtTurnOffHourGlass(f->frame);
|
||||
return;
|
||||
}
|
||||
new_tick->next = NULL;
|
||||
_csa_iso8601_to_tick(appt->time->value->item.date_time_value, &(new_tick->tick));
|
||||
if (f->ticks == NULL)
|
||||
f->ticks = new_tick;
|
||||
else
|
||||
tail_ptr->next = new_tick;
|
||||
tail_ptr = new_tick;
|
||||
match_total++;
|
||||
strcpy(buf, "");
|
||||
strcpy(buf2, "");
|
||||
strcpy(what_buf, "");
|
||||
strftime(buf, WHAT_LEN, "%h %e, %Y",
|
||||
_XLocaltime(
|
||||
(const time_t *)&new_tick->tick,
|
||||
localtime_buf));
|
||||
fmt_time_what(appt, what_buf, dt);
|
||||
sprintf (buf2, "%10s %s",
|
||||
buf, what_buf);
|
||||
buf_str = XmStringCreateLocalized(buf2);
|
||||
XmListAddItem(f->find_list, buf_str, 0);
|
||||
XmStringFree(buf_str);
|
||||
|
||||
break;
|
||||
} /* end if stmt */
|
||||
} /* end for i = 0 loop */
|
||||
|
||||
if (match_total != last_match_total) {
|
||||
if (match_total == 1)
|
||||
sprintf(message, catgets(c->DT_catd, 1, 631, "%d match found"), match_total);
|
||||
else if (match_total > 1)
|
||||
sprintf(message, catgets(c->DT_catd, 1, 292, "%d matches found"), match_total);
|
||||
|
||||
set_message(f->find_message, message);
|
||||
}
|
||||
|
||||
last_match_total = match_total;
|
||||
|
||||
|
||||
csa_free(entries);
|
||||
free_range(&range_attrs, &ops, range_count);
|
||||
|
||||
if (stop == real_eot)
|
||||
break;
|
||||
|
||||
start = stop + 1;
|
||||
|
||||
if (start > end_of_time)
|
||||
break;
|
||||
|
||||
stop = start + (4 * wksec);
|
||||
if ((stop > end_of_time) || (stop < 0))
|
||||
stop = end_of_time;
|
||||
|
||||
|
||||
} /* end for range.end loop */
|
||||
|
||||
if (match_total == 0)
|
||||
sprintf(message, catgets(c->DT_catd, 1, 291, "Appointment Not Found."));
|
||||
else if (match_total == 1)
|
||||
sprintf(message, catgets(c->DT_catd, 1, 631, "%d match found"), match_total);
|
||||
else
|
||||
sprintf(message, catgets(c->DT_catd, 1, 292, "%d matches found"), match_total);
|
||||
set_message(f->find_message, message);
|
||||
free_appt_struct(&appt);
|
||||
_DtTurnOffHourGlass(f->frame);
|
||||
|
||||
XtFree(astr);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
show_appt(widget, client_data, cbs)
|
||||
Widget widget;
|
||||
XtPointer client_data;
|
||||
XmPushButtonCallbackStruct *cbs;
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
|
||||
Props *p = (Props*)c->properties;
|
||||
Find *f = (Find*)c->find;
|
||||
int *pos_list;
|
||||
int pos_cnt;
|
||||
int i;
|
||||
Dimension w, h;
|
||||
Tick_list *ptr;
|
||||
char buf[BUFSIZ];
|
||||
int list_cnt;
|
||||
|
||||
XtVaGetValues(f->find_list, XmNitemCount, &list_cnt, NULL);
|
||||
if (list_cnt == 0) {
|
||||
sprintf(buf, "%s", catgets(c->DT_catd, 1, 714, "There are no appointments in the list. You must find one before showing an appointment."));
|
||||
set_message(f->find_message, buf);
|
||||
return;
|
||||
}
|
||||
if (!XmListGetSelectedPos(f->find_list, &pos_list, &pos_cnt)) {
|
||||
sprintf(buf, "%s", catgets(c->DT_catd, 1, 632, "Please select an appointment from the list to show"));
|
||||
set_message(f->find_message, buf);
|
||||
return;
|
||||
}
|
||||
set_message(f->find_message, " ");
|
||||
XtVaGetValues(c->canvas, XmNheight, &h, XmNwidth, &w, NULL);
|
||||
gr_clear_area(c->xcontext, 0, 0, w, h);
|
||||
|
||||
c->view->olddate = c->view->date;
|
||||
for (ptr = (Tick_list*)f->ticks, i = 1; ptr != NULL && i < *pos_list; i++)
|
||||
ptr = ptr->next;
|
||||
|
||||
c->view->date = ptr->tick;
|
||||
c->view->nwks = numwks(c->view->date);
|
||||
XtFree((XtPointer)pos_list);
|
||||
invalidate_cache(c);
|
||||
paint_canvas(c, NULL, RENDER_UNMAP);
|
||||
calendar_deselect(c);
|
||||
paint_selection(c);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
f_cancel_cb(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XmPushButtonCallbackStruct *cbs)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Find *f;
|
||||
|
||||
f = (Find *)c->find;
|
||||
|
||||
XmTextSetString(f->apptstr, "");
|
||||
set_message(f->find_message, " ");
|
||||
XmListDeleteAllItems(f->find_list);
|
||||
|
||||
XtPopdown(f->frame);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
layout_labels(
|
||||
Widget l1,
|
||||
Widget l2,
|
||||
Widget l3,
|
||||
Widget list)
|
||||
{
|
||||
int list_char_width;
|
||||
Dimension label_width;
|
||||
XmString xmstr;
|
||||
XmFontList font_list;
|
||||
|
||||
xmstr = XmStringCreateLocalized(" ");
|
||||
|
||||
XtVaGetValues(list, XmNfontList, &font_list, NULL);
|
||||
|
||||
list_char_width = XmStringWidth(font_list, xmstr);
|
||||
|
||||
XtVaGetValues(l1, XmNwidth, &label_width, NULL);
|
||||
|
||||
/*
|
||||
* The ``Time'' label.
|
||||
*/
|
||||
XtVaSetValues(l2,
|
||||
XmNleftOffset, (14 * list_char_width) - label_width,
|
||||
NULL);
|
||||
|
||||
XtVaGetValues(l2, XmNwidth, &label_width, NULL);
|
||||
|
||||
/*
|
||||
* The ``What'' label.
|
||||
*/
|
||||
XtVaSetValues(l3,
|
||||
XmNleftOffset, (8 * list_char_width) - label_width,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xmstr);
|
||||
}
|
||||
|
||||
72
cde/programs/dtcm/dtcm/find.h
Normal file
72
cde/programs/dtcm/dtcm/find.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** find.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)find.h 1.8 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: find.h /main/3 1995/11/03 10:26:18 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _FIND_H
|
||||
#define _FIND_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
|
||||
typedef struct tick_list {
|
||||
Tick tick;
|
||||
struct tick_list *next;
|
||||
} Tick_list;
|
||||
|
||||
typedef enum {search_all, search_range} Searchset;
|
||||
|
||||
typedef struct {
|
||||
Widget frame;
|
||||
Widget form;
|
||||
Widget apptstr_label;
|
||||
Widget apptstr;
|
||||
Widget search_rc_mgr;
|
||||
Widget search_all;
|
||||
Widget search_range;
|
||||
Widget search_from;
|
||||
Widget search_tolabel;
|
||||
Widget search_to;
|
||||
Widget find_button;
|
||||
Widget help_button;
|
||||
Widget date_label;
|
||||
Widget time_label;
|
||||
Widget what_label;
|
||||
Widget find_list;
|
||||
Widget find_list_sw;
|
||||
Widget show_button;
|
||||
Widget cancel_button;
|
||||
Widget find_message;
|
||||
Tick_list *ticks;
|
||||
Searchset search_set;
|
||||
Tick search_from_date;
|
||||
Tick search_to_date;
|
||||
}Find;
|
||||
|
||||
extern caddr_t make_find P((Calendar*));
|
||||
static Tick f_get_searchdate P((Widget, Props*));
|
||||
|
||||
#endif
|
||||
217
cde/programs/dtcm/dtcm/fns.c
Normal file
217
cde/programs/dtcm/dtcm/fns.c
Normal file
@@ -0,0 +1,217 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** cmfns.c
|
||||
**
|
||||
** $XConsortium: fns.c /main/3 1995/11/03 10:26:30 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)fns.c 1.3 94/11/07 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved
|
||||
*/
|
||||
|
||||
#ifdef FNS
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef POSIX_THREADS
|
||||
#include <thread.h>
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
#include "calendar.h"
|
||||
#include "props.h"
|
||||
#include "misc.h"
|
||||
#include "dtfns.h"
|
||||
#include "cmfns.h"
|
||||
|
||||
extern char *strdup(const char *);
|
||||
extern FILE *fdopen(int, const char *);
|
||||
|
||||
#ifdef POSIX_THREADS
|
||||
/* Data used by registration thread */
|
||||
typedef struct _Registration_data {
|
||||
char *username;
|
||||
char *location;
|
||||
} Registration_data;
|
||||
|
||||
static void *registration_thr(void *data);
|
||||
#endif
|
||||
static int register_calendar(const char *username, const char *location);
|
||||
|
||||
/*
|
||||
* Register a calendar location in FNS.
|
||||
*/
|
||||
int
|
||||
cm_register_calendar(const char *username, const char *location)
|
||||
|
||||
{
|
||||
#ifdef POSIX_THREADS
|
||||
int error;
|
||||
Registration_data *data;
|
||||
|
||||
data = (Registration_data *)malloc(sizeof(Registration_data));
|
||||
|
||||
if (data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
data->username = strdup(username);
|
||||
data->location = strdup(location);
|
||||
|
||||
error = thr_create(NULL, 0, registration_thr, data, THR_DETACHED, NULL);
|
||||
|
||||
if (error > 0) {
|
||||
printf("Could not create registration thread\n");
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
return cmfns_register_calendar(username, location);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef POSIX_THREADS
|
||||
static void *
|
||||
registration_thr(void *data)
|
||||
|
||||
{
|
||||
Registration_data *reg_data;
|
||||
|
||||
DP(("registration_thr: THREAD ENTER\n"));
|
||||
if (data == NULL) {
|
||||
return (void *)-1;
|
||||
}
|
||||
|
||||
reg_data = (Registration_data *)data;
|
||||
|
||||
DP(("registration_thr: Registering calendar\n"));
|
||||
cmfns_register_calendar(reg_data->username, reg_data->location);
|
||||
|
||||
DP(("registration_thr: Registration complete. Freeing data\n"));
|
||||
free(reg_data->username);
|
||||
free(reg_data->location);
|
||||
free(reg_data);
|
||||
DP(("registration_thr: THREAD EXIT\n"));
|
||||
return (void *)1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FNS_DEMO
|
||||
|
||||
/*
|
||||
* Extract the FNS name out of a file or directory. In the case of a
|
||||
* file it should have the format of
|
||||
*
|
||||
* # Zero or more
|
||||
* # comments
|
||||
* fns:name:for:the:fns:object
|
||||
*
|
||||
* In the case of a directory this routine looks for a file called
|
||||
* ".FNSName" in the directory specified. This file should have the
|
||||
* format described above.
|
||||
*
|
||||
* Caller is responsible for providing the buffer to place the name in.
|
||||
*
|
||||
* Returns
|
||||
* -1 Internal error or corrupted file
|
||||
* 0 Could not access file/directory
|
||||
* 1 Success. 'name' contains the FNS name
|
||||
*/
|
||||
int
|
||||
cmfns_name_from_file(
|
||||
const char *path, /* Path to file to get name from */
|
||||
char *name, /* Buffer to put name in */
|
||||
int len) /* Length of buffer */
|
||||
|
||||
{
|
||||
int fd;
|
||||
FILE *fp;
|
||||
char *p;
|
||||
struct stat statb;
|
||||
|
||||
if ((fd = open(path, O_RDONLY)) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fstat(fd, &statb) < 0) {
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (S_ISDIR(statb.st_mode)) {
|
||||
char *newpath;
|
||||
|
||||
/* path points to a directory. Look for .FNSName file */
|
||||
close(fd);
|
||||
newpath = (char *)malloc(strlen(path) + strlen(FNS_FILE) + 2);
|
||||
if (newpath == NULL) {
|
||||
return -1;
|
||||
}
|
||||
sprintf(newpath, "%s/%s", path, FNS_FILE);
|
||||
if ((fp = fopen(newpath, "r")) == NULL) {
|
||||
free(newpath);
|
||||
return 0;
|
||||
}
|
||||
free(newpath);
|
||||
} else {
|
||||
if ((fp = fdopen(fd, "r")) == NULL) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
/* Get line from file */
|
||||
if (fgets(name, len, fp) == NULL) {
|
||||
fclose(fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Make sure we got a full line */
|
||||
p = strrchr(name, '\n');
|
||||
|
||||
/*
|
||||
* If it is a comment line or we got a partial line
|
||||
* try again
|
||||
*/
|
||||
} while (*name == '#' || p == NULL);
|
||||
|
||||
/* Should have the name. Wipe out newline */
|
||||
*p = '\0';
|
||||
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
#endif /* FNS_DEMO */
|
||||
|
||||
#endif /* FNS */
|
||||
390
cde/programs/dtcm/dtcm/font.c
Normal file
390
cde/programs/dtcm/dtcm/font.c
Normal file
@@ -0,0 +1,390 @@
|
||||
/* $XConsortium: font.c /main/4 1995/11/09 12:59:38 rswiston $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/AtomMgr.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "calendar.h"
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS(x) (((x) > 0) ? (x) : (-(x)))
|
||||
#endif /* ABS */
|
||||
|
||||
/*
|
||||
* Walk a font_list looking for a FontSet with the
|
||||
* XmFONTLIST_DEFAULT_TAG set. If we fail to find a FontSet with this tag,
|
||||
* return the first FontSet found. If we fail to find a FontSet return
|
||||
* the first font found.
|
||||
*
|
||||
* This function returns either a XFontStruct or a XFontSet. The type can
|
||||
* be determined by the value of type_return which will equal either
|
||||
* XmFONT_IS_FONTSET or XmFONT_IS_FONT.
|
||||
*
|
||||
* The XFontStruct or XFontSet that is returned is not a copy and should
|
||||
* not be freed.
|
||||
*/
|
||||
static XtPointer
|
||||
get_font(
|
||||
XmFontList font_list,
|
||||
XmFontType *type_return)
|
||||
{
|
||||
XmFontContext fl_context;
|
||||
XmFontListEntry fl_entry;
|
||||
XtPointer fl_entry_font,
|
||||
font_to_use;
|
||||
char *fl_entry_font_tag;
|
||||
Boolean found_font_set = False,
|
||||
found_font_struct = False;
|
||||
|
||||
*type_return = XmFONT_IS_FONT;
|
||||
|
||||
if (!XmFontListInitFontContext(&fl_context, font_list))
|
||||
return (XtPointer)NULL;
|
||||
|
||||
do {
|
||||
fl_entry = XmFontListNextEntry(fl_context);
|
||||
if (fl_entry) {
|
||||
fl_entry_font =
|
||||
XmFontListEntryGetFont(fl_entry, type_return);
|
||||
if (*type_return == XmFONT_IS_FONTSET) {
|
||||
fl_entry_font_tag =
|
||||
XmFontListEntryGetTag(fl_entry);
|
||||
/*
|
||||
* Save the first font set found in-
|
||||
* case the default tag is not set.
|
||||
*/
|
||||
if (!found_font_set) {
|
||||
font_to_use = fl_entry_font;
|
||||
found_font_set = True;
|
||||
found_font_struct = True;
|
||||
|
||||
if (!strcmp(XmFONTLIST_DEFAULT_TAG,
|
||||
fl_entry_font_tag))
|
||||
break;
|
||||
} else if (!strcmp(XmFONTLIST_DEFAULT_TAG,
|
||||
fl_entry_font_tag)) {
|
||||
/* Found right font set */
|
||||
font_to_use = fl_entry_font;
|
||||
break;
|
||||
}
|
||||
} else if (!found_font_struct) {
|
||||
font_to_use = fl_entry_font;
|
||||
found_font_struct = True;
|
||||
}
|
||||
}
|
||||
} while (fl_entry != NULL);
|
||||
|
||||
XmFontListFreeFontContext(fl_context);
|
||||
|
||||
if (!found_font_set && !found_font_struct)
|
||||
return (XtPointer)NULL;
|
||||
|
||||
return (XtPointer)font_to_use;
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
fontlist_to_font(
|
||||
XmFontList font_list,
|
||||
Cal_Font *cal_font)
|
||||
{
|
||||
XmFontType type_return;
|
||||
XtPointer font_data;
|
||||
|
||||
if (!font_list) return False;
|
||||
|
||||
font_data = get_font(font_list, &type_return);
|
||||
|
||||
if (!font_data)
|
||||
return False;
|
||||
|
||||
cal_font->cf_type = type_return;
|
||||
|
||||
if (type_return == XmFONT_IS_FONTSET)
|
||||
cal_font->f.cf_fontset = (XFontSet)font_data;
|
||||
else
|
||||
cal_font->f.cf_font = (XFontStruct *)font_data;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for a font that is closest to the requested point size and resolution
|
||||
* using the weight and family name specified.
|
||||
*/
|
||||
static Boolean
|
||||
ProbeForFont(
|
||||
Calendar *cal,
|
||||
Font_Weight weight,
|
||||
unsigned long target_pixel_size,
|
||||
int with_foundry,
|
||||
char *font_name)
|
||||
{
|
||||
char **font_names,
|
||||
notused[48];
|
||||
int i,
|
||||
nnames,
|
||||
size = 0,
|
||||
closest_size_diff = 100000,
|
||||
closest_size,
|
||||
closest_index = -1;
|
||||
|
||||
if (!strcmp(cal->app_data->app_font_family, "application")) {
|
||||
sprintf (font_name, "-%s-%s-%s-r-normal-sans-*-*-*-*-p-*",
|
||||
(with_foundry)?"dt":"*",
|
||||
cal->app_data->app_font_family,
|
||||
(weight == BOLD)?"bold":"medium");
|
||||
} else {
|
||||
sprintf (font_name, "-%s-%s-%s-r-normal--*-*-*-*-*-*",
|
||||
(with_foundry)?"dt":"*",
|
||||
cal->app_data->app_font_family,
|
||||
(weight == BOLD)?"bold":"medium");
|
||||
}
|
||||
|
||||
/* See if the font exists */
|
||||
font_names = XListFonts(XtDisplay(cal->frame), font_name, 80, &nnames);
|
||||
if (!nnames) {
|
||||
if (with_foundry)
|
||||
return ProbeForFont(cal, weight, target_pixel_size,
|
||||
FALSE, font_name);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* For the fonts that match, get their pixel size and
|
||||
* look for the one with the pixel size closest to the size we are
|
||||
* looking for.
|
||||
*/
|
||||
for (i = 0; i < nnames; i++) {
|
||||
sscanf(font_names[i],
|
||||
"-%[^-]-%[^-]-%[^-]-%[^-]-%[^-]-%[^-]-%d-%s",
|
||||
notused, notused, notused, notused, notused, notused,
|
||||
&size, notused);
|
||||
|
||||
if (!size)
|
||||
sscanf(font_names[i],
|
||||
"-%[^-]-%[^-]-%[^-]-%[^-]-%[^-]--%d-%s",
|
||||
notused, notused, notused, notused, notused,
|
||||
&size, notused);
|
||||
|
||||
if (size) {
|
||||
if ((ABS((int)(target_pixel_size - size)) <=
|
||||
closest_size_diff)) {
|
||||
closest_size_diff =
|
||||
ABS((int)(target_pixel_size - size));
|
||||
closest_size = size;
|
||||
closest_index = i;
|
||||
if (closest_size_diff == 0)
|
||||
break;
|
||||
}
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (closest_index == -1)
|
||||
return FALSE;
|
||||
|
||||
/* This one is the closest in size */
|
||||
sprintf (font_name, "-%s-%s-%s-r-normal-%s-%d-*-*-*-*-*",
|
||||
(with_foundry)?"dt":"*",
|
||||
cal->app_data->app_font_family,
|
||||
(weight == BOLD)?"bold":"medium",
|
||||
(!strcmp(cal->app_data->app_font_family, "application")) ?
|
||||
"sans": "",
|
||||
closest_size);
|
||||
|
||||
XFreeFontNames(font_names);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern void
|
||||
load_app_font(
|
||||
Calendar *cal,
|
||||
Font_Weight weight,
|
||||
Cal_Font *userfont,
|
||||
Cal_Font *return_font)
|
||||
{
|
||||
unsigned long pixel_size;
|
||||
Display *dpy = XtDisplay(cal->frame);
|
||||
char font_name[128],
|
||||
*font_name_ptr = font_name,
|
||||
**font_names;
|
||||
int nnames;
|
||||
XrmValue in_font;
|
||||
XrmValue out_fontlist;
|
||||
XmFontList font_list;
|
||||
Atom pixel_atom = XmInternAtom(dpy, "PIXEL_SIZE", FALSE);
|
||||
|
||||
/* First get the pixel size from the User Font */
|
||||
if (userfont->cf_type == XmFONT_IS_FONT) {
|
||||
/* If we can't get the pixel size from the user font we
|
||||
* defaults to a 12 pixel font.
|
||||
*/
|
||||
if (!XGetFontProperty(userfont->f.cf_font, pixel_atom,
|
||||
&pixel_size))
|
||||
pixel_size = 12;
|
||||
} else {
|
||||
XFontStruct **font_struct_list;
|
||||
char **font_name_list;
|
||||
int list_size;
|
||||
|
||||
if (!(list_size = XFontsOfFontSet(userfont->f.cf_fontset,
|
||||
&font_struct_list,
|
||||
&font_name_list))) {
|
||||
pixel_size = 12;
|
||||
} else {
|
||||
int i;
|
||||
if (!XGetFontProperty(font_struct_list[0],
|
||||
pixel_atom,
|
||||
&pixel_size))
|
||||
pixel_size = 12;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the font family is not ``application'' then it is probably
|
||||
* multibyte so we can't assume there is an add-style or a proportional
|
||||
* version available.
|
||||
*/
|
||||
if (!strcmp(cal->app_data->app_font_family, "application")) {
|
||||
sprintf (font_name, "-dt-%s-%s-r-normal-sans-%d-*-*-*-p-*",
|
||||
cal->app_data->app_font_family,
|
||||
(weight == BOLD)?"bold":"medium",
|
||||
pixel_size);
|
||||
} else {
|
||||
sprintf (font_name, "-dt-%s-%s-r-normal--%d-*-*-*-*-*",
|
||||
cal->app_data->app_font_family,
|
||||
(weight == BOLD)?"bold":"medium",
|
||||
pixel_size);
|
||||
}
|
||||
|
||||
/* See if the font exists */
|
||||
font_names = XListFonts(dpy, font_name, 1, &nnames);
|
||||
if (!nnames) {
|
||||
if (!ProbeForFont(cal, weight, pixel_size, TRUE,
|
||||
font_name_ptr)) {
|
||||
/* We didn't find anything */
|
||||
*return_font = *userfont;
|
||||
return;
|
||||
}
|
||||
} else
|
||||
XFreeFontNames(font_names);
|
||||
|
||||
strcat(font_name, ":");
|
||||
in_font.size = strlen(font_name);
|
||||
in_font.addr = font_name;
|
||||
out_fontlist.size = sizeof(XmFontList);
|
||||
out_fontlist.addr = (XPointer)&font_list;
|
||||
|
||||
/* Convert font string to a font list. */
|
||||
if (!XtConvertAndStore(cal->frame, XtRString, &in_font, XmRFontList,
|
||||
&out_fontlist)) {
|
||||
*return_font = *userfont;
|
||||
}
|
||||
|
||||
if (!fontlist_to_font(font_list, return_font)) {
|
||||
*return_font = *userfont;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a font or fontset, return the extents of the text.
|
||||
*/
|
||||
void
|
||||
CalTextExtents(
|
||||
Cal_Font *font,
|
||||
char *string,
|
||||
int nbytes,
|
||||
int *x_return,
|
||||
int *y_return,
|
||||
int *width_return,
|
||||
int *height_return)
|
||||
{
|
||||
|
||||
if (!font) return;
|
||||
|
||||
if (font->cf_type == XmFONT_IS_FONT) {
|
||||
int direction,
|
||||
ascent,
|
||||
descent;
|
||||
XCharStruct overall;
|
||||
|
||||
XTextExtents(font->f.cf_font, string, nbytes,
|
||||
&direction, &ascent, &descent, &overall);
|
||||
|
||||
*x_return = overall.lbearing;
|
||||
*y_return = overall.ascent;
|
||||
*width_return = overall.width;
|
||||
*height_return = overall.ascent + overall.descent;
|
||||
} else {
|
||||
XRectangle ink,
|
||||
logical;
|
||||
|
||||
XmbTextExtents(font->f.cf_fontset, string, nbytes,
|
||||
&ink, &logical);
|
||||
|
||||
*x_return = logical.x;
|
||||
*y_return = logical.y;
|
||||
*width_return = logical.width;
|
||||
*height_return = logical.height;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a font or fontset, render the text.
|
||||
*/
|
||||
void
|
||||
CalDrawString(
|
||||
Display *dpy,
|
||||
Drawable draw,
|
||||
Cal_Font *font,
|
||||
GC gc,
|
||||
int x,
|
||||
int y,
|
||||
char *string,
|
||||
int length)
|
||||
{
|
||||
|
||||
if (font->cf_type == XmFONT_IS_FONT) {
|
||||
XSetFont(dpy, gc, font->f.cf_font->fid);
|
||||
XDrawString(dpy, draw, gc, x, y, string, length);
|
||||
} else {
|
||||
XmbDrawString(dpy, draw, font->f.cf_fontset, gc, x, y,
|
||||
string, length);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CalFontExtents(
|
||||
Cal_Font *font,
|
||||
XFontSetExtents *fse)
|
||||
{
|
||||
if (font->cf_type == XmFONT_IS_FONT) {
|
||||
/*
|
||||
* These computations are stolen from _XsimlCreateFontSet()
|
||||
* in Xlib.
|
||||
*/
|
||||
fse->max_ink_extent.x = font->f.cf_font->min_bounds.lbearing;
|
||||
fse->max_ink_extent.y = - font->f.cf_font->max_bounds.ascent;
|
||||
fse->max_ink_extent.width = font->f.cf_font->min_bounds.width;
|
||||
fse->max_ink_extent.height =
|
||||
font->f.cf_font->max_bounds.ascent +
|
||||
font->f.cf_font->max_bounds.descent;
|
||||
|
||||
fse->max_logical_extent.x = 0;
|
||||
fse->max_logical_extent.y = - font->f.cf_font->ascent;
|
||||
fse->max_logical_extent.width =
|
||||
font->f.cf_font->max_bounds.width;
|
||||
fse->max_logical_extent.height =
|
||||
font->f.cf_font->ascent +
|
||||
font->f.cf_font->descent;
|
||||
} else {
|
||||
*fse = *XExtentsOfFontSet(font->f.cf_fontset);
|
||||
}
|
||||
}
|
||||
499
cde/programs/dtcm/dtcm/format.c
Normal file
499
cde/programs/dtcm/dtcm/format.c
Normal file
@@ -0,0 +1,499 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** format.c
|
||||
**
|
||||
** $XConsortium: format.c /main/5 1996/11/21 19:42:52 drk $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)format.c 1.27 95/01/19 Copyr 1991 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#if defined(sun) && defined(_XOPEN_SOURCE)
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <Xm/Xm.h>
|
||||
#include <csa.h>
|
||||
#include "util.h"
|
||||
#include "cm_tty.h"
|
||||
#include "timeops.h"
|
||||
#include "format.h"
|
||||
#include "gettext.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#define X_INCLUDE_TIME_H
|
||||
#include <X11/Xos_r.h>
|
||||
|
||||
/*
|
||||
* Convert tick to m, d, y string. e.g. May 1, 1988
|
||||
*/
|
||||
extern void
|
||||
format_date(Tick t, OrderingType order, char *buf, int day_and_date,
|
||||
int and_date, int full_day)
|
||||
{
|
||||
int m, d, y, wd;
|
||||
struct tm *tm;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
buf[0]=NULL;
|
||||
tm = _XLocaltime(&t, localtime_buf);
|
||||
m = tm->tm_mon+1;
|
||||
d = tm->tm_mday;
|
||||
y = tm->tm_year + 1900;
|
||||
wd = tm->tm_wday;
|
||||
|
||||
switch(order) {
|
||||
case ORDER_DMY:
|
||||
/* STRING_EXTRACTION SUNW_DESKSET_CM_MSG :
|
||||
*
|
||||
* %s, %d %s %4d is a form of the date format.
|
||||
* Change this to reflect your local convention.
|
||||
* eg. In the German locale, "%s, %d %s %4d" may be changed
|
||||
* to "%s. %d %s %4d".
|
||||
*/
|
||||
if (day_and_date)
|
||||
if (full_day)
|
||||
(void)sprintf(buf, "%s, %d %s %4d",
|
||||
days2[wd], d, months[m], y);
|
||||
else
|
||||
(void)sprintf(buf, "%s, %d %s %4d",
|
||||
days[wd], d, months[m], y);
|
||||
else if (and_date)
|
||||
(void)sprintf(buf, "%d %s %4d", d, months[m], y);
|
||||
|
||||
else
|
||||
(void) sprintf(buf, "%s %4d", months[m], y);
|
||||
break;
|
||||
case ORDER_YMD:
|
||||
if (day_and_date)
|
||||
if (full_day)
|
||||
(void)sprintf(buf, "%s, %4d %s %d",
|
||||
days2[wd], y, months[m], d);
|
||||
else
|
||||
(void)sprintf(buf, "%s, %4d %s %d",
|
||||
days[wd], y, months[m], d);
|
||||
else if (and_date)
|
||||
(void)sprintf(buf, "%4d %s %d", y, months[m], d);
|
||||
else
|
||||
(void) sprintf(buf, "%4d %s", y, months[m]);
|
||||
break;
|
||||
case ORDER_MDY:
|
||||
default:
|
||||
if (day_and_date)
|
||||
if (full_day)
|
||||
(void)sprintf(buf, "%s, %s %d %4d",
|
||||
days2[wd], months[m], d, y);
|
||||
else
|
||||
(void)sprintf(buf, "%s, %s %d %4d",
|
||||
days[wd], months[m], d, y);
|
||||
else if (and_date)
|
||||
(void)sprintf(buf, "%s %d %4d",
|
||||
months[m], d, y);
|
||||
else
|
||||
(void) sprintf(buf, "%s %4d", months[m], y);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert tick to m/d
|
||||
*/
|
||||
extern void
|
||||
format_date3(Tick t, OrderingType order, SeparatorType sep, char *buf)
|
||||
{
|
||||
int m, d;
|
||||
struct tm *tm;
|
||||
char *str = (char *) separator_str(sep);
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
buf[0]=NULL;
|
||||
tm = _XLocaltime(&t, localtime_buf);
|
||||
|
||||
m = tm->tm_mon+1;
|
||||
d = tm->tm_mday;
|
||||
switch(order) {
|
||||
case ORDER_YMD:
|
||||
case ORDER_MDY:
|
||||
default:
|
||||
(void) sprintf(buf, "%d%s%.2d", m, str, d);
|
||||
break;
|
||||
case ORDER_DMY:
|
||||
(void) sprintf(buf, "%.2d%s%d", d, str, m);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Format 1 line of appt data. Returns True if begin hour is < 10 - thus
|
||||
* padding needs to be done.
|
||||
*/
|
||||
extern Boolean
|
||||
format_line(Tick tick,
|
||||
char *what,
|
||||
char *buf,
|
||||
int end_tick,
|
||||
Boolean showtime,
|
||||
DisplayType display)
|
||||
{
|
||||
int hr, hr1, mn, mn1;
|
||||
Boolean am=True;
|
||||
Boolean am_end=True;
|
||||
struct tm *tm;
|
||||
Boolean pad = FALSE;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
if (buf==NULL) return pad;
|
||||
buf[0]=NULL;
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hr = tm->tm_hour;
|
||||
mn = tm->tm_min;
|
||||
if (showtime && !magic_time(tick)) {
|
||||
if (display == HOUR12)
|
||||
am = adjust_hour(&hr);
|
||||
if (end_tick && end_tick != tick) {
|
||||
hr1 = hour(end_tick);
|
||||
mn1 = minute(end_tick);
|
||||
if (display == HOUR12) {
|
||||
am_end = adjust_hour(&hr1);
|
||||
if (am_end != am) {
|
||||
(void) sprintf(buf, "%d:%.2d - %d:%.2d%s ",
|
||||
hr, mn,
|
||||
hr1, mn1, am_end ? "am" : "pm");
|
||||
} else {
|
||||
(void) sprintf(buf, "%d:%.2d - %d:%.2d ",
|
||||
hr, mn, hr1, mn1);
|
||||
}
|
||||
if (hr < 10) pad = TRUE;
|
||||
}
|
||||
else
|
||||
(void) sprintf(buf, "%02d%02d - %02d%02d ",
|
||||
hr, mn, hr1, mn1);
|
||||
}
|
||||
else {
|
||||
/* Check to see if there are 2 digits in
|
||||
in initial time format. If so, pad with
|
||||
1 space; if not 2. The font is not fixed
|
||||
width, so I have to line it up myself.. */
|
||||
if (display == HOUR12) {
|
||||
if (hr > 9)
|
||||
(char *)sprintf(buf, "%2d:%.2d%s ",
|
||||
hr, mn, am ? "a" : "p");
|
||||
else {
|
||||
(char *)sprintf(buf, "%d:%.2d%s ",
|
||||
hr, mn, am ? "a" : "p");
|
||||
pad = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
(char *)sprintf(buf, "%02d%02d ", hr, mn);
|
||||
}
|
||||
}
|
||||
if (what)
|
||||
(void) cm_strcat(buf, what);
|
||||
|
||||
return pad;
|
||||
}
|
||||
|
||||
/*
|
||||
* Format 2 lines of appt data
|
||||
*/
|
||||
extern void
|
||||
format_maxchars(Dtcm_appointment *appt, char *buf1, int maxchars,
|
||||
DisplayType display) {
|
||||
Tick tick, end_tick = 0;
|
||||
int hour1, min1, hour2, min2;
|
||||
Lines *lines;
|
||||
char *s1, *s2;
|
||||
struct tm *tm;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
if (appt->end_time)
|
||||
_csa_iso8601_to_tick(appt->end_time->value->item.string_value,
|
||||
&end_tick);
|
||||
*buf1 = NULL;
|
||||
if (appt == NULL || appt->what->value->item.string_value == NULL) return;
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hour1 = tm->tm_hour;
|
||||
min1 = tm->tm_min;
|
||||
if (showtime_set(appt) && !magic_time(tick)) {
|
||||
s1 = s2 = "am";
|
||||
if (display == HOUR12 && !adjust_hour(&hour1))
|
||||
s1="pm";
|
||||
|
||||
if (end_tick) {
|
||||
hour2 = hour(end_tick);
|
||||
if (display == HOUR12 && !adjust_hour(&hour2))
|
||||
s2="pm";
|
||||
|
||||
min2 = minute(end_tick);
|
||||
}
|
||||
|
||||
if (end_tick == 0 || hour1 == hour2 && min1 == min2) {
|
||||
if (display == HOUR24)
|
||||
sprintf(buf1, "%02d%02d ", hour1, min1);
|
||||
else
|
||||
sprintf(buf1, "%d:%.2d%s ", hour1, min1, s1);
|
||||
}
|
||||
else {
|
||||
if (display == HOUR12)
|
||||
sprintf(buf1, "%d:%.2d%s-%d:%.2d%s ",
|
||||
hour1, min1, s1, hour2, min2, s2);
|
||||
else
|
||||
sprintf(buf1, "%02d%02d-%02d%02d ",
|
||||
hour1, min1, hour2, min2);
|
||||
}
|
||||
}
|
||||
|
||||
lines = (Lines *) text_to_lines(appt->what->value->item.string_value, 10);
|
||||
|
||||
while (lines != NULL) {
|
||||
if ((cm_strlen(buf1) + cm_strlen(lines->s)) < (maxchars-2)) {
|
||||
cm_strcat(buf1, lines->s);
|
||||
lines = lines->next;
|
||||
if (lines != NULL)
|
||||
cm_strcat(buf1, " - ");
|
||||
}
|
||||
else {
|
||||
strncat(buf1, lines->s, (maxchars - cm_strlen(buf1)-1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
destroy_lines(lines);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Format 2 lines of appt data
|
||||
*/
|
||||
extern void
|
||||
format_line2(Dtcm_appointment *appt, char *buf1, char *buf2,
|
||||
DisplayType display) {
|
||||
Tick tick, end_tick = 0;
|
||||
int hour1, min1, hour2, min2;
|
||||
Lines *lines;
|
||||
char *s1, *s2;
|
||||
struct tm *tm;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
if (appt->end_time)
|
||||
_csa_iso8601_to_tick(appt->end_time->value->item.string_value,
|
||||
&end_tick);
|
||||
|
||||
/*
|
||||
* Extract an appointment and format it into 2 lines of no more
|
||||
* then maxchars
|
||||
*/
|
||||
*buf1 = *buf2 = NULL;
|
||||
if (appt == NULL || appt->what->value->item.string_value == NULL) return;
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hour1 = tm->tm_hour;
|
||||
min1 = tm->tm_min;
|
||||
|
||||
if (!showtime_set(appt) || magic_time(tick)) {
|
||||
lines = (Lines *) text_to_lines(appt->what->value->item.string_value, 1);
|
||||
if (lines==NULL) return;
|
||||
strncpy(buf2, lines->s, 256);
|
||||
destroy_lines(lines);
|
||||
return;
|
||||
}
|
||||
|
||||
s1 = s2 = "am";
|
||||
if (display == HOUR12 && !adjust_hour(&hour1))
|
||||
s1="pm";
|
||||
|
||||
if (end_tick) {
|
||||
hour2 = hour(end_tick);
|
||||
min2 = minute(end_tick);
|
||||
if (display == HOUR12 && !adjust_hour(&hour2))
|
||||
s2="pm";
|
||||
}
|
||||
|
||||
if (end_tick == 0 ||
|
||||
(hour1 == hour2 && min1 == min2 && (strcmp(s1, s2) == 0))) {
|
||||
if (display == HOUR24)
|
||||
sprintf(buf1, "%02d%.2d", hour1, min1);
|
||||
else
|
||||
sprintf(buf1, "%d:%.2d%s", hour1, min1, s1);
|
||||
}
|
||||
else {
|
||||
if (display == HOUR12)
|
||||
sprintf(buf1, "%d:%.2d%s-%d:%.2d%s", hour1, min1, s1,
|
||||
hour2, min2, s2);
|
||||
else
|
||||
sprintf(buf1, "%02d%02d-%02d%02d", hour1, min1,
|
||||
hour2, min2);
|
||||
}
|
||||
|
||||
|
||||
lines = (Lines *) text_to_lines(appt->what->value->item.string_value, 1);
|
||||
|
||||
if (lines == NULL || lines->s == NULL ||
|
||||
(cm_strlen(lines->s) == 1 && lines->s[0] == ' '))
|
||||
buf2[0] = NULL;
|
||||
else
|
||||
sprintf(buf2, " %s", lines->s);
|
||||
destroy_lines(lines);
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
format_abbrev_appt(Dtcm_appointment *appt, char *b, Boolean show_am,
|
||||
DisplayType display)
|
||||
{
|
||||
int hr, mn;
|
||||
Tick tick;
|
||||
Lines *lines=NULL;
|
||||
Boolean am = True;
|
||||
struct tm *tm;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
if(appt==NULL || b==NULL) return;
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hr = tm->tm_hour;
|
||||
mn = tm->tm_min;
|
||||
if (showtime_set(appt) && !magic_time(tick)) {
|
||||
if (display == HOUR12) {
|
||||
am = adjust_hour(&hr);
|
||||
if (show_am)
|
||||
sprintf(b, "%2d:%02d%s ", hr, mn, am ?
|
||||
"a" : "p");
|
||||
else
|
||||
sprintf(b, "%2d:%02d ", hr, mn);
|
||||
}
|
||||
else
|
||||
sprintf(b, "%02d%02d ", hr, mn);
|
||||
}
|
||||
lines = text_to_lines(appt->what->value->item.string_value, 1);
|
||||
if (lines != NULL && lines->s != NULL) {
|
||||
(void) cm_strcat(b, lines->s);
|
||||
destroy_lines(lines);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Format the appointment in the character array passed (assumed to be pointing
|
||||
* to allocated space) to contain the time followed by the what string. The
|
||||
* appointment string is truncated at "max" chars or at DEFAULT_APPT_LEN if
|
||||
* max is 0.
|
||||
*/
|
||||
extern void
|
||||
format_appt(Dtcm_appointment *appt, char *b, DisplayType display, int max) {
|
||||
int hr, mn, len, i = 0, j = 0;
|
||||
Tick tick;
|
||||
struct tm *tm;
|
||||
register char *what_ptr;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
if (!appt || !b)
|
||||
return;
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hr = tm->tm_hour;
|
||||
mn = tm->tm_min;
|
||||
|
||||
if (showtime_set(appt) && !magic_time(tick)) {
|
||||
if (display == HOUR12) {
|
||||
adjust_hour(&hr);
|
||||
sprintf(b, "%2d:%02d ", hr, mn);
|
||||
} else
|
||||
sprintf(b, "%02d%02d ", hr, mn);
|
||||
i = cm_strlen(b);
|
||||
}
|
||||
|
||||
if (appt->what->value->item.string_value) {
|
||||
if (max <= 0)
|
||||
max = DEFAULT_APPT_LEN;
|
||||
len = max - i;
|
||||
what_ptr = appt->what->value->item.string_value;
|
||||
while ((i < len) && *what_ptr != '\n' && *what_ptr)
|
||||
b[i++] = *what_ptr++;
|
||||
b[i] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Format the appointment in the character array passed (assumed to be pointing
|
||||
* to allocated space) to contain the formatted string for the group
|
||||
* appointment editor. The string is truncated at "max" chars or at
|
||||
* DEFAULT_GAPPT_LEN if max is 0.
|
||||
*/
|
||||
extern void
|
||||
format_gappt(Dtcm_appointment *appt, char *name, char *b, DisplayType display,
|
||||
int max) {
|
||||
int hr, mn, i, j;
|
||||
Tick tick;
|
||||
char *what_ptr;
|
||||
struct tm *tm;
|
||||
_Xltimeparams localtime_buf;
|
||||
|
||||
if (!appt || !b)
|
||||
return;
|
||||
|
||||
_csa_iso8601_to_tick(appt->time->value->item.string_value, &tick);
|
||||
if ((tick > 0) && !magic_time(tick) &&
|
||||
showtime_set(appt)) {
|
||||
tm = _XLocaltime(&tick, localtime_buf);
|
||||
hr = tm->tm_hour;
|
||||
mn = tm->tm_min;
|
||||
|
||||
if (display == HOUR12) {
|
||||
adjust_hour(&hr);
|
||||
sprintf(b, "%2d:%02d ", hr, mn);
|
||||
} else
|
||||
sprintf(b, "%02d%02d ", hr, mn);
|
||||
} else
|
||||
sprintf(b, "%6s", " ");
|
||||
|
||||
if (max <= 0)
|
||||
max = DEFAULT_GAPPT_LEN;
|
||||
i = cm_strlen(b);
|
||||
|
||||
j = 0;
|
||||
while (j < 10 && i < max && name && name[j])
|
||||
b[i++] = name[j++];
|
||||
while (j < 11 && i < max)
|
||||
b[i++] = ' ', ++j;
|
||||
|
||||
if (i >= max) {
|
||||
b[i - 1] = '\0';
|
||||
return;
|
||||
}
|
||||
b[i] = '\0';
|
||||
|
||||
if (appt->what->value->item.string_value) {
|
||||
what_ptr = appt->what->value->item.string_value;
|
||||
while (i < max && *what_ptr != '\n' && *what_ptr)
|
||||
b[i++] = *what_ptr++;
|
||||
b[i] = '\0';
|
||||
}
|
||||
}
|
||||
54
cde/programs/dtcm/dtcm/format.h
Normal file
54
cde/programs/dtcm/dtcm/format.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** format.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)format.h 1.11 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: format.h /main/3 1995/11/03 10:27:14 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _FORMAT_H
|
||||
#define _FORMAT_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "props.h"
|
||||
|
||||
#define DEFAULT_APPT_LEN 50
|
||||
#define DEFAULT_GAPPT_LEN 80
|
||||
|
||||
|
||||
extern void format_date P((Tick, OrderingType, char*, int, int, int));
|
||||
extern void format_date3 P((Tick, OrderingType, SeparatorType, char*));
|
||||
extern Boolean format_line P((Tick, char*, char*, int, Boolean,
|
||||
DisplayType));
|
||||
extern void format_line2 P((Dtcm_appointment*, char*, char*,
|
||||
DisplayType));
|
||||
extern void format_appt P((Dtcm_appointment*, char*, DisplayType, int));
|
||||
extern void format_abbrev_appt P((Dtcm_appointment*, char*, Boolean,
|
||||
DisplayType));
|
||||
extern void format_maxchars P((Dtcm_appointment*, char*, int, DisplayType));
|
||||
extern void format_gappt P((Dtcm_appointment*, char*, char*,
|
||||
DisplayType, int));
|
||||
|
||||
#endif
|
||||
49
cde/programs/dtcm/dtcm/gettext.h
Normal file
49
cde/programs/dtcm/dtcm/gettext.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** gettext.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)gettext.h 1.5 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: gettext.h /main/3 1995/11/03 10:27:24 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _GETTEXT_H
|
||||
#define _GETTEXT_H
|
||||
|
||||
/*
|
||||
#ifdef XGETTEXT
|
||||
#define MSGFILE_ERROR "SUNW_DESKSET_CM_ERR"
|
||||
#define MSGFILE_LABEL "SUNW_DESKSET_CM_LABEL"
|
||||
#define MSGFILE_MESSAGE "SUNW_DESKSET_CM_MSG"
|
||||
#else
|
||||
extern char *MSGFILE_ERROR;
|
||||
extern char *MSGFILE_LABEL;
|
||||
extern char *MSGFILE_MESSAGE;
|
||||
#endif
|
||||
|
||||
#define EGET(s) (char *)dgettext(MSGFILE_ERROR, s)
|
||||
#define LGET(s) (char *)dgettext(MSGFILE_LABEL, s)
|
||||
#define MGET(s) (char *)dgettext(MSGFILE_MESSAGE, s)
|
||||
*/
|
||||
|
||||
#endif
|
||||
316
cde/programs/dtcm/dtcm/goto.c
Normal file
316
cde/programs/dtcm/dtcm/goto.c
Normal file
@@ -0,0 +1,316 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** goto.c
|
||||
**
|
||||
** $XConsortium: goto.c /main/4 1995/12/04 14:18:24 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)goto.c 1.40 95/03/28 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include "calendar.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "find.h"
|
||||
#include "datefield.h"
|
||||
#include "getdate.h"
|
||||
#include "dayglance.h"
|
||||
#include "select.h"
|
||||
#include "props.h"
|
||||
#include "editor.h"
|
||||
#include "goto.h"
|
||||
#include "help.h"
|
||||
|
||||
extern caddr_t
|
||||
make_goto(Calendar *c)
|
||||
{
|
||||
Goto *g;
|
||||
XmString xmstr;
|
||||
Widget separator, button_form;
|
||||
void goto_date(), g_cancel_cb();
|
||||
char *title;
|
||||
|
||||
if (c->goTo == NULL) {
|
||||
c->goTo = (caddr_t)ckalloc(sizeof(Goto));
|
||||
g = (Goto*)c->goTo;
|
||||
}
|
||||
else
|
||||
g = (Goto*)c->goTo;
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 715, "Calendar : Go to Date"));
|
||||
g->frame = XtVaCreatePopupShell("frame",
|
||||
xmDialogShellWidgetClass, c->frame,
|
||||
XmNtitle, title,
|
||||
XmNallowShellResize, True,
|
||||
XmNmappedWhenManaged, False,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
g->form = XtVaCreateWidget("form",
|
||||
xmFormWidgetClass, g->frame,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 3,
|
||||
XmNhorizontalSpacing, 4,
|
||||
XmNverticalSpacing, 4,
|
||||
XmNmarginWidth, 0,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 293, "Date:"));
|
||||
g->datelabel = XtVaCreateWidget("Date:",
|
||||
xmLabelWidgetClass, g->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 11,
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
g->datetext = XtVaCreateWidget("text",
|
||||
xmTextWidgetClass, g->form,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopWidget, g->datelabel,
|
||||
XmNtopOffset, 7,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, g->datelabel,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNrightOffset, 10,
|
||||
XmNcolumns, 32,
|
||||
NULL);
|
||||
XtAddCallback(g->datetext, XmNactivateCallback, goto_date, NULL);
|
||||
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
g->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, g->datetext,
|
||||
XmNtopOffset, 5,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("form",
|
||||
xmFormWidgetClass, g->form,
|
||||
XmNautoUnmanage, False,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNhorizontalSpacing, 4,
|
||||
XmNfractionBase, 3,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 294, "Go To"));
|
||||
g->datebutton = XtVaCreateWidget("goTo",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNlabelString, xmstr,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 1,
|
||||
NULL);
|
||||
XtAddCallback(g->datebutton, XmNactivateCallback, goto_date, NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close"));
|
||||
g->cancelbutton = XtVaCreateWidget("cancel",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 2,
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XtAddCallback(g->cancelbutton, XmNactivateCallback, g_cancel_cb, NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help"));
|
||||
g->helpbutton = XtVaCreateWidget("help",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 2,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XtAddCallback(g->helpbutton, XmNactivateCallback,
|
||||
(XtCallbackProc)help_cb, GOTO_HELP_BUTTON);
|
||||
XtAddCallback(g->form, XmNhelpCallback,
|
||||
(XtCallbackProc)help_cb, (XtPointer) GOTO_HELP_BUTTON);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
g->goto_message = XtVaCreateWidget("message",
|
||||
xmLabelGadgetClass, g->form,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, g->cancelbutton,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
/* set default button */
|
||||
XtVaSetValues(g->form, XmNdefaultButton, g->datebutton, NULL);
|
||||
XtVaSetValues(g->form, XmNcancelButton, g->cancelbutton, NULL);
|
||||
XtVaSetValues(button_form, XmNdefaultButton, g->datebutton, NULL);
|
||||
XtVaSetValues(button_form, XmNcancelButton, g->cancelbutton, NULL);
|
||||
XmProcessTraversal(g->datetext, XmTRAVERSE_CURRENT);
|
||||
XtVaSetValues(g->form, XmNinitialFocus, g->datetext, NULL);
|
||||
|
||||
ManageChildren(button_form);
|
||||
ManageChildren(g->form);
|
||||
XtManageChild(g->form);
|
||||
XtVaSetValues(g->frame, XmNmappedWhenManaged, True, NULL);
|
||||
XtRealizeWidget(g->frame);
|
||||
|
||||
XtPopup(g->frame, XtGrabNone);
|
||||
|
||||
return(caddr_t)g;
|
||||
}
|
||||
|
||||
void
|
||||
goto_date(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Props *p;
|
||||
Goto *g;
|
||||
Tick gotodate, start, stop;
|
||||
char *date = NULL, today[DATESIZ];
|
||||
char message[40];
|
||||
Dimension w, h;
|
||||
OrderingType ot;
|
||||
SeparatorType st;
|
||||
|
||||
p = (Props*)c->properties;
|
||||
ot = get_int_prop(p, CP_DATEORDERING);
|
||||
st = get_int_prop(p, CP_DATESEPARATOR);
|
||||
g = (Goto*)c->goTo;
|
||||
|
||||
date = XmTextGetString(g->datetext);
|
||||
if ((*date == NULL) || (date == NULL)) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 297, "Please type in a date"));
|
||||
set_message(g->goto_message, message);
|
||||
return;
|
||||
}
|
||||
format_tick(c->view->date, ot, st, today);
|
||||
set_message(g->goto_message, "");
|
||||
date = get_date_from_widget(c->view->date, g->datetext, ot, st);
|
||||
if ( date == NULL ) {
|
||||
return;
|
||||
} else {
|
||||
gotodate = cm_getdate(date, NULL);
|
||||
}
|
||||
if (!strcmp(today, date)) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 298, "You are already viewing %s"), date);
|
||||
set_message(g->goto_message, message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (gotodate == DATE_BBOT) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038"));
|
||||
set_message(g->goto_message, message);
|
||||
return;
|
||||
}
|
||||
else if (gotodate == DATE_AEOT) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038"));
|
||||
set_message(g->goto_message, message);
|
||||
return;
|
||||
}
|
||||
else if (gotodate <= 0) {
|
||||
sprintf(message, catgets(c->DT_catd, 1, 299, "Invalid Date"));
|
||||
set_message(g->goto_message, message);
|
||||
return;
|
||||
}
|
||||
|
||||
invalidate_cache(c);
|
||||
|
||||
get_range(c->view->glance, c->view->date, &start, &stop);
|
||||
if (in_range(start, stop, gotodate)) {
|
||||
/* date is in view; deselect and repaint new selection */
|
||||
calendar_deselect(c);
|
||||
c->view->olddate = c->view->date;
|
||||
c->view->date = gotodate;
|
||||
paint_selection(c);
|
||||
}
|
||||
else {
|
||||
/* repaint the entire canvas */
|
||||
c->view->olddate = c->view->date;
|
||||
c->view->date = gotodate;
|
||||
c->view->nwks = numwks(c->view->date);
|
||||
XtVaGetValues(c->canvas, XmNwidth, &w, XmNheight, &h, NULL);
|
||||
gr_clear_area(c->xcontext, 0, 0, w, h);
|
||||
if (c->view->glance == dayGlance) {
|
||||
init_mo(c);
|
||||
init_dayview(c);
|
||||
}
|
||||
paint_canvas(c, NULL, RENDER_UNMAP);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_cancel_cb(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XmPushButtonCallbackStruct *cbs)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Goto *g;
|
||||
|
||||
g = (Goto *)c->goTo;
|
||||
|
||||
XmTextSetString(g->datetext, "");
|
||||
|
||||
XtPopdown(g->frame);
|
||||
|
||||
return;
|
||||
}
|
||||
50
cde/programs/dtcm/dtcm/goto.h
Normal file
50
cde/programs/dtcm/dtcm/goto.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** goto.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)goto.h 1.6 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: goto.h /main/3 1995/11/03 10:27:45 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _GOTO_H
|
||||
#define _GOTO_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
|
||||
typedef struct {
|
||||
Widget frame;
|
||||
Widget form;
|
||||
Widget datelabel;
|
||||
Widget datetext;
|
||||
Widget datebutton;
|
||||
Widget cancelbutton;
|
||||
Widget helpbutton;
|
||||
Widget goto_message;
|
||||
}Goto;
|
||||
|
||||
extern caddr_t make_goto P((Calendar*));
|
||||
|
||||
#define DATESIZ 40
|
||||
|
||||
#endif
|
||||
654
cde/programs/dtcm/dtcm/graphics.c
Normal file
654
cde/programs/dtcm/dtcm/graphics.c
Normal file
@@ -0,0 +1,654 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** graphics.c
|
||||
**
|
||||
** $XConsortium: graphics.c /main/3 1995/11/03 10:27:52 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)graphics.c 1.23 94/11/29 Copyr 1994 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/param.h> /* MAXPATHLEN defined here */
|
||||
#ifdef SVR4
|
||||
#include <sys/utsname.h> /* SYS_NMLN */
|
||||
#endif /* SVR4 */
|
||||
#include <limits.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <netinet/in.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/DrawingA.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/ManagerP.h>
|
||||
#include <Xm/GadgetP.h>
|
||||
#include "util.h"
|
||||
#include "misc.h"
|
||||
#include "timeops.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
#include "props_pu.h"
|
||||
/*
|
||||
#include "select.h"
|
||||
*/
|
||||
/*
|
||||
#include "editor.h"
|
||||
#include "graphics.h"
|
||||
*/
|
||||
#include "browser.h"
|
||||
#include "blist.h"
|
||||
/*
|
||||
#include "alarm.h"
|
||||
#include "dayglance.h"
|
||||
#include "yearglance.h"
|
||||
#include "weekglance.h"
|
||||
*/
|
||||
#include "calendar.h"
|
||||
/*
|
||||
#include "todo.h"
|
||||
*/
|
||||
#include "find.h"
|
||||
#include "goto.h"
|
||||
#include "tempbr.h"
|
||||
/*
|
||||
#include "gettext.h"
|
||||
#include "namesvc.h"
|
||||
#include "monthglance.h"
|
||||
*/
|
||||
|
||||
#define gray_data_75_width 8
|
||||
#define gray_data_75_height 8
|
||||
#define gray_data_50_width 8
|
||||
#define gray_data_50_height 8
|
||||
#define gray_data_25_width 8
|
||||
#define gray_data_25_height 8
|
||||
#define black_data_width 8
|
||||
#define black_data_height 8
|
||||
|
||||
#define solid_list_length 2
|
||||
#define short_dotted_list_length 2
|
||||
#define dotted_list_length 2
|
||||
#define dot_dashed_list_length 4
|
||||
#define short_dashed_list_length 2
|
||||
#define long_dashed_list_length 2
|
||||
#define odd_dashed_list_length 3
|
||||
static unsigned char black_data[] = {
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF
|
||||
};
|
||||
static unsigned char gray_data_75[] = {
|
||||
0xDD,
|
||||
0xBB,
|
||||
0xEE,
|
||||
0xF7,
|
||||
0xDD,
|
||||
0xBB,
|
||||
0xEE,
|
||||
0xF7
|
||||
};
|
||||
|
||||
static unsigned char gray_data_50[] = {
|
||||
0xAA,
|
||||
0x55,
|
||||
0xAA,
|
||||
0x55,
|
||||
0xAA,
|
||||
0x55,
|
||||
0xAA,
|
||||
0x55
|
||||
};
|
||||
|
||||
static unsigned char gray_data_25[] = {
|
||||
0x88,
|
||||
0x22,
|
||||
0x44,
|
||||
0x11,
|
||||
0x88,
|
||||
0x22,
|
||||
0x44,
|
||||
0x11
|
||||
};
|
||||
|
||||
static Pixmap black_data_pixmap = NULL;
|
||||
static Pixmap gray_data_75_pixmap = NULL;
|
||||
static Pixmap gray_data_50_pixmap = NULL;
|
||||
static Pixmap gray_data_25_pixmap = NULL;
|
||||
|
||||
static unsigned char solid[solid_list_length] = {1, 0};
|
||||
static unsigned char short_dotted[short_dotted_list_length] = {1, 1};
|
||||
static unsigned char dotted[dotted_list_length] = {3, 1};
|
||||
static unsigned char dot_dashed[dot_dashed_list_length] = {3, 4, 3, 1};
|
||||
static unsigned char short_dashed[short_dashed_list_length] = {4, 4};
|
||||
static unsigned char long_dashed[long_dashed_list_length] = {4, 7};
|
||||
static unsigned char odd_dashed[odd_dashed_list_length] = {1, 2, 3};
|
||||
|
||||
static unsigned char *dash_list[] = {
|
||||
solid,
|
||||
short_dotted,
|
||||
dotted,
|
||||
dot_dashed,
|
||||
short_dashed,
|
||||
long_dashed,
|
||||
odd_dashed,
|
||||
};
|
||||
|
||||
extern void
|
||||
gr_clear_area(new_XContext *xc, int x, int y, Dimension w, Dimension h) {
|
||||
|
||||
XFillRectangle(xc->display, xc->xid, xc->clear_gc, x, y, w, h);
|
||||
/*
|
||||
XClearArea(xc->display, xc->xid, x, y, w, h, False);
|
||||
*/
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_clear_box (new_XContext *xc, int x, int y, int w, int h) {
|
||||
|
||||
x+=1; y+=1; w-=1; h-=1;
|
||||
|
||||
XFillRectangle(xc->display, xc->xid, xc->clear_gc, x, y, w, h);
|
||||
/*
|
||||
XClearArea(xc->display, xc->xid, x, y, w, h, False);
|
||||
*/
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_make_grayshade(new_XContext *xc, int x, int y, int w, int h, int shade) {
|
||||
|
||||
XColor colorcell_del, rgb_db_ref;
|
||||
|
||||
XSetForeground((Display*)xc->display, (GC)xc->gc, (unsigned long)xc->colorcell_del[shade].pixel);
|
||||
|
||||
XSetFillStyle(xc->display, xc->gc, FillSolid);
|
||||
XFillRectangle(xc->display, xc->xid, xc->gc, x, y, w, h);
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_make_gray(new_XContext *xc, int x, int y, int w, int h, int percent) {
|
||||
|
||||
/* Set up gray stipple */
|
||||
switch(percent) {
|
||||
case 25:
|
||||
XSetStipple(xc->display, xc->gc, gray_data_25_pixmap);
|
||||
break;
|
||||
case 50:
|
||||
XSetStipple(xc->display, xc->gc, gray_data_50_pixmap);
|
||||
break;
|
||||
case 75:
|
||||
XSetStipple(xc->display, xc->gc, gray_data_75_pixmap);
|
||||
break;
|
||||
default:
|
||||
XSetStipple(xc->display, xc->gc, gray_data_25_pixmap);
|
||||
break;
|
||||
}
|
||||
|
||||
XSetForeground(xc->display, xc->gc, xc->foreground);
|
||||
XSetFillStyle(xc->display, xc->gc, FillOpaqueStippled);
|
||||
XFillRectangle(xc->display, xc->xid, xc->gc, x, y, w, h);
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_make_rgbcolor(new_XContext *xc, Colormap cms, int x, int y, int w, int h,
|
||||
int r, int g, int b) {
|
||||
|
||||
XColor colorcell_del;
|
||||
|
||||
colorcell_del.red = (unsigned short)(r<<8);
|
||||
colorcell_del.green = (unsigned short)(g<<8);
|
||||
colorcell_del.blue = (unsigned short)(b<<8);
|
||||
XAllocColor(xc->display, cms, &colorcell_del);
|
||||
|
||||
XSetForeground((Display*)xc->display, (GC)xc->gc,
|
||||
(unsigned long)colorcell_del.pixel);
|
||||
XSetFillStyle(xc->display, xc->gc, FillSolid);
|
||||
XFillRectangle(xc->display, xc->xid, xc->gc, x, y, w, h);
|
||||
}
|
||||
|
||||
extern int
|
||||
gr_nchars(int area, char *str, Cal_Font *font) {
|
||||
|
||||
char *buf;
|
||||
int i, l, w=0, n=0;
|
||||
int first = 1;
|
||||
int len = cm_strlen(str);
|
||||
int nop, width;
|
||||
|
||||
CalTextExtents(font, str, len, &nop, &nop, &width, &nop);
|
||||
if (width <= area)
|
||||
return(strlen(str));
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
if ( first ) {
|
||||
buf = (char *)cm_mbchar(str);
|
||||
first = 0;
|
||||
} else {
|
||||
buf = (char *)cm_mbchar((char *)NULL);
|
||||
}
|
||||
l = cm_strlen(buf);
|
||||
CalTextExtents(font, buf, l, &nop, &nop, &width, &nop);
|
||||
w += width;
|
||||
if (w <= area)
|
||||
n += mblen(buf, MB_LEN_MAX);
|
||||
else break;
|
||||
}
|
||||
return(n);
|
||||
}
|
||||
|
||||
void
|
||||
gr_draw_rgb_box(
|
||||
new_XContext *xc,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
int thickness,
|
||||
int shade,
|
||||
Colormap cms)
|
||||
|
||||
{
|
||||
XColor colorcell_del, rgb_db_ref;
|
||||
unsigned long pixel;
|
||||
int gc_changed = 0;
|
||||
|
||||
switch(shade) {
|
||||
case RED:
|
||||
/*
|
||||
XGetGCValues(xc->display, xc->gc,
|
||||
GCForeground|GCFillStyle, xc->gcvals);
|
||||
*/
|
||||
pixel = xc->colorcell_del[RED].pixel;
|
||||
break;
|
||||
default:
|
||||
pixel = shade;
|
||||
break;
|
||||
}
|
||||
|
||||
XSetForeground((Display*)xc->display, (GC)xc->gc, pixel);
|
||||
XSetFillStyle(xc->display, xc->gc, FillSolid);
|
||||
|
||||
for (;thickness > 0; thickness--) {
|
||||
XDrawRectangle(xc->display, xc->xid, xc->gc, x, y, w, h);
|
||||
x++; y++;
|
||||
w -= 2; h -=2;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
gr_dissolve_box(
|
||||
new_XContext *xc,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
int thickness)
|
||||
{
|
||||
for (;thickness > 0; thickness--) {
|
||||
XDrawRectangle(xc->display, xc->xid, xc->clear_gc, x, y, w, h);
|
||||
x++; y++;
|
||||
w -= 2; h -=2;
|
||||
}
|
||||
}
|
||||
|
||||
/* given an area of a certain length (in pixels), compute
|
||||
where to lay down a string such that it's centered */
|
||||
|
||||
extern int
|
||||
gr_center(int area, char *str, Cal_Font *font) {
|
||||
|
||||
int i, strl, l, w, first = 1;
|
||||
int nop, width;
|
||||
char *buf;
|
||||
|
||||
w = 0;
|
||||
strl = cm_strlen(str);
|
||||
for (i=0; i<strl; i++) {
|
||||
if ( first ) {
|
||||
buf = (char*)cm_mbchar(str);
|
||||
first = 0;
|
||||
} else {
|
||||
buf = (char*)cm_mbchar((char *)NULL);
|
||||
}
|
||||
l = cm_strlen(buf);
|
||||
CalTextExtents(font, buf, l, &nop, &nop, &width, &nop);
|
||||
w += width;
|
||||
}
|
||||
return ((area - w)/2);
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_text(new_XContext *xc, int x, int y, Cal_Font *font, char *str,
|
||||
XRectangle *rect) {
|
||||
|
||||
int len = cm_strlen(str);
|
||||
int x2, y2, w, h;
|
||||
XRectangle overall_ink_return;
|
||||
|
||||
if (rect != NULL) {
|
||||
CalTextExtents(font, str, len, &x2, &y2, &w, &h);
|
||||
|
||||
overall_ink_return.x = x2 + rect->x;
|
||||
overall_ink_return.y = y2 + rect->y;
|
||||
overall_ink_return.width = w;
|
||||
overall_ink_return.height = h;
|
||||
|
||||
if (!myrect_intersectsrect(rect, &overall_ink_return))
|
||||
return;
|
||||
}
|
||||
CalDrawString(xc->display, xc->xid, font, xc->draw_gc, x, y,
|
||||
str, cm_strlen(str));
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_text_rgb(new_XContext *xc, int x, int y, Cal_Font *font, char *str,
|
||||
Pixel shade, Colormap cms, XRectangle *rect) {
|
||||
|
||||
XRectangle overall_ink_return;
|
||||
int x2, y2, w, h;
|
||||
|
||||
if (rect != NULL) {
|
||||
CalTextExtents(font, str, cm_strlen(str), &x2, &y2, &w, &h);
|
||||
|
||||
overall_ink_return.x = x2 + rect->x;
|
||||
overall_ink_return.y = y2 + rect->y;
|
||||
overall_ink_return.width = w;
|
||||
overall_ink_return.height = h;
|
||||
|
||||
if (!myrect_intersectsrect(rect, &overall_ink_return))
|
||||
return;
|
||||
}
|
||||
|
||||
XSetForeground((Display*)xc->display, (GC)xc->gc,
|
||||
(unsigned long)shade);
|
||||
|
||||
CalDrawString(xc->display, xc->xid, font, xc->gc, x, y,
|
||||
str, cm_strlen(str));
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_draw_line(new_XContext *xc, int x1, int y1, int x2, int y2,
|
||||
GR_Line_Style style, XRectangle *rect) {
|
||||
|
||||
int dash_offset = 0;
|
||||
|
||||
if (rect != NULL) {
|
||||
XRectangle gr_rect;
|
||||
|
||||
gr_rect.x = x1;
|
||||
gr_rect.y = y1;
|
||||
gr_rect.width = x2-x1;
|
||||
gr_rect.height = y2-y1;
|
||||
|
||||
if (!myrect_intersectsrect(rect, &gr_rect))
|
||||
return;
|
||||
}
|
||||
if (style==gr_solid) {
|
||||
XDrawLine(xc->display, xc->xid, xc->draw_gc, x1, y1, x2,
|
||||
y2);
|
||||
}
|
||||
else {
|
||||
/* Set up and paint */
|
||||
XSetForeground(xc->display, xc->gc, xc->foreground);
|
||||
XSetDashes(xc->display, xc->gc, dash_offset,
|
||||
(char *)dash_list[style],
|
||||
short_dotted_list_length);
|
||||
XSetLineAttributes(xc->display, xc->gc, 0,
|
||||
LineOnOffDash, CapNotLast, JoinMiter);
|
||||
XDrawLine(xc->display, xc->xid, xc->gc, x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_draw_box(new_XContext *xc, int x, int y, int w, int h, XRectangle *rect) {
|
||||
|
||||
if (rect != NULL) {
|
||||
XRectangle gr_rect;
|
||||
|
||||
gr_rect.x = x;
|
||||
gr_rect.y = y;
|
||||
gr_rect.width = w;
|
||||
gr_rect.height = h;
|
||||
|
||||
if (!myrect_intersectsrect(rect, &gr_rect))
|
||||
return;
|
||||
}
|
||||
XDrawRectangle(xc->display, xc->xid, xc->draw_gc, x, y, w, h);
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_draw_glyph(new_XContext *src_xc, new_XContext *dst_xc, Pixmap pixmap,
|
||||
int x, int y, int w, int h) {
|
||||
|
||||
XSetStipple(src_xc->display, src_xc->gc, pixmap);
|
||||
XSetTSOrigin(src_xc->display, src_xc->gc, x, y);
|
||||
XFillRectangle(src_xc->display, dst_xc->xid, src_xc->gc, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
saturate(XColor *xclr)
|
||||
|
||||
{
|
||||
unsigned short n;
|
||||
|
||||
n = MAX(xclr->red, xclr->green);
|
||||
n = MAX(n, xclr->blue);
|
||||
|
||||
n = USHRT_MAX - n;
|
||||
|
||||
xclr->red += n;
|
||||
xclr->blue += n;
|
||||
xclr->green += n;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and initialize an XContext
|
||||
*/
|
||||
new_XContext *
|
||||
gr_create_xcontext(Calendar *c, Widget widget, GR_depth depth, XtAppContext app)
|
||||
{
|
||||
|
||||
new_XContext *xc;
|
||||
Colormap cms = NULL;
|
||||
XGCValues gc_vals, tmp_vals;
|
||||
GC hilight_gc;
|
||||
XColor exact_color;
|
||||
XColor def_color;
|
||||
|
||||
/* X Drawing Stuff */
|
||||
if ((xc = (new_XContext *) ckalloc(sizeof(new_XContext))) == NULL)
|
||||
return NULL;
|
||||
|
||||
xc->display = (Display *) XtDisplay(widget);
|
||||
xc->app = app;
|
||||
|
||||
if (depth == gr_mono) {
|
||||
xc->foreground = 1;
|
||||
xc->background = 0;
|
||||
xc->hilight_color = 1;
|
||||
} else {
|
||||
XtVaGetValues(widget,
|
||||
XmNbackground, &xc->background,
|
||||
XmNforeground, &xc->foreground,
|
||||
NULL);
|
||||
/*
|
||||
* XXX EEEEEEK! We use a private interface to get the
|
||||
* hilight color. We do this because there is no public
|
||||
* interface.
|
||||
*/
|
||||
hilight_gc = XmParentHighlightGC(widget);
|
||||
XGetGCValues(xc->display, hilight_gc, GCForeground, &tmp_vals);
|
||||
xc->hilight_color = tmp_vals.foreground;
|
||||
}
|
||||
|
||||
xc->xid = XtWindowOfObject(widget);
|
||||
xc->screen_depth = DefaultDepthOfScreen(XtScreen(widget));
|
||||
|
||||
/*
|
||||
* Create general purpose gc. This gc is changed as needed by
|
||||
* the drawing routines.
|
||||
*/
|
||||
xc->gcvals = (XGCValues *) ckalloc(sizeof(XGCValues));
|
||||
xc->gcvals->foreground = xc->foreground;
|
||||
xc->gcvals->background = xc->background;
|
||||
|
||||
xc->gcvals->fill_style = FillOpaqueStippled;
|
||||
xc->gc = XCreateGC(
|
||||
xc->display,
|
||||
xc->xid,
|
||||
GCForeground|GCBackground|GCFillStyle,
|
||||
xc->gcvals);
|
||||
|
||||
/*
|
||||
* Specialized GCs. We create a couple of specialized GCs to increase
|
||||
* the speed of common operations. This way we don't need to change
|
||||
* the GC for every operation.
|
||||
*/
|
||||
|
||||
/* GC used for clearing */
|
||||
gc_vals.foreground = xc->background;
|
||||
xc->clear_gc = XCreateGC(xc->display, xc->xid, GCForeground, &gc_vals);
|
||||
|
||||
/* Create GC used for inverting */
|
||||
gc_vals.foreground = xc->background;
|
||||
gc_vals.function = GXinvert;
|
||||
xc->invert_gc = XCreateGC(xc->display, xc->xid,
|
||||
GCForeground | GCFunction, &gc_vals);
|
||||
XSetSubwindowMode(xc->display, xc->invert_gc, IncludeInferiors);
|
||||
|
||||
/* Create GC used for drawing */
|
||||
gc_vals.function = GXcopy;
|
||||
gc_vals.foreground = xc->foreground;
|
||||
xc->draw_gc = XCreateGC(xc->display, xc->xid, GCForeground | GCFunction,
|
||||
&gc_vals);
|
||||
XSetLineAttributes(xc->display, xc->draw_gc, 0,
|
||||
LineSolid, CapNotLast, JoinMiter);
|
||||
|
||||
return xc;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the clip mask for all gcs the graphics package uses
|
||||
*/
|
||||
|
||||
extern void
|
||||
gr_set_clip_rectangles(new_XContext *xc, int x, int y, XRectangle *rectangles,
|
||||
int n, int ordering) {
|
||||
|
||||
XSetClipRectangles(xc->display, xc->gc, x, y, rectangles, n, ordering);
|
||||
XSetClipRectangles(xc->display, xc->draw_gc,
|
||||
x, y, rectangles, n, ordering);
|
||||
XSetClipRectangles(xc->display, xc->clear_gc,
|
||||
x, y, rectangles, n, ordering);
|
||||
XSetClipRectangles(xc->display, xc->invert_gc,
|
||||
x, y, rectangles, n, ordering);
|
||||
return;
|
||||
}
|
||||
|
||||
extern void
|
||||
gr_clear_clip_rectangles(new_XContext *xc) {
|
||||
|
||||
XSetClipMask(xc->display, xc->gc, None);
|
||||
XSetClipMask(xc->display, xc->draw_gc, None);
|
||||
XSetClipMask(xc->display, xc->clear_gc, None);
|
||||
XSetClipMask(xc->display, xc->invert_gc, None);
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
gr_create_stipple(new_XContext *xc, unsigned char *data, int datawidth, int dataheight,
|
||||
Pixmap *stipple, unsigned int *width, unsigned int *height) {
|
||||
|
||||
|
||||
Boolean ok = True;
|
||||
|
||||
if ((*stipple = XCreateBitmapFromData(xc->display,
|
||||
xc->xid,
|
||||
/* RootWindow(xc->display, DefaultScreen(xc->display)), */
|
||||
(char *)data, datawidth, dataheight)) == NULL) {
|
||||
ok = False;
|
||||
}
|
||||
else {
|
||||
*width = datawidth;
|
||||
*height = dataheight;
|
||||
}
|
||||
return(ok);
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
gr_init(new_XContext *xc, Widget canvas) {
|
||||
|
||||
unsigned int width, height;
|
||||
Boolean ok = True;
|
||||
XColor rgb_db_ref;
|
||||
|
||||
Display *dpy = XtDisplay(canvas);
|
||||
int scr = DefaultScreen(dpy);
|
||||
Colormap cmap = DefaultColormap(dpy, scr);
|
||||
|
||||
ok = gr_create_stipple(xc, black_data,
|
||||
black_data_width, black_data_height,
|
||||
&black_data_pixmap, &width, &height);
|
||||
ok = gr_create_stipple(xc, gray_data_75,
|
||||
gray_data_75_width, gray_data_75_height,
|
||||
&gray_data_75_pixmap, &width, &height);
|
||||
ok = gr_create_stipple(xc, gray_data_50,
|
||||
gray_data_50_width, gray_data_50_height,
|
||||
&gray_data_50_pixmap, &width, &height);
|
||||
ok = gr_create_stipple(xc, gray_data_25,
|
||||
gray_data_25_width, gray_data_25_height,
|
||||
&gray_data_25_pixmap, &width, &height);
|
||||
|
||||
ok = XAllocNamedColor(dpy, cmap,
|
||||
"dark slate grey", &xc->colorcell_del[DARKGREY], &rgb_db_ref);
|
||||
ok = XAllocNamedColor(dpy, cmap,
|
||||
"dim grey", &xc->colorcell_del[DIMGREY], &rgb_db_ref);
|
||||
ok = XAllocNamedColor(dpy, cmap,
|
||||
"grey", &xc->colorcell_del[GREY], &rgb_db_ref);
|
||||
ok = XAllocNamedColor(dpy, cmap,
|
||||
"light grey", &xc->colorcell_del[LIGHTGREY], &rgb_db_ref);
|
||||
ok = XAllocNamedColor(dpy, cmap,
|
||||
"red", &xc->colorcell_del[RED], &rgb_db_ref);
|
||||
|
||||
return(ok);
|
||||
}
|
||||
1992
cde/programs/dtcm/dtcm/group_editor.c
Normal file
1992
cde/programs/dtcm/dtcm/group_editor.c
Normal file
File diff suppressed because it is too large
Load Diff
125
cde/programs/dtcm/dtcm/group_editor.h
Normal file
125
cde/programs/dtcm/dtcm/group_editor.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** group_editor.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)group_editor.h 1.24 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: group_editor.h /main/4 1996/05/23 11:18:16 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _GEDITOR_H
|
||||
#define _GEDITOR_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "util.h"
|
||||
#include "calendar.h"
|
||||
#include "misc.h"
|
||||
#include "dssw.h"
|
||||
#include "rfp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Group Editor structures
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
int appt_count;
|
||||
CSA_entry_handle *appt_head;
|
||||
char *name;
|
||||
CSA_session_handle cal_handle;
|
||||
int version;
|
||||
unsigned int entry_access;
|
||||
} Access_data;
|
||||
|
||||
/*
|
||||
** An entry in this structure will point to the big list in the Access_data
|
||||
** structure
|
||||
*/
|
||||
typedef struct {
|
||||
int entry_idx;
|
||||
Tick tick;
|
||||
Access_data *ad;
|
||||
} List_data;
|
||||
|
||||
typedef struct {
|
||||
CmDataList *access_data;
|
||||
Widget access_list;
|
||||
Widget access_list_label;
|
||||
Widget access_list_sw;
|
||||
Widget appt_list;
|
||||
Widget appt_list_label;
|
||||
Widget appt_list_sw;
|
||||
Widget base_form_mgr;
|
||||
Widget button_rc_mgr;
|
||||
Calendar *cal;
|
||||
Widget change_button;
|
||||
Widget clear_button;
|
||||
Widget close_button;
|
||||
Widget delete_button;
|
||||
DSSW dssw;
|
||||
int dsswFlags;
|
||||
Widget expand_ui_button;
|
||||
Widget frame;
|
||||
Boolean geditor_is_up;
|
||||
Widget help_button;
|
||||
Widget insert_button;
|
||||
CmDataList *list_data;
|
||||
Widget mail_button;
|
||||
Widget message_text;
|
||||
RFP rfp;
|
||||
int rfpFlags;
|
||||
Widget separator1;
|
||||
Widget separator2;
|
||||
Pixmap drag_bitmap;
|
||||
Pixmap drag_mask;
|
||||
Widget drag_icon;
|
||||
Widget drag_source;
|
||||
int initialX;
|
||||
int initialY;
|
||||
Boolean doing_drag;
|
||||
} GEditor;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Group Editor external function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void add_to_gaccess_list P((char*, CSA_session_handle,
|
||||
unsigned int, int, GEditor*,
|
||||
Boolean));
|
||||
extern void add_all_gappt P((GEditor*));
|
||||
extern void geditor_clean_up P((GEditor*));
|
||||
extern CSA_entry_handle geditor_nth_appt P((GEditor*, int,
|
||||
Access_data**));
|
||||
extern Boolean geditor_showing P((GEditor*));
|
||||
extern void get_geditor_vals P((GEditor*));
|
||||
extern void remove_all_gaccess_data P((GEditor*));
|
||||
extern void remove_all_gaccess P((GEditor*));
|
||||
extern void remove_from_gaccess_list P((char*, GEditor*));
|
||||
extern void set_geditor_defaults P((GEditor*, Tick, Tick));
|
||||
extern void set_geditor_title P((GEditor*, char*));
|
||||
extern void set_geditor_vals P((GEditor*, Tick, Tick));
|
||||
extern void show_geditor P((Calendar*, Tick, Tick));
|
||||
|
||||
#endif
|
||||
216
cde/programs/dtcm/dtcm/help.c
Normal file
216
cde/programs/dtcm/dtcm/help.c
Normal file
@@ -0,0 +1,216 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** help.c
|
||||
**
|
||||
** $XConsortium: help.c /main/7 1996/04/19 15:47:41 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)help.c 1.19 95/03/28 Copyr 1991 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h> /* MAXPATHLEN defined here */
|
||||
#ifdef SVR4
|
||||
#include <sys/utsname.h> /* SYS_NMLN */
|
||||
#endif /* SVR4 specific includes */
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/signal.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <netinet/in.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleB.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
#include <Dt/HelpDialog.h>
|
||||
#include "calendar.h"
|
||||
#include "revision.h"
|
||||
#include "help.h"
|
||||
#include "props_pu.h"
|
||||
|
||||
static void display_help(Calendar *, ArgList, int);
|
||||
|
||||
static void
|
||||
display_help(Calendar *c, ArgList args, int nargs)
|
||||
{
|
||||
if (!c->mainhelpdialog)
|
||||
{
|
||||
Arg oneArg;
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 1076, "Calendar : Help"));
|
||||
|
||||
XtSetArg(oneArg, XmNtitle, title);
|
||||
c->mainhelpdialog =
|
||||
(Widget)DtCreateHelpDialog(c->frame, "mainhelpdialog", &oneArg, 1);
|
||||
XtFree(title);
|
||||
}
|
||||
|
||||
XtSetValues(c->mainhelpdialog, args, nargs);
|
||||
XtManageChild(c->mainhelpdialog);
|
||||
}
|
||||
|
||||
void show_main_help(Widget w, XtPointer clientData, XtPointer cbs)
|
||||
{
|
||||
int ac;
|
||||
Arg al[10];
|
||||
Calendar *c = calendar;
|
||||
Props_pu *p = (Props_pu *) c->properties_pu;
|
||||
Widget selWidget = NULL;
|
||||
int status = DtHELP_SELECT_ERROR;
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
|
||||
switch ((int)clientData) {
|
||||
case HELP_OVERVIEW:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
|
||||
break;
|
||||
case HELP_USINGHELP:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
|
||||
break;
|
||||
case HELP_TASKS:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "TASKS"); ac++;
|
||||
break;
|
||||
case HELP_REFERENCE:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "REFERENCE"); ac++;
|
||||
break;
|
||||
case HELP_ABOUTCALENDAR:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "_COPYRIGHT"); ac++;
|
||||
break;
|
||||
case HELP_TOC:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "TOC"); ac++;
|
||||
break;
|
||||
case HELP_ONITEM:
|
||||
while (!XtIsSubclass(w, applicationShellWidgetClass))
|
||||
w = XtParent(w);
|
||||
|
||||
status = DtHelpReturnSelectedWidgetId(w, NULL, &selWidget);
|
||||
switch ((int)status)
|
||||
{
|
||||
case DtHELP_SELECT_ERROR:
|
||||
printf(catgets(c->DT_catd, 1, 350, "Selection Error, cannot continue\n"));
|
||||
break;
|
||||
case DtHELP_SELECT_VALID:
|
||||
while (selWidget != NULL)
|
||||
{
|
||||
if ((XtHasCallbacks(selWidget, XmNhelpCallback) == XtCallbackHasSome))
|
||||
{
|
||||
XtCallCallbacks((Widget)selWidget,
|
||||
XmNhelpCallback,NULL);
|
||||
break;
|
||||
}
|
||||
else
|
||||
selWidget = XtParent(selWidget);
|
||||
}
|
||||
break;
|
||||
case DtHELP_SELECT_ABORT:
|
||||
return;
|
||||
|
||||
case DtHELP_SELECT_INVALID:
|
||||
{
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 110, "Calendar : Error - Help"));
|
||||
char *text = XtNewString(catgets(c->DT_catd, 1, 352, "You must select a component within your application."));
|
||||
char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
|
||||
dialog_popup(c->frame,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, text,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
DIALOG_IMAGE, p->xm_error_pixmap,
|
||||
NULL);
|
||||
XtFree(ident1);
|
||||
XtFree(text);
|
||||
XtFree(title);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
|
||||
break;
|
||||
}
|
||||
|
||||
display_help(c, al, ac);
|
||||
}
|
||||
|
||||
extern void
|
||||
help_cb(Widget w, XtPointer clientData, XtPointer callData)
|
||||
{
|
||||
int ac;
|
||||
Arg al[10];
|
||||
Calendar *c = calendar;
|
||||
char *locationid = (char *) clientData;
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
|
||||
XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
|
||||
XtSetArg(al[ac], DtNlocationId, locationid); ac++;
|
||||
|
||||
display_help(c, al, ac);
|
||||
}
|
||||
|
||||
/* special case where we must determine the view */
|
||||
extern void
|
||||
help_view_cb(Widget w, XtPointer clientData, XtPointer callData)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
|
||||
switch (c->view->glance) {
|
||||
case dayGlance:
|
||||
help_cb(w, (XtPointer)CALENDAR_HELP_DAY_WINDOW, callData);
|
||||
break;
|
||||
case weekGlance:
|
||||
help_cb(w, (XtPointer)CALENDAR_HELP_WEEK_WINDOW, callData);
|
||||
break;
|
||||
case monthGlance:
|
||||
help_cb(w, (XtPointer)CALENDAR_HELP_MONTH_WINDOW, callData);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
101
cde/programs/dtcm/dtcm/help.h
Normal file
101
cde/programs/dtcm/dtcm/help.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** help.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)help.h 1.16 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: help.h /main/5 1996/10/08 14:12:28 barstow $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _HELP_H
|
||||
#define _HELP_H
|
||||
|
||||
/* for help */
|
||||
#define HELP_OVERVIEW 100
|
||||
#define HELP_TASKS 101
|
||||
#define HELP_REFERENCE 102
|
||||
#define HELP_ONITEM 103
|
||||
#define HELP_USINGHELP 104
|
||||
#define HELP_ABOUTCALENDAR 105
|
||||
#define HELP_TOC 106
|
||||
|
||||
/* location id's for on item help */
|
||||
#define CALENDAR_HELP_FILE_BUTTON "CalendarFileMenu"
|
||||
#define CALENDAR_HELP_EDIT_BUTTON "CalendarEditMenu"
|
||||
#define CALENDAR_HELP_VIEW_BUTTON "CalendarViewMenu"
|
||||
#define CALENDAR_HELP_BROWSE_BUTTON "CalendarBrowseMenu"
|
||||
#define CALENDAR_HELP_HELP_BUTTON "CalendarHelpMenu"
|
||||
#define CALENDAR_HELP_APPT_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_TODO_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_PREV_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_NEXT_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_TODAY_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_DAY_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_WEEK_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_MONTH_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_YEAR_BUTTON "CalendarToolBar"
|
||||
#define CALENDAR_HELP_MONTH_WINDOW "CalendarMonthWindow"
|
||||
#define CALENDAR_HELP_WEEK_WINDOW "CalendarWeekWindow"
|
||||
#define CALENDAR_HELP_DAY_WINDOW "CalendarDayWindow"
|
||||
#define CALENDAR_HELP_YEAR_WINDOW "CalendarYearWindow"
|
||||
|
||||
/* help buttons for popups */
|
||||
#define OPTIONS_HELP_BUTTON "CalendarOptionsCategoryDialog"
|
||||
#define APPT_EDITOR_HELP_BUTTON "CalendarApptEditorDialog"
|
||||
#define TODO_EDITOR_HELP_BUTTON "CalendarToDoEditorDialog"
|
||||
#define FIND_HELP_BUTTON "CalendarFindDialog"
|
||||
#define GOTO_HELP_BUTTON "CalendarGotoDateDialog"
|
||||
#define SHOW_OTHER_CAL_HELP_BUTTON "CalendarShowOtherCalendarDialog"
|
||||
#define COMPARE_CALS_HELP_BUTTON "CalendarCompareCalsDialog"
|
||||
#define MENU_EDITOR_HELP_BUTTON "CalendarMenuEditorDialog"
|
||||
#define GROUP_APPT_EDITOR_HELP_BUTTON "CalendarGroupApptEditorDialog"
|
||||
#define APPT_LIST_HELP_BUTTON "CalendarApptListDialog"
|
||||
#define TODO_LIST_HELP_BUTTON "CalendarTodoListDialog"
|
||||
#define PRINT_HELP_BUTTON "CalendarPrintDialog"
|
||||
#define TIMEZONE_HELP_BUTTON "CalendarTimeZoneDialog"
|
||||
|
||||
/* help buttons for popups */
|
||||
#define CMSD_ERROR_HELP "CalendarCmsdError"
|
||||
#define CAL_LOCATION_ERROR_HELP "CalendarLocationError"
|
||||
#define DND_ERROR_HELP "CalendarDnDError"
|
||||
#define RESELECT_ERROR_HELP "CalendarReselectError"
|
||||
#define DATE_ERROR_HELP "CalendarDateFieldError"
|
||||
#define START_ERROR_HELP "CalendarStartFieldError"
|
||||
#define STOP_ERROR_HELP "CalendarStopFieldError"
|
||||
#define MISSING_FIELD_ERROR_HELP "CalendarMissingFieldError"
|
||||
#define REPEAT_FOR_ERROR_HELP "CalendarRepeatForFieldError"
|
||||
#define NO_TIME_ERROR_HELP "CalendarNoTimeError"
|
||||
#define BACK_END_ERROR_HELP "CalendarBackEndError"
|
||||
#define MEMORY_ALLOC_ERROR_HELP "CalendarMemoryAllocError"
|
||||
#define ACCESS_RIGHTS_ERROR_HELP "CalendarAccessRightsError"
|
||||
#define DESKSET_DEFAULTS_ERROR_HELP "CalendarDesksetDefaultsError"
|
||||
#define DURATION_ERROR_HELP "CalendarDurationError"
|
||||
#define ADVANCE_ERROR_HELP "CalendarAdvanceError"
|
||||
|
||||
extern void show_main_help P((Widget, XtPointer, XtPointer));
|
||||
extern void help_cb P((Widget, XtPointer, XtPointer));
|
||||
extern void help_view_cb P((Widget, XtPointer, XtPointer));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
184
cde/programs/dtcm/dtcm/i18nxlate.c
Normal file
184
cde/programs/dtcm/dtcm/i18nxlate.c
Normal file
@@ -0,0 +1,184 @@
|
||||
/* $XConsortium: i18nxlate.c /main/5 1995/11/09 13:00:30 rswiston $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <LocaleXlate.h> /* under DtHelp, for Operation constants */
|
||||
|
||||
#ifndef True
|
||||
#define True 1
|
||||
#endif
|
||||
#ifndef False
|
||||
#define False 0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Wrapper functions taken from libHelp/CEUtil.c
|
||||
*
|
||||
* We took these functions and renamed them because
|
||||
* 1. Originally these are called _DtHelpCeXlate* and thus they are private
|
||||
* to libHelp and not exported to outside of libHelp.
|
||||
* 2. When these functions are moved to another library, then users of these
|
||||
* functions would only need to link with a different library. The caller
|
||||
* doesn't have to modify code.
|
||||
*/
|
||||
|
||||
static const char *DfltStdCharset = "ISO-8859-1";
|
||||
static const char *DfltStdLang = "C";
|
||||
|
||||
static char MyPlatform[_DtPLATFORM_MAX_LEN+1];
|
||||
static _DtXlateDb MyDb = NULL;
|
||||
char MyProcess = False;
|
||||
char MyFirst = True;
|
||||
int ExecVer;
|
||||
int CompVer;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: static int OpenLcxDb ()
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Return Value: 0: ok
|
||||
* -1: error
|
||||
*
|
||||
* errno Values:
|
||||
*
|
||||
* Purpose: Opens the Ce-private Lcx database
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int
|
||||
OpenLcxDb (void)
|
||||
{
|
||||
time_t time1 = 0;
|
||||
time_t time2 = 0;
|
||||
|
||||
/*
|
||||
* wait 30 sec. until another thread or enter is done modifying the table
|
||||
*/
|
||||
while (MyProcess == True)
|
||||
{
|
||||
/* if time out, return */
|
||||
if (time(&time2) == (time_t)-1)
|
||||
return -1;
|
||||
|
||||
if (time1 == 0)
|
||||
time1 = time2;
|
||||
else if (time2 - time1 >= (time_t)30)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (MyFirst == True)
|
||||
{
|
||||
MyProcess = True;
|
||||
if (_DtLcxOpenAllDbs(&MyDb) == 0 &&
|
||||
_DtXlateGetXlateEnv(MyDb,MyPlatform,&ExecVer,&CompVer) != 0)
|
||||
{
|
||||
_DtLcxCloseDb(&MyDb);
|
||||
MyDb = NULL;
|
||||
}
|
||||
MyFirst = False;
|
||||
MyProcess = False;
|
||||
}
|
||||
|
||||
return (MyDb == NULL ? -1 : 0 );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int DtI18NXlateOpToStdLocale (char *operation, char *opLocale,
|
||||
* char **ret_stdLocale, char **ret_stdLang, char **ret_stdSet)
|
||||
*
|
||||
* Parameters:
|
||||
* operation Operation associated with the locale value
|
||||
* opLocale An operation-specific locale string
|
||||
* ret_locale Returns the std locale
|
||||
* Caller must free this string.
|
||||
* ret_stdLang Returns the std language & territory string.
|
||||
* Caller must free this string.
|
||||
* ret_stdSet Returns the std code set string.
|
||||
* Caller must free this string.
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: Gets the standard locale given an operation and its locale
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtI18NXlateOpToStdLocale (
|
||||
char *operation,
|
||||
char *opLocale,
|
||||
char **ret_stdLocale,
|
||||
char **ret_stdLang,
|
||||
char **ret_stdSet)
|
||||
{
|
||||
OpenLcxDb();
|
||||
|
||||
if (MyDb != NULL)
|
||||
{
|
||||
(void) _DtLcxXlateOpToStd(MyDb, MyPlatform, CompVer,
|
||||
operation,opLocale,
|
||||
ret_stdLocale, ret_stdLang, ret_stdSet, NULL);
|
||||
}
|
||||
|
||||
/* if failed, give default values */
|
||||
if (ret_stdLocale != NULL && *ret_stdLocale == NULL)
|
||||
{
|
||||
*ret_stdLocale = (char *)malloc(strlen(DfltStdLang)+strlen(DfltStdCharset)+3);
|
||||
sprintf(*ret_stdLocale,"%s.%s",DfltStdLang,DfltStdCharset);
|
||||
}
|
||||
if (ret_stdLang != NULL && *ret_stdLang == NULL)
|
||||
*ret_stdLang = (char *)strdup(DfltStdLang);
|
||||
if (ret_stdSet != NULL && *ret_stdSet == NULL)
|
||||
*ret_stdSet = (char *)strdup(DfltStdCharset);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int DtI18NXlateStdToOpLocale ( char *operation, char *stdLocale,
|
||||
* char *dflt_opLocale, char **ret_opLocale)
|
||||
*
|
||||
* Parameters:
|
||||
* operation operation whose locale value will be retrieved
|
||||
* stdLocale standard locale value
|
||||
* dflt_opLocale operation-specific locale-value
|
||||
* This is the default value used in error case
|
||||
* ret_opLocale operation-specific locale-value placed here
|
||||
* Caller must free this string.
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: Gets an operation-specific locale string given the standard string
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtI18NXlateStdToOpLocale (
|
||||
char *operation,
|
||||
char *stdLocale,
|
||||
char *dflt_opLocale,
|
||||
char **ret_opLocale)
|
||||
{
|
||||
OpenLcxDb();
|
||||
|
||||
if (MyDb != NULL)
|
||||
{
|
||||
(void) _DtLcxXlateStdToOp(MyDb, MyPlatform, CompVer,
|
||||
operation, stdLocale, NULL, NULL, NULL, ret_opLocale);
|
||||
}
|
||||
|
||||
/* if translation fails, use a default value */
|
||||
if (ret_opLocale && *ret_opLocale == NULL)
|
||||
{
|
||||
if (dflt_opLocale) *ret_opLocale = (char *)strdup(dflt_opLocale);
|
||||
else if (stdLocale) *ret_opLocale = (char *)strdup(stdLocale);
|
||||
}
|
||||
}
|
||||
|
||||
322
cde/programs/dtcm/dtcm/icon.c
Normal file
322
cde/programs/dtcm/dtcm/icon.c
Normal file
@@ -0,0 +1,322 @@
|
||||
/* $TOG: icon.c /main/5 1998/01/09 15:29:53 cshi $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#define NO_RES_DISPLAY 0
|
||||
#define LOW_RES_DISPLAY 1
|
||||
#define VGA_RES_DISPLAY 2
|
||||
#define MED_RES_DISPLAY 3
|
||||
#define HIGH_RES_DISPLAY 4
|
||||
|
||||
#define DTCM_STD_ICON "IcCM"
|
||||
#define DTCM_INV_ICON "IcCMinv"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include "calendar.h"
|
||||
|
||||
/* XXX: Defined in Xm/IconFile.h but the file isn't installed??? */
|
||||
/*
|
||||
* values for icon magnitude
|
||||
*/
|
||||
#define XmUNSPECIFIED_ICON_SIZE 0
|
||||
#define XmLARGE_ICON_SIZE 1
|
||||
#define XmMEDIUM_ICON_SIZE 2
|
||||
#define XmSMALL_ICON_SIZE 3
|
||||
#define XmTINY_ICON_SIZE 4
|
||||
extern String XmGetIconFileName(
|
||||
Screen *screen,
|
||||
String imageInstanceName,
|
||||
String imageClassName,
|
||||
String hostPrefix,
|
||||
unsigned int size) ;
|
||||
|
||||
/* XXX: Private routines, but what are my other choices? */
|
||||
extern Pixmap _DtGetMask(Screen *screen, char *image_name);
|
||||
extern int _DtGetDisplayResolution(Display *disp, int screen);
|
||||
|
||||
static Boolean load_icon(Calendar *c, IconInfo *icon, char *icon_name, int size, Pixel, Pixel);
|
||||
|
||||
static int
|
||||
wm_icon_preference(
|
||||
Display *dpy,
|
||||
Screen *screen,
|
||||
int size)
|
||||
{
|
||||
int icon_size_count,
|
||||
cal_icon_size,
|
||||
i;
|
||||
XIconSize *icon_sizes;
|
||||
|
||||
if (XGetIconSizes(dpy, XRootWindowOfScreen(screen),
|
||||
&icon_sizes, &icon_size_count) == 0)
|
||||
return (size);
|
||||
|
||||
/* Calendar icons are either 32x32 or 48x48 */
|
||||
if (size == XmLARGE_ICON_SIZE)
|
||||
cal_icon_size = 48;
|
||||
else
|
||||
cal_icon_size = 32;
|
||||
|
||||
for (i = 0; i < icon_size_count; i++) {
|
||||
if (icon_sizes[i].min_width <= cal_icon_size &&
|
||||
icon_sizes[i].max_width >= cal_icon_size &&
|
||||
icon_sizes[i].min_height <= cal_icon_size &&
|
||||
icon_sizes[i].max_height >= cal_icon_size) {
|
||||
|
||||
XFree(icon_sizes);
|
||||
return (size);
|
||||
}
|
||||
}
|
||||
/* If we are here then WM doesn't want us to use this icon
|
||||
* size. If we are using 48x48 then we can see if 32x32 will
|
||||
* work.
|
||||
*/
|
||||
if (size == XmLARGE_ICON_SIZE)
|
||||
cal_icon_size = 32;
|
||||
|
||||
for (i = 0; i < icon_size_count; i++) {
|
||||
if (icon_sizes[i].min_width <= cal_icon_size &&
|
||||
icon_sizes[i].max_width >= cal_icon_size &&
|
||||
icon_sizes[i].min_height <= cal_icon_size &&
|
||||
icon_sizes[i].max_height >= cal_icon_size) {
|
||||
|
||||
XFree(icon_sizes);
|
||||
return (XmMEDIUM_ICON_SIZE);
|
||||
}
|
||||
}
|
||||
XFree(icon_sizes);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* We load two icons. The main icon used when the tool is iconic and an
|
||||
* inverted icon that is used during flashing when a reminder occurs.
|
||||
*/
|
||||
|
||||
static Boolean
|
||||
load_icons(
|
||||
Calendar *c)
|
||||
{
|
||||
Pixel fg, bg;
|
||||
int resolution,
|
||||
size;
|
||||
Screen *screen = XtScreen(c->frame);
|
||||
|
||||
if (!c->icon)
|
||||
c->icon = (IconInfo *) ckalloc(sizeof(IconInfo));
|
||||
if (!c->icon_inverted)
|
||||
c->icon_inverted = (IconInfo *) ckalloc(sizeof(IconInfo));
|
||||
|
||||
XtVaGetValues(c->canvas,
|
||||
XmNforeground, &fg,
|
||||
XmNbackground, &bg,
|
||||
NULL);
|
||||
|
||||
resolution = _DtGetDisplayResolution(XtDisplay(c->frame),
|
||||
XScreenNumberOfScreen(screen));
|
||||
|
||||
/*
|
||||
* The CDE spec says we use a large icon in high and medium
|
||||
* resolution. We use a medium size icon in low res.
|
||||
*/
|
||||
switch (resolution) {
|
||||
case HIGH_RES_DISPLAY:
|
||||
case MED_RES_DISPLAY:
|
||||
size = XmLARGE_ICON_SIZE;
|
||||
break;
|
||||
case LOW_RES_DISPLAY:
|
||||
default:
|
||||
size = XmMEDIUM_ICON_SIZE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* See if the resolution size we have chosen is acceptable by the WM */
|
||||
if (!(size = wm_icon_preference(XtDisplay(c->frame), screen, size))) {
|
||||
c->icon->icon = NULL;
|
||||
c->icon_inverted->icon = NULL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (!load_icon(c, c->icon, DTCM_STD_ICON, size, fg, bg))
|
||||
return (FALSE);
|
||||
|
||||
/*
|
||||
* If we are color we load a color icon that has been inverted
|
||||
* by a graphic's artist. If we are mono or reduced color we take
|
||||
* our one bit deep pixmap and invert it ourself by switching fg and
|
||||
* bg.
|
||||
*/
|
||||
if (c->icon->icon_depth >= 8) {
|
||||
if (!load_icon(c, c->icon_inverted, DTCM_INV_ICON, size,
|
||||
fg, bg))
|
||||
return (FALSE);
|
||||
} else {
|
||||
/* Reverse fg/bg on STD_ICON to get inverted icon. */
|
||||
/* XXX: This probably won't work on 1 < depth < 8 visuals */
|
||||
if (!load_icon(c, c->icon_inverted, DTCM_STD_ICON, size,
|
||||
bg, fg))
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static Boolean
|
||||
load_icon(
|
||||
Calendar *c,
|
||||
IconInfo *icon,
|
||||
char *icon_name,
|
||||
int size,
|
||||
Pixel fg,
|
||||
Pixel bg)
|
||||
{
|
||||
char *icon_filename;
|
||||
int x, y;
|
||||
Window root;
|
||||
unsigned int border_width;
|
||||
Screen *screen = XtScreen(c->frame);
|
||||
|
||||
if (!(icon_filename = XmGetIconFileName(screen, NULL, icon_name,
|
||||
NULL, size))) {
|
||||
icon->icon = NULL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if ((icon->icon = XmGetPixmap(screen, icon_filename, fg, bg)) ==
|
||||
XmUNSPECIFIED_PIXMAP) {
|
||||
free(icon_filename);
|
||||
icon->icon = NULL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if ((icon->icon_mask = _DtGetMask(screen, icon_filename)) ==
|
||||
XmUNSPECIFIED_PIXMAP) {
|
||||
free(icon_filename);
|
||||
icon->icon = NULL;
|
||||
icon->icon_mask = NULL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Store away the size of the icon */
|
||||
XGetGeometry(XtDisplay(c->frame),
|
||||
icon->icon,
|
||||
&root,
|
||||
&x, &y,
|
||||
&icon->icon_width, &icon->icon_height,
|
||||
&border_width, &icon->icon_depth);
|
||||
|
||||
XtFree(icon_filename);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
free_icon(
|
||||
Calendar *c,
|
||||
IconInfo *icon)
|
||||
{
|
||||
if (!icon)
|
||||
return;
|
||||
|
||||
if (icon->icon)
|
||||
XmDestroyPixmap(XtScreen(c->frame), icon->icon);
|
||||
|
||||
icon->icon = NULL;
|
||||
|
||||
if (icon->icon_mask)
|
||||
XmDestroyPixmap(XtScreen(c->frame), icon->icon_mask);
|
||||
|
||||
icon->icon_mask = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
paint_icon_date(
|
||||
Calendar *c)
|
||||
{
|
||||
Tick current_time;
|
||||
char buf[25];
|
||||
Cal_Font *font = c->fonts->iconfont;
|
||||
new_XContext *xc;
|
||||
int len,
|
||||
x, y,
|
||||
width, height,
|
||||
nop;
|
||||
Screen *s = XtScreen(c->canvas);
|
||||
Pixel fg, bg;
|
||||
GC gc;
|
||||
XGCValues gc_vals;
|
||||
Display *dpy;
|
||||
|
||||
if (!(c->icon && c->icon->icon && c->icon->icon_mask))
|
||||
return;
|
||||
|
||||
dpy = XtDisplayOfObject(c->frame);
|
||||
|
||||
current_time = now();
|
||||
XtVaSetValues(c->frame, XmNiconName, months[month(current_time)], NULL);
|
||||
xc = c->xcontext;
|
||||
|
||||
if (c->icon->icon_depth == 1) {
|
||||
XtVaGetValues(c->canvas,
|
||||
XmNforeground, &fg,
|
||||
XmNbackground, &bg,
|
||||
NULL);
|
||||
} else {
|
||||
fg = BlackPixelOfScreen(s);
|
||||
bg = WhitePixelOfScreen(s);
|
||||
}
|
||||
|
||||
gc_vals.foreground = fg;
|
||||
gc_vals.function = GXcopy;
|
||||
gc_vals.fill_style = FillSolid;
|
||||
gc = XCreateGC(xc->display, c->icon->icon, GCForeground | GCFunction |
|
||||
GCFillStyle, &gc_vals);
|
||||
|
||||
/* painting new date */
|
||||
/* day of the month */
|
||||
(void) sprintf(buf, "%d", dom(current_time));
|
||||
len = cm_strlen(buf);
|
||||
CalTextExtents(font, buf, len, &nop, &nop, &width, &height);
|
||||
x = c->icon->icon_width/2 - width/2 - 1;
|
||||
y = c->icon->icon_height - 2 * (c->icon->icon_height - height) / 3;
|
||||
|
||||
CalDrawString(dpy, c->icon->icon, font, gc, x, y, buf, len);
|
||||
|
||||
gc_vals.foreground = bg;
|
||||
XChangeGC(xc->display, gc, GCForeground, &gc_vals);
|
||||
if (c->icon_inverted && c->icon_inverted->icon
|
||||
&& c->icon_inverted->icon_mask)
|
||||
CalDrawString(dpy, c->icon_inverted->icon, font,
|
||||
gc, x, y, buf, len);
|
||||
|
||||
XFreeGC(xc->display, gc);
|
||||
XFlush(xc->display);
|
||||
}
|
||||
|
||||
void
|
||||
paint_icon(Calendar *c)
|
||||
{
|
||||
|
||||
/* Free the old pixmaps since they have the wrong date in them. */
|
||||
if (c->icon && c->icon->icon)
|
||||
free_icon(c, c->icon);
|
||||
if (c->icon_inverted && c->icon_inverted->icon)
|
||||
free_icon(c, c->icon_inverted);
|
||||
|
||||
/* Load the icon, mask and related info into calendar->icon */
|
||||
load_icons(calendar);
|
||||
|
||||
paint_icon_date(c);
|
||||
|
||||
XtVaSetValues(c->frame, XmNiconPixmap, NULL, NULL);
|
||||
|
||||
if (c->icon && c->icon->icon && c->icon->icon_mask)
|
||||
XtVaSetValues(c->frame,
|
||||
XmNiconPixmap, c->icon->icon,
|
||||
XmNiconMask, c->icon->icon_mask,
|
||||
NULL);
|
||||
}
|
||||
28
cde/programs/dtcm/dtcm/icon_pixmap_xbm
Normal file
28
cde/programs/dtcm/dtcm/icon_pixmap_xbm
Normal file
@@ -0,0 +1,28 @@
|
||||
/* $XConsortium: icon_pixmap_xbm /main/2 1995/07/19 16:49:29 drk $ */
|
||||
#define icon_pixmap_xbm_width 48
|
||||
#define icon_pixmap_xbm_height 48
|
||||
static unsigned char icon_pixmap_xbm_bits[] = {
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
|
||||
0x55, 0xd5, 0x55, 0xb5, 0x55, 0x55, 0xaa, 0xda, 0xaa, 0xaa, 0xaa, 0xaa,
|
||||
0x55, 0xd5, 0x55, 0xb5, 0x55, 0x55, 0xaa, 0xda, 0xaa, 0xaa, 0xaa, 0xaa,
|
||||
0xf5, 0xdf, 0xff, 0xbf, 0xff, 0x55, 0x1a, 0x50, 0x02, 0xa0, 0x04, 0xab,
|
||||
0x15, 0x50, 0x03, 0xa0, 0x04, 0x5d, 0x1a, 0xd0, 0x03, 0xa0, 0x06, 0xb5,
|
||||
0x15, 0xf0, 0x01, 0xe0, 0x07, 0x55, 0x1a, 0xe0, 0x00, 0xe0, 0x03, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x00, 0x00, 0x55, 0x1a, 0x00, 0x00, 0x00, 0x00, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x80, 0xff, 0x55, 0x1a, 0x00, 0x00, 0x80, 0xc0, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x80, 0xe0, 0x55, 0x1a, 0x00, 0x00, 0x80, 0xf0, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x80, 0x78, 0x55, 0x1a, 0x00, 0x00, 0x80, 0xbc, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x80, 0x1e, 0x55, 0x1a, 0x00, 0x00, 0x80, 0x4f, 0xb5,
|
||||
0x15, 0x00, 0x00, 0x80, 0x17, 0x55, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xb5,
|
||||
0x35, 0x00, 0x00, 0x00, 0x00, 0x54, 0xea, 0xff, 0xff, 0xff, 0xff, 0xb7,
|
||||
0x55, 0x00, 0x00, 0x00, 0x00, 0x50, 0xea, 0xff, 0xff, 0xff, 0xff, 0xbf,
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa};
|
||||
378
cde/programs/dtcm/dtcm/md5.c
Normal file
378
cde/programs/dtcm/dtcm/md5.c
Normal file
@@ -0,0 +1,378 @@
|
||||
static char sccsid[] = "$XConsortium: md5.c /main/2 1996/03/25 10:28:16 rswiston $";
|
||||
/*
|
||||
* COMPONENT_NAME: desktop
|
||||
*
|
||||
* FUNCTIONS: Decode
|
||||
* Encode
|
||||
* F
|
||||
* FF
|
||||
* G
|
||||
* GG
|
||||
* H
|
||||
* HH
|
||||
* I
|
||||
* II
|
||||
* MD5Final
|
||||
* MD5Init
|
||||
* MD5Transform
|
||||
* MD5Update
|
||||
* MD5_memcpy
|
||||
* MD5_memset
|
||||
* ROTATE_LEFT
|
||||
*
|
||||
* ORIGINS: 119
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $Revision: /main/2 $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "md5.h"
|
||||
|
||||
/* Constants for MD5Transform routine.
|
||||
*/
|
||||
|
||||
#define S11 7
|
||||
#define S12 12
|
||||
#define S13 17
|
||||
#define S14 22
|
||||
#define S21 5
|
||||
#define S22 9
|
||||
#define S23 14
|
||||
#define S24 20
|
||||
#define S31 4
|
||||
#define S32 11
|
||||
#define S33 16
|
||||
#define S34 23
|
||||
#define S41 6
|
||||
#define S42 10
|
||||
#define S43 15
|
||||
#define S44 21
|
||||
|
||||
static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
|
||||
static void Encode PROTO_LIST
|
||||
((unsigned char *, UINT4 *, unsigned int));
|
||||
static void Decode PROTO_LIST
|
||||
((UINT4 *, unsigned char *, unsigned int));
|
||||
static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
|
||||
static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
/* F, G, H and I are basic MD5 functions.
|
||||
*/
|
||||
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
|
||||
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
|
||||
#define H(x, y, z) ((x) ^ (y) ^ (z))
|
||||
#define I(x, y, z) ((y) ^ ((x) | (~z)))
|
||||
|
||||
/* ROTATE_LEFT rotates x left n bits.
|
||||
*/
|
||||
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
|
||||
|
||||
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
|
||||
Rotation is separate from addition to prevent recomputation.
|
||||
*/
|
||||
#define FF(a, b, c, d, x, s, ac) { \
|
||||
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define GG(a, b, c, d, x, s, ac) { \
|
||||
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define HH(a, b, c, d, x, s, ac) { \
|
||||
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define II(a, b, c, d, x, s, ac) { \
|
||||
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
|
||||
/* MD5 initialization. Begins an MD5 operation, writing a new context.
|
||||
*/
|
||||
void MD5Init (context)
|
||||
MD5_CTX *context; /* context */
|
||||
{
|
||||
context->count[0] = context->count[1] = 0;
|
||||
/* Load magic initialization constants.
|
||||
*/
|
||||
context->state[0] = 0x67452301;
|
||||
context->state[1] = 0xefcdab89;
|
||||
context->state[2] = 0x98badcfe;
|
||||
context->state[3] = 0x10325476;
|
||||
}
|
||||
|
||||
/* MD5 block update operation. Continues an MD5 message-digest
|
||||
operation, processing another message block, and updating the
|
||||
context.
|
||||
*/
|
||||
void MD5Update (context, input, inputLen)
|
||||
MD5_CTX *context; /* context */
|
||||
unsigned char *input; /* input block */
|
||||
unsigned int inputLen; /* length of input block */
|
||||
{
|
||||
unsigned int i, index, partLen;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
||||
|
||||
/* Update number of bits */
|
||||
if ((context->count[0] += ((UINT4)inputLen << 3))
|
||||
< ((UINT4)inputLen << 3))
|
||||
context->count[1]++;
|
||||
context->count[1] += ((UINT4)inputLen >> 29);
|
||||
|
||||
partLen = 64 - index;
|
||||
|
||||
/* Transform as many times as possible.
|
||||
*/
|
||||
if (inputLen >= partLen) {
|
||||
MD5_memcpy
|
||||
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||
MD5Transform (context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD5Transform (context->state, &input[i]);
|
||||
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
i = 0;
|
||||
|
||||
/* Buffer remaining input */
|
||||
MD5_memcpy
|
||||
((POINTER)&context->buffer[index], (POINTER)&input[i],
|
||||
inputLen-i);
|
||||
}
|
||||
|
||||
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||
the message digest and zeroizing the context.
|
||||
*/
|
||||
void MD5Final (digest, context)
|
||||
unsigned char digest[16]; /* message digest */
|
||||
MD5_CTX *context; /* context */
|
||||
{
|
||||
unsigned char bits[8];
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
Encode (bits, context->count, 8);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
||||
MD5Update (context, PADDING, padLen);
|
||||
|
||||
/* Append length (before padding) */
|
||||
MD5Update (context, bits, 8);
|
||||
|
||||
/* Store state in digest */
|
||||
Encode (digest, context->state, 16);
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD5_memset ((POINTER)context, 0, sizeof (*context));
|
||||
}
|
||||
|
||||
/* MD5 basic transformation. Transforms state based on block.
|
||||
*/
|
||||
static void MD5Transform (state, block)
|
||||
UINT4 state[4];
|
||||
unsigned char block[64];
|
||||
{
|
||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||
|
||||
Decode (x, block, 64);
|
||||
|
||||
/* Round 1 */
|
||||
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
|
||||
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
|
||||
FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
|
||||
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
|
||||
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
|
||||
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
|
||||
FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
|
||||
FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
|
||||
FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
|
||||
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
|
||||
FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
|
||||
FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
|
||||
FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
|
||||
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
|
||||
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
|
||||
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
|
||||
|
||||
/* Round 2 */
|
||||
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
|
||||
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
|
||||
GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
|
||||
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
|
||||
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
|
||||
GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
|
||||
GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
|
||||
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
|
||||
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
|
||||
GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
|
||||
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
|
||||
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
|
||||
GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
|
||||
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
|
||||
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
|
||||
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
|
||||
|
||||
/* Round 3 */
|
||||
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
|
||||
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
|
||||
HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
|
||||
HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
|
||||
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
|
||||
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
|
||||
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
|
||||
HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
|
||||
HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
|
||||
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
|
||||
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
|
||||
HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
|
||||
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
|
||||
HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
|
||||
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
|
||||
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
|
||||
|
||||
/* Round 4 */
|
||||
II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
|
||||
II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
|
||||
II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
|
||||
II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
|
||||
II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
|
||||
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
|
||||
II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
|
||||
II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
|
||||
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
|
||||
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
|
||||
II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
|
||||
II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
|
||||
II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
|
||||
II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
|
||||
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
|
||||
II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
|
||||
|
||||
state[0] += a;
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
MD5_memset ((POINTER)x, 0, sizeof (x));
|
||||
}
|
||||
|
||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Encode (output, input, len)
|
||||
unsigned char *output;
|
||||
UINT4 *input;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||
output[j] = (unsigned char)(input[i] & 0xff);
|
||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Decode (output, input, len)
|
||||
UINT4 *output;
|
||||
unsigned char *input;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
|
||||
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
|
||||
}
|
||||
|
||||
/* Note: Replace "for loop" with standard memcpy if possible.
|
||||
*/
|
||||
|
||||
static void MD5_memcpy (output, input, len)
|
||||
POINTER output;
|
||||
POINTER input;
|
||||
unsigned int len;
|
||||
{
|
||||
memcpy(output, input, len);
|
||||
}
|
||||
|
||||
/* Note: Replace "for loop" with standard memset if possible.
|
||||
*/
|
||||
static void MD5_memset (output, value, len)
|
||||
POINTER output;
|
||||
int value;
|
||||
unsigned int len;
|
||||
{
|
||||
memset(output, value, len);
|
||||
}
|
||||
91
cde/programs/dtcm/dtcm/md5.h
Normal file
91
cde/programs/dtcm/dtcm/md5.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* $XConsortium: md5.h /main/1 1995/11/03 10:29:17 rswiston $ */
|
||||
/*
|
||||
* COMPONENT_NAME: desktop
|
||||
*
|
||||
* FUNCTIONS: none
|
||||
*
|
||||
* ORIGINS: 119
|
||||
*
|
||||
* This module contains IBM CONFIDENTIAL code. -- (IBM
|
||||
* Confidential Restricted when combined with the aggregated
|
||||
* modules for this product)
|
||||
* OBJECT CODE ONLY SOURCE MATERIALS
|
||||
*
|
||||
* (C) COPYRIGHT International Business Machines Corp. 1995
|
||||
* All Rights Reserved
|
||||
* US Government Users Restricted Rights - Use, duplication or
|
||||
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $Revision: /main/1 $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
/* MD5.H - header file for MD5C.C
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
#ifndef _MD5_H
|
||||
#define _MD5_H
|
||||
|
||||
#include "md5global.h"
|
||||
|
||||
/* MD5 context. */
|
||||
typedef struct {
|
||||
UINT4 state[4]; /* state (ABCD) */
|
||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} MD5_CTX;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void MD5Init(MD5_CTX *);
|
||||
void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
|
||||
void MD5Final(unsigned char *, MD5_CTX *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
74
cde/programs/dtcm/dtcm/md5global.h
Normal file
74
cde/programs/dtcm/dtcm/md5global.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* $XConsortium: md5global.h /main/1 1995/11/03 10:29:25 rswiston $ */
|
||||
/*
|
||||
* COMPONENT_NAME: desktop
|
||||
*
|
||||
* FUNCTIONS: PROTO_LIST
|
||||
*
|
||||
* ORIGINS: 27,118,119,120,121
|
||||
*
|
||||
* This module contains IBM CONFIDENTIAL code. -- (IBM
|
||||
* Confidential Restricted when combined with the aggregated
|
||||
* modules for this product)
|
||||
* OBJECT CODE ONLY SOURCE MATERIALS
|
||||
*
|
||||
* (C) COPYRIGHT International Business Machines Corp. 1995
|
||||
* All Rights Reserved
|
||||
* US Government Users Restricted Rights - Use, duplication or
|
||||
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $Revision: /main/1 $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
/* GLOBAL.H - RSAREF types and constants
|
||||
*/
|
||||
|
||||
/* PROTOTYPES should be set to one if and only if the compiler supports
|
||||
function argument prototyping.
|
||||
The following makes PROTOTYPES default to 0 if it has not already
|
||||
been defined with C compiler flags.
|
||||
*/
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#define PROTOTYPES 1
|
||||
#else
|
||||
#define PROTOTYPES 0
|
||||
#endif
|
||||
|
||||
/* POINTER defines a generic pointer type */
|
||||
typedef unsigned char *POINTER;
|
||||
|
||||
/* UINT2 defines a two byte word */
|
||||
typedef unsigned short int UINT2;
|
||||
|
||||
/* UINT4 defines a four byte word */
|
||||
typedef unsigned long int UINT4;
|
||||
|
||||
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
||||
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
||||
returns an empty list.
|
||||
*/
|
||||
#if PROTOTYPES
|
||||
#define PROTO_LIST(list) list
|
||||
#else
|
||||
#define PROTO_LIST(list) ()
|
||||
#endif
|
||||
1460
cde/programs/dtcm/dtcm/misc.c
Normal file
1460
cde/programs/dtcm/dtcm/misc.c
Normal file
File diff suppressed because it is too large
Load Diff
89
cde/programs/dtcm/dtcm/misc.h
Normal file
89
cde/programs/dtcm/dtcm/misc.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** misc.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)misc.h 1.27 95/02/09 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: misc.h /main/4 1995/11/03 10:29:44 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _MISC_H
|
||||
#define _MISC_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
#include "cm_tty.h"
|
||||
#include "datefield.h"
|
||||
|
||||
/*
|
||||
** Variable "types" to be passed to the dialog_popup function (that
|
||||
** function accepts a variable argument list with these attribute, value
|
||||
** pairs).
|
||||
**
|
||||
** The BUTTON_IDENT attribute can be used to identify 1 or more buttons on
|
||||
** the dialog. The int id value will be returned if that button is
|
||||
** pressed and the char* name value will be the button label.
|
||||
*/
|
||||
typedef enum {
|
||||
DIALOG_TITLE = 1, /* Followed by char* */
|
||||
DIALOG_TEXT, /* Followed by char* */
|
||||
BUTTON_IDENT, /* Followed by int, char* */
|
||||
DIALOG_IMAGE, /* Followed by pixmap from Props_pu */
|
||||
BUTTON_HELP, /* Followed by char* */
|
||||
BUTTON_INSENSITIVE /* Followed by int, char* */
|
||||
} Dialog_create_op;
|
||||
|
||||
/*
|
||||
** External function declarations
|
||||
*/
|
||||
extern char *cm_mbchar P((char*));
|
||||
extern int cm_mbstrlen P((char*));
|
||||
extern Widget create_for_menu P((Widget));
|
||||
extern Widget create_privacy_menu P((Widget));
|
||||
extern Widget create_repeat_menu P((Widget, XtCallbackProc, XtPointer));
|
||||
extern Widget create_repeat_scope_menu P((Widget, XmString, XtCallbackProc,
|
||||
XtPointer));
|
||||
extern Widget create_start_stop_time_menu P((Widget, XmString, XtCallbackProc,
|
||||
XtPointer, Props*, Boolean,
|
||||
Boolean, Widget**, int*));
|
||||
extern Widget create_time_scope_menu P((Widget, XmString, XtCallbackProc,
|
||||
XtPointer));
|
||||
#ifndef _AIX
|
||||
extern int dialog_popup P((Widget, ...));
|
||||
#endif /* _AIX */
|
||||
extern void editor_err_msg P((Widget, char*, Validate_op, Pixmap));
|
||||
extern void backend_err_msg P((Widget, char*, CSA_return_code, Pixmap));
|
||||
extern void get_range P((Glance, time_t, time_t*, time_t*));
|
||||
extern boolean_t query_user P((void*));
|
||||
extern void set_message P((Widget, char*));
|
||||
extern void setup_quit_handler P((Widget, XtCallbackProc, caddr_t));
|
||||
extern int ds_is_double_click P((XEvent*, XEvent*));
|
||||
extern int cm_select_text P((Widget, Time));
|
||||
extern void set_time_submenu P((Widget, Widget, Props*,
|
||||
XtCallbackProc, XtPointer,
|
||||
Boolean, Boolean, Widget**, int*));
|
||||
extern void ManageChildren P((Widget));
|
||||
#endif
|
||||
1068
cde/programs/dtcm/dtcm/monthglance.c
Normal file
1068
cde/programs/dtcm/dtcm/monthglance.c
Normal file
File diff suppressed because it is too large
Load Diff
53
cde/programs/dtcm/dtcm/monthglance.h
Normal file
53
cde/programs/dtcm/dtcm/monthglance.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** monthglance.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)yearglance.h 1.2 93/08/10 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: monthglance.h /main/4 1996/04/12 14:58:21 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _MONTHGLANCE_H
|
||||
#define _MONTHGLANCE_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
|
||||
typedef struct month {
|
||||
Widget *hot_button;
|
||||
Widget month_label;
|
||||
XPoint *button_loc;
|
||||
int ndays;
|
||||
int dayname_height;
|
||||
} Month;
|
||||
|
||||
extern void prepare_to_paint_monthview P((Calendar*, XRectangle*));
|
||||
extern void get_time_str P((Dtcm_appointment*, char*));
|
||||
extern void month_button P((Widget, XtPointer, XtPointer));
|
||||
extern void month_event P((XEvent*));
|
||||
extern void paint_grid P((Calendar*, XRectangle*));
|
||||
extern void print_month_range P((Calendar*, Tick, Tick));
|
||||
extern void cleanup_after_monthview P((Calendar*));
|
||||
|
||||
|
||||
#endif
|
||||
447
cde/programs/dtcm/dtcm/namesvc.c
Normal file
447
cde/programs/dtcm/dtcm/namesvc.c
Normal file
@@ -0,0 +1,447 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** namesvc.c
|
||||
**
|
||||
** $XConsortium: namesvc.c /main/3 1995/11/03 10:30:13 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)namesvc.c 1.5 94/11/07 Copyr 1993 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#include <rpcsvc/nis.h>
|
||||
#include <rpcsvc/ypclnt.h>
|
||||
#include <rpcsvc/yp_prot.h>
|
||||
#include "util.h"
|
||||
#include "namesvc.h"
|
||||
#include "gettext.h"
|
||||
|
||||
extern int debug;
|
||||
|
||||
#define MAPNAME "mail.aliases"
|
||||
|
||||
static char *
|
||||
get_userscontext()
|
||||
{
|
||||
static char *userscontext;
|
||||
|
||||
if (userscontext == NULL) {
|
||||
if ((userscontext = cm_strdup(
|
||||
(char *)getenv("USERSCONTEXT"))) == NULL)
|
||||
userscontext = USERSCONTEXT;
|
||||
}
|
||||
return(userscontext);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
get_principal(table, ent, udata)
|
||||
char *table;
|
||||
nis_object *ent;
|
||||
void *udata;
|
||||
{
|
||||
char **principal = (char **)udata;
|
||||
entry_col *ec = ent->EN_data.en_cols.en_cols_val;
|
||||
int ncol = ent->EN_data.en_cols.en_cols_len;
|
||||
|
||||
if (ec[PRINCIPALCOLNUM].ec_value.ec_value_len)
|
||||
*principal = cm_strdup(ec[PRINCIPALCOLNUM].ec_value.ec_value_val);
|
||||
else *principal = NULL;
|
||||
return(1);
|
||||
}
|
||||
|
||||
extern Lookup_stat
|
||||
cm_get_nis_location(name, calname, host)
|
||||
char *name;
|
||||
char *calname;
|
||||
char **host;
|
||||
{
|
||||
nis_result *tres, *eres;
|
||||
char cmtbl[NIS_MAXNAMELEN];
|
||||
char indexname[NIS_MAXNAMELEN];
|
||||
char *user, *domain;
|
||||
Lookup_stat res;
|
||||
u_long tflag = EXPAND_NAME;
|
||||
entry_col *ec;
|
||||
int ncol;
|
||||
nis_object *nis_obj;
|
||||
|
||||
*host = NULL;
|
||||
user = get_head(name, '@');
|
||||
domain = get_tail(name, '@');
|
||||
sprintf(cmtbl, "%s.%s.%s", USERMAP, user, get_userscontext());
|
||||
if (domain) {
|
||||
strcat(cmtbl, ".");
|
||||
strcat(cmtbl, domain);
|
||||
}
|
||||
|
||||
tres = nis_lookup(cmtbl, tflag);
|
||||
if (tres->status != NIS_SUCCESS) {
|
||||
nis_freeresult(tres);
|
||||
return(l_no_table);
|
||||
}
|
||||
|
||||
sprintf(indexname, "[%s=%s],%s.", NAMECOLNAME, calname,
|
||||
tres->objects.objects_val[0].zo_name);
|
||||
if (*(tres->objects.objects_val[0].zo_domain) != '.')
|
||||
strcat(indexname, tres->objects.objects_val[0].zo_domain);
|
||||
|
||||
eres = nis_list(indexname, tflag, 0, 0);
|
||||
|
||||
if (eres->status == NIS_SUCCESS || eres->status == NIS_CBRESULTS) {
|
||||
nis_obj = NIS_RES_OBJECT(eres);
|
||||
if (nis_obj == NULL)
|
||||
res = l_nis_error;
|
||||
else {
|
||||
ec = nis_obj->EN_data.en_cols.en_cols_val;
|
||||
ncol = nis_obj->EN_data.en_cols.en_cols_len;
|
||||
if (ncol >= NUMTBLCOLS && ec != NULL &&
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_len) {
|
||||
*host = cm_strdup(
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_val);
|
||||
res = l_ok;
|
||||
}
|
||||
else {
|
||||
*host = NULL;
|
||||
res = l_nis_error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (debug)
|
||||
nis_perror(tres->status, "nis_list");
|
||||
res = l_nis_error;
|
||||
}
|
||||
nis_freeresult(tres);
|
||||
nis_freeresult(eres);
|
||||
return(res);
|
||||
}
|
||||
|
||||
extern char *
|
||||
netname2principal(netname)
|
||||
char *netname;
|
||||
{
|
||||
nis_result *eres;
|
||||
char indexname[NIS_MAXNAMELEN];
|
||||
char *domain;
|
||||
u_long tflag = EXPAND_NAME;
|
||||
char *principal = NULL;
|
||||
|
||||
domain = get_tail(netname, '@');
|
||||
if (domain == NULL)
|
||||
return(NULL);
|
||||
|
||||
sprintf(indexname, "[%s=%s],%s.%s", AUTHNAMECOLNAME, netname,
|
||||
CREDDIR, domain);
|
||||
eres = nis_list(indexname, tflag, get_principal, (void *)&principal);
|
||||
if (eres->status != NIS_SUCCESS && eres->status != NIS_CBRESULTS)
|
||||
if (debug)
|
||||
nis_perror(eres->status, "nis_list");
|
||||
nis_freeresult(eres);
|
||||
return(principal);
|
||||
}
|
||||
|
||||
Lookup_stat
|
||||
test_cm_get_target(name, name2)
|
||||
char *name, **name2;
|
||||
{
|
||||
FILE *f;
|
||||
char *b, *tmp, *uname, *ptr, buffer[BUFSIZ];
|
||||
char *tail;
|
||||
Boolean domain = False;
|
||||
|
||||
*name2 = NULL;
|
||||
|
||||
f = fopen("/home2/curry/myds/src/cm2/testfile", "r");
|
||||
tail = get_tail(name, '@');
|
||||
if (tail != NULL && strcasecmp(tail, "eng") == 0) {
|
||||
domain = True;
|
||||
free(tail);
|
||||
}
|
||||
uname = cm_target2name(name);
|
||||
while (fgets(buffer, BUFSIZ, f)) {
|
||||
b = (char*)cm_strdup(buffer);
|
||||
tmp = (char*)strtok(b, " ");
|
||||
if (strcmp(uname, tmp) == 0) {
|
||||
ptr = (char*)strrchr(buffer, ' ');
|
||||
ptr++;
|
||||
ptr[strlen(ptr)-1] = 0;
|
||||
*name2 = ckalloc(cm_strlen(name) + cm_strlen(ptr) + 7);
|
||||
if (domain)
|
||||
sprintf(*name2, "%s@%s.eng", uname, ptr);
|
||||
else
|
||||
sprintf(*name2, "%s@%s", uname, ptr);
|
||||
free(uname); free(b);
|
||||
fclose(f);
|
||||
return l_ok;
|
||||
}
|
||||
free(b);
|
||||
}
|
||||
fclose(f);
|
||||
free(uname);
|
||||
return l_other;
|
||||
}
|
||||
|
||||
/* principal.domain -> principal */
|
||||
extern char *
|
||||
principal_to_user(principal)
|
||||
char *principal;
|
||||
{
|
||||
return(get_head(principal, '.'));
|
||||
}
|
||||
|
||||
/* principal.domain -> domain */
|
||||
extern char *
|
||||
principal_to_domain(principal)
|
||||
char *principal;
|
||||
{
|
||||
return(get_tail(principal, '.'));
|
||||
}
|
||||
static void
|
||||
new_entryobj(nobj, loc)
|
||||
nis_object *nobj;
|
||||
char *loc;
|
||||
{
|
||||
entry_col *ec;
|
||||
entry_obj *eo;
|
||||
|
||||
nobj->zo_data.zo_type = ENTRY_OBJ;
|
||||
eo = &(nobj->EN_data);
|
||||
eo->en_cols.en_cols_len = NUMTBLCOLS;
|
||||
eo->en_type = "cm_location_tbl";
|
||||
ec = (entry_col*)ckalloc(sizeof(entry_col) * NUMTBLCOLS);
|
||||
eo->en_cols.en_cols_val = ec;
|
||||
ec[NAMECOLNUM].ec_value.ec_value_len = cm_strlen(DEFAULT_CALNAME)+1;
|
||||
ec[NAMECOLNUM].ec_value.ec_value_val = DEFAULT_CALNAME;
|
||||
ec[NAMECOLNUM].ec_flags = 0;
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_len = cm_strlen(loc)+1;
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_val = cm_strdup(loc);
|
||||
ec[LOCATIONCOLNUM].ec_flags = 0;
|
||||
}
|
||||
static nis_object*
|
||||
new_nisobj()
|
||||
{
|
||||
nis_object *nobj;
|
||||
|
||||
nobj = (nis_object*)ckalloc(sizeof(nis_object));
|
||||
nobj->zo_owner = nis_local_principal();
|
||||
nobj->zo_group = nis_local_group();
|
||||
nobj->zo_access = DEFAULT_RIGHTS;
|
||||
nobj->zo_ttl = 43200;
|
||||
|
||||
return nobj;
|
||||
}
|
||||
|
||||
extern Lookup_stat
|
||||
cm_set_nis_location(name, calname, loc)
|
||||
char *name;
|
||||
char *calname;
|
||||
char *loc;
|
||||
{
|
||||
nis_result *eres, *mres, *ares;
|
||||
char cmtbl[NIS_MAXNAMELEN];
|
||||
char indexname[NIS_MAXNAMELEN];
|
||||
char *user, *domain;
|
||||
Lookup_stat res = l_ok;
|
||||
u_long tflag = EXPAND_NAME;
|
||||
nis_object *new_obj, *nis_obj;
|
||||
entry_col *ec;
|
||||
int ncol;
|
||||
|
||||
user = get_head(name, '@');
|
||||
domain = get_tail(name, '@');
|
||||
sprintf(cmtbl, "%s.%s.%s", USERMAP, user, get_userscontext());
|
||||
if (domain) {
|
||||
strcat(cmtbl, ".");
|
||||
strcat(cmtbl, domain);
|
||||
}
|
||||
else {
|
||||
strcat(cmtbl, ".");
|
||||
strcat(cmtbl, cm_get_local_domain());
|
||||
}
|
||||
|
||||
eres = nis_lookup(cmtbl, tflag);
|
||||
if (eres->status != NIS_SUCCESS) {
|
||||
nis_freeresult(eres);
|
||||
return(l_no_table);
|
||||
}
|
||||
|
||||
sprintf(indexname, "[%s=%s],%s.", NAMECOLNAME, calname,
|
||||
eres->objects.objects_val[0].zo_name);
|
||||
if (*(eres->objects.objects_val[0].zo_domain) != '.')
|
||||
strcat(indexname, eres->objects.objects_val[0].zo_domain);
|
||||
nis_freeresult(eres);
|
||||
|
||||
eres = nis_list(indexname, tflag, 0, 0);
|
||||
|
||||
if (eres->status == NIS_SUCCESS || eres->status == NIS_CBRESULTS) {
|
||||
nis_obj = NIS_RES_OBJECT(eres);
|
||||
if (nis_obj == NULL)
|
||||
res = l_nis_error;
|
||||
else {
|
||||
ncol = nis_obj->EN_data.en_cols.en_cols_len;
|
||||
ec = nis_obj->EN_data.en_cols.en_cols_val;
|
||||
if (ncol >= NUMTBLCOLS && ec != NULL &&
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_len) {
|
||||
new_obj = nis_clone_object(nis_obj, NULL);
|
||||
ec = new_obj->EN_data.en_cols.en_cols_val;
|
||||
ec[LOCATIONCOLNUM].ec_flags = EN_MODIFIED;
|
||||
free(ec[LOCATIONCOLNUM].ec_value.ec_value_val);
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_val =
|
||||
cm_strdup(loc);
|
||||
ec[LOCATIONCOLNUM].ec_value.ec_value_len =
|
||||
cm_strlen(loc)+1;
|
||||
mres = nis_modify_entry(indexname, new_obj, 0);
|
||||
if (mres->status != NIS_SUCCESS) {
|
||||
if (debug)
|
||||
nis_perror(eres->status, "nis_modify_entry");
|
||||
res = l_nis_error;
|
||||
}
|
||||
nis_destroy_object(new_obj);
|
||||
}
|
||||
else
|
||||
res = l_nis_error;
|
||||
nis_freeresult(mres);
|
||||
}
|
||||
}
|
||||
else if (eres->status == NIS_NOTFOUND) {
|
||||
/* table exists but no entry; add new entry to NIS+ cm table*/
|
||||
nis_obj = (nis_object*)new_nisobj();
|
||||
new_entryobj(nis_obj, loc);
|
||||
ares = nis_add_entry(cmtbl, nis_obj, 0);
|
||||
if (ares->status != NIS_SUCCESS) {
|
||||
if (debug)
|
||||
nis_perror(eres->status, "nis_add_entry");
|
||||
res = l_nis_error;
|
||||
}
|
||||
nis_destroy_object(nis_obj);
|
||||
nis_freeresult(ares);
|
||||
}
|
||||
else {
|
||||
if (debug)
|
||||
nis_perror(eres->status, "nis_list");
|
||||
res = l_nis_error;
|
||||
}
|
||||
nis_freeresult(eres);
|
||||
|
||||
return(res);
|
||||
}
|
||||
/*
|
||||
* user specification -> calendar_name@host[.domain]
|
||||
*/
|
||||
|
||||
extern void
|
||||
cm_get_target(name, target)
|
||||
char *name;
|
||||
char **target;
|
||||
{
|
||||
char *user, *domain;
|
||||
int status=0;
|
||||
char *host;
|
||||
|
||||
*target = NULL;
|
||||
|
||||
if (name == NULL)
|
||||
return(l_other);
|
||||
|
||||
test_cm_get_target(name, target);
|
||||
return;
|
||||
|
||||
/* assume user@domain and do nis+ lookup */
|
||||
status = cm_get_nis_location(name, DEFAULT_CALNAME, &host);
|
||||
|
||||
if (status == l_ok) {
|
||||
/*
|
||||
* Nis+ table exists.
|
||||
* If we cannot find the location, default to local host.
|
||||
* Otherwise, build the calendar name. For now,
|
||||
* calendar name is the user login name.
|
||||
*/
|
||||
if (host) {
|
||||
*target = (char *)ckalloc(cm_strlen(name) +
|
||||
cm_strlen(host) + 3);
|
||||
user = get_head(name, '@');
|
||||
domain = get_tail(name, '@');
|
||||
sprintf(*target, "%s@%s", user, host);
|
||||
if (domain) {
|
||||
strcat(*target, ".");
|
||||
strcat(*target, domain);
|
||||
}
|
||||
free(user);
|
||||
free(domain);
|
||||
free(host);
|
||||
} else {
|
||||
*target = NULL;
|
||||
status = l_nis_error;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Assume nis+ is not use, or no entry in table.
|
||||
* name = user@host[.domain]
|
||||
* If host is not specified, default to local host.
|
||||
*/
|
||||
*target = NULL;
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define YP_SUCCESS 0
|
||||
|
||||
extern int
|
||||
cm_get_yptarget(name, name2)
|
||||
char *name, **name2;
|
||||
{
|
||||
char *domain;
|
||||
int outlen, inlen, status=0;
|
||||
char *save_name=NULL, *tmp=NULL, *tmp2=NULL, *ptr;
|
||||
|
||||
*name2 = NULL;
|
||||
domain = cm_get_local_domain();
|
||||
inlen = cm_strlen(name)+1;
|
||||
status = yp_match(domain, MAPNAME, name, inlen, &tmp, &outlen);
|
||||
if (status != YP_SUCCESS)
|
||||
return YP_SUCCESS;
|
||||
/* Name was mapped successfully, so continue; may be more than 1 */
|
||||
/* Lots of white space in map for some dumb reason */
|
||||
while (status == YP_SUCCESS) {
|
||||
save_name = tmp;
|
||||
/* get rid of beginning white space */
|
||||
while (tmp != NULL && *tmp == ' ') tmp++;
|
||||
/* get rid of trailing white space */
|
||||
for (ptr = tmp+cm_strlen(tmp)-1;
|
||||
ptr != NULL && *ptr == ' '; *ptr = 0, ptr--);
|
||||
inlen = cm_strlen(tmp)+1;
|
||||
status = yp_match(domain, MAPNAME, tmp, inlen, &tmp2, &outlen);
|
||||
/* no more maps so return value */
|
||||
if (status != YP_SUCCESS)
|
||||
*name2 = cm_strdup(tmp);
|
||||
else
|
||||
tmp = tmp2;
|
||||
free(save_name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
90
cde/programs/dtcm/dtcm/postup_xbm
Normal file
90
cde/programs/dtcm/dtcm/postup_xbm
Normal file
@@ -0,0 +1,90 @@
|
||||
/* $XConsortium: postup_xbm /main/2 1995/07/19 16:49:37 drk $ */
|
||||
#define postup_xbm_width 64
|
||||
#define postup_xbm_height 128
|
||||
static unsigned char postup_xbm_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x03,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xf4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe2, 0x07, 0x00, 0x00, 0x00,
|
||||
0x00, 0xf8, 0x05, 0x1a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x07,
|
||||
0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0xdc, 0x01, 0x10, 0x00, 0x00, 0x00,
|
||||
0x80, 0x00, 0x7c, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0xde, 0x03,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x81, 0x97, 0xff, 0x07, 0x00, 0x00, 0x00,
|
||||
0x00, 0x7e, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x86, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x0a,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x06, 0x02, 0x00, 0x00, 0x00,
|
||||
0x00, 0x40, 0x44, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24, 0x02,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x24, 0x01, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x0c, 0x24, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x08,
|
||||
0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x10, 0x0c, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x04, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x04, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x00, 0x04, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x90, 0x00, 0x00,
|
||||
0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x02, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
|
||||
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00};
|
||||
1603
cde/programs/dtcm/dtcm/print.c
Normal file
1603
cde/programs/dtcm/dtcm/print.c
Normal file
File diff suppressed because it is too large
Load Diff
86
cde/programs/dtcm/dtcm/print.h
Normal file
86
cde/programs/dtcm/dtcm/print.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** print.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)print.h 1.2 94/06/01 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: print.h /main/8 1996/11/25 10:28:34 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _PRINT_H
|
||||
#define _PRINT_H
|
||||
|
||||
#include "calendar.h"
|
||||
#include <Dt/Print.h>
|
||||
|
||||
/*
|
||||
* IMPORTANT
|
||||
*
|
||||
* These indicate the type of report to be printed
|
||||
* they are used in callback for option menu in print.c
|
||||
* and stored in print data structure to record the
|
||||
* option that's selected.
|
||||
*/
|
||||
#define PR_DAY_VIEW 0
|
||||
#define PR_WEEK_VIEW 1
|
||||
#define PR_MONTH_VIEW 2
|
||||
#define PR_YEAR_VIEW 3
|
||||
#define PR_APPT_LIST 4
|
||||
#define PR_TODO_LIST 5
|
||||
|
||||
/*
|
||||
* Moved from ps_graphics.h 04/10/96
|
||||
*/
|
||||
#define PUBLIC 0
|
||||
#define SEMIPRIVATE 1
|
||||
#define PRIVATE 2
|
||||
|
||||
#define PORTRAIT TRUE
|
||||
#define LANDSCAPE FALSE
|
||||
|
||||
/* bit masks for checking privacy for printing */
|
||||
#define PRINT_PUBLIC 0x1
|
||||
#define PRINT_SEMIPRIVATE 0x2
|
||||
#define PRINT_PRIVATE 0x4
|
||||
|
||||
extern void post_print_dialog(Calendar *c);
|
||||
extern void create_print_dialog(Calendar *c);
|
||||
extern char *pd_get_printer_name(Calendar *c);
|
||||
extern int pd_get_copies(Calendar *c);
|
||||
extern Tick pd_get_start_date(Calendar *c);
|
||||
extern Tick pd_get_end_date(Calendar *c);
|
||||
extern char *pd_get_print_options(Calendar *c);
|
||||
extern Boolean pd_print_to_file(Calendar *c);
|
||||
extern char *pd_get_file_name(Calendar *c);
|
||||
extern int pd_get_report_type(Calendar *c);
|
||||
extern void print_report(Calendar *c);
|
||||
extern Widget pd_get_print_shell(Calendar *c);
|
||||
extern Display *pd_get_print_display(Calendar *c);
|
||||
extern void pd_set_bad_alloc_error(Calendar *c, Boolean errorOn);
|
||||
extern Boolean pd_get_bad_alloc_error(Calendar *c);
|
||||
|
||||
# ifdef GR_DEBUG
|
||||
extern Boolean inDebugMode(Calendar *c);
|
||||
# endif
|
||||
|
||||
#endif
|
||||
79
cde/programs/dtcm/dtcm/process_msg
Normal file
79
cde/programs/dtcm/dtcm/process_msg
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/bin/sh
|
||||
# $TOG: process_msg /main/4 1999/09/20 10:33:13 mgreess $
|
||||
# Script to determine which source files need to have new messages
|
||||
# substitued into them and accomplish those substitutions. The
|
||||
# files on the command line will be run thru genmsg, and those
|
||||
# files that exhibit actual differences will then be checked out,
|
||||
# and really run thru genmsg, and then checked back in.
|
||||
#
|
||||
# To use the script, you must scccs get all of the source files you wish
|
||||
# to process, as well as dtcm.msg and project.set. When ready, one runs
|
||||
# "process_msg *.c". It will look thru all the .c files, looking to
|
||||
# see which ones have unassigned message id's, and check those files out.
|
||||
# It will then run those files thru genmsg, and regenerate the dtcm.msg
|
||||
# file. You must delta in the processed .c files as well as project.set
|
||||
# and dtcm.msg. A bunch of old .msg files will remain in the directory.
|
||||
# The old message file will be stored in dtcm.msg.orig.
|
||||
|
||||
rm -f *.new *.msg >/dev/null
|
||||
filelist=""
|
||||
null=""
|
||||
for file in $*
|
||||
do
|
||||
genmsg -l project.set $file >/dev/null
|
||||
diff $file $file.new >/dev/null
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
filelist="$filelist $file"
|
||||
fi
|
||||
done
|
||||
|
||||
echo $filelist
|
||||
|
||||
if [ "$filelist" = "$null" ]
|
||||
then
|
||||
echo "No files need to be updated. Exiting."
|
||||
exit
|
||||
fi
|
||||
|
||||
# Now that we have the list of files that actually need to
|
||||
# be changed, check to see if any of them are already checked
|
||||
# out. If they are, then quit with an error, else run
|
||||
# genmsg to change them.
|
||||
|
||||
checkout=`sccs tell`
|
||||
|
||||
if [ "$checkout" ]
|
||||
then
|
||||
for file in $filelist
|
||||
do
|
||||
for newfile in $checkout
|
||||
do
|
||||
if [ "$file" = "$newfile" ]
|
||||
then
|
||||
echo "The file $file needs to be changed, but is already checked out. Exiting"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
sccs edit $filelist project.set dtcm.msg
|
||||
|
||||
|
||||
for file in $filelist
|
||||
do
|
||||
genmsg -c NL_COMMENT -l project.set $file >/dev/null
|
||||
mv $file.new $file
|
||||
mv project.set.new project.set
|
||||
done
|
||||
|
||||
# regenerate the message file for the application
|
||||
|
||||
mv -f dtcm.msg dtcm.msg.orig
|
||||
|
||||
genmsg -c NL_COMMENT -d dtcm.msg $*
|
||||
|
||||
#sccs unedit $filelist project.set dtcm.msg
|
||||
#rm *.new *.msg
|
||||
2
cde/programs/dtcm/dtcm/project.set
Normal file
2
cde/programs/dtcm/dtcm/project.set
Normal file
@@ -0,0 +1,2 @@
|
||||
0 1
|
||||
1 1092
|
||||
884
cde/programs/dtcm/dtcm/props.c
Normal file
884
cde/programs/dtcm/dtcm/props.c
Normal file
@@ -0,0 +1,884 @@
|
||||
/* $XConsortium: props.c /main/9 1996/03/25 10:22:39 rswiston $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <csa.h>
|
||||
#include "props_pu.h"
|
||||
#include "help.h"
|
||||
#include "calendar.h"
|
||||
#include "deskset.h"
|
||||
|
||||
#define GAP 10
|
||||
#define TOG_GAP 10
|
||||
#define RIGHT_GAP 85 /* Space between text field and right edge */
|
||||
#define MAX_LABEL_SPACE 55
|
||||
#define INDICATOR_SIZE 20
|
||||
|
||||
extern unsigned int p_gap_convert_permissions(Props_pu *);
|
||||
extern void gap_list_select_proc(Widget, XtPointer, XtPointer);
|
||||
extern void p_gap_remove_proc(Widget, XtPointer, XtPointer);
|
||||
extern void p_set_change(Props_pu *);
|
||||
extern Dimension ComputeMaxWidth(Widget, Widget, Widget, Widget);
|
||||
|
||||
static void GAPAddProc(Widget, XtPointer, XtPointer);
|
||||
static void GAPChangeProc(Widget, XtPointer, XtPointer);
|
||||
static Widget CreatePermissions(Props_pu *, Widget, Widget, Dimension,
|
||||
Dimension);
|
||||
static int ChangeExistingGAPEntry(Props_pu *);
|
||||
|
||||
extern void
|
||||
v5_gap_pending_change(Widget w, XtPointer data, XtPointer cbs) {
|
||||
Props_pu *p = (Props_pu *) data;
|
||||
|
||||
if (p->v5_gap_pending_message_up == False) {
|
||||
p->v5_gap_pending_message_up = True;
|
||||
XtSetSensitive(p->gap2_add_button, True);
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
v5_gap_clear_pending_change(Props_pu *p) {
|
||||
|
||||
p->v5_gap_pending_message_up = False;
|
||||
XtSetSensitive(p->gap2_add_button, False);
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void
|
||||
p_create_v5_group_access_pane(
|
||||
Props_pu *p)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
XmString xstr = NULL;
|
||||
int i = 0;
|
||||
Widget gap2_form_mgr;
|
||||
Dimension max_left_label_width,
|
||||
max_button_label_width,
|
||||
tmp;
|
||||
Arg args[20];
|
||||
XtWidgetGeometry geo;
|
||||
|
||||
gap2_form_mgr =
|
||||
XtVaCreateWidget("gap2_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
p->base_form_mgr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->separator1,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 0,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomOffset, GAP,
|
||||
XmNbottomWidget, p->separator2,
|
||||
NULL);
|
||||
|
||||
p->pane_list[GROUP_ACCESS_PANE] = gap2_form_mgr;
|
||||
|
||||
/*
|
||||
* Create our three left hand side labels first in order to figure
|
||||
* out the offset required between the middle widgets and the left
|
||||
* side.
|
||||
*/
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 410, "User Name:"));
|
||||
p->gap2_user_label =
|
||||
XtVaCreateWidget("gap2_label_user_name",
|
||||
xmLabelGadgetClass,
|
||||
gap2_form_mgr,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 738, "Access List:"));
|
||||
p->gap2_access_label =
|
||||
XtVaCreateWidget("gap2_label_access",
|
||||
xmLabelGadgetClass,
|
||||
gap2_form_mgr,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 739, "Access Rights:"));
|
||||
p->gap2_permissions_label =
|
||||
XtVaCreateWidget("gap2_label_permissions",
|
||||
xmLabelGadgetClass,
|
||||
gap2_form_mgr,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
|
||||
max_left_label_width = ComputeMaxWidth(p->gap2_user_label,
|
||||
p->gap2_access_label,
|
||||
p->gap2_permissions_label,
|
||||
NULL)
|
||||
+ 2 * GAP;
|
||||
|
||||
p->gap2_user_text =
|
||||
XtVaCreateWidget("gap2_text_user_name",
|
||||
xmTextWidgetClass,
|
||||
gap2_form_mgr,
|
||||
XmNmaxLength, 80,
|
||||
XmNbottomAttachment, XmATTACH_NONE,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, max_left_label_width,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
p->gap_user_text = p->gap2_user_text;
|
||||
|
||||
XtAddCallback(p->gap_user_text, XmNvalueChangedCallback,
|
||||
v5_gap_pending_change, (XtPointer)p);
|
||||
|
||||
p->gap2_perm_form = CreatePermissions(p, gap2_form_mgr,
|
||||
p->gap2_user_text,
|
||||
max_left_label_width, RIGHT_GAP);
|
||||
|
||||
p->gap2_button_form =
|
||||
XtVaCreateWidget("gap2_button_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
gap2_form_mgr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_perm_form,
|
||||
XmNtopOffset, GAP,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, GAP,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 740, "Add"));
|
||||
p->gap2_add_button =
|
||||
XtVaCreateWidget("gap2_button_add",
|
||||
xmPushButtonWidgetClass,
|
||||
p->gap2_button_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 5,
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(p->gap2_add_button, XmNactivateCallback, GAPAddProc, p);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete"));
|
||||
p->gap2_delete_button =
|
||||
XtVaCreateWidget("gap2_button_delete",
|
||||
xmPushButtonWidgetClass,
|
||||
p->gap2_button_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_add_button,
|
||||
XmNtopOffset, GAP,
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
p->gap_remove_button = p->gap2_delete_button;
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(p->gap2_delete_button, XmNactivateCallback,
|
||||
p_gap_remove_proc, p);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change"));
|
||||
p->gap2_change_button =
|
||||
XtVaCreateWidget("gap2_button_change",
|
||||
xmPushButtonWidgetClass,
|
||||
p->gap2_button_form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 0,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_delete_button,
|
||||
XmNtopOffset, GAP,
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelType, XmSTRING,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree(xstr);
|
||||
XtAddCallback(p->gap2_change_button, XmNactivateCallback, GAPChangeProc,
|
||||
p);
|
||||
|
||||
max_button_label_width = ComputeMaxWidth(p->gap2_add_button,
|
||||
p->gap2_delete_button,
|
||||
p->gap2_change_button,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(p->gap2_add_button,
|
||||
XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
|
||||
XmNrightOffset, -max_button_label_width,
|
||||
NULL);
|
||||
XtVaSetValues(p->gap2_delete_button,
|
||||
XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
|
||||
XmNrightOffset, -max_button_label_width,
|
||||
NULL);
|
||||
XtVaSetValues(p->gap2_change_button,
|
||||
XmNrightAttachment, XmATTACH_OPPOSITE_FORM,
|
||||
XmNrightOffset, -max_button_label_width,
|
||||
NULL);
|
||||
|
||||
p->gap_list = NULL;
|
||||
XtSetArg(args[i], XmNscrollBarDisplayPolicy, XmAUTOMATIC); ++i;
|
||||
XtSetArg(args[i], XmNlistSizePolicy, XmVARIABLE); ++i;
|
||||
XtSetArg(args[i], XmNvisibleItemCount, 10); ++i;
|
||||
XtSetArg(args[i], XmNrightAttachment, XmATTACH_WIDGET); ++i;
|
||||
XtSetArg(args[i], XmNrightWidget, p->gap2_button_form); ++i;
|
||||
XtSetArg(args[i], XmNrightOffset, GAP * 2); ++i;
|
||||
XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); ++i;
|
||||
XtSetArg(args[i], XmNleftOffset, max_left_label_width);
|
||||
++i;
|
||||
XtSetArg(args[i], XmNtopAttachment, XmATTACH_WIDGET); ++i;
|
||||
XtSetArg(args[i], XmNtopOffset, GAP); ++i;
|
||||
XtSetArg(args[i], XmNtopWidget, p->gap2_perm_form); ++i;
|
||||
XtSetArg(args[i], XmNbottomAttachment, XmATTACH_WIDGET); ++i;
|
||||
XtSetArg(args[i], XmNbottomOffset, 0); ++i;
|
||||
XtSetArg(args[i], XmNbottomWidget, p->separator2); ++i;
|
||||
XtSetArg(args[i], XmNdoubleClickInterval, 5); ++i;
|
||||
|
||||
p->gap2_access_list =
|
||||
XmCreateScrolledList(gap2_form_mgr, "gap2_access_list", args, i);
|
||||
p->gap_access_list = p->gap2_access_list;
|
||||
|
||||
XtAddCallback(p->gap2_access_list, XmNbrowseSelectionCallback,
|
||||
gap_list_select_proc, p);
|
||||
|
||||
XtManageChild(p->gap2_access_list);
|
||||
|
||||
XtQueryGeometry( p->gap2_button_form, NULL, &geo );
|
||||
|
||||
XtVaSetValues( p->gap2_user_text,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, geo.width + GAP + GAP,
|
||||
NULL );
|
||||
XtVaSetValues( p->gap2_perm_form,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, geo.width + GAP + GAP,
|
||||
NULL );
|
||||
|
||||
|
||||
ManageChildren(p->gap2_button_form);
|
||||
|
||||
XtVaSetValues(p->gap2_user_label,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_user_text,
|
||||
XmNrightOffset, 5,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(p->gap2_permissions_label,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_user_text,
|
||||
XmNtopOffset, GAP,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_perm_form,
|
||||
XmNrightOffset, 5,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(p->gap2_access_label,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_perm_form,
|
||||
XmNtopOffset, GAP,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_access_list,
|
||||
XmNrightOffset, 5,
|
||||
NULL);
|
||||
|
||||
ManageChildren(gap2_form_mgr);
|
||||
}
|
||||
|
||||
static Widget
|
||||
CreatePermissions(
|
||||
Props_pu *p,
|
||||
Widget parent,
|
||||
Widget widget_above,
|
||||
Dimension left_gap,
|
||||
Dimension right_gap)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Widget perm_form;
|
||||
int n,
|
||||
max_label_width,
|
||||
label_offset;
|
||||
Dimension tog_width,
|
||||
view_label_width,
|
||||
insert_label_width,
|
||||
change_label_width;
|
||||
XmString xstr = NULL,
|
||||
xstr_empty = NULL;
|
||||
|
||||
/* Create the box containing the permission settings */
|
||||
|
||||
perm_form =
|
||||
XtVaCreateWidget("gap2_perm_form_mgr",
|
||||
xmFormWidgetClass,
|
||||
parent,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, left_gap,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, widget_above,
|
||||
XmNtopOffset, GAP,
|
||||
XmNshadowThickness, 1,
|
||||
XmNshadowType, XmSHADOW_IN,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 743, "Public:"));
|
||||
p->gap2_public_label =
|
||||
XtVaCreateWidget("gap2_public_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
xstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 744, "Semiprivate:"));
|
||||
p->gap2_semi_label =
|
||||
XtVaCreateWidget("gap2_semi_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 10,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 745, "Private:"));
|
||||
p->gap2_private_label =
|
||||
XtVaCreateWidget("gap2_private_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
/* Margin to the left of the View label */
|
||||
max_label_width = ComputeMaxWidth(p->gap2_public_label,
|
||||
p->gap2_semi_label,
|
||||
p->gap2_private_label,
|
||||
NULL) + 2 * GAP;
|
||||
|
||||
/* Create the labels and toggles for the permissions */
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 40, "View"));
|
||||
p->gap2_view_label =
|
||||
XtVaCreateWidget("gap2_view_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, max_label_width,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
XtVaGetValues(p->gap2_view_label,
|
||||
XmNwidth, &view_label_width,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* If label is greater than the allocated space for the
|
||||
* label, then we use a 0 offset.
|
||||
*/
|
||||
#ifdef __ppc
|
||||
label_offset = MAX_LABEL_SPACE;
|
||||
label_offset -= view_label_width;
|
||||
#else
|
||||
label_offset = MAX_LABEL_SPACE - view_label_width;
|
||||
#endif /* __ppc */
|
||||
if (label_offset < 0) label_offset = 0;
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert"));
|
||||
|
||||
p->gap2_insert_label =
|
||||
XtVaCreateWidget("gap2_insert_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, p->gap2_view_label,
|
||||
XmNleftOffset, label_offset,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
XtVaGetValues(p->gap2_insert_label,
|
||||
XmNwidth, &insert_label_width,
|
||||
NULL);
|
||||
|
||||
xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change"));
|
||||
|
||||
/*
|
||||
* If label is greater than the allocated space for the
|
||||
* label, then we use a 0 offset.
|
||||
*/
|
||||
#ifdef __ppc
|
||||
label_offset = MAX_LABEL_SPACE;
|
||||
label_offset -= insert_label_width;
|
||||
#else
|
||||
label_offset = MAX_LABEL_SPACE - insert_label_width;
|
||||
#endif /* __ppc */
|
||||
if (label_offset < 0) label_offset = 0;
|
||||
|
||||
p->gap2_change_label =
|
||||
XtVaCreateWidget("gap2_change_label",
|
||||
xmLabelGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, p->gap2_insert_label,
|
||||
XmNleftOffset, label_offset,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, GAP,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr);
|
||||
|
||||
XtVaGetValues(p->gap2_change_label,
|
||||
XmNwidth, &change_label_width,
|
||||
NULL);
|
||||
|
||||
xstr_empty = XmStringCreateLocalized("");
|
||||
p->gap2_public_tog[GAP_VIEW] =
|
||||
XtVaCreateWidget("gap2_public_view_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_view_label,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_view_label,
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
XtVaGetValues(p->gap2_public_tog[GAP_VIEW],
|
||||
XmNwidth, &tog_width,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* Center the toggle item under the label above it.
|
||||
*/
|
||||
XtVaSetValues(p->gap2_public_tog[GAP_VIEW],
|
||||
XmNleftOffset, view_label_width/2 -
|
||||
(int)(tog_width * 3)/8,
|
||||
NULL);
|
||||
|
||||
p->gap2_public_tog[GAP_INSERT] =
|
||||
XtVaCreateWidget("gap2_public_insert_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_insert_label,
|
||||
XmNleftOffset, insert_label_width/2 -
|
||||
(int)(tog_width * 3)/8,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_insert_label,
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_public_tog[GAP_CHANGE] =
|
||||
XtVaCreateWidget("gap2_public_change_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_change_label,
|
||||
XmNleftOffset, change_label_width/2 -
|
||||
(int)(tog_width * 3)/8,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_change_label,
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_semi_tog[GAP_VIEW] =
|
||||
XtVaCreateWidget("gap2_semi_view_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_semi_tog[GAP_INSERT] =
|
||||
XtVaCreateWidget("gap2_semi_insert_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_public_tog[GAP_INSERT],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_public_tog[GAP_INSERT],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_semi_tog[GAP_CHANGE] =
|
||||
XtVaCreateWidget("gap2_semi_change_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_public_tog[GAP_CHANGE],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_public_tog[GAP_CHANGE],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_private_tog[GAP_VIEW] =
|
||||
XtVaCreateWidget("gap2_private_view_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_semi_tog[GAP_VIEW],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_semi_tog[GAP_VIEW],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_private_tog[GAP_INSERT] =
|
||||
XtVaCreateWidget("gap2_private_insert_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_semi_tog[GAP_INSERT],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_semi_tog[GAP_INSERT],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
p->gap2_private_tog[GAP_CHANGE] =
|
||||
XtVaCreateWidget("gap2_private_change_tog",
|
||||
xmToggleButtonGadgetClass,
|
||||
perm_form,
|
||||
XmNlabelString, xstr_empty,
|
||||
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNleftWidget, p->gap2_semi_tog[GAP_CHANGE],
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, p->gap2_semi_tog[GAP_CHANGE],
|
||||
XmNtopOffset, TOG_GAP,
|
||||
XmNindicatorSize, INDICATOR_SIZE,
|
||||
NULL);
|
||||
|
||||
XmStringFree (xstr_empty);
|
||||
|
||||
XtVaSetValues(p->gap2_public_label,
|
||||
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNtopWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNrightOffset, 2 * GAP,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(p->gap2_semi_label,
|
||||
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNtopWidget, p->gap2_semi_tog[GAP_VIEW],
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNrightOffset, 2 * GAP,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(p->gap2_private_label,
|
||||
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNtopWidget, p->gap2_private_tog[GAP_VIEW],
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, p->gap2_public_tog[GAP_VIEW],
|
||||
XmNrightOffset, 2 * GAP,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNbottomOffset, GAP,
|
||||
NULL);
|
||||
|
||||
/* Margin to the right of the Change label */
|
||||
XtVaSetValues(p->gap2_change_label,
|
||||
XmNmarginRight, GAP,
|
||||
NULL);
|
||||
|
||||
ManageChildren(perm_form);
|
||||
return (perm_form);
|
||||
}
|
||||
|
||||
static void
|
||||
GAPAddProc(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Props_pu *p = (Props_pu *)client_data;
|
||||
CSA_flags access_rights;
|
||||
CSA_access_rights *access_entry,
|
||||
*access_list_ptr;
|
||||
char *user_name;
|
||||
XmString xmstr;
|
||||
|
||||
/*
|
||||
* Get the necessary strings from the UI.
|
||||
*/
|
||||
if (!(access_rights = p_gap_convert_permissions(p)))
|
||||
return;
|
||||
|
||||
/* Get the user's name and host */
|
||||
if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) ||
|
||||
!*user_name) {
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 750,
|
||||
"Calendar : Error - Access List and Permissions"));
|
||||
char *text = XtNewString(catgets(c->DT_catd, 1, 749,
|
||||
"Name and Access Rights must be set to add an item to the Access List."));
|
||||
char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95,
|
||||
"Continue"));
|
||||
|
||||
XtFree(user_name);
|
||||
dialog_popup(p->frame,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, text,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
BUTTON_HELP, ACCESS_RIGHTS_ERROR_HELP,
|
||||
DIALOG_IMAGE, p->xm_error_pixmap,
|
||||
NULL);
|
||||
XtFree(ident1);
|
||||
XtFree(text);
|
||||
XtFree(title);
|
||||
return;
|
||||
}
|
||||
|
||||
xmstr = XmStringCreateLocalized(user_name);
|
||||
|
||||
/* See if the item is already in the list */
|
||||
if (p->gap_list) {
|
||||
int list_pos = XmListItemPos(p->gap_access_list, xmstr);
|
||||
|
||||
if (list_pos) {
|
||||
XmListSelectPos(p->gap_access_list, list_pos, False);
|
||||
XmListSetBottomPos(p->gap_access_list, list_pos);
|
||||
XtSetSensitive(p->gap2_change_button, True);
|
||||
XtSetSensitive(p->gap2_delete_button, True);
|
||||
|
||||
/* Does the user want us to change an existing item? */
|
||||
if (!ChangeExistingGAPEntry(p)) {
|
||||
/* No */
|
||||
XtFree(user_name);
|
||||
XmStringFree(xmstr);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find the entry and change the rights. */
|
||||
access_list_ptr = p->gap_list;
|
||||
do {
|
||||
if (!strcmp(access_list_ptr->user->user_name,
|
||||
user_name)) {
|
||||
access_list_ptr->rights = access_rights;
|
||||
p->changed_flag = True;
|
||||
p_set_change(p);
|
||||
XtFree(user_name);
|
||||
XmStringFree(xmstr);
|
||||
return;
|
||||
}
|
||||
} while (access_list_ptr = access_list_ptr->next);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a new access entry and add it to the end of the list */
|
||||
access_entry =
|
||||
(CSA_access_rights *)ckalloc(sizeof(CSA_access_rights));
|
||||
access_entry->user =
|
||||
(CSA_calendar_user *)ckalloc(sizeof(CSA_calendar_user));
|
||||
access_entry->user->user_name = cm_strdup(user_name);
|
||||
access_entry->rights = access_rights;
|
||||
access_entry->next = NULL;
|
||||
|
||||
if (!p->gap_list) {
|
||||
p->gap_list = access_entry;
|
||||
} else {
|
||||
access_list_ptr = p->gap_list;
|
||||
while (access_list_ptr->next)
|
||||
access_list_ptr = access_list_ptr->next;
|
||||
access_list_ptr->next = access_entry;
|
||||
}
|
||||
|
||||
XmListAddItem(p->gap_access_list, xmstr, 0);
|
||||
p->changed_flag = True;
|
||||
p_set_change(p);
|
||||
XtFree(user_name);
|
||||
XmStringFree(xmstr);
|
||||
}
|
||||
|
||||
static int
|
||||
ChangeExistingGAPEntry(
|
||||
Props_pu *p)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
int answer;
|
||||
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 1078,
|
||||
"Calendar : Access List and Permissions - Add"));
|
||||
char *text = XtNewString(catgets(c->DT_catd, 1, 751,
|
||||
"This entry already exists in the Access List. Do you wish to change it?"));
|
||||
char *ident1 = XtNewString(catgets(c->DT_catd, 1, 343,
|
||||
"Change"));
|
||||
char *ident2 = XtNewString(catgets(c->DT_catd, 1, 923,
|
||||
"Cancel"));
|
||||
|
||||
answer = dialog_popup(p->frame,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, text,
|
||||
BUTTON_IDENT, 2, ident2,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
NULL);
|
||||
XtFree(ident2);
|
||||
XtFree(ident1);
|
||||
XtFree(text);
|
||||
XtFree(title);
|
||||
|
||||
if (answer == 1)
|
||||
return False;
|
||||
return True;
|
||||
}
|
||||
|
||||
static void
|
||||
GAPChangeProc(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer callback_struct)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
Props_pu *p = (Props_pu *)client_data;
|
||||
CSA_access_list step = p->gap_list,
|
||||
last = NULL;
|
||||
int *item_list = NULL,
|
||||
item_cnt = 0;
|
||||
CSA_flags access_rights;
|
||||
CSA_access_rights *access_entry;
|
||||
char *user_name;
|
||||
XmString xmstr;
|
||||
|
||||
|
||||
/* An item to change must be selected in the access list */
|
||||
if (!XmListGetSelectedPos(p->gap2_access_list, &item_list, &item_cnt)) {
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 750,
|
||||
"Calendar : Error - Access List and Permissions"));
|
||||
char *text = XtNewString(catgets(c->DT_catd, 1, 408,
|
||||
"Please select a name first. "));
|
||||
char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
|
||||
dialog_popup(p->frame,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, text,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
DIALOG_IMAGE, p->xm_error_pixmap,
|
||||
NULL);
|
||||
XtFree(ident1);
|
||||
XtFree(text);
|
||||
XtFree(title);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the necessary strings from the UI.
|
||||
*/
|
||||
if (!(access_rights = p_gap_convert_permissions(p)))
|
||||
return;
|
||||
|
||||
/* Get the user's name and host */
|
||||
if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) ||
|
||||
!*user_name) {
|
||||
char *title = XtNewString(catgets(c->DT_catd, 1, 750,
|
||||
"Calendar : Error - Access List and Permissions"));
|
||||
char *text = XtNewString(catgets(c->DT_catd, 1, 756,
|
||||
"Name and Access rights must be set to change an item in the Access List"));
|
||||
char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
|
||||
|
||||
XtFree(user_name);
|
||||
dialog_popup(p->frame,
|
||||
DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, text,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
DIALOG_IMAGE, p->xm_error_pixmap,
|
||||
NULL);
|
||||
XtFree(ident1);
|
||||
XtFree(text);
|
||||
XtFree(title);
|
||||
return;
|
||||
}
|
||||
|
||||
xmstr = XmStringCreateLocalized(user_name);
|
||||
|
||||
/* Create a new access entry and add it to the end of the list */
|
||||
access_entry =
|
||||
(CSA_access_rights *)ckalloc(sizeof(CSA_access_rights));
|
||||
access_entry->user =
|
||||
(CSA_calendar_user *)ckalloc(sizeof(CSA_calendar_user));
|
||||
access_entry->user->user_name = cm_strdup(user_name);
|
||||
access_entry->rights = access_rights;
|
||||
access_entry->next = NULL;
|
||||
|
||||
/*
|
||||
* Find and change the Access_Entry/name from the list.
|
||||
*/
|
||||
item_cnt = 1;
|
||||
while(item_cnt < *item_list) {
|
||||
last = step;
|
||||
step = step->next;
|
||||
++item_cnt;
|
||||
}
|
||||
|
||||
if (last)
|
||||
last->next = access_entry;
|
||||
else
|
||||
p->gap_list = access_entry;
|
||||
|
||||
access_entry->next = step->next;
|
||||
|
||||
free(step->user);
|
||||
free(step);
|
||||
|
||||
XmListReplaceItemsPos(p->gap2_access_list, &xmstr, 1, *item_list);
|
||||
|
||||
p->changed_flag = True;
|
||||
p_set_change(p);
|
||||
|
||||
XmStringFree(xmstr);
|
||||
XtFree((XtPointer)item_list);
|
||||
}
|
||||
3385
cde/programs/dtcm/dtcm/props_pu.c
Normal file
3385
cde/programs/dtcm/dtcm/props_pu.c
Normal file
File diff suppressed because it is too large
Load Diff
247
cde/programs/dtcm/dtcm/props_pu.h
Normal file
247
cde/programs/dtcm/dtcm/props_pu.h
Normal file
@@ -0,0 +1,247 @@
|
||||
/* $TOG: props_pu.h /main/8 1999/05/07 14:12:09 jff $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _PROPS_PU_H
|
||||
#define _PROPS_PU_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "dssw.h"
|
||||
#include "props.h"
|
||||
#include "reminders.h"
|
||||
|
||||
/* Array indices for group access toggle items. */
|
||||
#define GAP_VIEW 0
|
||||
#define GAP_INSERT 1
|
||||
#define GAP_CHANGE 2
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Bit Masks for determining redisplay behavior.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
#define PROPS_REDO_DISPLAY 0x1 /* This is all displays. The main
|
||||
canvas, the appointment and todo
|
||||
lists, and the multi-browse window. */
|
||||
#define PROPS_REDO_EDITORS 0x2 /* This is the todo and appointment
|
||||
editor. */
|
||||
#define PROPS_REDO_PRINT_DIALOG 0x4 /* The print dialog. */
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Supporting typedefs
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef enum {
|
||||
EDITOR_PANE,
|
||||
DISPLAY_PANE,
|
||||
GROUP_ACCESS_PANE,
|
||||
PRINTER_OPS_PANE,
|
||||
DATE_FORMAT_PANE
|
||||
} PaneType;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** The Props Pop Up Structure
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
Widget ok_button;
|
||||
Widget apply_button;
|
||||
Widget base_form_mgr;
|
||||
Calendar *cal;
|
||||
Widget category_menu;
|
||||
Boolean changed_flag;
|
||||
Widget close_button;
|
||||
Pixmap contract_pixmap; /* 16x16-contract buttons */
|
||||
Widget defaults_button;
|
||||
Pixmap expand_pixmap; /* 16x16-expand buttons */
|
||||
Widget frame;
|
||||
Widget help_button;
|
||||
PaneType last_props_pane;
|
||||
Widget *pane_list;
|
||||
Pixmap postup_pixmap; /* 64x128-reminder image */
|
||||
Widget separator1;
|
||||
Widget separator2;
|
||||
Pixmap xm_error_pixmap; /* 20x20-motif error */
|
||||
Pixmap xm_info_pixmap; /* 11x24-motif information */
|
||||
Pixmap xm_question_pixmap; /* 22x22-motif question */
|
||||
Pixmap xm_warning_pixmap; /* 9x22-motif warning */
|
||||
|
||||
/*
|
||||
* These are temporary - until problem with resource file is worked out
|
||||
*/
|
||||
Pixmap appt_button_xbm;
|
||||
Pixmap todo_button_xbm;
|
||||
Pixmap year_button_xbm;
|
||||
Pixmap month_button_xbm;
|
||||
Pixmap week_button_xbm;
|
||||
Pixmap day_button_xbm;
|
||||
Pixmap drag_icon_xbm;
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** Editor pane widgets
|
||||
**
|
||||
***********************************************************************/
|
||||
Widget ep_appt_label;
|
||||
DSSW ep_dssw;
|
||||
Widget ep_dur_cb;
|
||||
Widget ep_dur_label;
|
||||
Widget ep_dur_message;
|
||||
Reminders ep_reminders;
|
||||
Widget privacy_label;
|
||||
Widget privacy_menu;
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** Display pane widgets
|
||||
**
|
||||
***********************************************************************/
|
||||
Widget dp_beg_label;
|
||||
Widget dp_beg_scale;
|
||||
Widget dp_beg_value;
|
||||
Widget dp_day_label;
|
||||
Widget dp_end_label;
|
||||
Widget dp_end_scale;
|
||||
Widget dp_end_value;
|
||||
Widget dp_hour12_toggle;
|
||||
Widget dp_hour24_toggle;
|
||||
Widget dp_hour_label;
|
||||
Widget dp_hour_rc_mgr;
|
||||
Widget dp_init_view_label;
|
||||
Widget dp_init_view_text;
|
||||
Widget dp_loc_label;
|
||||
Widget dp_loc_text;
|
||||
Widget dp_view_label;
|
||||
Widget dp_view_rc_mgr;
|
||||
Widget dp_view_day_toggle;
|
||||
Widget dp_view_month_toggle;
|
||||
Widget dp_view_week_toggle;
|
||||
Widget dp_view_year_toggle;
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** Group Access pane widgets
|
||||
**
|
||||
***********************************************************************/
|
||||
Widget gap_access_header;
|
||||
Widget gap_access_list;
|
||||
Widget gap_access_list_sw;
|
||||
Widget gap_access_msg;
|
||||
Widget gap_add_button;
|
||||
Widget gap_browse_toggle;
|
||||
Widget gap_delete_toggle;
|
||||
Widget gap_insert_toggle;
|
||||
CSA_access_list gap_list;
|
||||
Widget gap_perm_label;
|
||||
Widget gap_perm_rc_mgr;
|
||||
Widget gap_remove_button;
|
||||
Widget gap_user_label;
|
||||
Widget gap_user_text;
|
||||
Boolean v4_gap_pending_message_up;
|
||||
|
||||
Widget gap2_user_label;
|
||||
Widget gap2_access_label;
|
||||
Widget gap2_permissions_label;
|
||||
Widget gap2_user_text;
|
||||
Widget gap2_button_form;
|
||||
Widget gap2_add_button;
|
||||
Widget gap2_delete_button;
|
||||
Widget gap2_change_button;
|
||||
Widget gap2_access_list;
|
||||
Widget gap2_perm_form;
|
||||
Widget gap2_public_label;
|
||||
Widget gap2_semi_label;
|
||||
Widget gap2_private_label;
|
||||
Widget gap2_view_label;
|
||||
Widget gap2_insert_label;
|
||||
Widget gap2_change_label;
|
||||
Widget gap2_public_tog[3];
|
||||
Widget gap2_semi_tog[3];
|
||||
Widget gap2_private_tog[3];
|
||||
Boolean v5_gap_pending_message_up;
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** Printer Ops pane widgets
|
||||
**
|
||||
***********************************************************************/
|
||||
Widget pop_margin_frame;
|
||||
Widget pop_left_text;
|
||||
Widget pop_top_text;
|
||||
Widget pop_right_text;
|
||||
Widget pop_bottom_text;
|
||||
Widget pop_header_frame;
|
||||
Widget pop_tl_option;
|
||||
Widget pop_tr_option;
|
||||
Widget pop_bl_option;
|
||||
Widget pop_br_option;
|
||||
Widget pop_privacy_label;
|
||||
Widget pop_privacy_private_toggle;
|
||||
Widget pop_privacy_public_toggle;
|
||||
Widget pop_privacy_rc_mgr;
|
||||
Widget pop_privacy_semi_toggle;
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** Date Format pane widgets
|
||||
**
|
||||
***********************************************************************/
|
||||
Widget dfp_order_ddmmyy_toggle;
|
||||
Widget dfp_order_label;
|
||||
Widget dfp_order_mmddyy_toggle;
|
||||
Widget dfp_order_rc_mgr;
|
||||
Widget dfp_order_yymmdd_toggle;
|
||||
Widget dfp_sep_blank_toggle;
|
||||
Widget dfp_sep_dash_toggle;
|
||||
Widget dfp_sep_label;
|
||||
Widget dfp_sep_period_toggle;
|
||||
Widget dfp_sep_rc_mgr;
|
||||
Widget dfp_sep_slash_toggle;
|
||||
} Props_pu;
|
||||
|
||||
/* Enum for Print Option header/footer specifications. */
|
||||
enum
|
||||
{
|
||||
POP_HDR_DATE,
|
||||
POP_HDR_USER_ID,
|
||||
POP_HDR_PAGE_NUMBER,
|
||||
POP_HDR_REPORT_TYPE,
|
||||
POP_HDR_NONE,
|
||||
POP_HDR_NUM_CHOICES /* MUST BE LAST */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** External function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void create_all_pixmaps P((Props_pu*, Widget));
|
||||
extern Boolean get_date_vals_from_ui P((Props_pu*, Props*));
|
||||
extern Boolean get_display_vals_from_ui P((Props_pu*, Props*));
|
||||
extern Boolean get_editor_vals_from_ui P((Props_pu*, Props*));
|
||||
extern Boolean get_gap_vals_from_ui P((Props_pu*, Props*));
|
||||
extern Boolean get_printer_vals_from_ui P((Props_pu*, Props*));
|
||||
extern Boolean get_props_from_ui P((Props_pu*, Props*, int*));
|
||||
extern void set_date_vals_on_ui P((Props_pu*, Props*));
|
||||
extern void set_display_vals_on_ui P((Props_pu*, Props*));
|
||||
extern void set_editor_vals_on_ui P((Props_pu*, Props*));
|
||||
extern void set_gap_vals_on_ui P((Props_pu*, Props*));
|
||||
extern void set_printer_vals_on_ui P((Props_pu*, Props*));
|
||||
extern void set_props_on_ui P((Props_pu*, Props*));
|
||||
extern void set_props_pu_defaults P((Props_pu*, Props*));
|
||||
extern void show_props_pu P((Calendar*));
|
||||
extern void props_pu_clean_up P((Props_pu*));
|
||||
extern Boolean props_pu_showing P((Props_pu*));
|
||||
extern Boolean p_flush_changes P((Calendar*));
|
||||
extern void show_print_props_pu P((Calendar*));
|
||||
|
||||
extern void p_defaults_proc_helper(XtPointer client_data);
|
||||
|
||||
#endif
|
||||
915
cde/programs/dtcm/dtcm/reminders.c
Normal file
915
cde/programs/dtcm/dtcm/reminders.c
Normal file
@@ -0,0 +1,915 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** reminders.c
|
||||
**
|
||||
** $XConsortium: reminders.c /main/7 1996/08/06 11:41:54 barstow $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
#include <ctype.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/ToggleB.h>
|
||||
#include "reminders.h"
|
||||
#include "props.h"
|
||||
#include "help.h"
|
||||
#include "props_pu.h"
|
||||
#include "util.h"
|
||||
|
||||
extern int _csa_duration_to_iso8601(int, char *);
|
||||
extern int _csa_iso8601_to_duration(char *, int*);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Static functions local to reminders.c only
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
static Reminder_val_op
|
||||
r_validate_advance(char *advance_string) {
|
||||
|
||||
char *c_p = advance_string;
|
||||
char *end_ptr;
|
||||
Boolean scanned_sign = False;
|
||||
|
||||
/* crush out leading white space for the name
|
||||
comparison/insert process */
|
||||
|
||||
while ((*c_p == ' ') || (*c_p == '\t'))
|
||||
c_p++;
|
||||
|
||||
/* compress off trailing whitespace */
|
||||
|
||||
end_ptr = c_p;
|
||||
while (*end_ptr)
|
||||
end_ptr++;
|
||||
while ((end_ptr > c_p) &&
|
||||
((*(end_ptr - 1) == ' ') || (*(end_ptr - 1) == '\t')))
|
||||
end_ptr--;
|
||||
|
||||
*end_ptr = NULL;
|
||||
|
||||
|
||||
if (blank_buf(c_p)) {
|
||||
return(ADVANCE_BLANK);
|
||||
}
|
||||
|
||||
if (embedded_blank(c_p)) {
|
||||
return(ADVANCE_CONTAINS_BLANK);
|
||||
}
|
||||
|
||||
while (c_p && *c_p) {
|
||||
if (isdigit(*c_p) || ((*c_p == '-') && (scanned_sign == False))) {
|
||||
if ((*c_p == '-') && (scanned_sign == False))
|
||||
scanned_sign = True;
|
||||
c_p++;
|
||||
} else {
|
||||
return(ADVANCE_NONNUMERIC);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return(REMINDERS_OK);
|
||||
}
|
||||
|
||||
static Reminder_val_op
|
||||
r_get_bfpm_vals(Widget toggle, Widget text, Reminders_val *val,
|
||||
Boolean convert_to_secs) {
|
||||
char *cval;
|
||||
Time_scope_menu_op scope;
|
||||
Reminder_val_op status;
|
||||
|
||||
if (!XmToggleButtonGetState(toggle)) {
|
||||
val->selected = False;
|
||||
val->scope_val = -1;
|
||||
return(REMINDERS_OK);
|
||||
}
|
||||
|
||||
val->selected = True;
|
||||
cval = XmTextGetString(text);
|
||||
|
||||
if ((status = r_validate_advance(cval)) != REMINDERS_OK)
|
||||
return(status);
|
||||
|
||||
val->scope_val = atoi(cval);
|
||||
XtFree(cval);
|
||||
|
||||
switch(val->scope) {
|
||||
case TIME_DAYS:
|
||||
if (convert_to_secs)
|
||||
val->scope_val = days_to_seconds(val->scope_val);
|
||||
break;
|
||||
case TIME_HRS:
|
||||
if (convert_to_secs)
|
||||
val->scope_val = hours_to_seconds(val->scope_val);
|
||||
break;
|
||||
case TIME_MINS:
|
||||
default:
|
||||
if (convert_to_secs)
|
||||
val->scope_val = minutes_to_seconds(val->scope_val);
|
||||
break;
|
||||
}
|
||||
|
||||
return(REMINDERS_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
r_get_mailto_val(Reminders *r) {
|
||||
char *c;
|
||||
|
||||
c = XmTextGetString(r->mailto_text);
|
||||
if (!blank_buf(c))
|
||||
cm_strcpy(r->mailto_val, c);
|
||||
else
|
||||
cm_strcpy(r->mailto_val, cm_get_credentials());
|
||||
XtFree(c);
|
||||
}
|
||||
|
||||
static void
|
||||
r_set_bfpm_vals(
|
||||
Widget toggle,
|
||||
Widget text,
|
||||
Widget menu,
|
||||
Reminders_val *val,
|
||||
Boolean compute_best_fit)
|
||||
{
|
||||
char buf[128];
|
||||
Calendar *c = calendar;
|
||||
Widget submenu;
|
||||
int n;
|
||||
WidgetList option_items;
|
||||
Time_scope_menu_op scope = val->scope;
|
||||
XmString xmstr;
|
||||
|
||||
|
||||
if (!XtIsManaged(toggle))
|
||||
return;
|
||||
|
||||
XtVaGetValues(menu,
|
||||
XmNsubMenuId, &submenu,
|
||||
NULL);
|
||||
|
||||
XtVaGetValues(submenu,
|
||||
XmNchildren, &option_items,
|
||||
XmNnumChildren, &n,
|
||||
NULL);
|
||||
|
||||
if (!val->selected) {
|
||||
XmToggleButtonSetState(toggle, False, True);
|
||||
XtVaSetValues(text, XmNvalue, "\0",
|
||||
NULL);
|
||||
|
||||
switch ( scope ) {
|
||||
case TIME_MINS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 877, time_scope_str(scope) ) );
|
||||
break;
|
||||
case TIME_HRS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 878, time_scope_str(scope) ) );
|
||||
break;
|
||||
case TIME_DAYS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 879, time_scope_str(scope) ) );
|
||||
break;
|
||||
default :
|
||||
xmstr = XmStringCreateLocalized(time_scope_str(scope));
|
||||
}
|
||||
XtVaSetValues(XmOptionButtonGadget(menu), XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (compute_best_fit) {
|
||||
if (val->scope_val % daysec == 0) {
|
||||
val->scope = TIME_DAYS;
|
||||
sprintf(buf, "%d", seconds_to_days(val->scope_val));
|
||||
} else if (val->scope_val % hrsec == 0) {
|
||||
val->scope = TIME_HRS;
|
||||
sprintf(buf, "%d", seconds_to_hours(val->scope_val));
|
||||
} else {
|
||||
val->scope = TIME_MINS;
|
||||
sprintf(buf, "%d", seconds_to_minutes(val->scope_val));
|
||||
}
|
||||
} else
|
||||
sprintf(buf, "%d", val->scope_val);
|
||||
|
||||
switch ( scope ) {
|
||||
case TIME_MINS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 877, time_scope_str(scope) ) );
|
||||
break;
|
||||
case TIME_HRS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 878, time_scope_str(scope) ) );
|
||||
break;
|
||||
case TIME_DAYS :
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets( calendar->DT_catd, 1, 879, time_scope_str(scope) ) );
|
||||
break;
|
||||
default :
|
||||
xmstr = XmStringCreateLocalized(time_scope_str(scope));
|
||||
}
|
||||
XtVaSetValues(XmOptionButtonGadget(menu), XmNlabelString, xmstr,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
XmToggleButtonSetState(toggle, True, True);
|
||||
XtVaSetValues(text, XmNvalue, buf,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
r_set_mailto_val(Reminders *r) {
|
||||
XtVaSetValues(r->mailto_text, XmNvalue, r->mailto_val,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** The function ensures the user data is set properly for the time scope
|
||||
** menus. This way, when the r_get_bfpm_vals function is called, it knows
|
||||
** how it should convert the value found in the text field.
|
||||
*/
|
||||
static void
|
||||
r_scope_menu_proc(Widget item, XtPointer client_data, XtPointer cbs) {
|
||||
Reminders_val *val = (Reminders_val *)client_data;
|
||||
Time_scope_menu_op scope;
|
||||
|
||||
XtVaGetValues(item, XmNuserData, &val->scope,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** Function sets the alarm text fields and menus sensitive/insensitive
|
||||
** depending on the state of the toggle button.
|
||||
*/
|
||||
static void
|
||||
r_alarm_toggle_proc(Widget toggle_w, XtPointer client_data, XtPointer cbs) {
|
||||
|
||||
Boolean status = XmToggleButtonGetState(toggle_w);
|
||||
Reminders *r = (Reminders *)client_data;
|
||||
Widget text_w, menu_w;
|
||||
|
||||
if (!r)
|
||||
return;
|
||||
|
||||
if (toggle_w == r->beep_toggle) {
|
||||
XtVaSetValues(r->beep_text, XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(XmOptionButtonGadget(r->beep_menu),
|
||||
XmNsensitive, status,
|
||||
NULL);
|
||||
} else if (toggle_w == r->flash_toggle) {
|
||||
XtVaSetValues(r->flash_text, XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(XmOptionButtonGadget(r->flash_menu),
|
||||
XmNsensitive, status,
|
||||
NULL);
|
||||
} else if (toggle_w == r->popup_toggle) {
|
||||
XtVaSetValues(r->popup_text, XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(XmOptionButtonGadget(r->popup_menu),
|
||||
XmNsensitive, status,
|
||||
NULL);
|
||||
} else if (toggle_w == r->mail_toggle) {
|
||||
XtVaSetValues(r->mail_text, XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(XmOptionButtonGadget(r->mail_menu),
|
||||
XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(r->mailto_label, XmNsensitive, status,
|
||||
NULL);
|
||||
XtVaSetValues(r->mailto_text, XmNsensitive, status,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** External functions
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void
|
||||
build_reminders(Reminders *r, Calendar *c, Widget parent) {
|
||||
|
||||
Widget widest_toggle;
|
||||
Dimension widest, highest;
|
||||
Widget prev, curr;
|
||||
Dimension _toText, _toOption;
|
||||
XmString xmstr;
|
||||
|
||||
r->cal = c;
|
||||
r->parent = parent;
|
||||
|
||||
/*
|
||||
** Base form and label
|
||||
*/
|
||||
r->bfpm_form_mgr = XtVaCreateWidget("bfpm_form_mgr",
|
||||
xmFormWidgetClass, parent,
|
||||
XmNautoUnmanage, False,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 985, "Reminders"));
|
||||
r->alarm_label = XtVaCreateWidget("Reminders",
|
||||
xmLabelGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 5,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
/* Create the 4 toggle items to see which one is the longest */
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 986, "Beep"));
|
||||
r->beep_toggle = XtVaCreateWidget("Beep",
|
||||
xmToggleButtonGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 987, "Flash"));
|
||||
r->flash_toggle = XtVaCreateWidget("Flash",
|
||||
xmToggleButtonGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 988, "Popup"));
|
||||
r->popup_toggle = XtVaCreateWidget("Popup",
|
||||
xmToggleButtonGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 989, "Mail"));
|
||||
r->mail_toggle = XtVaCreateWidget("Mail",
|
||||
xmToggleButtonGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
xmstr = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 990, "Mail To:" ) );
|
||||
r->mailto_label = XtVaCreateManagedWidget("MailTo",
|
||||
xmLabelGadgetClass, r->bfpm_form_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNsensitive, False,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
|
||||
|
||||
/*
|
||||
** Beep toggle, text, and menu
|
||||
*/
|
||||
XtAddCallback(r->beep_toggle, XmNvalueChangedCallback,
|
||||
r_alarm_toggle_proc, r);
|
||||
|
||||
r->beep_text = XtVaCreateWidget("beep_text",
|
||||
xmTextWidgetClass, r->bfpm_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNsensitive, False,
|
||||
XmNmaxLength, REMINDER_SCOPE_LEN - 1,
|
||||
NULL);
|
||||
|
||||
r->beep_menu = (Widget)create_time_scope_menu(r->bfpm_form_mgr,
|
||||
NULL, r_scope_menu_proc, (XtPointer)&r->beep_val);
|
||||
XtVaSetValues(r->beep_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
** Flash toggle, text, and menu
|
||||
*/
|
||||
XtAddCallback(r->flash_toggle, XmNvalueChangedCallback,
|
||||
r_alarm_toggle_proc, r);
|
||||
|
||||
r->flash_text = XtVaCreateWidget("flash_text",
|
||||
xmTextWidgetClass, r->bfpm_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNsensitive, False,
|
||||
XmNmaxLength, REMINDER_SCOPE_LEN - 1,
|
||||
NULL);
|
||||
|
||||
r->flash_menu = (Widget)create_time_scope_menu(r->bfpm_form_mgr,
|
||||
NULL, r_scope_menu_proc, (XtPointer)&r->flash_val);
|
||||
XtVaSetValues(r->flash_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
** Popup toggle, text, and menu
|
||||
*/
|
||||
XtAddCallback(r->popup_toggle, XmNvalueChangedCallback,
|
||||
r_alarm_toggle_proc, r);
|
||||
|
||||
r->popup_text = XtVaCreateWidget("popup_text",
|
||||
xmTextWidgetClass, r->bfpm_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNsensitive, False,
|
||||
XmNmaxLength, REMINDER_SCOPE_LEN - 1,
|
||||
NULL);
|
||||
|
||||
r->popup_menu = (Widget)create_time_scope_menu(r->bfpm_form_mgr,
|
||||
NULL, r_scope_menu_proc, (XtPointer)&r->popup_val);
|
||||
XtVaSetValues(r->popup_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
** Mail toggle, text, and menu
|
||||
*/
|
||||
XtAddCallback(r->mail_toggle, XmNvalueChangedCallback,
|
||||
r_alarm_toggle_proc, r);
|
||||
|
||||
r->mail_text = XtVaCreateWidget("mail_text",
|
||||
xmTextWidgetClass, r->bfpm_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNsensitive, False,
|
||||
XmNmaxLength, REMINDER_SCOPE_LEN - 1,
|
||||
NULL);
|
||||
|
||||
r->mail_menu = (Widget)create_time_scope_menu(r->bfpm_form_mgr,
|
||||
NULL, r_scope_menu_proc, (XtPointer)&r->mail_val);
|
||||
XtVaSetValues(r->mail_menu,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
** Mailto text
|
||||
*/
|
||||
r->mailto_text = XtVaCreateWidget("mailto_text",
|
||||
xmTextWidgetClass, r->bfpm_form_mgr,
|
||||
XmNeditMode, XmSINGLE_LINE_EDIT,
|
||||
XmNsensitive, False,
|
||||
XmNmaxLength, MAILTO_LEN - 1,
|
||||
NULL);
|
||||
/*
|
||||
* Here, we do a layout.
|
||||
*/
|
||||
|
||||
_i18n_WidestWidget( 5, &prev, &widest, r->beep_toggle, r->flash_toggle,
|
||||
r->popup_toggle, r->mail_toggle, r->mailto_label );
|
||||
_toText = 5 + 10 + widest + 10;
|
||||
|
||||
_i18n_WidestWidget( 4, &prev, &widest, r->beep_text, r->flash_text,
|
||||
r->popup_text, r->mail_text );
|
||||
_toOption = _toText + widest + 5;
|
||||
|
||||
/*
|
||||
* r->beep_toggle,r->beep_text,r->beep_menu
|
||||
*/
|
||||
prev = r->alarm_label;
|
||||
_i18n_HighestWidgetAdjust( 3, &curr, &highest, r->beep_toggle,
|
||||
r->beep_text, r->beep_menu );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->beep_toggle,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5 + 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->beep_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( r->beep_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toOption,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* r->flash_toggle,r->flash_text,r->flash_menu
|
||||
*/
|
||||
_i18n_HighestWidgetAdjust( 3, &curr, &highest, r->flash_toggle,
|
||||
r->flash_text, r->flash_menu );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->flash_toggle,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5 + 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->flash_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( r->flash_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toOption,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* r->popup_toggle,r->popup_text,r->popup_menu
|
||||
*/
|
||||
_i18n_HighestWidgetAdjust( 3, &curr, &highest, r->popup_toggle,
|
||||
r->popup_text, r->popup_menu );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->popup_toggle,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5 + 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->popup_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( r->popup_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toOption,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* r->mail_toggle,r->mail_text,r->mail_menu
|
||||
*/
|
||||
_i18n_HighestWidgetAdjust( 3, &curr, &highest, r->mail_toggle,
|
||||
r->mail_text, r->mail_menu );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->mail_toggle,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5 + 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->mail_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
XtVaSetValues( r->mail_menu,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toOption,
|
||||
NULL );
|
||||
prev = curr;
|
||||
|
||||
/*
|
||||
* r->mailto_label,r->mailto_text
|
||||
*/
|
||||
_i18n_HighestWidgetAdjust( 2, &curr, &highest, r->mailto_label,
|
||||
r->mailto_text );
|
||||
XtVaSetValues( curr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, prev,
|
||||
XmNtopOffset, 20,
|
||||
NULL );
|
||||
XtVaSetValues( r->mailto_label,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5 + 10,
|
||||
NULL );
|
||||
XtVaSetValues( r->mailto_text,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, _toText,
|
||||
NULL );
|
||||
}
|
||||
|
||||
extern Reminder_val_op
|
||||
get_reminders_vals(Reminders *r, Boolean convert_to_secs) {
|
||||
|
||||
Reminder_val_op status;
|
||||
|
||||
if ((status = r_get_bfpm_vals(r->beep_toggle, r->beep_text, &r->beep_val,
|
||||
convert_to_secs)) != REMINDERS_OK)
|
||||
return(status);
|
||||
|
||||
if ((status = r_get_bfpm_vals(r->flash_toggle, r->flash_text, &r->flash_val,
|
||||
convert_to_secs)) != REMINDERS_OK)
|
||||
return(status);
|
||||
|
||||
if ((status = r_get_bfpm_vals(r->mail_toggle, r->mail_text, &r->mail_val,
|
||||
convert_to_secs)) != REMINDERS_OK)
|
||||
return(status);
|
||||
|
||||
if ((status = r_get_bfpm_vals(r->popup_toggle, r->popup_text, &r->popup_val,
|
||||
convert_to_secs)) != REMINDERS_OK)
|
||||
return(status);
|
||||
|
||||
r_get_mailto_val(r);
|
||||
|
||||
return(REMINDERS_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
reminder_err_msg(Widget frame, char *name, Reminder_val_op op, Pixmap p)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
char buf[MAXNAMELEN], buf2[MAXNAMELEN * 2];
|
||||
char *title;
|
||||
char *ident1;
|
||||
|
||||
switch(op) {
|
||||
case ADVANCE_BLANK:
|
||||
sprintf(buf, catgets(c->DT_catd, 1, 775, "You must specify a reminder advance\nOperation was cancelled. Calendar"));
|
||||
break;
|
||||
case ADVANCE_CONTAINS_BLANK:
|
||||
sprintf(buf, catgets(c->DT_catd, 1, 776, "A reminder advance may not contain an embedded blank\nOperation was cancelled. Calendar"));
|
||||
break;
|
||||
case ADVANCE_NONNUMERIC:
|
||||
sprintf(buf, catgets(c->DT_catd, 1, 777, "Advance values must be a number with an optional sign\nOperation was cancelled. Calendar"));
|
||||
break;
|
||||
case REMINDERS_OK:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sprintf(buf2, "%s %s", buf, name);
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 364,
|
||||
"Calendar : Error - Editor"));
|
||||
ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
|
||||
dialog_popup(frame, DIALOG_TITLE, title,
|
||||
DIALOG_TEXT, buf2,
|
||||
BUTTON_IDENT, 1, ident1,
|
||||
BUTTON_HELP, ADVANCE_ERROR_HELP,
|
||||
DIALOG_IMAGE, p,
|
||||
NULL);
|
||||
XtFree(ident1);
|
||||
XtFree(title);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** This function will consume form values and stuff them into an appointment.
|
||||
*/
|
||||
extern Boolean
|
||||
reminders_form_to_appt(Reminders *r, Dtcm_appointment *appt, char *name) {
|
||||
|
||||
Reminder_val_op status;
|
||||
Props_pu *pu = (Props_pu *)r->cal->properties_pu;
|
||||
|
||||
if (r->bfpm_form_mgr) {
|
||||
if ((status = get_reminders_vals(r, True)) != REMINDERS_OK) {
|
||||
reminder_err_msg(r->parent, name, status,
|
||||
pu->xm_error_pixmap);
|
||||
return(False);
|
||||
}
|
||||
}
|
||||
|
||||
if (!r->beep_val.selected) {
|
||||
free(appt->beep->value);
|
||||
appt->beep->value = NULL;
|
||||
} else {
|
||||
appt->beep->value->item.reminder_value->lead_time = (char *) malloc(BUFSIZ);
|
||||
_csa_duration_to_iso8601(r->beep_val.scope_val, appt->beep->value->item.reminder_value->lead_time);
|
||||
appt->beep->value->item.reminder_value->reminder_data.data = NULL;
|
||||
appt->beep->value->item.reminder_value->reminder_data.size = 0;
|
||||
}
|
||||
|
||||
if (!r->flash_val.selected) {
|
||||
free(appt->flash->value);
|
||||
appt->flash->value = NULL;
|
||||
} else {
|
||||
appt->flash->value->item.reminder_value->lead_time = (char *) malloc(BUFSIZ);
|
||||
_csa_duration_to_iso8601(r->flash_val.scope_val, appt->flash->value->item.reminder_value->lead_time);
|
||||
appt->flash->value->item.reminder_value->reminder_data.data = NULL;
|
||||
appt->flash->value->item.reminder_value->reminder_data.size = 0;
|
||||
}
|
||||
|
||||
if (!r->popup_val.selected) {
|
||||
free(appt->popup->value);
|
||||
appt->popup->value = NULL;
|
||||
} else {
|
||||
appt->popup->value->item.reminder_value->lead_time = (char *) malloc(BUFSIZ);
|
||||
_csa_duration_to_iso8601(r->popup_val.scope_val, appt->popup->value->item.reminder_value->lead_time);
|
||||
appt->popup->value->item.reminder_value->reminder_data.data = NULL;
|
||||
appt->popup->value->item.reminder_value->reminder_data.size = 0;
|
||||
}
|
||||
|
||||
if (!r->mail_val.selected) {
|
||||
free(appt->mail->value);
|
||||
appt->mail->value = NULL;
|
||||
} else {
|
||||
appt->mail->value->item.reminder_value->lead_time = (char *) malloc(BUFSIZ);
|
||||
_csa_duration_to_iso8601(r->mail_val.scope_val, appt->mail->value->item.reminder_value->lead_time);
|
||||
appt->mail->value->item.reminder_value->reminder_data.data = (CSA_uint8 *) cm_strdup(r->mailto_val);
|
||||
appt->mail->value->item.reminder_value->reminder_data.size = strlen(r->mailto_val);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** This function will take appointment values and stuff them into a form.
|
||||
*/
|
||||
extern Boolean
|
||||
reminders_appt_to_form(Reminders *r, CSA_entry_handle entry) {
|
||||
Boolean ret_val;
|
||||
CSA_return_code stat;
|
||||
Dtcm_appointment *appt;
|
||||
|
||||
appt = allocate_appt_struct(appt_read,
|
||||
r->cal->general->version,
|
||||
CSA_ENTRY_ATTR_AUDIO_REMINDER_I,
|
||||
CSA_ENTRY_ATTR_FLASHING_REMINDER_I,
|
||||
CSA_ENTRY_ATTR_POPUP_REMINDER_I,
|
||||
CSA_ENTRY_ATTR_MAIL_REMINDER_I,
|
||||
NULL);
|
||||
stat = query_appt_struct(r->cal->cal_handle, entry, appt);
|
||||
backend_err_msg(r->cal->frame, r->cal->view->current_calendar, stat,
|
||||
((Props_pu *)r->cal->properties_pu)->xm_error_pixmap);
|
||||
if (stat != CSA_SUCCESS) {
|
||||
free_appt_struct(&appt);
|
||||
return False;
|
||||
}
|
||||
|
||||
ret_val = reminders_attrs_to_form(r, appt);
|
||||
free_appt_struct(&appt);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
extern Boolean
|
||||
reminders_attrs_to_form(Reminders *r, Dtcm_appointment *appt) {
|
||||
|
||||
if (appt->beep && appt->beep->value) {
|
||||
r->beep_val.selected = True;
|
||||
_csa_iso8601_to_duration(appt->beep->value->item.reminder_value->lead_time, &r->beep_val.scope_val);
|
||||
} else {
|
||||
r->beep_val.selected = False;
|
||||
r->beep_val.scope_val = -1;
|
||||
}
|
||||
|
||||
if (appt->flash && appt->flash->value) {
|
||||
r->flash_val.selected = True;
|
||||
_csa_iso8601_to_duration(appt->flash->value->item.reminder_value->lead_time, &r->flash_val.scope_val);
|
||||
} else {
|
||||
r->flash_val.selected = False;
|
||||
r->flash_val.scope_val = -1;
|
||||
}
|
||||
|
||||
if (appt->popup && appt->popup->value) {
|
||||
r->popup_val.selected = True;
|
||||
_csa_iso8601_to_duration(appt->popup->value->item.reminder_value->lead_time, &r->popup_val.scope_val);;
|
||||
} else {
|
||||
r->popup_val.selected = False;
|
||||
r->popup_val.scope_val = -1;
|
||||
}
|
||||
if (appt->mail && appt->mail->value) {
|
||||
r->mail_val.selected = True;
|
||||
_csa_iso8601_to_duration(appt->mail->value->item.reminder_value->lead_time, &r->mail_val.scope_val);
|
||||
memset(r->mailto_val, NULL, MAILTO_LEN);
|
||||
strncpy(r->mailto_val, (char *) appt->mail->value->item.reminder_value->reminder_data.data, appt->mail->value->item.reminder_value->reminder_data.size);
|
||||
} else {
|
||||
r->mail_val.selected = False;
|
||||
r->mail_val.scope_val = -1;
|
||||
r->mailto_val[0] = '\0';
|
||||
}
|
||||
|
||||
set_reminders_vals(r, True);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
extern void
|
||||
set_reminders_defaults(Reminders *r) {
|
||||
Props *p = (Props *)r->cal->properties;
|
||||
Reminders_val *val;
|
||||
|
||||
val = &r->beep_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_BEEPON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_BEEPUNIT));
|
||||
val->scope_val = get_int_prop(p, CP_BEEPADV);
|
||||
|
||||
val = &r->flash_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_FLASHON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_FLASHUNIT));
|
||||
val->scope_val = get_int_prop(p, CP_FLASHADV);
|
||||
|
||||
val = &r->popup_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_OPENON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_OPENUNIT));
|
||||
val->scope_val = get_int_prop(p, CP_OPENADV);
|
||||
|
||||
val = &r->mail_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_MAILON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_MAILUNIT));
|
||||
val->scope_val = get_int_prop(p, CP_MAILADV);
|
||||
strcpy(r->mailto_val, get_char_prop(p, CP_MAILTO));
|
||||
|
||||
set_reminders_vals(r, False);
|
||||
}
|
||||
|
||||
extern void
|
||||
set_reminders_vals(Reminders *r, Boolean compute_best_fit) {
|
||||
|
||||
r_set_bfpm_vals(r->beep_toggle, r->beep_text, r->beep_menu,
|
||||
&r->beep_val, compute_best_fit);
|
||||
r_set_bfpm_vals(r->flash_toggle, r->flash_text, r->flash_menu,
|
||||
&r->flash_val, compute_best_fit);
|
||||
r_set_bfpm_vals(r->mail_toggle, r->mail_text, r->mail_menu,
|
||||
&r->mail_val, compute_best_fit);
|
||||
r_set_bfpm_vals(r->popup_toggle, r->popup_text, r->popup_menu,
|
||||
&r->popup_val, compute_best_fit);
|
||||
|
||||
r_set_mailto_val(r);
|
||||
}
|
||||
|
||||
static int
|
||||
convert_time_val(
|
||||
int value,
|
||||
Time_scope_menu_op type)
|
||||
{
|
||||
switch(type) {
|
||||
case TIME_DAYS:
|
||||
return days_to_seconds(value);
|
||||
case TIME_HRS:
|
||||
return hours_to_seconds(value);
|
||||
case TIME_MINS:
|
||||
default:
|
||||
return minutes_to_seconds(value);
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
reminders_init(
|
||||
Reminders *r,
|
||||
Calendar *c,
|
||||
Widget parent)
|
||||
{
|
||||
Props *p = (Props *)c->properties;
|
||||
Reminders_val *val;
|
||||
|
||||
r->parent = parent;
|
||||
r->cal = c;
|
||||
|
||||
val = &r->beep_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_BEEPON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_BEEPUNIT));
|
||||
val->scope_val = convert_time_val(get_int_prop(p, CP_BEEPADV),
|
||||
val->scope);
|
||||
|
||||
val = &r->flash_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_FLASHON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_FLASHUNIT));
|
||||
val->scope_val = convert_time_val(get_int_prop(p, CP_FLASHADV),
|
||||
val->scope);
|
||||
|
||||
val = &r->popup_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_OPENON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_OPENUNIT));
|
||||
val->scope_val = convert_time_val(get_int_prop(p, CP_OPENADV),
|
||||
val->scope);
|
||||
|
||||
val = &r->mail_val;
|
||||
val->selected = convert_boolean_str(get_char_prop(p, CP_MAILON));
|
||||
val->scope = convert_time_scope_str(get_char_prop(p, CP_MAILUNIT));
|
||||
val->scope_val = convert_time_val(get_int_prop(p, CP_MAILADV),
|
||||
val->scope);
|
||||
strcpy(r->mailto_val, get_char_prop(p, CP_MAILTO));
|
||||
|
||||
}
|
||||
|
||||
105
cde/programs/dtcm/dtcm/reminders.h
Normal file
105
cde/programs/dtcm/dtcm/reminders.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** reminders.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)reminders.h 1.15 93/10/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: reminders.h /main/3 1995/11/03 10:32:24 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _REMINDERS_H
|
||||
#define _REMINDERS_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define REMINDER_SCOPE_LEN 5
|
||||
#define MAILTO_LEN 100
|
||||
#define BEEP_FLAG "bp"
|
||||
#define FLASH_FLAG "fl"
|
||||
#define MAIL_FLAG "ml"
|
||||
#define POPUP_FLAG "op"
|
||||
|
||||
typedef enum {
|
||||
REMINDERS_OK,
|
||||
ADVANCE_BLANK,
|
||||
ADVANCE_CONTAINS_BLANK,
|
||||
ADVANCE_NONNUMERIC
|
||||
} Reminder_val_op;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Reminders structure will hold widgets for the "Reminders Display"
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
Boolean selected;
|
||||
Time_scope_menu_op scope;
|
||||
int scope_val;
|
||||
} Reminders_val;
|
||||
|
||||
typedef struct {
|
||||
Widget parent;
|
||||
Widget alarm_label;
|
||||
Widget beep_menu;
|
||||
Widget beep_text;
|
||||
Widget beep_toggle;
|
||||
Reminders_val beep_val;
|
||||
Widget bfpm_form_mgr;
|
||||
Calendar *cal;
|
||||
Widget flash_menu;
|
||||
Widget flash_text;
|
||||
Widget flash_toggle;
|
||||
Reminders_val flash_val;
|
||||
Widget mail_menu;
|
||||
Widget mail_text;
|
||||
Widget mail_toggle;
|
||||
Reminders_val mail_val;
|
||||
Widget mailto_label;
|
||||
Widget mailto_text;
|
||||
char mailto_val[MAILTO_LEN];
|
||||
Widget popup_menu;
|
||||
Widget popup_text;
|
||||
Widget popup_toggle;
|
||||
Reminders_val popup_val;
|
||||
} Reminders;
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Editor external function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void build_reminders P((Reminders*, Calendar*, Widget));
|
||||
extern Reminder_val_op get_reminders_vals P((Reminders*, Boolean));
|
||||
extern Boolean reminders_attrs_to_form P((Reminders*, Dtcm_appointment*));
|
||||
extern Boolean reminders_appt_to_form P((Reminders*, CSA_entry_handle));
|
||||
extern Boolean reminders_form_to_appt P((Reminders*, Dtcm_appointment*, char *));
|
||||
extern void set_reminders_defaults P((Reminders*));
|
||||
extern void set_reminders_vals P((Reminders*, Boolean));
|
||||
extern void reminders_init P((Reminders*, Calendar*, Widget));
|
||||
|
||||
|
||||
#endif
|
||||
23
cde/programs/dtcm/dtcm/revision.h
Normal file
23
cde/programs/dtcm/dtcm/revision.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $TOG: revision.h /main/5 1999/02/03 15:36:22 mgreess $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _REVISION_H
|
||||
#define _REVISION_H
|
||||
|
||||
/*
|
||||
* Increment this value before check-ins!!
|
||||
*/
|
||||
#define DTCM_INTERNAL_REV 0
|
||||
#define DTCM_VERSION_MONTH 6 /* 1 = January, 12 = December */
|
||||
#define DTCM_VERSION_YEAR 1995
|
||||
|
||||
|
||||
#define DTCM_DATA_VER DATAVER3
|
||||
#define DTCM_RPC_VER 4
|
||||
|
||||
#endif
|
||||
1246
cde/programs/dtcm/dtcm/rfp.c
Normal file
1246
cde/programs/dtcm/dtcm/rfp.c
Normal file
File diff suppressed because it is too large
Load Diff
95
cde/programs/dtcm/dtcm/rfp.h
Normal file
95
cde/programs/dtcm/dtcm/rfp.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** rfp.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)rfp.h 1.20 95/02/10 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: rfp.h /main/4 1996/05/23 11:17:56 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _RFP_H
|
||||
#define _RFP_H
|
||||
|
||||
#include <csa.h>
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define FOR_LEN 5
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Structure for repeat, for scope, and privacy values
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct {
|
||||
Widget for_label;
|
||||
Widget for_menu;
|
||||
Widget for_scope;
|
||||
int for_val;
|
||||
Widget frequency_label;
|
||||
Widget parent;
|
||||
Widget privacy_label;
|
||||
Widget privacy_menu;
|
||||
CSA_sint32 privacy_val;
|
||||
Calendar *cal;
|
||||
Widget repeat_form_mgr;
|
||||
Widget repeat_label;
|
||||
Widget repeat_menu;
|
||||
Widget repeat_popup_frame;
|
||||
Widget repeat_popup_menu;
|
||||
Widget repeat_popup_text;
|
||||
Widget repeat_apply_button;
|
||||
Widget repeat_cancel_button;
|
||||
int repeat_nth;
|
||||
CSA_sint32 repeat_type;
|
||||
char *recurrence_rule;
|
||||
Widget rfp_form_mgr;
|
||||
} RFP;
|
||||
|
||||
/* Monthly-by-weekday flags */
|
||||
#define RFP_MBW_LAST 1
|
||||
#define RFP_MBW_4TH 2
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** RFP (repeat, for, privacy) external function declarations
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void build_rfp P((RFP*, Calendar*, Widget));
|
||||
extern void get_rfp_privacy_val P((RFP*));
|
||||
extern void get_rfp_repeat_val P((RFP*, time_t));
|
||||
extern void get_rfp_vals P((RFP*, time_t));
|
||||
extern Boolean rfp_attrs_to_form P((RFP*, Dtcm_appointment*));
|
||||
extern Boolean rfp_appt_to_form P((RFP*, CSA_entry_handle));
|
||||
extern Boolean rfp_form_to_appt P((RFP*, Dtcm_appointment*, char*));
|
||||
extern Boolean rfp_form_flags_to_appt P((RFP*, Dtcm_appointment*, char*, int *));
|
||||
extern void set_rfp_privacy_val P((RFP*));
|
||||
extern void set_rfp_repeat_val P((RFP*));
|
||||
extern void set_rfp_defaults P((RFP*));
|
||||
extern void set_rfp_vals P((RFP*));
|
||||
extern void rfp_set_repeat_values P((RFP*));
|
||||
extern void rfp_init P((RFP*, Calendar *, Widget));
|
||||
|
||||
|
||||
#endif
|
||||
727
cde/programs/dtcm/dtcm/select.c
Normal file
727
cde/programs/dtcm/dtcm/select.c
Normal file
@@ -0,0 +1,727 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** select.c
|
||||
**
|
||||
** $TOG: select.c /main/4 1998/08/18 17:32:33 samborn $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)select.c 1.24 95/02/21 Copyr 1994 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include "util.h"
|
||||
#include "select.h"
|
||||
/*
|
||||
#include "graphics.h"
|
||||
*/
|
||||
#include "calendar.h"
|
||||
#include "timeops.h"
|
||||
#include "browser.h"
|
||||
#include "todo.h"
|
||||
#include "dayglance.h"
|
||||
#include "weekglance.h"
|
||||
#include "monthglance.h"
|
||||
#include "yearglance.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
|
||||
static void select_weekhotbox();
|
||||
|
||||
|
||||
extern int
|
||||
selection_active (Selection *s)
|
||||
{
|
||||
return (s->active);
|
||||
}
|
||||
|
||||
extern void
|
||||
deactivate_selection (Selection *s)
|
||||
{
|
||||
s->active=0;
|
||||
}
|
||||
|
||||
extern void
|
||||
activate_selection (Selection *s)
|
||||
{
|
||||
s->active=1;
|
||||
}
|
||||
|
||||
extern void
|
||||
weekchart_deselect(Calendar *c)
|
||||
{
|
||||
int h, i, j, k, index, wi, x, y, chart_x, chart_y;
|
||||
Week *w = (Week *)c->view->week_info;
|
||||
Selection *sel = (Selection *) w->current_selection;
|
||||
XFontSetExtents fontextents;
|
||||
int char_height;
|
||||
Colormap cms;
|
||||
|
||||
CalFontExtents(w->font, &fontextents);
|
||||
char_height = fontextents.max_ink_extent.height;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
|
||||
if (!selection_active (sel)) return;
|
||||
|
||||
j = sel->col;
|
||||
k = sel->row;
|
||||
|
||||
/* dissolves box around weekday letter over chart */
|
||||
chart_x = w->chart_x + (j * w->chart_day_width);
|
||||
chart_y = w->chart_y - char_height - 4;
|
||||
gr_dissolve_box(c->xcontext, chart_x, chart_y - 6,
|
||||
w->chart_day_width, char_height + 6, 2);
|
||||
|
||||
x = (j*w->chart_day_width) + w->chart_x + 1;
|
||||
y = (k * (w->chart_hour_height + w->add_pixels)) + w->chart_y + 1;
|
||||
h = (w->chart_hour_height/BOX_SEG);
|
||||
wi = w->chart_day_width-2;
|
||||
|
||||
gr_clear_area(c->xcontext, x, y, w->chart_day_width-1,
|
||||
w->chart_hour_height-1 + w->add_pixels);
|
||||
gr_draw_box(c->xcontext, x - 1, y - 1, w->chart_day_width,
|
||||
w->chart_hour_height + w->add_pixels, NULL);
|
||||
index = j * (w->segs_in_array / 7) + (BOX_SEG * k);
|
||||
for (i = index; i < (index + BOX_SEG); i++) {
|
||||
/* compensate for the added pixel for displaying chart */
|
||||
if ((i+1) == (index + BOX_SEG)) h += w->add_pixels;
|
||||
if (w->time_array[i] == 1) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(c->xcontext, x, y, wi+1, h, 25);
|
||||
else
|
||||
gr_make_grayshade(c->xcontext, x, y, wi+1, h,
|
||||
LIGHTGREY);
|
||||
}
|
||||
else if (w->time_array[i] == 2) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(c->xcontext, x, y,
|
||||
wi+1, h, 50);
|
||||
else
|
||||
gr_make_rgbcolor(c->xcontext, cms, x, y, wi+1, h,
|
||||
MIDGREY, MIDGREY, MIDGREY);
|
||||
}
|
||||
else if (w->time_array[i] >= 3) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(c->xcontext, x, y, wi+1, h, 75);
|
||||
else
|
||||
gr_make_grayshade(c->xcontext, x, y, wi+1, h,
|
||||
DIMGREY);
|
||||
}
|
||||
/* compensate for grid line pixel */
|
||||
if (i == (index+BOX_SEG-2))
|
||||
y += (h-1);
|
||||
else
|
||||
y += h;
|
||||
}
|
||||
deactivate_selection (sel);
|
||||
}
|
||||
|
||||
/* selects day in chart */
|
||||
extern void
|
||||
weekchart_select(Calendar *c)
|
||||
{
|
||||
int i, j, chart_x, chart_y;
|
||||
Week *w = (Week *)c->view->week_info;
|
||||
Selection *sel = (Selection *) w->current_selection;
|
||||
Colormap cms;
|
||||
Pixel background_pixel;
|
||||
XFontSetExtents fontextents;
|
||||
int char_height;
|
||||
|
||||
CalFontExtents(w->font, &fontextents);
|
||||
char_height = fontextents.max_ink_extent.height;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
/*
|
||||
XtVaGetValues(c->frame, XmNbackground, &background_pixel, NULL);
|
||||
*/
|
||||
background_pixel = c->xcontext->hilight_color;
|
||||
|
||||
i = sel->col;
|
||||
j = sel->row;
|
||||
if (j >= 0) {
|
||||
chart_x = w->chart_x + (i * w->chart_day_width);
|
||||
chart_y = w->chart_y - char_height - 4;
|
||||
if (c->xcontext->screen_depth < 8) {
|
||||
gr_draw_box(c->xcontext, (i * w->chart_day_width) +
|
||||
w->chart_x + 1, (j * w->chart_hour_height) +
|
||||
(j * w->add_pixels) + w->chart_y + 1,
|
||||
w->chart_day_width - 2,
|
||||
w->chart_hour_height - 2 + w->add_pixels, NULL);
|
||||
gr_draw_box(c->xcontext, chart_x, chart_y,
|
||||
w->chart_day_width, char_height + 1, NULL);
|
||||
}
|
||||
else {
|
||||
/* Select time slot */
|
||||
gr_draw_rgb_box(c->xcontext, (i * w->chart_day_width)
|
||||
+ w->chart_x, (j * w->chart_hour_height)
|
||||
+ (j * w->add_pixels) + w->chart_y,
|
||||
w->chart_day_width, w->chart_hour_height
|
||||
+ w->add_pixels, 1, background_pixel, cms);
|
||||
|
||||
/* Select weekday letter over chart */
|
||||
gr_draw_rgb_box(c->xcontext, chart_x, chart_y - 6,
|
||||
w->chart_day_width, char_height + 6, 1,
|
||||
background_pixel, cms);
|
||||
}
|
||||
sel->nunits = 1;
|
||||
activate_selection(sel);
|
||||
}
|
||||
}
|
||||
|
||||
/* selects day is main boxes: not chart */
|
||||
static void
|
||||
select_weekday(Calendar *c, Boolean select)
|
||||
{
|
||||
int n, x, y;
|
||||
new_XContext*xc = c->xcontext;
|
||||
Week *w = (Week *)c->view->week_info;
|
||||
Pixel foreground_pixel;
|
||||
|
||||
|
||||
foreground_pixel = xc->hilight_color;
|
||||
|
||||
/* Draw selection feedback on week view */
|
||||
(n = dow(c->view->date)) == 0 ? n = 6 : n--;
|
||||
|
||||
if (n < 5) {
|
||||
x = w->x + n * w->day_width + 2;
|
||||
y = w->y + w->label_height + 2;
|
||||
} else {
|
||||
n -= (5 - 3);
|
||||
x = w->x + n * w->day_width + 2;
|
||||
y = w->y + w->day_height + w->label_height + 2;
|
||||
}
|
||||
|
||||
if (select) {
|
||||
if (c->xcontext->screen_depth < 8) {
|
||||
gr_draw_box(xc, x, y, w->day_width - 2,
|
||||
w->day_height - w->label_height - 2, NULL);
|
||||
}
|
||||
else {
|
||||
Colormap cms;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
gr_draw_rgb_box(xc, x - 2, y - 2, w->day_width,
|
||||
w->day_height - w->label_height, 1,
|
||||
foreground_pixel, cms);
|
||||
}
|
||||
weekchart_select(c);
|
||||
} else {
|
||||
gr_draw_box(xc, x - 2, y - 2, w->day_width,
|
||||
w->day_height - w->label_height, NULL);
|
||||
gr_dissolve_box(xc, x - 1, y - 1, w->day_width - 2,
|
||||
w->day_height - w->label_height - 2, 2);
|
||||
weekchart_deselect(c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* selection service for all views. ref is a client_data
|
||||
field which is cast depending on the selection unit. if
|
||||
it's a daySelect, ref contains the number of weeks in the
|
||||
month. if it's a monthSelect, ref contains a point to x,y
|
||||
coordinates. ref is NULL on a weekSelect. */
|
||||
|
||||
extern void
|
||||
calendar_select (Calendar *c, Selection_unit unit, caddr_t ref)
|
||||
{
|
||||
int i, j;
|
||||
int xpos, boxw, boxh, margin, topoff, date;
|
||||
Selection *sel;
|
||||
new_XContext *xc;
|
||||
Colormap cms;
|
||||
Pixel foreground_pixel;
|
||||
int dayname_height;
|
||||
|
||||
date = c->view->date;
|
||||
sel = (Selection *) c->view->current_selection;
|
||||
boxw = c->view->boxw;
|
||||
boxh = c->view->boxh;
|
||||
margin = c->view->outside_margin;
|
||||
topoff = c->view->topoffset;
|
||||
xc = c->xcontext;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
/*
|
||||
XtVaGetValues(c->canvas, XmNforeground, &foreground_pixel, NULL);
|
||||
*/
|
||||
foreground_pixel = xc->hilight_color;
|
||||
switch (unit) {
|
||||
/* day selection on month glance */
|
||||
case daySelect:
|
||||
dayname_height = ((Month *) c->view->month_info)->dayname_height;
|
||||
i=dow(date);
|
||||
j=wom(date);
|
||||
if (j >= 0) {
|
||||
sel->row=j-1;
|
||||
sel->col=i;
|
||||
sel->nunits=1;
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_draw_box(xc, (i*boxw)+margin+
|
||||
1, (sel->row*boxh)+topoff+
|
||||
dayname_height+1, boxw-2, boxh-2, NULL);
|
||||
else {
|
||||
gr_draw_rgb_box(xc, (i*boxw)
|
||||
+margin,
|
||||
(sel->row*boxh)+topoff+
|
||||
dayname_height, boxw,
|
||||
boxh, 1,
|
||||
foreground_pixel, cms);
|
||||
}
|
||||
activate_selection (sel);
|
||||
|
||||
}
|
||||
break;
|
||||
/* week selection on month glance view */
|
||||
case weekSelect:
|
||||
#ifdef NEVER
|
||||
i=0; j=7;
|
||||
sel->row=(int)ref;
|
||||
sel->col=i;
|
||||
sel->nunits=j-i;
|
||||
while (i < j) {
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_draw_box(xc, i*boxw+margin+1,
|
||||
(int)ref*boxh+margin+topoff+1,
|
||||
boxw-2, boxh-2, NULL);
|
||||
else {
|
||||
gr_draw_rgb_box(xc, i*boxw+margin+2,
|
||||
(int)ref*boxh+margin+topoff+2,
|
||||
boxw-4, boxh-4, 1,
|
||||
foreground_pixel, cms);
|
||||
gr_draw_rgb_box(xc, i*boxw+margin+1,
|
||||
(int)ref*boxh+margin+topoff+1,
|
||||
boxw-2, boxh-2, 1,
|
||||
foreground_pixel, cms);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
activate_selection (sel);
|
||||
#endif
|
||||
break;
|
||||
/* month selection on year glance view */
|
||||
case monthSelect:
|
||||
if (ref != NULL) {
|
||||
i=((pr_pos *)ref)->x;
|
||||
j=((pr_pos *)ref)->y;
|
||||
}
|
||||
else {
|
||||
i = sel->col;
|
||||
j = sel->row;
|
||||
}
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_draw_box(xc, i*boxw+margin+10,
|
||||
j*boxh+topoff-4, boxw-4, boxh-4, NULL);
|
||||
else {
|
||||
if (i == 0)
|
||||
xpos = margin-5;
|
||||
else if (i == 1)
|
||||
xpos = i*(boxw-18);
|
||||
else
|
||||
xpos = i*(boxw-24);
|
||||
/*
|
||||
gr_draw_rgb_box(xc, xpos,
|
||||
j*boxh+topoff+10, boxw-2, boxh-2, 1,
|
||||
foreground_pixel, cms);
|
||||
*/
|
||||
gr_draw_rgb_box(xc, xpos,
|
||||
j*boxh+topoff+10, boxw-56, boxh+2, 1,
|
||||
foreground_pixel, cms);
|
||||
}
|
||||
sel->row=j;
|
||||
sel->col=i;
|
||||
sel->nunits=1;
|
||||
activate_selection (sel);
|
||||
break;
|
||||
/* hour box selection day glance view */
|
||||
case hourSelect:
|
||||
if (ref != NULL)
|
||||
j=((pr_pos *)ref)->y;
|
||||
else
|
||||
j = sel->row;
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_draw_box(xc, MOBOX_AREA_WIDTH+5,
|
||||
j*boxh+topoff+1, c->view->boxw-4,
|
||||
c->view->boxh-2, NULL);
|
||||
else {
|
||||
gr_draw_rgb_box(xc, MOBOX_AREA_WIDTH+3,
|
||||
j*boxh+topoff,
|
||||
c->view->boxw - 2,
|
||||
c->view->boxh,
|
||||
1,
|
||||
foreground_pixel, cms);
|
||||
}
|
||||
sel->row=j;
|
||||
sel->col=MOBOX_AREA_WIDTH+4;
|
||||
sel->nunits=1;
|
||||
activate_selection(sel);
|
||||
break;
|
||||
/* day selection on week glance */
|
||||
case weekdaySelect:
|
||||
select_weekday(c, True);
|
||||
activate_selection (sel);
|
||||
break;
|
||||
/* hotbox selection on week glance */
|
||||
case weekhotboxSelect:
|
||||
select_weekhotbox(c);
|
||||
activate_selection (sel);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/*
|
||||
common_update_lists(c);
|
||||
*/
|
||||
}
|
||||
|
||||
extern void
|
||||
calendar_deselect (Calendar *c)
|
||||
{
|
||||
int i, j, k, xpos;
|
||||
int x, y;
|
||||
int boxh = c->view->boxh;
|
||||
int boxw = c->view->boxw;
|
||||
int margin = c->view->outside_margin;
|
||||
int topoff = c->view->topoffset;
|
||||
Selection *s = (Selection *) c->view->current_selection;
|
||||
int nunits = s->nunits;
|
||||
new_XContext *xc = c->xcontext;
|
||||
int dayname_height;
|
||||
int nop;
|
||||
Cal_Font *pf = c->fonts->boldfont;
|
||||
Props *p = (Props*)c->properties;
|
||||
DisplayType disp_t = get_int_prop(p, CP_DEFAULTDISP);
|
||||
|
||||
if (selection_active(s)) {
|
||||
j=s->col;
|
||||
k=s->row;
|
||||
switch(c->view->glance) {
|
||||
case weekGlance:
|
||||
select_weekday(c, False);
|
||||
deactivate_selection (s);
|
||||
break;
|
||||
case dayGlance: {
|
||||
int hrbox_margin;
|
||||
int num_hrs = get_int_prop(p, CP_DAYEND) -
|
||||
get_int_prop(p, CP_DAYBEGIN) + 1;
|
||||
|
||||
for (i=0; i < nunits; i++) {
|
||||
gr_dissolve_box(xc, MOBOX_AREA_WIDTH+3,
|
||||
k*boxh+topoff + 1, boxw-3, boxh-2, 3);
|
||||
x = MOBOX_AREA_WIDTH + 2;
|
||||
y = k * boxh + topoff;
|
||||
|
||||
gr_draw_line(xc, x, y, x + boxw, y,
|
||||
gr_solid, NULL);
|
||||
y += boxh;
|
||||
gr_draw_line(xc, x, y, x + boxw, y,
|
||||
gr_solid, NULL);
|
||||
}
|
||||
|
||||
if (disp_t == HOUR12)
|
||||
CalTextExtents(pf, "12pm", 4, &nop, &nop,
|
||||
&hrbox_margin, &nop);
|
||||
else
|
||||
CalTextExtents(pf, "24 ", 3, &nop, &nop,
|
||||
&hrbox_margin, &nop);
|
||||
|
||||
/* draw vertical line */
|
||||
gr_draw_line(xc, MOBOX_AREA_WIDTH+2+hrbox_margin,
|
||||
c->view->topoffset, MOBOX_AREA_WIDTH+2+hrbox_margin,
|
||||
c->view->topoffset + num_hrs * c->view->boxh,
|
||||
gr_solid, NULL);
|
||||
break;
|
||||
}
|
||||
case monthGlance:
|
||||
dayname_height =
|
||||
((Month *) c->view->month_info)->dayname_height;
|
||||
|
||||
for (i=0; i<nunits; i++) {
|
||||
gr_dissolve_box(xc,
|
||||
(j * boxw) + margin + 1,
|
||||
(k * boxh) + topoff + dayname_height + 1,
|
||||
boxw - 2, boxh - 2, 2);
|
||||
gr_draw_box(xc,
|
||||
(j * boxw) + margin,
|
||||
(k * boxh) + topoff + dayname_height,
|
||||
boxw, boxh, NULL);
|
||||
j++;
|
||||
}
|
||||
break;
|
||||
case yearGlance:
|
||||
for (i=0; i<nunits; i++) {
|
||||
if (j == 0)
|
||||
xpos = margin-5;
|
||||
else if (j == 1)
|
||||
xpos = j*(boxw-18);
|
||||
else
|
||||
xpos = j*(boxw-24);
|
||||
|
||||
/*
|
||||
gr_dissolve_box(xc, (j*boxw)+margin+10,
|
||||
k*boxh+topoff-5,
|
||||
boxw-2, boxh-2, 1);
|
||||
*/
|
||||
gr_dissolve_box(xc, xpos,
|
||||
k*boxh+topoff+10, boxw-56, boxh+2, 1);
|
||||
|
||||
/*
|
||||
gr_dissolve_box(xc, (j*boxw)+margin+11,
|
||||
k*boxh+topoff-4,
|
||||
boxw-2, boxh-2, 1);
|
||||
*/
|
||||
j++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
deactivate_selection (s);
|
||||
}
|
||||
}
|
||||
extern void
|
||||
monthbox_deselect(Calendar *c)
|
||||
{
|
||||
char buf[3];
|
||||
Day *day_info = (Day *)c->view->day_info;
|
||||
int x, y;
|
||||
|
||||
if (day_info->day_selected == -1)
|
||||
return;
|
||||
|
||||
x = day_info->day_selected_x + 2;
|
||||
y = day_info->day_selected_y + 2;
|
||||
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_make_gray(c->xcontext,
|
||||
x,
|
||||
y,
|
||||
day_info->col_w+1,
|
||||
day_info->row_h-1, 25);
|
||||
else
|
||||
gr_make_grayshade(c->xcontext,
|
||||
x,
|
||||
y,
|
||||
day_info->col_w+1,
|
||||
day_info->row_h-1, LIGHTGREY);
|
||||
buf [0] = '\0';
|
||||
sprintf(buf, "%d", day_info->day_selected);
|
||||
gr_text(c->xcontext, day_info->day_selected_x2+2,
|
||||
day_info->day_selected_y2,
|
||||
c->fonts->viewfont, buf, NULL);
|
||||
}
|
||||
extern void
|
||||
monthbox_select(Calendar *c)
|
||||
{
|
||||
char buf[3];
|
||||
Day *day_info = (Day *)c->view->day_info;
|
||||
int x, y;
|
||||
|
||||
x = day_info->day_selected_x + 2;
|
||||
y = day_info->day_selected_y + 2;
|
||||
|
||||
gr_clear_box(c->xcontext,
|
||||
x,
|
||||
y,
|
||||
day_info->col_w,
|
||||
day_info->row_h-3);
|
||||
gr_draw_box(c->xcontext,
|
||||
x,
|
||||
y,
|
||||
day_info->col_w,
|
||||
day_info->row_h-3, NULL);
|
||||
buf [0] = '\0';
|
||||
sprintf(buf, "%d", day_info->day_selected);
|
||||
gr_text(c->xcontext, day_info->day_selected_x2+2,
|
||||
day_info->day_selected_y2,
|
||||
c->fonts->viewfont, buf, NULL);
|
||||
}
|
||||
|
||||
extern void
|
||||
browser_deselect (Calendar *c, Browser *b)
|
||||
{
|
||||
int h, i, j, k, index, w, x, y;
|
||||
Selection *sel = (Selection *) b->current_selection;
|
||||
Colormap cms;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
if (!selection_active (sel))
|
||||
return;
|
||||
j = sel->col;
|
||||
k = sel->row;
|
||||
x = (j*b->boxw) + b->chart_x + 1;
|
||||
y = (k*b->boxh) + b->chart_y + 1;
|
||||
h = (b->boxh/BOX_SEG);
|
||||
w = b->boxw-2;
|
||||
gr_clear_area(b->xcontext, x, y, b->boxw-1, b->boxh-1);
|
||||
index = j * (b->segs_in_array / 7) + (BOX_SEG * k);
|
||||
for (i = index; i < (index + BOX_SEG); i++) {
|
||||
if (b->multi_array[i] == 1) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(b->xcontext, x, y, w+1,
|
||||
h, 25);
|
||||
else
|
||||
gr_make_grayshade(b->xcontext, x, y,
|
||||
w+1, h, LIGHTGREY);
|
||||
}
|
||||
else if (b->multi_array[i] == 2) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(b->xcontext, x, y,
|
||||
w+1, h, 50);
|
||||
else
|
||||
gr_make_rgbcolor(b->xcontext, cms, x, y,
|
||||
w+1, h, MIDGREY, MIDGREY, MIDGREY);
|
||||
}
|
||||
else if (b->multi_array[i] >= 3) {
|
||||
if ((c->xcontext->screen_depth < 8) || FAKE_MONOCHROME)
|
||||
gr_make_gray(b->xcontext, x, y,
|
||||
w+1, h, 75);
|
||||
else
|
||||
gr_make_grayshade(b->xcontext, x, y,
|
||||
w+1, h, DIMGREY);
|
||||
}
|
||||
/* compensate for grid line pixel */
|
||||
if (i == (index+BOX_SEG-2))
|
||||
y += (h-1);
|
||||
else
|
||||
y += h;
|
||||
}
|
||||
deactivate_selection (sel);
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
browser_select(Calendar *c, Browser *b, pr_pos *xy)
|
||||
{
|
||||
int i, j;
|
||||
Selection *sel = (Selection *) b->current_selection;
|
||||
Colormap cms;
|
||||
Pixel pixel;
|
||||
|
||||
if (xy != NULL) {
|
||||
i = xy->x;
|
||||
j = xy->y;
|
||||
}
|
||||
else {
|
||||
i = sel->col;
|
||||
j = sel->row;
|
||||
}
|
||||
if (j >= 0) {
|
||||
if (c->xcontext->screen_depth < 8) {
|
||||
gr_draw_box(b->xcontext, (i * b->boxw) +
|
||||
b->chart_x + 2, (j * b->boxh) + b->chart_y
|
||||
+ 2, b->boxw - 4, b->boxh - 4, NULL);
|
||||
}
|
||||
else {
|
||||
pixel = c->xcontext->hilight_color;
|
||||
XtVaGetValues(b->canvas, XmNcolormap, &cms, NULL);
|
||||
gr_draw_rgb_box(b->xcontext, (i * b->boxw) +
|
||||
b->chart_x + 2, (j * b->boxh) + b->chart_y
|
||||
+ 2, b->boxw - 4, b->boxh - 4, 1,
|
||||
pixel, cms);
|
||||
gr_draw_rgb_box(b->xcontext, (i * b->boxw) +
|
||||
b->chart_x + 1, (j * b->boxh) + b->chart_y
|
||||
+ 1, b->boxw - 2, b->boxh - 2, 1,
|
||||
pixel, cms);
|
||||
}
|
||||
sel->row = j;
|
||||
sel->col = i;
|
||||
sel->nunits = 1;
|
||||
activate_selection(sel);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
select_weekhotbox(Calendar *c)
|
||||
{
|
||||
int n, x, y;
|
||||
new_XContext*xc = c->xcontext;
|
||||
Week *w = (Week *)c->view->week_info;
|
||||
long date = c->view->date;
|
||||
Colormap cms;
|
||||
Pixel background_pixel;
|
||||
|
||||
XtVaGetValues(c->canvas, XmNcolormap, &cms, NULL);
|
||||
XtVaGetValues(c->frame, XmNbackground, &background_pixel, NULL);
|
||||
|
||||
/* Draw selection feedback on week view */
|
||||
if ((n = dow(date)) == 0)
|
||||
n = 6;
|
||||
else
|
||||
n--;
|
||||
|
||||
if (n < 5) {
|
||||
x = w->x + n * w->day_width + 2;
|
||||
y = w->y + 2;
|
||||
}
|
||||
else {
|
||||
n -= (5 - 3);
|
||||
x = w->x + n * w->day_width + 2;
|
||||
y = w->y + w->day_height + 2;
|
||||
}
|
||||
|
||||
if (c->xcontext->screen_depth < 8)
|
||||
gr_draw_box(xc, x, y, w->day_width - 4, w->label_height - 4, NULL);
|
||||
else {
|
||||
gr_draw_rgb_box(xc, x, y,
|
||||
w->day_width - 4, w->label_height - 4, 1,
|
||||
background_pixel, cms);
|
||||
gr_draw_rgb_box(xc, x-1, y-1,
|
||||
w->day_width-2, w->label_height - 2, 1,
|
||||
background_pixel, cms);
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
paint_selection(Calendar *c)
|
||||
{
|
||||
Props *p = (Props*)c->properties;
|
||||
Selection *sel;
|
||||
int d, mo, beg = get_int_prop(p, CP_DAYBEGIN);
|
||||
Week *w = (Week *)c->view->week_info;
|
||||
pr_pos xy;
|
||||
|
||||
switch ((Glance)c->view->glance) {
|
||||
case monthGlance:
|
||||
calendar_select(c, daySelect, (caddr_t)NULL);
|
||||
break;
|
||||
case dayGlance:
|
||||
sel = (Selection *) c->view->current_selection;
|
||||
sel->row = hour(c->view->date) - beg + 1;
|
||||
calendar_select(c, hourSelect, (caddr_t)NULL);
|
||||
break;
|
||||
case weekGlance:
|
||||
sel = (Selection*)w->current_selection;
|
||||
sel->row = hour(c->view->date) - beg;
|
||||
sel->col = (d = dow(c->view->date)) == 0 ? 6 : --d; calendar_select(c, weekdaySelect, (caddr_t)NULL);
|
||||
break;
|
||||
case yearGlance:
|
||||
mo = month(c->view->date);
|
||||
xy.y = month_row_col[mo-1][ROW];
|
||||
xy.x = month_row_col[mo-1][COL];
|
||||
calendar_select(c, monthSelect, (caddr_t)&xy);
|
||||
break;
|
||||
}
|
||||
}
|
||||
72
cde/programs/dtcm/dtcm/select.h
Normal file
72
cde/programs/dtcm/dtcm/select.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** select.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)select.h 1.6 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: select.h /main/3 1995/11/03 10:33:23 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _SELECT_H
|
||||
#define _SELECT_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "browser.h"
|
||||
#include "calendar.h"
|
||||
|
||||
typedef enum {
|
||||
daySelect,
|
||||
weekSelect,
|
||||
monthSelect,
|
||||
hourSelect,
|
||||
weekdaySelect,
|
||||
weekhotboxSelect
|
||||
} Selection_unit;
|
||||
|
||||
typedef struct {
|
||||
int row;
|
||||
int col;
|
||||
int nunits;
|
||||
int active;
|
||||
int boxw;
|
||||
int boxh;
|
||||
} Selection;
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
} pr_pos;
|
||||
|
||||
extern void activate_selection P((Selection*));
|
||||
extern void browser_deselect P((Calendar *, Browser*));
|
||||
extern void browser_select P((Calendar *, Browser*, pr_pos*));
|
||||
extern void calendar_deselect P((Calendar*));
|
||||
extern void calendar_select P((Calendar*, Selection_unit, caddr_t));
|
||||
extern void deactivate_selection P((Selection *));
|
||||
extern void monthbox_deselect P((Calendar*));
|
||||
extern void monthbox_select P((Calendar*));
|
||||
extern void paint_selection P((Calendar*));
|
||||
extern int selection_active P((Selection*));
|
||||
extern void weekchart_select P((Calendar*));
|
||||
|
||||
#endif
|
||||
224
cde/programs/dtcm/dtcm/session.c
Normal file
224
cde/programs/dtcm/dtcm/session.c
Normal file
@@ -0,0 +1,224 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** session.c
|
||||
**
|
||||
** $TOG: session.c /main/6 1997/06/18 17:28:49 samborn $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/AtomMgr.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Dt/Session.h>
|
||||
#include "calendar.h"
|
||||
#include "session.h"
|
||||
|
||||
extern Calendar *calendar;
|
||||
|
||||
/* Structure used on a save session to see if a dt is iconic */
|
||||
typedef struct {
|
||||
int state;
|
||||
Window icon;
|
||||
} WM_STATE;
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Routine: CMSaveSessionCB *
|
||||
* *
|
||||
* Purpose: save state information for session management *
|
||||
**************************************************************************/
|
||||
void
|
||||
CMSaveSessionCB (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callbackArg)
|
||||
{
|
||||
char *path,
|
||||
*command,
|
||||
*name;
|
||||
FILE *fp;
|
||||
int n,
|
||||
actualFormat,
|
||||
command_len,
|
||||
save_session = True;
|
||||
Position x, y;
|
||||
Dimension width, height;
|
||||
WM_STATE *wmState;
|
||||
Atom wmStateAtom, actualType;
|
||||
unsigned long nitems,
|
||||
leftover;
|
||||
Atom command_atom;
|
||||
|
||||
if (!DtSessionSavePath(calendar->frame, &path, &name))
|
||||
save_session = False;
|
||||
|
||||
if (save_session) {
|
||||
|
||||
/* Create the session file */
|
||||
if (!(fp = fopen(path, "w+"))) {
|
||||
printf("fopen of %s failed. %p \n", path, fp);
|
||||
XtFree ((char *)path);
|
||||
XtFree ((char *)name);
|
||||
return;
|
||||
}
|
||||
|
||||
chmod(path, S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP);
|
||||
|
||||
/* The initial set up is done on the file. From here on
|
||||
out the application should write out a set of resource
|
||||
definitions that will later be read in. These resource
|
||||
definitions will be used to restore the syate of the tool
|
||||
when the session is restarted. */
|
||||
|
||||
/* Getting the WM_STATE property to see if iconified or not */
|
||||
wmStateAtom = XmInternAtom(XtDisplay(calendar->frame),
|
||||
"WM_STATE", False);
|
||||
|
||||
XGetWindowProperty(XtDisplay(calendar->frame),
|
||||
XtWindow(calendar->frame),
|
||||
wmStateAtom, 0L, (long)BUFSIZ, False,
|
||||
wmStateAtom, &actualType, &actualFormat,
|
||||
&nitems, &leftover, (unsigned char **) &wmState);
|
||||
|
||||
if (wmState->state == IconicState)
|
||||
fprintf(fp, "*iconic: True\n");
|
||||
else
|
||||
fprintf(fp, "*iconic: False\n");
|
||||
|
||||
/*** Get and write out the geometry info for our Window ***/
|
||||
x = XtX(calendar->frame);
|
||||
y = XtY(calendar->frame);
|
||||
width = XtWidth(calendar->frame);
|
||||
height = XtHeight(calendar->frame);
|
||||
|
||||
fprintf(fp, "*x: %d\n", x);
|
||||
fprintf(fp, "*y: %d\n", y);
|
||||
fprintf(fp, "*width: %d\n", width);
|
||||
fprintf(fp, "*height: %d\n", height);
|
||||
|
||||
if (calendar->view->glance == dayGlance)
|
||||
fprintf (fp, "*defaultView: day\n");
|
||||
else if (calendar->view->glance == weekGlance)
|
||||
fprintf (fp, "*defaultView: week\n");
|
||||
else if (calendar->view->glance == monthGlance)
|
||||
fprintf (fp, "*defaultView: month\n");
|
||||
else
|
||||
fprintf (fp, "*defaultView: year\n");
|
||||
|
||||
/* This is the end of client resource writing. At this point
|
||||
the client will reset the WM_COMMAND property on it's top
|
||||
level window to include the original starting parameters as
|
||||
well as the -session flag and the file to restore with. */
|
||||
}
|
||||
|
||||
command_atom = XA_WM_COMMAND;
|
||||
/* Generate the reinvoking command and add it as the
|
||||
property value */
|
||||
|
||||
if (save_session)
|
||||
command_len = calendar->view->wm_cmdstrlen +
|
||||
strlen("-session") + strlen(name) + 2;
|
||||
else
|
||||
command_len = calendar->view->wm_cmdstrlen + 2;
|
||||
|
||||
command = XtMalloc (sizeof (char) * command_len);
|
||||
|
||||
memcpy(command, calendar->view->wm_cmdstr,
|
||||
calendar->view->wm_cmdstrlen);
|
||||
command_len = calendar->view->wm_cmdstrlen;
|
||||
|
||||
if (save_session) {
|
||||
memcpy(command + command_len, "-session", 8);
|
||||
command_len += 8;
|
||||
command[command_len] = NULL;
|
||||
command_len++;
|
||||
memcpy(command + command_len, name, strlen(name));
|
||||
command_len += strlen(name);
|
||||
}
|
||||
|
||||
XChangeProperty(XtDisplay(calendar->frame), XtWindow(calendar->frame),
|
||||
command_atom, XA_STRING, 8, PropModeReplace,
|
||||
(unsigned char *)command,
|
||||
command_len);
|
||||
|
||||
free(command);
|
||||
|
||||
/* Note the bogus use of XtFree here. DtSessionSavePath requires that
|
||||
the returned strings be freed this way. Yick. */
|
||||
|
||||
if (save_session) {
|
||||
XtFree((char *)path);
|
||||
XtFree((char *)name);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Routine: GetSessionInfo *
|
||||
* *
|
||||
* Purpose: get dticon session information *
|
||||
**************************************************************************/
|
||||
|
||||
void
|
||||
GetSessionInfo(
|
||||
Calendar *c)
|
||||
{
|
||||
XrmDatabase db;
|
||||
char *path;
|
||||
XrmName xrm_name[5];
|
||||
XrmRepresentation rep_type;
|
||||
XrmValue value;
|
||||
|
||||
if (c->app_data->session_file == NULL)
|
||||
return;
|
||||
|
||||
/*** Open the resource database file ***/
|
||||
|
||||
if (DtSessionRestorePath(c->frame, &path, c->app_data->session_file)
|
||||
== False) {
|
||||
/* XXX: Should generate error about not being able to restore session.*/
|
||||
return;
|
||||
}
|
||||
|
||||
if ((c->view->sessiondb = XrmGetFileDatabase (path)) == NULL) {
|
||||
if (path) XtFree(path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (path) XtFree(path);
|
||||
|
||||
xrm_name[1] = NULL;
|
||||
|
||||
/* get default view */
|
||||
xrm_name[0] = XrmStringToQuark ("defaultView");
|
||||
if (XrmQGetResource(c->view->sessiondb, xrm_name, xrm_name,
|
||||
&rep_type, &value)) {
|
||||
if (value.addr)
|
||||
c->app_data->default_view = strdup(value.addr);
|
||||
}
|
||||
}
|
||||
39
cde/programs/dtcm/dtcm/session.h
Normal file
39
cde/programs/dtcm/dtcm/session.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** session.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)session.h 1.3 93/11/08 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: session.h /main/3 1995/11/03 10:33:56 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _SESSION_H
|
||||
#define _SESSION_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
|
||||
extern void CMSaveSessionCB P((Widget, XtPointer, XtPointer));
|
||||
extern void GetSessionInfo P(());
|
||||
|
||||
#endif
|
||||
405
cde/programs/dtcm/dtcm/submit.c
Normal file
405
cde/programs/dtcm/dtcm/submit.c
Normal file
@@ -0,0 +1,405 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** submit.c
|
||||
**
|
||||
** $XConsortium: submit.c /main/5 1996/10/03 10:58:04 drk $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <LocaleXlate.h>
|
||||
#include <RFCMIME.h>
|
||||
#include "rerule.h" /* FALSE */
|
||||
|
||||
|
||||
static char **
|
||||
arpaPhrase(const char * name)
|
||||
{
|
||||
register char c;
|
||||
register const char *cp;
|
||||
char * cp2;
|
||||
int gotlt, lastsp, didq;
|
||||
int nesting;
|
||||
const char * last_comma = name;
|
||||
int biggest = 0;
|
||||
int n_addrs = 0;
|
||||
int cur_addr;
|
||||
int distance;
|
||||
char ** addrs;
|
||||
const char * comma;
|
||||
const char * start;
|
||||
|
||||
if (name == (char *) 0) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* We need to figure out what is the biggest possible address.
|
||||
This will be the maximum distance between commas.
|
||||
*/
|
||||
for (comma = name; *comma; comma++) {
|
||||
if (*comma == ',') {
|
||||
n_addrs += 1;
|
||||
distance = comma - last_comma;
|
||||
biggest = biggest < distance ? distance : biggest;
|
||||
last_comma = comma;
|
||||
}
|
||||
}
|
||||
distance = comma - last_comma;
|
||||
biggest = biggest < distance ? distance : biggest;
|
||||
biggest += 2; /* Just in case. */
|
||||
|
||||
cur_addr = 0;
|
||||
addrs = (char **)malloc((n_addrs + 1) * sizeof(char *));
|
||||
|
||||
cp2 = (char *)malloc(biggest);
|
||||
addrs[cur_addr++] = cp2;
|
||||
|
||||
gotlt = 0;
|
||||
lastsp = 0;
|
||||
start = name;
|
||||
for (cp = name; (c = *cp++) != 0;) {
|
||||
switch (c) {
|
||||
case '(':
|
||||
/*
|
||||
Start of a comment, ignore it.
|
||||
*/
|
||||
nesting = 1;
|
||||
while ((c = *cp) != 0) {
|
||||
cp++;
|
||||
switch(c) {
|
||||
case '\\':
|
||||
if (*cp == 0) goto outcm;
|
||||
cp++;
|
||||
break;
|
||||
case '(':
|
||||
nesting++;
|
||||
break;
|
||||
case ')':
|
||||
--nesting;
|
||||
break;
|
||||
}
|
||||
if (nesting <= 0) break;
|
||||
}
|
||||
outcm:
|
||||
lastsp = 0;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
/*
|
||||
Start a quoted string.
|
||||
Copy it in its entirety.
|
||||
*/
|
||||
didq = 0;
|
||||
while ((c = *cp) != 0) {
|
||||
cp++;
|
||||
switch (c) {
|
||||
case '\\':
|
||||
if ((c = *cp) == 0) goto outqs;
|
||||
cp++;
|
||||
break;
|
||||
case '"':
|
||||
goto outqs;
|
||||
}
|
||||
if (gotlt == 0 || gotlt == '<') {
|
||||
if (lastsp) {
|
||||
lastsp = 0;
|
||||
*cp2++ = ' ';
|
||||
}
|
||||
if (!didq) {
|
||||
*cp2++ = '"';
|
||||
didq++;
|
||||
}
|
||||
*cp2++ = c;
|
||||
}
|
||||
}
|
||||
outqs:
|
||||
if (didq)
|
||||
*cp2++ = '"';
|
||||
lastsp = 0;
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\n':
|
||||
done:
|
||||
*cp2 = 0;
|
||||
|
||||
cp2 = (char *)malloc(biggest);
|
||||
addrs[cur_addr++] = cp2;
|
||||
|
||||
lastsp = 1;
|
||||
break;
|
||||
|
||||
case ',':
|
||||
*cp2++ = c;
|
||||
if (gotlt != '<') {
|
||||
gotlt = 0;
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
|
||||
case '<':
|
||||
cp2 = addrs[cur_addr - 1];
|
||||
gotlt = c;
|
||||
lastsp = 0;
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (gotlt == '<') {
|
||||
gotlt = c;
|
||||
break;
|
||||
}
|
||||
|
||||
/* FALLTHROUGH . . . */
|
||||
|
||||
default:
|
||||
if (gotlt == 0 || gotlt == '<') {
|
||||
if (lastsp) {
|
||||
lastsp = 0;
|
||||
*cp2++ = ' ';
|
||||
}
|
||||
*cp2++ = c;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
*cp2 = 0;
|
||||
addrs[cur_addr] = NULL;
|
||||
return(addrs);
|
||||
}
|
||||
|
||||
static char *
|
||||
formatMessage(char ** addrs, const char * subject, const char * body)
|
||||
{
|
||||
char * msg;
|
||||
int size = 0;
|
||||
int line;
|
||||
char ** to;
|
||||
int isAllASCII;
|
||||
char hdr_buf[1024];
|
||||
_DtXlateDb db = NULL;
|
||||
char plat[_DtPLATFORM_MAX_LEN];
|
||||
int execver;
|
||||
int compver;
|
||||
int body_len;
|
||||
char digest[16];
|
||||
char mime_type[64];
|
||||
char tmpbuf[20];
|
||||
char *ret_locale = NULL;
|
||||
char *ret_lang = NULL;
|
||||
char *ret_codeset = NULL;
|
||||
char default_charset[64];
|
||||
char *NewBuf = NULL;
|
||||
unsigned long _len = 0;
|
||||
Encoding enc;
|
||||
|
||||
/* Figure out how big we need the buffer to be. */
|
||||
for (to = addrs; *to; to++) {
|
||||
size += strlen(*to);
|
||||
size += 2; /* Leave room for the , */
|
||||
}
|
||||
|
||||
size += strlen(subject);
|
||||
size += strlen(body);
|
||||
|
||||
/* We will need space for the header names, a blank line, and
|
||||
other general formatting things. We could be exact, but
|
||||
1024 is more than enough and give us some spare.
|
||||
*/
|
||||
size += 1024;
|
||||
|
||||
msg = (char *)malloc(size);
|
||||
|
||||
strcpy(msg, "To: ");
|
||||
line = 4;
|
||||
|
||||
for (to = addrs; *to; to++) {
|
||||
strcat(msg, *to);
|
||||
if (*(to + 1) != NULL) {
|
||||
strcat(msg, ", ");
|
||||
line += strlen(*to);
|
||||
if (line > 72) {
|
||||
strcat(msg, "\n ");
|
||||
line = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
strcat(msg, "\nSubject: ");
|
||||
|
||||
/* Encode the body of the message */
|
||||
|
||||
/* 1) Open Lcx data bases */
|
||||
|
||||
if ((_DtLcxOpenAllDbs(&db) == 0) &&
|
||||
(_DtXlateGetXlateEnv(db,plat,&execver,&compver) != 0))
|
||||
{
|
||||
_DtLcxCloseDb(&db);
|
||||
strcat(msg, subject);
|
||||
if (msg[strlen(msg) - 1] == '\n') {
|
||||
msg[strlen(msg) - 1] = 0;
|
||||
}
|
||||
|
||||
strcat(msg, "\nMime-Version: 1.0\n");
|
||||
strcat(msg, "Content-Type: text/plain;charset=us-ascii\n\n");
|
||||
strcat(msg, body);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
body_len = strlen(body);
|
||||
|
||||
hdr_buf[0]='\0';
|
||||
|
||||
strcpy(mime_type,"text/plain");
|
||||
rfc1522cpy(hdr_buf,subject);
|
||||
strcat(hdr_buf,"Mime-Version: 1.0\n");
|
||||
isAllASCII= CvtStr((char *)NULL,(void *)body,(unsigned long)body_len,(void**)&NewBuf, &_len, CURRENT_TO_INTERNET);
|
||||
|
||||
enc = getEncodingType(body,body_len,FALSE);
|
||||
/*
|
||||
* Here is an ugly adjustment again. If mime_type is text/plain and if
|
||||
* ret_codeset is ISO-2022-JP/KR/TW/CN, we have to always use
|
||||
* enc = MIME_7BIT
|
||||
* This means if the user inputs UDC/VDC into the e-mail body,
|
||||
* fold7 may convert it to the string with MSB-on character and
|
||||
* dtmail passes it to sendmail as if I had all 7bit chars.
|
||||
*/
|
||||
getCharSet(default_charset);
|
||||
DtXlateOpToStdLocale(DtLCX_OPER_MIME, default_charset,
|
||||
&ret_locale, &ret_lang, &ret_codeset);
|
||||
if ( !strncasecmp( mime_type, "text/plain", 10 ) &&
|
||||
( !strncasecmp( ret_codeset, "ISO-2022-JP", 11 ) ||
|
||||
!strncasecmp( ret_codeset, "ISO-2022-KR", 11 ) ||
|
||||
!strncasecmp( ret_codeset, "ISO-2022-TW", 11 ) ||
|
||||
!strncasecmp( ret_codeset, "ISO-2022-CN", 11 ) ) )
|
||||
enc = MIME_7BIT;
|
||||
|
||||
memset(digest,0,sizeof(digest));
|
||||
md5PlainText(body,body_len,digest);
|
||||
writeContentHeaders(hdr_buf,mime_type,enc,(char *)digest,isAllASCII);
|
||||
strcat(hdr_buf,"\n");
|
||||
strcat(hdr_buf,"Content-Length: ");
|
||||
if (( NewBuf != NULL) && ( _len != 0))
|
||||
{
|
||||
sprintf(tmpbuf,"%ld",_len);
|
||||
strcat(hdr_buf,tmpbuf);
|
||||
strcat(hdr_buf,"\n");
|
||||
strcat(msg,hdr_buf);
|
||||
strncat(msg,NewBuf,_len);
|
||||
strcat(hdr_buf,"\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(tmpbuf,"%d",body_len);
|
||||
strcat(hdr_buf,tmpbuf);
|
||||
strcat(hdr_buf,"\n");
|
||||
strcat(msg,hdr_buf);
|
||||
strcat(msg,body);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return(msg);
|
||||
}
|
||||
|
||||
static int
|
||||
deliver(char ** addrs, char * msg)
|
||||
{
|
||||
char ** argv;
|
||||
int fd[2];
|
||||
int c_pid;
|
||||
int status;
|
||||
int n_addrs;
|
||||
int cp;
|
||||
|
||||
for (n_addrs = 0; addrs[n_addrs]; n_addrs++) {
|
||||
continue;
|
||||
}
|
||||
|
||||
argv = (char **)malloc((n_addrs + 2) * sizeof(char *));
|
||||
argv[0] = "/usr/lib/sendmail";
|
||||
|
||||
for (cp = 0; addrs[cp]; cp++) {
|
||||
argv[cp + 1] = addrs[cp];
|
||||
}
|
||||
argv[cp + 1] = NULL;
|
||||
|
||||
pipe(fd);
|
||||
|
||||
c_pid = fork();
|
||||
if (c_pid < 0) {
|
||||
return(c_pid);
|
||||
}
|
||||
|
||||
if (c_pid == 0) { /* The child. */
|
||||
dup2(fd[0], STDIN_FILENO);
|
||||
|
||||
execvp("/usr/lib/sendmail", (char *const *)argv);
|
||||
_exit(1); /* This had better never happen! */
|
||||
}
|
||||
else { /* The parent. */
|
||||
write(fd[1], msg, strlen(msg));
|
||||
close(fd[0]);
|
||||
close(fd[1]);
|
||||
|
||||
waitpid(c_pid, &status, 0);
|
||||
}
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
int
|
||||
submit_mail(const char * to,
|
||||
const char * subject,
|
||||
const char * body)
|
||||
{
|
||||
char ** addrs;
|
||||
char ** ad;
|
||||
char * msg;
|
||||
int status;
|
||||
|
||||
/*
|
||||
Parse the address list so we can form a reasonable one
|
||||
for the user to see in the message.
|
||||
*/
|
||||
addrs = arpaPhrase(to);
|
||||
|
||||
msg = formatMessage(addrs, subject, body);
|
||||
|
||||
status = deliver(addrs, msg);
|
||||
|
||||
for (ad = addrs; *ad; ad++) {
|
||||
free(*ad);
|
||||
}
|
||||
free(addrs);
|
||||
|
||||
free(msg);
|
||||
|
||||
return(status);
|
||||
}
|
||||
399
cde/programs/dtcm/dtcm/tempbr.c
Normal file
399
cde/programs/dtcm/dtcm/tempbr.c
Normal file
@@ -0,0 +1,399 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** tempbr.c
|
||||
**
|
||||
** $TOG: tempbr.c /main/5 1999/02/23 09:42:53 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)tempbr.c 1.48 95/03/28 Copyr 1991 Sun Microsystems, Inc.";
|
||||
#endif
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/XmStrDefs.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
#ifdef FNS_DEMO
|
||||
#include <Tt/tt_c.h>
|
||||
#include <Tt/tttk.h>
|
||||
#endif
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "tempbr.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
#include "editor.h"
|
||||
#include "deskset.h"
|
||||
#include "help.h"
|
||||
#ifdef FNS
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
|
||||
static void tb_cancel_cb();
|
||||
static void tb_close_cb();
|
||||
static void tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs);
|
||||
extern char *strdup(const char *);
|
||||
|
||||
#ifdef FNS_DEMO
|
||||
/* This stuff is currently broken */
|
||||
Tt_message
|
||||
tempbr_sundex_ttedit_cb(
|
||||
Tt_message m,
|
||||
void *c_data,
|
||||
Tttk_op op,
|
||||
unsigned char *contents,
|
||||
int len,
|
||||
char *file)
|
||||
|
||||
{
|
||||
char *user_str = "user:";
|
||||
char *p;
|
||||
|
||||
Tempbr *tb = (Tempbr *)c_data;
|
||||
/*
|
||||
cmfns_name_to_namepanel(contents, tb->np);
|
||||
*/
|
||||
/* XXX Yech, but hell it is just a demo */
|
||||
if (strncmp(user_str, (char *)contents, strlen(user_str)) == 0) {
|
||||
p = strchr((char *)contents, ':');
|
||||
p++;
|
||||
} else {
|
||||
p = (char *)contents;
|
||||
}
|
||||
|
||||
XmTextFieldSetString(tb->name_text, p);
|
||||
return m;
|
||||
}
|
||||
|
||||
static void
|
||||
tempbr_sundex_cb(Widget w, XtPointer data, XtPointer cbs)
|
||||
{
|
||||
Tempbr *tb = (Tempbr *)data;
|
||||
Tt_message msg = NULL;
|
||||
Tt_status status;
|
||||
|
||||
msg = ttmedia_load(0, (Ttmedia_load_msg_cb)tempbr_sundex_ttedit_cb,
|
||||
tb, TTME_EDIT, "Sun_Info", data, strlen(data) + 1,
|
||||
NULL, "calendar-address", 0);
|
||||
|
||||
status = tt_ptr_error(msg);
|
||||
if (tt_is_err(status)) {
|
||||
fprintf(stderr, "dtcm: ttmedia_load: %s\n",
|
||||
tt_status_message(status));
|
||||
return;
|
||||
}
|
||||
|
||||
status = tt_message_send(msg);
|
||||
if (tt_is_err(status)) {
|
||||
fprintf(stderr, "dtcm: tt_message_send: %s\n",
|
||||
tt_status_message(status));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* FNS_DEMO */
|
||||
|
||||
static void
|
||||
tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs)
|
||||
{
|
||||
Calendar *c = calendar;
|
||||
char *name;
|
||||
Tempbr *tb = (Tempbr *)data;
|
||||
char msg_buf[256];
|
||||
char buf[256];
|
||||
|
||||
if ((name = XmTextGetString(tb->name_text)) == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
_DtTurnOnHourGlass(tb->frame);
|
||||
|
||||
#ifdef FNS
|
||||
if (cmfns_use_fns((Props *)c->properties)) {
|
||||
sprintf(msg_buf, catgets(c->DT_catd, 1, 647,
|
||||
"Looking up %s..."), name);
|
||||
set_message(tb->show_message, msg_buf);
|
||||
XmUpdateDisplay(tb->show_message);
|
||||
XFlush(XtDisplay(w));
|
||||
/* Translate name to a calendar address */
|
||||
cmfns_lookup_calendar(name, buf, sizeof(buf));
|
||||
name = buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
sprintf(msg_buf, catgets(c->DT_catd, 1, 559, "Browsing %s..."),
|
||||
name);
|
||||
set_message(tb->show_message, msg_buf);
|
||||
XFlush(XtDisplay(w));
|
||||
switch_it(tb->cal, name, tempbrowser);
|
||||
_DtTurnOffHourGlass(tb->frame);
|
||||
return;
|
||||
}
|
||||
|
||||
extern caddr_t
|
||||
make_std_tempbr(Calendar *c)
|
||||
{
|
||||
Tempbr *tb;
|
||||
XmString label_str;
|
||||
Widget separator, button_form;
|
||||
char *title;
|
||||
|
||||
if (c->tempbr == NULL) {
|
||||
c->tempbr = (caddr_t)ckalloc(sizeof(Tempbr));
|
||||
tb = (Tempbr*)c->tempbr;
|
||||
}
|
||||
else
|
||||
tb = (Tempbr*)c->tempbr;
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 560, "Calendar : Show Other Calendar"));
|
||||
tb->frame = XtVaCreatePopupShell("frame",
|
||||
xmDialogShellWidgetClass, c->frame,
|
||||
XmNtitle, title,
|
||||
XmNallowShellResize, True,
|
||||
XmNmappedWhenManaged, False,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
tb->form = XtVaCreateWidget("form",
|
||||
xmFormWidgetClass,
|
||||
tb->frame,
|
||||
XmNautoUnmanage, False,
|
||||
XmNfractionBase, 3,
|
||||
XmNhorizontalSpacing, 4,
|
||||
XmNverticalSpacing, 4,
|
||||
XmNmarginWidth, 0,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 410, "User Name:"));
|
||||
tb->name_label = XtVaCreateWidget("name_label",
|
||||
xmLabelWidgetClass,
|
||||
tb->form,
|
||||
XmNlabelString, label_str,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 11,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
tb->name_text = XtVaCreateWidget("show_text",
|
||||
xmTextWidgetClass,
|
||||
tb->form,
|
||||
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNbottomWidget, tb->name_label,
|
||||
XmNbottomOffset, -4,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, tb->name_label,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNrightOffset, 10,
|
||||
XmNcolumns, 30,
|
||||
NULL);
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
tb->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, tb->name_text,
|
||||
XmNtopOffset, 5,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("form",
|
||||
xmFormWidgetClass,
|
||||
tb->form,
|
||||
XmNautoUnmanage, False,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNhorizontalSpacing, 4,
|
||||
XmNfractionBase, 3,
|
||||
NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 562, "Show"));
|
||||
tb->show_button = XtVaCreateWidget("show_button",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 1,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
|
||||
label_str = XmStringCreateLocalized(
|
||||
catgets(c->DT_catd, 1, 680, "Close"));
|
||||
tb->cancel_button = XtVaCreateWidget("cancelButton",
|
||||
xmPushButtonWidgetClass,
|
||||
button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 2,
|
||||
XmNuserData, c,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(tb->cancel_button,
|
||||
XmNactivateCallback, tb_cancel_cb, NULL);
|
||||
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help"));
|
||||
tb->help_button = XtVaCreateWidget("helpButton",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNlabelString, label_str,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 2,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(tb->help_button, XmNactivateCallback,
|
||||
(XtCallbackProc)help_cb, SHOW_OTHER_CAL_HELP_BUTTON);
|
||||
XtAddCallback(tb->form, XmNhelpCallback,
|
||||
(XtCallbackProc)help_cb, (XtPointer) SHOW_OTHER_CAL_HELP_BUTTON);
|
||||
|
||||
#ifdef FNS_SUNDEX_DEMO
|
||||
label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 648,
|
||||
"SunDex"));
|
||||
tb->show_button = XtVaCreateWidget("sundex_button",
|
||||
xmPushButtonWidgetClass, tb->form,
|
||||
XmNlabelString, label_str,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 9,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, tb->name_text,
|
||||
XmNleftOffset, 5,
|
||||
NULL);
|
||||
XmStringFree(label_str);
|
||||
XtAddCallback(tb->show_button, XmNactivateCallback,
|
||||
tempbr_sundex_cb, tb);
|
||||
#endif
|
||||
|
||||
tb->show_message = XtVaCreateWidget("show_message",
|
||||
xmLabelGadgetClass, tb->form,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, tb->cancel_button,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
set_message(tb->show_message, "");
|
||||
|
||||
XtAddCallback(tb->show_button, XmNactivateCallback,
|
||||
tempbr_show_cb, tb);
|
||||
ds_position_popup(c->frame, tb->frame, DS_POPUP_LOR);
|
||||
|
||||
/* set default button */
|
||||
XtVaSetValues(button_form,
|
||||
XmNdefaultButton, tb->show_button,
|
||||
XmNcancelButton, tb->show_button,
|
||||
NULL);
|
||||
XtVaSetValues(tb->form,
|
||||
XmNdefaultButton, tb->show_button,
|
||||
XmNcancelButton, tb->show_button,
|
||||
NULL);
|
||||
|
||||
XmProcessTraversal(tb->name_text, XmTRAVERSE_CURRENT);
|
||||
XtVaSetValues(tb->form, XmNinitialFocus, tb->name_text, NULL);
|
||||
|
||||
ManageChildren(button_form);
|
||||
ManageChildren(tb->form);
|
||||
XtManageChild(tb->form);
|
||||
XtVaSetValues(tb->frame, XmNmappedWhenManaged, True, NULL);
|
||||
XtRealizeWidget(tb->frame);
|
||||
|
||||
XtPopup(tb->frame, XtGrabNone);
|
||||
|
||||
return(caddr_t)tb;
|
||||
}
|
||||
|
||||
caddr_t
|
||||
make_tempbr(Calendar *c)
|
||||
{
|
||||
caddr_t tb;
|
||||
|
||||
tb = make_std_tempbr(c);
|
||||
((Tempbr *)tb)->cal = c;
|
||||
|
||||
return tb;
|
||||
}
|
||||
|
||||
static void
|
||||
tb_cancel_cb(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XmPushButtonCallbackStruct *cbs)
|
||||
{
|
||||
Calendar *c;
|
||||
Tempbr *tb;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &c, NULL);
|
||||
tb = (Tempbr *)c->tempbr;
|
||||
|
||||
XmTextSetString(tb->name_text, "");
|
||||
XtPopdown(tb->frame);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
tb_close_cb(Widget w, XtPointer data, XtPointer cbs)
|
||||
{
|
||||
Tempbr *tb = (Tempbr *)data;
|
||||
|
||||
XtPopdown(tb->frame);
|
||||
|
||||
return;
|
||||
}
|
||||
59
cde/programs/dtcm/dtcm/tempbr.h
Normal file
59
cde/programs/dtcm/dtcm/tempbr.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** tempbr.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)tempbr.h 1.10 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $XConsortium: tempbr.h /main/3 1995/11/03 10:34:36 rswiston $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _TEMPBR_H
|
||||
#define _TEMPBR_H
|
||||
|
||||
#include "ansi_c.h"
|
||||
#include "calendar.h"
|
||||
#ifdef FNS
|
||||
#include "cmfns.h"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
Calendar *cal;
|
||||
Widget frame;
|
||||
Widget form;
|
||||
Widget name_label;
|
||||
Widget name_text;
|
||||
Widget show_button;
|
||||
Widget cancel_button;
|
||||
Widget help_button;
|
||||
Widget show_message;
|
||||
#ifdef FNS
|
||||
Widget close_button;
|
||||
#endif
|
||||
#ifdef FNS_DEMO
|
||||
Widget sundex_button;
|
||||
#endif
|
||||
} Tempbr;
|
||||
|
||||
extern caddr_t make_tempbr P(());
|
||||
|
||||
#endif /* _TEMPBR_H */
|
||||
444
cde/programs/dtcm/dtcm/timezone.c
Normal file
444
cde/programs/dtcm/dtcm/timezone.c
Normal file
@@ -0,0 +1,444 @@
|
||||
/* $TOG: timezone.c /main/10 1999/07/01 16:36:43 mgreess $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <EUSCompat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <csa.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/RowColumn.h>
|
||||
#include <Xm/Scale.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/ToggleBG.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Xm/ComboBox.h>
|
||||
#include <Dt/HourGlass.h>
|
||||
#include "calendar.h"
|
||||
#include "util.h"
|
||||
#include "timeops.h"
|
||||
#include "timezone.h"
|
||||
#include "format.h"
|
||||
#include "datefield.h"
|
||||
#include "props.h"
|
||||
#include "editor.h"
|
||||
#include "todo.h"
|
||||
#include "group_editor.h"
|
||||
#include "select.h"
|
||||
#include "help.h"
|
||||
|
||||
extern caddr_t
|
||||
make_timezone(c)
|
||||
Calendar *c;
|
||||
{
|
||||
Timezone *t;
|
||||
Widget text, separator, button_form;
|
||||
XmString xmstr;
|
||||
int ac;
|
||||
Arg args[10];
|
||||
char buf[BUFSIZ], tmp_buf[BUFSIZ];
|
||||
char *title;
|
||||
void tz_customtime_cb(), tz_mytime_cb(),
|
||||
tz_apply_cb(), tz_cancel_cb(), tz_ok_cb();
|
||||
|
||||
if (c->timezone == NULL) {
|
||||
c->timezone = (caddr_t)ckalloc(sizeof(Timezone));
|
||||
t = (Timezone*)c->timezone;
|
||||
}
|
||||
else
|
||||
t = (Timezone*)c->timezone;
|
||||
|
||||
title = XtNewString(catgets(c->DT_catd, 1, 649, "Calendar : Time Zone"));
|
||||
t->frame = XtVaCreatePopupShell("frame",
|
||||
xmDialogShellWidgetClass, c->frame,
|
||||
XmNtitle, title,
|
||||
XmNallowShellResize, False,
|
||||
XmNmwmFunctions, MWM_FUNC_CLOSE | MWM_FUNC_MOVE,
|
||||
XmNmappedWhenManaged, False,
|
||||
NULL);
|
||||
XtFree(title);
|
||||
|
||||
t->form = XtVaCreateWidget("timezone_form",
|
||||
xmFormWidgetClass, t->frame,
|
||||
XmNautoUnmanage, False,
|
||||
XmNhorizontalSpacing, 5,
|
||||
XmNverticalSpacing, 5,
|
||||
XmNmarginWidth, 0,
|
||||
XmNmarginHeight, 0,
|
||||
XmNfractionBase, 4,
|
||||
NULL);
|
||||
|
||||
t->timezone_rc_mgr = XtVaCreateWidget("search_rc_mgr",
|
||||
xmRowColumnWidgetClass, t->form,
|
||||
XmNpacking, XmPACK_COLUMN,
|
||||
XmNorientation, XmVERTICAL,
|
||||
XmNradioBehavior, True,
|
||||
XmNisHomogeneous, True,
|
||||
XmNentryClass, xmToggleButtonGadgetClass,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 5,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 650, "My Time"));
|
||||
t->mytime = XtVaCreateWidget("myTime",
|
||||
xmToggleButtonGadgetClass, t->timezone_rc_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNset, True,
|
||||
XmNuserData, t,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->mytime, XmNvalueChangedCallback, tz_mytime_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 652, "Custom Time"));
|
||||
t->customtime = XtVaCreateWidget("customTime",
|
||||
xmToggleButtonGadgetClass, t->timezone_rc_mgr,
|
||||
XmNlabelString, xmstr,
|
||||
XmNuserData, t,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->customtime, XmNvalueChangedCallback, tz_customtime_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 653, "GMT"));
|
||||
t->gmtlabel = XtVaCreateWidget("gmtLabel", xmLabelWidgetClass, t->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, t->customtime,
|
||||
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNbottomWidget, t->timezone_rc_mgr,
|
||||
XmNbottomOffset, 7,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtSetSensitive(t->gmtlabel, False);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(args[ac], XmNcomboBoxType, XmDROP_DOWN_COMBO_BOX); ++ac;
|
||||
XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ++ac;
|
||||
XtSetArg(args[ac], XmNleftWidget, t->gmtlabel); ++ac;
|
||||
XtSetArg(args[ac], XmNleftOffset, 8); ++ac;
|
||||
XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ++ac;
|
||||
XtSetArg(args[ac], XmNbottomOffset, 5); ++ac;
|
||||
XtSetArg(args[ac], XmNbottomWidget, t->timezone_rc_mgr); ++ac;
|
||||
XtSetArg(args[ac], XmNpositionMode, XmONE_BASED); ++ac;
|
||||
t->gmtcombo = XmCreateComboBox(t->form, "gmtcombo", args, ac);
|
||||
|
||||
XtVaSetValues(t->gmtcombo, XmNwidth, 75, NULL);
|
||||
XtSetSensitive(t->gmtcombo, False);
|
||||
|
||||
for(ac = -12; ac <= 12; ac += 1) {
|
||||
if (ac >= 0)
|
||||
sprintf(buf, "+%d", ac);
|
||||
else
|
||||
sprintf(buf, "%d", ac);
|
||||
xmstr = XmStringCreateLocalized(buf);
|
||||
XmComboBoxAddItem(t->gmtcombo, xmstr, 0, False);
|
||||
XmStringFree(xmstr);
|
||||
}
|
||||
/* Remind: remove this kludge after timezone attribute is available */
|
||||
/* Remind: don't do this because of daylight savings time */
|
||||
/*
|
||||
XtVaGetValues(t->gmtcombo, XmNtextField, &text, NULL);
|
||||
XmTextSetString(text, "-6");
|
||||
*/
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 654, "Hours"));
|
||||
t->hourlabel = XtVaCreateWidget("gmtHours", xmLabelWidgetClass, t->form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, t->gmtcombo,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 10,
|
||||
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
|
||||
XmNbottomWidget, t->timezone_rc_mgr,
|
||||
XmNbottomOffset, 7,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtSetSensitive(t->hourlabel, False);
|
||||
|
||||
separator = XtVaCreateWidget("separator",
|
||||
xmSeparatorGadgetClass,
|
||||
t->form,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, t->timezone_rc_mgr,
|
||||
XmNtopOffset, 1,
|
||||
NULL);
|
||||
|
||||
button_form = XtVaCreateWidget("button_form",
|
||||
xmFormWidgetClass, t->form,
|
||||
XmNautoUnmanage, False,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNleftOffset, 5,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNrightOffset, 5,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNhorizontalSpacing, 3,
|
||||
XmNfractionBase, 4,
|
||||
NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK"));
|
||||
t->okbutton = XtVaCreateWidget("OK",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, 8,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 0,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 1,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
XmNuserData, c,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->okbutton, XmNactivateCallback, tz_ok_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 460, "Apply"));
|
||||
t->applybutton = XtVaCreateWidget("Apply",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, 8,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 1,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 2,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
XmNuserData, c,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->applybutton, XmNactivateCallback, tz_apply_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel"));
|
||||
t->cancelbutton = XtVaCreateWidget("Cancel",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, 8,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 2,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 3,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
XmNuserData, c,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->cancelbutton, XmNactivateCallback, tz_cancel_cb, NULL);
|
||||
|
||||
xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help"));
|
||||
t->helpbutton = XtVaCreateWidget("Help",
|
||||
xmPushButtonWidgetClass, button_form,
|
||||
XmNlabelString, xmstr,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, separator,
|
||||
XmNtopOffset, 8,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 3,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 4,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL);
|
||||
XmStringFree(xmstr);
|
||||
XtAddCallback(t->helpbutton, XmNactivateCallback,
|
||||
(XtCallbackProc)help_cb, TIMEZONE_HELP_BUTTON);
|
||||
|
||||
|
||||
t->timezone_message = XtVaCreateWidget("message",
|
||||
xmLabelGadgetClass, t->form,
|
||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, t->helpbutton,
|
||||
XmNtopOffset, 8,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
/* set timezone */
|
||||
/* Remind - get this from the structure after it's available */
|
||||
cm_strcpy(t->gmttimezone, "");
|
||||
cm_strcpy(t->mytimezone, "US/Pacific");
|
||||
cm_strcpy(tmp_buf, (char*)getenv("TZ"));
|
||||
if (tmp_buf)
|
||||
cm_strcpy(t->mytimezone, tmp_buf);
|
||||
|
||||
sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"),
|
||||
t->mytimezone);
|
||||
set_message(t->timezone_message, buf);
|
||||
set_message(c->message_text, buf);
|
||||
|
||||
XtVaSetValues(t->form,
|
||||
XmNdefaultButton, t->applybutton,
|
||||
XmNcancelButton, t->cancelbutton,
|
||||
NULL);
|
||||
XtVaSetValues(button_form,
|
||||
XmNdefaultButton, t->applybutton,
|
||||
XmNcancelButton, t->cancelbutton,
|
||||
NULL);
|
||||
ManageChildren(t->timezone_rc_mgr);
|
||||
ManageChildren(button_form);
|
||||
ManageChildren(t->form);
|
||||
XtManageChild(t->form);
|
||||
XtVaSetValues(t->frame, XmNmappedWhenManaged, True, NULL);
|
||||
XtRealizeWidget(t->frame);
|
||||
|
||||
XtPopup(t->frame, XtGrabNone);
|
||||
|
||||
return(caddr_t)t;
|
||||
}
|
||||
|
||||
extern void
|
||||
refresh_timezone(t)
|
||||
Timezone *t;
|
||||
{
|
||||
XmToggleButtonSetState(t->mytime, t->timezone_type == mytime, FALSE);
|
||||
XmToggleButtonSetState(t->customtime, t->timezone_type == customtime,FALSE);
|
||||
XtSetSensitive(t->gmtlabel, t->timezone_type == customtime);
|
||||
XtSetSensitive(t->gmtcombo, t->timezone_type == customtime);
|
||||
XtSetSensitive(t->hourlabel, t->timezone_type == customtime);
|
||||
|
||||
if (t->timezone_type == mytime)
|
||||
{
|
||||
Widget text;
|
||||
XtVaGetValues(t->gmtcombo, XmNtextField, &text, NULL);
|
||||
XmTextSetString(text, "");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tz_mytime_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Timezone *t;
|
||||
XmToggleButtonCallbackStruct *state =
|
||||
(XmToggleButtonCallbackStruct *) call_data;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &t, NULL);
|
||||
|
||||
if (state->set)
|
||||
t->edit_timezone_type = mytime;
|
||||
XtSetSensitive(t->gmtlabel, !state->set);
|
||||
XtSetSensitive(t->gmtcombo, !state->set);
|
||||
XtSetSensitive(t->hourlabel, !state->set);
|
||||
}
|
||||
|
||||
void
|
||||
tz_customtime_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Timezone *t;
|
||||
XmToggleButtonCallbackStruct *state =
|
||||
(XmToggleButtonCallbackStruct *) call_data;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &t, NULL);
|
||||
|
||||
if (state->set)
|
||||
t->edit_timezone_type = customtime;
|
||||
XtSetSensitive(t->gmtlabel, state->set);
|
||||
XtSetSensitive(t->gmtcombo, state->set);
|
||||
XtSetSensitive(t->hourlabel, state->set);
|
||||
}
|
||||
|
||||
void
|
||||
tz_set_timezone(Calendar *c, Timezone *t)
|
||||
{
|
||||
char *tmp_buf, buf[BUFSIZ], gmt[BUFSIZ];
|
||||
Widget text;
|
||||
Dtcm_calendar *cal_handle;
|
||||
int time_diff;
|
||||
|
||||
t->timezone_type = t->edit_timezone_type;
|
||||
if (t->timezone_type == mytime)
|
||||
{
|
||||
set_timezone(t->mytimezone);
|
||||
sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"),
|
||||
t->mytimezone);
|
||||
|
||||
/* get utc time */
|
||||
/* Remind: this won't work because of daylight savings time */
|
||||
/* Remind: add this after we can get more info from backend */
|
||||
/*
|
||||
cal_handle = allocate_cal_struct(
|
||||
appt_read,
|
||||
c->general->version,
|
||||
DtCM_ATTR_UTC_OFFSET_I,
|
||||
NULL);
|
||||
if (query_cal_struct(c->my_cal_handle, cal_handle) == CSA_SUCCESS)
|
||||
time_diff =
|
||||
seconds_to_hours(cal_handle->attrs->value->item.number_value);
|
||||
if (time_diff >= 0) sprintf(gmt, "GMT+%d", time_diff);
|
||||
else sprintf(gmt, "GMT%d", time_diff);
|
||||
set_timezone(gmt);
|
||||
*/
|
||||
|
||||
}
|
||||
else if (t->timezone_type == customtime)
|
||||
{
|
||||
XtVaGetValues(t->gmtcombo, XmNtextField, &text, NULL);
|
||||
tmp_buf = XmTextGetString(text);
|
||||
cm_strcpy(t->gmttimezone, tmp_buf);
|
||||
sprintf(gmt, "GMT%s", tmp_buf);
|
||||
set_timezone(gmt);
|
||||
sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"), gmt);
|
||||
}
|
||||
set_message(t->timezone_message, buf);
|
||||
paint_canvas(c, NULL, RENDER_CLEAR_FIRST);
|
||||
set_message(c->message_text, buf);
|
||||
if (editor_showing((Editor*)c->editor))
|
||||
add_all_appt((Editor*)c->editor);
|
||||
if (geditor_showing((GEditor*)c->geditor))
|
||||
add_all_gappt((GEditor*)c->geditor);
|
||||
if (todo_showing((ToDo*)c->todo))
|
||||
add_all_todo((ToDo*)c->todo);
|
||||
}
|
||||
|
||||
void
|
||||
tz_apply_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Calendar *c;
|
||||
Timezone *t;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &c, NULL);
|
||||
t = (Timezone*)c->timezone;
|
||||
tz_set_timezone(c, t);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tz_ok_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Calendar *c;
|
||||
Timezone *t;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &c, NULL);
|
||||
t = (Timezone*)c->timezone;
|
||||
tz_set_timezone(c, t);
|
||||
|
||||
XtPopdown(t->frame);
|
||||
}
|
||||
|
||||
void
|
||||
tz_cancel_cb(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
Calendar *c;
|
||||
Timezone *t;
|
||||
|
||||
XtVaGetValues(widget, XmNuserData, &c, NULL);
|
||||
t = (Timezone*)c->timezone;
|
||||
|
||||
XtPopdown(t->frame);
|
||||
}
|
||||
57
cde/programs/dtcm/dtcm/timezone.h
Normal file
57
cde/programs/dtcm/dtcm/timezone.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*******************************************************************************
|
||||
**
|
||||
** timezone.h
|
||||
**
|
||||
** static char sccsid[] = "@(#)timezone.h 1.4 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
|
||||
**
|
||||
** $TOG: timezone.h /main/4 1999/07/01 16:37:08 mgreess $
|
||||
**
|
||||
** RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
**
|
||||
** The information in this document is subject to special
|
||||
** restrictions in a confidential disclosure agreement between
|
||||
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
** document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
** Sun's specific written approval. This document and all copies
|
||||
** and derivative works thereof must be returned or destroyed at
|
||||
** Sun's request.
|
||||
**
|
||||
** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _TIMEZONE_H
|
||||
#define _TIMEZONE_H
|
||||
|
||||
typedef enum {mytime, customtime} Timezonetype;
|
||||
typedef struct {
|
||||
Widget frame;
|
||||
Widget form;
|
||||
Widget timezone_rc_mgr;
|
||||
Widget mytime;
|
||||
Widget customtime;
|
||||
Widget gmtlabel;
|
||||
Widget gmtcombo;
|
||||
Widget hourlabel;
|
||||
Widget cancelbutton;
|
||||
Widget helpbutton;
|
||||
Widget okbutton;
|
||||
Widget applybutton;
|
||||
Widget timezone_message;
|
||||
Timezonetype timezone_type;
|
||||
Timezonetype edit_timezone_type;
|
||||
char mytimezone[BUFSIZ];
|
||||
char gmttimezone[BUFSIZ];
|
||||
}Timezone;
|
||||
|
||||
extern caddr_t make_timezone P((Calendar*));
|
||||
extern void refresh_timezone P((Timezone*));
|
||||
|
||||
#endif
|
||||
2497
cde/programs/dtcm/dtcm/todo.c
Normal file
2497
cde/programs/dtcm/dtcm/todo.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user