From 3f1f2ea0f6d3d96906271a3aa3fb0fbe8170e868 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Mon, 15 Nov 2021 15:47:08 -0700 Subject: [PATCH] dticon: fix implicit-function-declaration warnings --- cde/programs/dticon/Makefile.am | 10 ++--- cde/programs/dticon/dtIconShell.c | 9 +++++ cde/programs/dticon/event.c | 5 +++ cde/programs/dticon/event.h | 33 ++++++++++++++++ cde/programs/dticon/externals.h | 3 ++ cde/programs/dticon/fileIO.c | 4 +- cde/programs/dticon/fileIO.h | 32 +++++++++++++++ cde/programs/dticon/graphics.c | 5 ++- cde/programs/dticon/graphics.h | 31 +++++++++++++++ cde/programs/dticon/help.c | 1 + cde/programs/dticon/help.h | 15 +++++++ cde/programs/dticon/image.c | 5 ++- cde/programs/dticon/image.h | 32 +++++++++++++++ cde/programs/dticon/main.c | 9 +++++ cde/programs/dticon/newIconDialog.c | 2 + cde/programs/dticon/process.c | 16 +++++--- cde/programs/dticon/process.h | 54 +++++++++++++++++++++++++ cde/programs/dticon/queryDialog.c | 1 + cde/programs/dticon/stdErrDialog.c | 1 + cde/programs/dticon/utils.c | 16 ++++---- cde/programs/dticon/utils.h | 61 +++++++++++++++++++++++++++++ 21 files changed, 323 insertions(+), 22 deletions(-) create mode 100644 cde/programs/dticon/event.h create mode 100644 cde/programs/dticon/fileIO.h create mode 100644 cde/programs/dticon/graphics.h create mode 100644 cde/programs/dticon/image.h create mode 100644 cde/programs/dticon/process.h create mode 100644 cde/programs/dticon/utils.h diff --git a/cde/programs/dticon/Makefile.am b/cde/programs/dticon/Makefile.am index 925c1c215..7d4356444 100644 --- a/cde/programs/dticon/Makefile.am +++ b/cde/programs/dticon/Makefile.am @@ -10,8 +10,8 @@ if SOLARIS dticon_LDADD += -ldl endif -dticon_SOURCES = dtIconShell.c event.c fileIO.c fileIODialog.c \ - globals.c graphics.c help.c image.c main.c \ - newIconDialog.c process.c queryDialog.c \ - stdErrDialog.c utils.c constants.h externals.h \ - help.h main.h +dticon_SOURCES = dtIconShell.c event.c event.h fileIO.c fileIO.h \ + fileIODialog.c globals.c graphics.c graphics.h \ + help.c image.c image.h main.c newIconDialog.c \ + process.c queryDialog.c stdErrDialog.c utils.c \ + utils.h constants.h externals.h help.h main.h diff --git a/cde/programs/dticon/dtIconShell.c b/cde/programs/dticon/dtIconShell.c index 04351eb01..fb552abcc 100644 --- a/cde/programs/dticon/dtIconShell.c +++ b/cde/programs/dticon/dtIconShell.c @@ -63,8 +63,17 @@ Includes, Defines, and Global variables from the Declarations Editor: *******************************************************************************/ +void ProcessTabletEvent( + Widget w, + XEvent *xptr, + String *params, + Cardinal num_params ); // event.c + + #include "externals.h" #include "main.h" +#include "utils.h" +#include "process.h" #define RES_CONVERT( res_name, res_value) \ XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1 diff --git a/cde/programs/dticon/event.c b/cde/programs/dticon/event.c index 3ab9f2f29..e955c462c 100644 --- a/cde/programs/dticon/event.c +++ b/cde/programs/dticon/event.c @@ -61,6 +61,11 @@ #include #include "externals.h" #include "main.h" +#include "utils.h" +#include "process.h" +#include "fileIO.h" +#include "graphics.h" +#include "image.h" #ifdef DEBUG extern Widget iconForm; diff --git a/cde/programs/dticon/event.h b/cde/programs/dticon/event.h new file mode 100644 index 000000000..210e1eda9 --- /dev/null +++ b/cde/programs/dticon/event.h @@ -0,0 +1,33 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +/* event.c */ +void ProcessTabletEvent(Widget w, XEvent *xptr, String *params, Cardinal num_params); +void Do_ButtonOp(XEvent *xptr); +void EndPolyOp(void); +void iLine(int x1, int y1, int x2, int y2, Boolean backupFlag); +void iRectangle(int x, int y, int width, int height, Boolean backupFlag); +void iArc(int x, int y, int width, int height, Boolean backupFlag); +void iPolygon(void); diff --git a/cde/programs/dticon/externals.h b/cde/programs/dticon/externals.h index 7b677c2cf..373fdadd1 100644 --- a/cde/programs/dticon/externals.h +++ b/cde/programs/dticon/externals.h @@ -28,6 +28,9 @@ * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of * Novell, Inc. **********************************************************************/ + +#pragma once + #include #include #include "constants.h" diff --git a/cde/programs/dticon/fileIO.c b/cde/programs/dticon/fileIO.c index 080ca6089..57f86cb34 100644 --- a/cde/programs/dticon/fileIO.c +++ b/cde/programs/dticon/fileIO.c @@ -59,11 +59,14 @@ #include #include #include +#include #include #include #include #include "externals.h" #include "main.h" +#include "utils.h" +#include "process.h" #ifdef __TOOLTALK #include @@ -87,7 +90,6 @@ unsigned int width_ret, height_ret; extern GC scratch_gc; extern void PixelTableClear(); -extern int PixelTableLookup(); extern void send_tt_saved(); extern void Display_XPMFile(int, int); extern void Display_XBMFile(int, int); diff --git a/cde/programs/dticon/fileIO.h b/cde/programs/dticon/fileIO.h new file mode 100644 index 000000000..96a6a9f4f --- /dev/null +++ b/cde/programs/dticon/fileIO.h @@ -0,0 +1,32 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +/* fileIO.c */ +void Do_FileIO(Widget wid, XtPointer client_unused, XmFileSelectionBoxCallbackStruct *callback_data); +Boolean Read_File(char *fnameIn); +Boolean Write_File(char *fnameIn); +void Display_XPMFile(int width, int height); +void Display_XBMFile(int width, int height); +void SetFileIODialogInfo(void); diff --git a/cde/programs/dticon/graphics.c b/cde/programs/dticon/graphics.c index f17b01e45..5b3d4058b 100644 --- a/cde/programs/dticon/graphics.c +++ b/cde/programs/dticon/graphics.c @@ -54,9 +54,12 @@ ** implied warranty. ** ******************************************************************************/ -#include +#include #include +#include #include "externals.h" +#include "utils.h" +#include "process.h" extern GC scratch_gc; diff --git a/cde/programs/dticon/graphics.h b/cde/programs/dticon/graphics.h new file mode 100644 index 000000000..21915b5cc --- /dev/null +++ b/cde/programs/dticon/graphics.h @@ -0,0 +1,31 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +/* graphics.c */ +void Flicker_Arc(Window win, int x1, int y1, int x2, int y2); +void Circle_Box(Window win, int x1, int y1, int x2, int y2, XRectangle *box); +void Set_HotBox_Coords(void); +void Start_HotBox(int flag); +void Stop_HotBox(void); diff --git a/cde/programs/dticon/help.c b/cde/programs/dticon/help.c index eb2d17742..94085f1c5 100644 --- a/cde/programs/dticon/help.c +++ b/cde/programs/dticon/help.c @@ -66,6 +66,7 @@ #include
#include "help.h" #include "main.h" +#include "utils.h" extern Widget circleButton, editMenu_addHS_pb, editMenu_clear_pb; extern Widget editMenu_copy_pb, editMenu_cut_pb, editMenu_deleteHS_pb; diff --git a/cde/programs/dticon/help.h b/cde/programs/dticon/help.h index 992fdc459..2a60f0e18 100644 --- a/cde/programs/dticon/help.h +++ b/cde/programs/dticon/help.h @@ -28,6 +28,9 @@ * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of * Novell, Inc. **********************************************************************/ + +#pragma once + #include "externals.h" /* help index flags */ @@ -158,3 +161,15 @@ #define HELP_VOLUME "Iconed" #define HELP_HELP_VOLUME "Help4Help" + +/* help.c */ +void AssignHelpCallbacks(void); +void HelpTriggerCB(Widget w, caddr_t client_data, caddr_t call_data); +void HelpOnItemCB(Widget w, caddr_t client_data, caddr_t call_data); +void HelpHyperlinkCB(Widget w, caddr_t client_data_unused, caddr_t call_data); +void HelpCloseCB(Widget w, caddr_t client_data, caddr_t call_data_unused); +void HelpSetVolAndLocation(int topic); +void DisplayHelp(char *helpVolume, char *locationId); +void DisplayNewHelp(char *helpVolume, char *locationId); +void DisplayHelpDialog(Widget helpDialog, char *helpVolume, char *locationId); +Widget CreateHelpDialog(HelpStruct *pHelp); diff --git a/cde/programs/dticon/image.c b/cde/programs/dticon/image.c index d8a4988ee..e28d1366f 100644 --- a/cde/programs/dticon/image.c +++ b/cde/programs/dticon/image.c @@ -54,8 +54,11 @@ ******************************************************************************/ #include #include "externals.h" +#include "utils.h" +#include "process.h" +#include "image.h" -int flood_min_x, flood_min_y, flood_max_x, flood_max_y; +static int flood_min_x, flood_min_y, flood_max_x, flood_max_y; /*************************************************************************** diff --git a/cde/programs/dticon/image.h b/cde/programs/dticon/image.h new file mode 100644 index 000000000..3c78c25b8 --- /dev/null +++ b/cde/programs/dticon/image.h @@ -0,0 +1,32 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +/* image.c */ +int Mirror_Image(int orientation); +int Block_Rotate(XImage *src_image, XImage *dst_image, int rtype); +void Scale_Image(void); +int Flood_Region(int flood_x, int flood_y); +void Set_FloodLimits(int x, int y); +int Flood_Fill(XImage *color_image, XImage *mono_image, int x, int y, int width, int height, unsigned long new_pixel, unsigned long new_mono); diff --git a/cde/programs/dticon/main.c b/cde/programs/dticon/main.c index 1256f8fe1..d80bf1496 100644 --- a/cde/programs/dticon/main.c +++ b/cde/programs/dticon/main.c @@ -50,6 +50,11 @@ #include
#include "externals.h" #include "main.h" +#include "help.h" +#include "event.h" +#include "utils.h" +#include "process.h" + #ifdef __TOOLTALK #include @@ -63,8 +68,12 @@ Tt_message ProcessToolTalkMediaMessage( ); extern void ProcessAppArgs(); void send_tt_saved(); #define dticon_ptype "DT_Icon_Editor" + +int edit_notifier(char* fname, Tt_message msg, int clear); + #endif + #define ERROR -1 #define NO_ERROR 0 diff --git a/cde/programs/dticon/newIconDialog.c b/cde/programs/dticon/newIconDialog.c index bd719e28e..5f140ddc5 100644 --- a/cde/programs/dticon/newIconDialog.c +++ b/cde/programs/dticon/newIconDialog.c @@ -49,6 +49,8 @@ #include "main.h" #include "externals.h" +#include "process.h" + /******************************************************************************* Includes, Defines, and Global variables from the Declarations Editor: diff --git a/cde/programs/dticon/process.c b/cde/programs/dticon/process.c index 1d8f08e8a..c0355f6a1 100644 --- a/cde/programs/dticon/process.c +++ b/cde/programs/dticon/process.c @@ -89,14 +89,23 @@ #include #include
+#include
#include
#include "main.h" +#include "utils.h" +#include "process.h" +#include "graphics.h" +#include "image.h" +#include "fileIO.h" #ifdef __TOOLTALK #include extern void ReplyToMessage( ); extern Tt_message replyMsg; + +int edit_notifier(char* fname, Tt_message msg, int clear); + #endif static void Do_DropCheckOp(DtDndTransferCallback); @@ -776,11 +785,6 @@ Process_GridState( void ) * Purpose: Convert the "object" received from bms to a full path name * * note: I am making BIG assumptions about the format of the * * file I am getting from dtfile. " - " * - * WARNING: I have used an Xe function directly (XeIsLocalHostP), rather * - * than include Dt/Connect.h, which was causing bad things to * - * happen at build time, probably because dticon is not ansi- * - * clean (it tried to get c++ version of /usr/include/stdlib.h?) * - * It's simply too late to clean up the ansi... (the bell tolls) * * * ***************************************************************************/ static char * @@ -799,7 +803,7 @@ ConvertDropName( char *objects) /* check if same host */ tmp[0] = '\0'; - if ((Boolean)XeIsLocalHostP(host)) + if (DtIsLocalHostP(host)) { char *slash = NULL; tmp[0] = ' '; diff --git a/cde/programs/dticon/process.h b/cde/programs/dticon/process.h new file mode 100644 index 000000000..7f6c246e2 --- /dev/null +++ b/cde/programs/dticon/process.h @@ -0,0 +1,54 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once +/* process.c */ +void Process_New(void); +void Process_Open(void); +void Process_Save(void); +void Process_SaveAs(void); +void Process_Quit(void); +void Process_Query_OK(void); +void Process_Query_Cancel(void); +void Process_Size_OK(void); +void Eval_NewSize(int width, int height); +void Process_Size_Cancel(void); +void Process_StdErr_OK(void); +void Process_Undo(void); +void Process_Cut(void); +void Process_Copy(XImage **img, XImage **img_mono); +void Process_Paste(void); +void Process_Scale(void); +void Process_Resize(void); +void Process_Clear(void); +void Process_GrabImage(void); +void Process_AddHotspot(void); +void Process_DeleteHotspot(void); +void Process_RotateLeft(void); +void Process_RotateRight(void); +void Process_FlipV(void); +void Process_FlipH(void); +void Process_GridState(void); +void Process_DropCheckOp(Widget w, XtPointer client_data, XtPointer call_data); +void Process_DropOp(Widget w, XtPointer client_data, XtPointer call_data); +void Do_Paste(int x, int y); diff --git a/cde/programs/dticon/queryDialog.c b/cde/programs/dticon/queryDialog.c index 479404205..f7203d3e0 100644 --- a/cde/programs/dticon/queryDialog.c +++ b/cde/programs/dticon/queryDialog.c @@ -41,6 +41,7 @@ #include #include "main.h" #include "externals.h" +#include "process.h" #define RES_CONVERT( res_name, res_value) \ XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1 diff --git a/cde/programs/dticon/stdErrDialog.c b/cde/programs/dticon/stdErrDialog.c index 888f563da..2ca7b5df9 100644 --- a/cde/programs/dticon/stdErrDialog.c +++ b/cde/programs/dticon/stdErrDialog.c @@ -40,6 +40,7 @@ #include #include "main.h" #include "externals.h" +#include "process.h" #include diff --git a/cde/programs/dticon/utils.c b/cde/programs/dticon/utils.c index 2e69b9cf8..6ef5cd7d1 100644 --- a/cde/programs/dticon/utils.c +++ b/cde/programs/dticon/utils.c @@ -86,11 +86,19 @@ #include #include #include +#include +#include
#include
#include #include
+#include
#include "externals.h" #include "main.h" +#include "process.h" +#include "fileIO.h" +#include "graphics.h" +#include "image.h" + /* Copied from Xm/BaseClassI.h */ extern XmWidgetExtData _XmGetWidgetExtData( Widget widget, @@ -149,14 +157,6 @@ void Init_Icons( int PixelTableLookup( Pixel pixelIn, Boolean allocNew); -extern void *Process_DropCheckOp( - Widget, - XtPointer, - XtPointer); -extern void *Process_DropOp( - Widget, - XtPointer, - XtPointer); extern void Repaint_Tablet(Window, int, int, int, int); extern void Init_Widget_List(void); extern void Init_Pen_Colors(Widget); diff --git a/cde/programs/dticon/utils.h b/cde/programs/dticon/utils.h new file mode 100644 index 000000000..ab0ef2d39 --- /dev/null +++ b/cde/programs/dticon/utils.h @@ -0,0 +1,61 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +/* utils.c */ +void Create_Gfx_Labels(unsigned long fg, unsigned long bg); +void Init_Editor(Widget wid); +void GetMarginData(void); +void New_MagFactor(int new_value); +void New_FileFormat(int new_value); +void Icon_Coords(int normal_x, int normal_y, int *fat_x, int *fat_y); +void Tablet_Coords(int fat_x, int fat_y, int *raw_x, int *raw_y); +void Quantize(int *x, int *y, int center); +void Repaint_Exposed_Tablet(void); +void Repaint_Tablet(Window win, int x, int y, int width, int height); +void Paint_Tile(int x, int y, GC gc); +void Transfer_Back_Image(int x1, int y1, int x2, int y2, Boolean tflag); +void Init_Widget_List(void); +void Init_Pen_Colors(Widget wid); +void Init_Color_Table(void); +void Size_IconForm(Dimension width, Dimension height); +void Init_Icons(Dimension width, Dimension height, Boolean saveFlag); +void RegisterDropSites(void); +void Abort(char *str); +void stat_out(char *msg, char *arg0, char *arg1, char *arg2, char *arg3, char *arg4, char *arg5, char *arg6); +void PixelTableClear(void); +int PixelTableLookup(Pixel pixelIn, Boolean allocNew); +void Switch_FillSolids(void); +void Select_New_Pen(int n); +void Backup_Icons(void); +void DoErrorDialog(char *str); +void DoQueryDialog(char *str); +void Do_GrabOp(void); +int LoadGrabbedImage(int x, int y, int width, int height); +void ParseAppArgs(int num, char *cmd[]); +void ProcessAppArgs(void); +void Set_Gfx_Labels(Boolean flag); +void SaveSession(void); +void GetSessionInfo(void); +void ChangeTitle(void);