1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtcreate: Add missing prototypes and more (64-bit)

- Fix missing prototypes
- Fix some 64-bit related problems (XtVaGetValues)
- Fix crash on dtcreate startup in create_applicationShell1()
- Add XmeFlushIconFileCache() prototype from <Xm/IconFileP.h>
This commit is contained in:
Marcin Cieslak 2012-09-30 00:16:31 +02:00 committed by Jon Trulson
parent 3eaeffaf7e
commit 27bc7d6bec
23 changed files with 112 additions and 50 deletions

View file

@ -33,6 +33,8 @@ extern XmWidgetExtData _XmGetWidgetExtData(
#else
unsigned char extType) ;
#endif /* NeedWidePrototypes */
/* Extracted from IconFileP.h */
extern void XmeFlushIconFileCache(String path);
/* Extracted from MenuStateI.h */
extern void _XmSetInDragMode(
Widget widget,

View file

@ -61,3 +61,4 @@ function proto() {
/_XmShellIsExclusive/ { proto(); }
/_XmTextFieldSetDestination/ { proto(); }
/_XmGetActiveTopLevelMenu/ { proto(); }
/XmeFlushIconFileCache/ { proto(); }

View file

@ -54,6 +54,7 @@
#include "dtcreate.h"
#include "af_aux.h"
#include "CreateActionAppShell.h"
#include "FileCharacteristics.h"
#include "cmncbs.h"
#define CONTEXT_MACRO_ACCESS 1
@ -255,7 +256,7 @@ static Widget _Uxbuild_AddFiletype(void)
int nbutton = 0;
Widget AF_ScrolledWindow;
Widget AF_BigForm;
Dimension dim1, dim2, dim3;
XtArgVal /* Dimension */ dim1, dim2, dim3;
Widget AF_MED_IconForm, AF_TINY_IconForm;
IconData *pIconData;
char *pre, *suf, *title;
@ -894,9 +895,9 @@ Widget create_AddFiletype(swidget _UxUxParent)
{
Widget rtrn;
_UxCAddFiletype *UxContext;
Dimension dimHeight;
Dimension dimWidth;
Dimension dimTmp;
XtArgVal /* Dimension */ dimHeight;
XtArgVal /* Dimension */ dimWidth;
XtArgVal /* Dimension */ dimTmp;
Widget widScrolledWindow;
Widget widTmp;

View file

@ -35,6 +35,7 @@
#include <sys/signal.h>
#include "dtcreate.h"
#include "ca_aux.h"
#include "UxXt.h"
#include "CreateActionAppShell.h"

View file

@ -55,15 +55,21 @@
#include <X11/Shell.h>
#include <X11/cursorfont.h>
#include <Dt/Dt.h>
#include <Dt/Icon.h>
#include <Dt/Action.h>
#include <Dt/HourGlass.h>
#include <Dt/Wsm.h>
#include "dtcreate.h"
#include "UxXt.h"
#include "af_aux.h"
#include "ca_aux.h"
#include "cmncbs.h"
#include "cmnrtns.h"
#include "fileio.h"
#include "Confirmed.h"
#include "ErrorDialog.h"
#define CONTEXT_MACRO_ACCESS 1
#include "CreateActionAppShell.h"
@ -73,7 +79,7 @@
Includes, Defines, and Global variables from the Declarations Editor:
*******************************************************************************/
Dimension winheight, xprtheight, newheight, wintypeheight;
XtArgVal /* Dimension */ winheight, xprtheight, newheight, wintypeheight;
Widget FileTypes;
/*******************************************************************************
@ -484,7 +490,7 @@ static void activateCB_WindowTypeOptionMenu( Widget UxWidget,
XtPointer UxCallbackArg)
{
AD.fsFlags &= (~(CA_WT_XWINDOWS | CA_WT_TERM | CA_WT_PERMTERM));
switch ((int)UxClientData) {
switch ((int)(XtArgVal)UxClientData) {
case CA_WT_XWINDOWS :
AD.fsFlags |= CA_WT_XWINDOWS;
break;
@ -516,7 +522,7 @@ static Widget _Uxbuild_CreateActionAppShell(void)
Widget CA_WindowType_Pane;
Widget CA_WindowType_OptionMenu;
char mnemonic[2];
Dimension dim1, dim2;
XtArgVal /* Dimension */ dim1, dim2;
Widget CA_MED_IconForm, CA_TINY_IconForm, CA_LRG_IconForm;
IconData *pIconData;

View file

@ -42,7 +42,7 @@ extern Widget ErrorDialog;
*******************************************************************************/
void display_error_message (Widget parent, char *message);
extern void display_error_message (Widget parent, char *message);
#endif /* _ERRORDIALOG_H_INCLUDED */

View file

@ -31,6 +31,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <string.h>
#include <stdlib.h>
#include <Xm/Xm.h>
#include <Xm/MwmUtil.h>
@ -39,6 +40,7 @@
#include <Xm/RowColumn.h>
#include <Xm/Form.h>
#include <Xm/ToggleBG.h>
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/Label.h>
#include <Xm/PushBG.h>
@ -48,6 +50,9 @@
#include "UxXt.h"
#include "dtcreate.h"
#include "cmncbs.h"
#include "cmnrtns.h"
#include "cmnutils.h"
#include "ErrorDialog.h"
#define CONTEXT_MACRO_ACCESS 1
#include "FileCharacteristics.h"
@ -167,6 +172,7 @@ ushort GetContentsType(void)
} else if (XmToggleButtonGadgetGetState(FC_LongToggle)) {
return((ushort)CA_FT_CNTLONG);
}
/* NOTREACHED */
}
/******************************************************************************/
@ -345,7 +351,7 @@ void ParseAndUpdateID(FiletypeData *pFtD)
/*****************************************************************************/
void CalculateAND(void)
{
Boolean set1, set2, set3, set4;
XtArgVal /* Boolean */ set1, set2, set3, set4;
int cnt;
XtVaGetValues(FC_NameOrPathToggle, XmNset, &set1, NULL);
@ -408,7 +414,7 @@ static void valueChangedCB_FC_PermissionToggle(Widget UxWidget,
XtPointer UxClientData,
XtPointer UxCallbackArg)
{
Boolean set;
XtArgVal /* Boolean */ set;
XtVaGetValues(UxWidget, XmNset, &set, NULL);
XtSetSensitive(FC_PermissionLabel, set);
@ -467,7 +473,7 @@ static void valueChangedCB_FC_ContentsToggle( Widget UxWidget,
XtPointer UxClientData,
XtPointer UxCallbackArg)
{
Boolean set;
XtArgVal /* Boolean */ set;
XtVaGetValues(UxWidget, XmNset, &set, NULL);
XtSetSensitive(FC_ContentsLabel, set);
@ -483,7 +489,7 @@ static void valueChangedCB_FC_NameOrPathToggle(Widget UxWidget,
XtPointer UxCallbackArg)
{
Boolean set;
XtArgVal /* Boolean */ set;
XtVaGetValues(UxWidget, XmNset, &set, NULL);
XtSetSensitive(FC_NamePatternLabel, set);
@ -1315,9 +1321,9 @@ static Widget _Uxbuild_FileCharacteristics(void)
Widget create_FileCharacteristics( swidget _UxUxParent )
{
Widget rtrn;
Dimension dimHeight;
Dimension dimWidth;
Dimension dimTmp;
XtArgVal /* Dimension */ dimHeight;
XtArgVal /* Dimension */ dimWidth;
XtArgVal /* Dimension */ dimTmp;
Widget widScrolledWindow;
Widget widTmp;

View file

@ -37,6 +37,7 @@
#include "UxXt.h"
#include "dtcreate.h"
#include "cmnrtns.h"
#include "cmncbs.h"
#include "ca_aux.h"
#include "fileio.h"
@ -132,7 +133,7 @@ static void helpCallback_OpenFile( Widget UxWidget,
UxOpenFileContext = UxContext =
(_UxCOpenFile *) UxGetContext( UxWidget );
{
DisplayHelpDialog(UxWidget, HELP_OPENFILE, UxCallbackArg);
DisplayHelpDialog(UxWidget, (XtPointer)HELP_OPENFILE, UxCallbackArg);
}
UxOpenFileContext = UxSaveCtx;
}

View file

@ -128,7 +128,7 @@ CREATION: Visual Edge Software Sept 19/91
-----------------------------------------------------------------------------*/
static int handle_dialog_child( Widget wgt, void (*manage_func)(Widget) )
{
int i, num_children;
XtArgVal i, num_children;
Widget *children;
int error_flag = UX_ERROR;
@ -284,7 +284,7 @@ void UxDeleteContextCB( Widget wgt, XtPointer client_data,
(void) XDeleteContext( XtDisplay( UxTopLevel ),
(Window) wgt,
(XContext) client_data );
(XContext)(XtArgVal) client_data );
}
/******************************************************************************
@ -323,7 +323,7 @@ int UxPutContext( Widget wgt, caddr_t context )
return ( UX_ERROR );
XtAddCallback (wgt, XmNdestroyCallback,
UxDeleteContextCB, (XtPointer) xcontext_id);
UxDeleteContextCB, (XtPointer)(XtArgVal) xcontext_id);
return ( UX_NO_ERROR );
}

View file

@ -170,6 +170,7 @@ extern void UxMrmRegisterClass( char *, Widget (*)(Widget, String, A
/* The following are declarations of the functions in UxXt.c */
extern void* UxNewContext (size_t size, int isSubclass);
extern int UxPopupInterface( Widget wgt, XtGrabKind grab_flag );
extern int UxPopdownInterface( Widget wgt );
extern int UxDestroyInterface( Widget wgt);

View file

@ -43,6 +43,7 @@
#include <Xm/RowColumnP.h>
#include <Xm/MessageB.h>
#include <Xm/FileSB.h>
#include <Xm/List.h>
#include <sys/stat.h>
#if defined(AIXV3)
# include <sys/dir.h>
@ -58,8 +59,11 @@
#include "dtcreate.h"
#include "af_aux.h"
#include "cmncbs.h"
#include "cmnutils.h"
#include "cmnrtns.h"
#include "ErrorDialog.h"
#include "FileCharacteristics.h"
/******************************************************************************/
/* */
@ -145,7 +149,8 @@ void activateCB_filetype_icon (Widget wid, XtPointer client_data,
printf("DblClick icon callback.\n");
#endif
activateCB_edit_icon(wid, CA_FILETYPE_ICONS, cbs);
activateCB_edit_icon(wid, (XtPointer)CA_FILETYPE_ICONS,
(XmPushButtonCallbackStruct *)cbs /* unused anyway */);
}

View file

@ -88,6 +88,7 @@ void getAF_PrintCmd (FiletypeData *);
void init_AddFiletype (FiletypeData *);
void free_Filetypedata(FiletypeData *);
void init_AddFiletype_dialog_fields(FiletypeData *pFtD);
void clear_AddFiletype_dialog_fields(void);
void AddFiletypeToList();
void UpdateFiletypeDataArray();

View file

@ -59,18 +59,25 @@
#include <Dt/IconFile.h>
#include "dtcreate.h"
#include "af_aux.h"
#include "ca_aux.h"
#include "cmnutils.h"
#include "cmncbs.h"
#include "cmnrtns.h"
#include "cmnutils.h"
#include "CreateActionAppShell.h"
#include "Confirmed.h"
#include "ErrorDialog.h"
#include "FileCharacteristics.h"
/* from main.c */
extern void RemoveTmpIconFiles( void );
/******************************************************************************/
/* */
/* External Variables */
/* */
/******************************************************************************/
extern Dimension wintypeheight, winheight, xprtheight, newheight;
extern XtArgVal /* Dimension */ wintypeheight, winheight, xprtheight, newheight;
/******************************************************************************/
/* */
@ -652,7 +659,7 @@ void activateCB_FileQuit (Widget wid, XtPointer cdata,
void activateCB_ExpertOption (Widget wid, XtPointer client_data,
XtPointer *cbs)
{
Dimension ca_width;
XtArgVal /* Dimension */ ca_width;
if (!XtIsManaged(XprtOptionForm)) {
/**********************************************************************/
@ -828,7 +835,8 @@ void activateCB_action_icon (Widget wid, XtPointer client_data,
printf("DblClick icon callback.\n");
#endif
activateCB_edit_icon(wid, CA_ACTION_ICONS, cbs);
activateCB_edit_icon(wid, (XtPointer)CA_ACTION_ICONS,
(XmPushButtonCallbackStruct *)cbs /* unused anyway */);
}
return;

View file

@ -31,14 +31,12 @@
#include "UxXt.h"
#if defined(USL) || defined(__uxp__)
#if !defined(_DIRENT_H)
#include <dirent.h>
#endif
#if !defined(_DtIcon_h_)
#include <Dt/Icon.h>
#endif
#endif
/***************************************************************************/
/* */
@ -60,6 +58,7 @@
/* */
/***************************************************************************/
void initAD( ActionData *pAD );
void readCAFromGUI (struct _ActionData *ca_struct);
void getCAactionName (struct _ActionData *ca_struct);
void getCAdblClkCmd (struct _ActionData *ca_struct);

View file

@ -41,9 +41,12 @@
#include "cmncbs.h"
#include "cmnrtns.h"
#include "CreateActionAppShell.h"
#include "af_aux.h"
#include "ca_aux.h"
#include "icon_selection_dialog.h"
/* from main.c */
extern void UxDoEditPixmap(Widget wid, char *fname);
/******************************************************************************/
/* Initialize global values. */
@ -68,7 +71,7 @@ void activateCB_open_FindSet (Widget find_set_button, XtPointer cdata,
XmFileSelectionBoxCallbackStruct *cbstruct)
{
Widget filter;
Boolean use_bm = False;
XtArgVal /* Boolean */ use_bm = False;
static char *use_bm_filter = "*.m.bm";
static char *use_pm_filter = "*.m.pm";
char *search_path;
@ -201,7 +204,7 @@ void activateCB_edit_icon (Widget wid, XtPointer client_data,
if (bIconEditorDisplayed) return;
if ((int)client_data == CA_ACTION_ICONS) {
if ((int)(XtArgVal)client_data == CA_ACTION_ICONS) {
IsActionIcons = True;
widSelectedIcon = get_selected_action_icon();
widEditSource = CreateActionAppShell;
@ -278,7 +281,7 @@ void DisplayHelpDialog(Widget wid, XtPointer client_data, XtPointer cbs)
XtSetArg(args[i], DtNhelpVolume, "CreatAct"); i++;
XtSetArg(args[i], DtNlocationId, pszTopic); i++;
switch ((int)client_data) {
switch ((XtArgVal)client_data) {
case HELP_OVERVIEW:
strcpy(pszTopic, "_hometopic");
break;

View file

@ -48,6 +48,8 @@ void activateCB_open_FindSet (Widget,XtPointer,XmFileSelectionBoxCallbackStruct
void activateCB_edit_icon (Widget,XtPointer,XmPushButtonCallbackStruct *);
void DisplayHelpDialog (Widget, XtPointer, XtPointer);
void helpCB_general (Widget, XtPointer, XtPointer);
void createCB_IconGadget(Widget wid, Boolean bActionIcons, enum icon_size_range IconSize);
#endif /* _CMNCBS_H_INCLUDED */

View file

@ -30,10 +30,12 @@
/*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <Dt/Icon.h>
#include <X11/cursorfont.h>
#include "UxXt.h"
#include <libgen.h>
#include <Dt/HourGlass.h>
#include "dtcreate.h"
#include "CreateActionAppShell.h"
@ -51,7 +53,7 @@ char * ReplaceSpaces(char *pszName)
char *ptr;
newName = (char *)XtMalloc(strlen(pszName) + 1);
memset(newName, 0, sizeof(newName));
memset(newName, 0, strlen(pszName) + 1);
strcpy(newName, pszName);
ptr = strrchr(newName, ' ');
if (ptr) {
@ -185,7 +187,7 @@ char * GetCoreName(char *pszFullName)
name = pszFullName;
}
newName = (char *)malloc(strlen(name) + 1);
memset(newName, 0, sizeof(newName));
memset(newName, 0, strlen(name) + 1);
strcpy(newName, name);
ptr = strrchr(newName, '.');
if (ptr) {
@ -210,7 +212,7 @@ void load_icons (Widget wid, XtPointer client_data,
char *full_name, *path_and_base_name, *type_name, *size_name;
char *base_name;
char *ptr;
int iSource;
XtArgVal /* int */ iSource;
FiletypeData *pFtD;
/*****************************************/

View file

@ -34,6 +34,7 @@
#include <Xm/RowColumnP.h>
#include <Xm/MessageB.h>
#include <Xm/Text.h>
#include <Xm/List.h>
#include "cmnutils.h"
@ -119,7 +120,7 @@ return (text_string);
/********************************************************************************/
void delete_all_list_items (Widget list)
{
int item_count = 0;
XtArgVal /* int */ item_count = 0;
XtVaGetValues (list, XmNitemCount, &item_count, NULL);
if (item_count > 0) {

View file

@ -55,6 +55,8 @@ void show_warning_dialog (void);
Widget show_working_dialog (void);
void show_info_dialog (void);
void free_XmStringTable (XmStringTable table);
void clear_text (Widget textfield);
void clear_text_field (Widget textfield);
void delete_all_list_items (Widget list);
#endif /* _CMNUTILS_H_INCLUDED */

View file

@ -23,7 +23,9 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <Dt/Icon.h>
@ -31,6 +33,8 @@
#include "dtcreate.h"
#include "cmnrtns.h"
#include "fileio.h"
#include "parser.h"
#include "ErrorDialog.h"
#define COMMENT_CHAR '#'
#define MAX_KEY 10000
@ -836,9 +840,14 @@ char * CreateIconName(char *pszDirName, char *pszBaseName, enum icon_size_range
case Medium_Icon :
strcpy(pszSize, MEDIUM_EXT);
break;
case Small_Icon :
strcpy(pszSize, SMALL_EXT);
break;
case Tiny_Icon :
strcpy(pszSize, TINY_EXT);
break;
case None_Selected :
pszSize[0] = 0;
}
if (bIsMask) {
strcat(pszSize, "_m");

View file

@ -44,14 +44,14 @@
/* */
/***************************************************************************/
ushort WriteDefinitionFile(char *, ActionData *);
ushort WriteActionFile(ActionData *);
Boolean check_file_exists(char *);
int OpenDefinitionFile(char *, ActionData *);
ushort CopyIconFiles(ActionData *);
char * CreateIconName(char *, char *, enum icon_size_range, char *, Boolean);
Boolean ActionHasIcon (void);
Boolean FiletypeHasIcon (FiletypeData *);
extern ushort WriteDefinitionFile(char *, ActionData *);
extern ushort WriteActionFile(ActionData *);
extern Boolean check_file_exists(char *);
extern int OpenDefinitionFile(char *, ActionData *);
extern ushort CopyIconFiles(ActionData *);
extern char * CreateIconName(char *, char *, enum icon_size_range, char *, Boolean);
extern Boolean ActionHasIcon (void);
extern Boolean FiletypeHasIcon (FiletypeData *);
#endif /* _FILEIO_H_INCLUDED */

View file

@ -50,6 +50,7 @@
#include <Xm/Form.h>
#include <Xm/RowColumn.h>
#include <Xm/MessageB.h>
#include <Xm/XmPrivate.h> /* XmeFlushIconFileCache */
#include <X11/cursorfont.h>
#include <Dt/Icon.h>
@ -59,6 +60,8 @@
#include "cmncbs.h"
#include "cmnrtns.h"
#include "cmnutils.h"
#include "fileio.h"
#include "ErrorDialog.h"
/*******************************************************************************
Includes, Defines, and Global variables from the Declarations Editor:
@ -1315,7 +1318,7 @@ void resizeCB_clipWindow( Widget UxWidget,
Widget widvScrollbar;
Widget widRowColumn;
int increment;
Dimension height;
XtArgVal /* Dimension */ height;
XtVaGetValues(XtParent(UxWidget), XmNverticalScrollBar, &widvScrollbar, NULL);
widRowColumn = (Widget)UxClientData;

View file

@ -40,9 +40,14 @@
#include <Xm/Xm.h>
#include <Xm/Protocols.h>
#include <Xm/VendorSEP.h>
#include <Xm/XmPrivate.h> /* XmeFlushIconFileCache */
#include <Dt/Action.h>
#include <Dt/GetDispRes.h>
#include <Dt/Icon.h>
#include <Dt/EnvControlP.h>
#include <Dt/UserMsg.h>
#include <Dt/Session.h>
#include <Dt/Wsm.h>
#define GETXMSTRING(s, m, d) XmStringCreateLocalized(GETMESSAGE(s,m,d))
#define CLASS_NAME "Dtcreate"
@ -60,6 +65,8 @@ extern XmWidgetExtData _XmGetWidgetExtData(
#include "dtcreate.h"
#include "ca_aux.h"
#include "cmnrtns.h"
#include "ErrorDialog.h"
#include "fileio.h"
#ifdef __TOOLTALK
#include <Tt/tttk.h>
@ -89,7 +96,7 @@ int UxScreen;
* Insert application global declarations here
*---------------------------------------------*/
extern Dimension wintypeheight;
extern XtArgVal /* Dimension */ wintypeheight;
/* Structure used on a save session to see if a dt is iconic */
typedef struct {
@ -533,7 +540,7 @@ void RemoveTmpIconFiles( void )
static void
ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data)
{
exit((int) client_data);
exit((int)(XtArgVal) client_data);
}
void
@ -753,7 +760,7 @@ Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
return;
return (TT_CALLBACK_CONTINUE);
}
/*******************************************************************/
@ -796,7 +803,7 @@ Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
return;
return (TT_CALLBACK_CONTINUE);
}
/*******************************************************************/
@ -847,7 +854,7 @@ Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
return;
return (TT_CALLBACK_CONTINUE);
}
/****************************************************************/
@ -873,7 +880,7 @@ Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
return;
return (TT_CALLBACK_CONTINUE);
}
#ifdef DEBUG
@ -900,7 +907,7 @@ Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
return;
return (TT_CALLBACK_CONTINUE);
}
/****************************************************************/
@ -1175,6 +1182,7 @@ void UxDoEditPixmap(Widget wid, char *fname)
/* */
/* */
/*****************************************************************************/
int
main(int argc, char *argv[])
{
/*-----------------------------------------------------------