123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413 |
- /*
- * 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
- */
- /* $XConsortium: IconicPath.c /main/9 1996/10/15 10:08:03 mustafa $ */
- /************************************<+>*************************************
- ****************************************************************************
- *
- * FILE: IconicPath.c
- *
- * COMPONENT_NAME: Desktop File Manager (dtfile)
- *
- * Description: Contains routines to handle the Iconic Path.
- *
- * FUNCTIONS: ButtonCallback
- * ChangeManaged
- * ClassInitialize
- * ClassPartInitialize
- * DESIRED_HEIGHT
- * DESIRED_WIDTH
- * Destroy
- * DtUpdateIconicPath
- * GeometryManager
- * ICON_HT
- * IconicPathRedraw
- * Initialize
- * MHT
- * MIN_WD
- * MWD
- * QueryGeometry
- * Redisplay
- * Resize
- * SPC
- * SetValues
- * Update
- * WidgetNavigable
- * _DtCreateIconicPath
- * externaldef
- *
- * (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
- * (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
- * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
- * (c) Copyright 1993, 1994, 1995 Novell, Inc.
- *
- ****************************************************************************
- ************************************<+>*************************************/
- /* Copied from Xm/XmI.h */
- #define GMode(g) ((g)->request_mode)
- #define IsWidth(g) (GMode (g) & CWWidth)
- #define IsHeight(g) (GMode (g) & CWHeight)
- #define IsBorder(g) (GMode (g) & CWBorderWidth)
- #define IsQueryOnly(g) (GMode (g) & XtCWQueryOnly)
- #include <Xm/TransltnsP.h>
- #include <Xm/LabelG.h>
- #include <Xm/PushBG.h>
- #include <Xm/DragDrop.h>
- #include <Dt/Icon.h>
- #include <Dt/IconP.h>
- #include <Dt/DtNlUtils.h>
- #include <Dt/Connect.h>
- #include <Dt/FileM.h>
- #include <Dt/Dts.h>
- #include "Encaps.h"
- #include "SharedProcs.h"
- #include <Xm/XmPrivate.h> /* _XmShellIsExclusive */
- #include "Desktop.h"
- #include "FileMgr.h"
- #include "Main.h"
- #include "ChangeDir.h"
- #include "Prefs.h"
- #include "IconicPathP.h"
- #define defaultTranslations _XmManager_defaultTranslations
- #define traversalTranslations _XmManager_managerTraversalTranslations
- /******** Static Function Declarations ********/
- static void ClassInitialize( void ) ;
- static void ClassPartInitialize(
- WidgetClass w_class) ;
- static void Initialize(
- Widget rw,
- Widget nw,
- ArgList args,
- Cardinal *num_args) ;
- static void Destroy(
- Widget w) ;
- static void Redisplay(
- Widget wid,
- XEvent *event,
- Region region) ;
- static void Resize(
- Widget wid) ;
- static XtGeometryResult GeometryManager(
- Widget w,
- XtWidgetGeometry *request,
- XtWidgetGeometry *reply) ;
- static void ChangeManaged(
- Widget wid) ;
- static Boolean SetValues(
- Widget cw,
- Widget rw,
- Widget nw,
- ArgList args,
- Cardinal *num_args) ;
- static XtGeometryResult QueryGeometry(
- Widget wid,
- XtWidgetGeometry *intended,
- XtWidgetGeometry *desired) ;
- static XmNavigability WidgetNavigable(
- Widget wid) ;
- /******** End Static Function Declarations ********/
- /*--------------------------------------------------------------------
- * Convenience macros
- *------------------------------------------------------------------*/
- #define MWD(ip) ((ip)->iconic_path.margin_width)
- #define MHT(ip) ((ip)->iconic_path.margin_height)
- #define SPC(ip) ((ip)->iconic_path.spacing)
- #define MIN_WD(ip) ((ip)->iconic_path.large_icons? \
- (ip)->iconic_path.large_min_width: \
- (ip)->iconic_path.small_min_width)
- #define ICON_HT(ip) ((ip)->iconic_path.large_icons? 32: 16)
- #define DESIRED_WIDTH(ip) \
- (MWD(ip) + (ip)->iconic_path.dotdot_button->core.width + MWD(ip) \
- + ((ip)->iconic_path.dropzone? \
- ((ip)->iconic_path.dropzone_icon->core.width + MWD(ip)): 0) \
- + ((ip)->iconic_path.status_msg? \
- ((ip)->iconic_path.status_label->core.width + MWD(ip)): 0))
- #define DESIRED_HEIGHT(ip) \
- (MHT(ip) + ICON_HT(ip) + SPC(ip) + \
- (ip)->iconic_path.dotdot_button->core.height + MHT(ip))
- /*--------------------------------------------------------------------
- * Resource definitions for IconicPath
- *------------------------------------------------------------------*/
- static XmSyntheticResource syn_resources[] =
- {
- { XmNmarginWidth,
- sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.margin_width),
- XmeFromHorizontalPixels,
- XmeToHorizontalPixels
- },
- { XmNmarginHeight,
- sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.margin_height),
- XmeFromVerticalPixels,
- XmeToVerticalPixels
- },
- };
- static XtResource resources[] =
- {
- { XmNmarginWidth,
- XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.margin_width),
- XmRImmediate, (XtPointer) 5
- },
- { XmNmarginHeight,
- XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.margin_height),
- XmRImmediate, (XtPointer) 2
- },
- { XmNspacing,
- XmCSpacing, XmRVerticalDimension, sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.spacing),
- XmRImmediate, (XtPointer) 4
- },
- { DtNsmallMinWidth,
- XmCMinWidth, XmRHorizontalDimension, sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec,
- iconic_path.small_min_width),
- XmRImmediate, (XtPointer) 25
- },
- { DtNlargeMinWidth,
- XmCMinWidth, XmRHorizontalDimension, sizeof (Dimension),
- XtOffsetOf( struct _DtIconicPathRec,
- iconic_path.large_min_width),
- XmRImmediate, (XtPointer) 45
- },
- { DtNforceSmallIcons,
- DtCForceSmallIcons, XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec,
- iconic_path.force_small_icons),
- XmRImmediate, (XtPointer) False
- },
- { DtNforceLargeIcons,
- DtCForceLargeIcons, XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec,
- iconic_path.force_large_icons),
- XmRImmediate, (XtPointer) False
- },
- { "buttons",
- "Buttons", XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.buttons),
- XmRImmediate, (XtPointer) False
- },
- { "dropZone",
- "DropZone", XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.dropzone),
- XmRImmediate, (XtPointer) False
- },
- { "statusMsg",
- "StatusMsg", XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.status_msg),
- XmRImmediate, (XtPointer) True
- },
- { DtNfileMgrRec,
- DtCfileMgrRec, XmRString, sizeof (char *),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.file_mgr_rec),
- XmRImmediate, (XtPointer) NULL
- },
- { DtNcurrentDirectory,
- DtCCurrentDirectory, XmRString, sizeof (char *),
- XtOffsetOf( struct _DtIconicPathRec,
- iconic_path.current_directory),
- XmRImmediate, (XtPointer) NULL
- },
- { DtNlargeIcons,
- DtCLargeIcons, XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.large_icons),
- XmRImmediate, (XtPointer) True
- },
- { DtNiconsChanged,
- DtCIconsChanged, XmRBoolean, sizeof (Boolean),
- XtOffsetOf( struct _DtIconicPathRec, iconic_path.icons_changed),
- XmRImmediate, (XtPointer) True
- },
- };
- /*--------------------------------------------------------------------
- *
- * Full class record constant
- *
- *------------------------------------------------------------------*/
- static XmBaseClassExtRec baseClassExtRec = {
- NULL,
- NULLQUARK,
- XmBaseClassExtVersion,
- sizeof(XmBaseClassExtRec),
- NULL, /* InitializePrehook */
- NULL, /* SetValuesPrehook */
- NULL, /* InitializePosthook */
- NULL, /* SetValuesPosthook */
- NULL, /* secondaryObjectClass */
- NULL, /* secondaryCreate */
- NULL, /* getSecRes data */
- { 0 }, /* fastSubclass flags */
- NULL, /* getValuesPrehook */
- NULL, /* getValuesPosthook */
- NULL, /* classPartInitPrehook */
- NULL, /* classPartInitPosthook*/
- NULL, /* ext_resources */
- NULL, /* compiled_ext_resources*/
- 0, /* num_ext_resources */
- FALSE, /* use_sub_resources */
- WidgetNavigable, /* widgetNavigable */
- NULL /* focusChange */
- };
- externaldef( dticonicpathclassrec) DtIconicPathClassRec dtIconicPathClassRec =
- {
- { /* core_class fields */
- (WidgetClass) &xmManagerClassRec, /* superclass */
- "DtIconicPath", /* class_name */
- sizeof(DtIconicPathRec), /* widget_size */
- ClassInitialize, /* class_initialize */
- ClassPartInitialize, /* class_part_init */
- FALSE, /* class_inited */
- Initialize, /* initialize */
- NULL, /* initialize_hook */
- XtInheritRealize, /* realize */
- NULL, /* actions */
- 0, /* num_actions */
- resources, /* resources */
- XtNumber(resources), /* num_resources */
- NULLQUARK, /* xrm_class */
- TRUE, /* compress_motion */
- FALSE, /* compress_exposure */
- TRUE, /* compress_enterlv */
- FALSE, /* visible_interest */
- Destroy, /* destroy */
- Resize, /* resize */
- Redisplay, /* expose */
- SetValues, /* set_values */
- NULL, /* set_values_hook */
- XtInheritSetValuesAlmost, /* set_values_almost */
- NULL, /* get_values_hook */
- NULL, /* accept_focus */
- XtVersion, /* version */
- NULL, /* callback_private */
- defaultTranslations, /* tm_table */
- QueryGeometry, /* query_geometry */
- NULL, /* display_accelerator*/
- (XtPointer)&baseClassExtRec, /* extension */
- },
- { /* composite_class fields */
- GeometryManager, /* geometry_manager */
- ChangeManaged, /* change_managed */
- XtInheritInsertChild, /* insert_child */
- XtInheritDeleteChild, /* delete_child */
- NULL, /* extension */
- },
- { /* constraint_class fields */
- NULL, /* resource list */
- 0, /* num resources */
- 0, /* constraint size */
- NULL, /* init proc */
- NULL, /* destroy proc */
- NULL, /* set values proc */
- NULL, /* extension */
- },
- { /* manager_class fields */
- traversalTranslations, /* translations */
- syn_resources, /* syn_resources */
- XtNumber (syn_resources), /* num_get_resources */
- NULL, /* syn_cont_resources */
- 0, /* num_get_cont_resources */
- XmInheritParentProcess, /* parent_process */
- NULL, /* extension */
- },
- { /* drawingArea class - none */
- 0 /* mumble */
- }
- };
- externaldef( dticonicpathwidgetclass) WidgetClass dtIconicPathWidgetClass
- = (WidgetClass) &dtIconicPathClassRec ;
- /*--------------------------------------------------------------------
- * Activate Callback for iconic path buttons and double click on icons
- *------------------------------------------------------------------*/
- static void
- ButtonCallback(
- Widget w,
- XtPointer client_data,
- XtPointer call_data )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget)client_data;
- FileMgrRec *file_mgr_rec = (FileMgrRec *) ip->iconic_path.file_mgr_rec;
- DialogData *dialog_data;
- FileMgrData *file_mgr_data;
- char host_name[MAX_PATH];
- int i;
- if (XtClass(w) == dtIconGadgetClass)
- {
- if (((XmAnyCallbackStruct *)call_data)->reason != XmCR_DEFAULT_ACTION)
- return;
- }
- if ((dialog_data = _DtGetInstanceData ((XtPointer)file_mgr_rec)) == NULL)
- return;
- file_mgr_data = (FileMgrData *) dialog_data->data;
- strcpy(host_name, file_mgr_data->host);
- if (w == ip->iconic_path.dotdot_button)
- i = ip->iconic_path.left_component - 1;
- else
- {
- for (i = 0; i < ip->iconic_path.num_components; i++)
- if (w == ip->iconic_path.components[i].button ||
- w == ip->iconic_path.components[i].icon)
- {
- break;
- }
- }
- if (i == ip->iconic_path.num_components - 1)
- FileMgrReread (file_mgr_rec);
- else if (i < ip->iconic_path.num_components)
- ShowNewDirectory (file_mgr_data, host_name,
- ip->iconic_path.components[i].path);
- }
- /*--------------------------------------------------------------------
- * Iconic path update function
- *------------------------------------------------------------------*/
- static int
- Update(
- DtIconicPathWidget ip,
- FileMgrRec *file_mgr_rec,
- FileMgrData *file_mgr_data)
- {
- static Pixmap change_view_pixmap = XmUNSPECIFIED_PIXMAP;
- char *fileLabel;
- Widget *manage;
- int nmanage;
- Dimension iwidth, iheight;
- int twidth;
- Pixel foreground, background;
- Arg args[35];
- char *ptr, *path, *name;
- XmString xm_string;
- int restricted_len;
- int path_len;
- Boolean forbidden;
- int i, j, n;
- int x, y;
- int n_changes = 0;
- PixmapData *pixmapData;
- char msg_buf[21+MAX_PATH];
- /* macro that updates the change count */
- # define INC_N_CHANGES() \
- if (n_changes++ == 0) \
- { /* first change: unmanage all children and clear the window */ \
- XtUnmanageChildren(ip->composite.children, ip->composite.num_children); \
- if (XtIsRealized((Widget)ip)) \
- XClearWindow(XtDisplay(ip), XtWindow(ip)); \
- } else
- /* macro that moves a child and updates the change count */
- # define MOVE_OBJECT(w,_x,_y) \
- if ((w)->core.x != (_x) || (w)->core.y != (_y)) \
- { \
- INC_N_CHANGES(); \
- XmeConfigureObject(w, _x, _y, (w)->core.width, (w)->core.height, (w)->core.border_width); \
- } else
- DPRINTF2((
- "IconicPath.Update: cur_dir '%s', dir_shown '%s', icons_changed %d\n",
- ip->iconic_path.current_directory,
- ip->iconic_path.directory_shown? ip->iconic_path.directory_shown: "(nil)",
- ip->iconic_path.icons_changed));
- /* enforce the forceSmallIconsor forceLargeIcons resources */
- if (ip->iconic_path.force_small_icons)
- ip->iconic_path.large_icons = False;
- else if (ip->iconic_path.force_large_icons)
- ip->iconic_path.large_icons = True;
- /* create "..." button, if necessary */
- if (ip->iconic_path.dotdot_button == NULL)
- {
- xm_string = XmStringCreateLocalized("...");
- n = 0;
- XtSetArg (args[n], XmNlabelString, xm_string); n++;
- XtSetArg (args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
- XtSetArg (args[n], XmNmarginHeight, 0); n++;
- XtSetArg (args[n], XmNhighlightThickness, 0); n++;
- if (ip->iconic_path.buttons)
- {
- XtSetArg (args[n], XmNshadowThickness, 1); n++;
- XtSetArg (args[n], XmNtraversalOn, False); n++;
- ip->iconic_path.dotdot_button =
- XmCreatePushButtonGadget((Widget)ip, "iconic_path_button", args, n);
- XtAddCallback(ip->iconic_path.dotdot_button,
- XmNactivateCallback, ButtonCallback, ip);
- }
- else
- {
- ip->iconic_path.dotdot_button =
- XmCreateLabelGadget((Widget)ip, "iconic_path_label", args, n);
- }
- XmStringFree(xm_string);
- if (ip->iconic_path.dotdot_button->core.width < (Dimension)((Dimension)MIN_WD(ip)/(Dimension)2))
- {
- XmeConfigureObject(ip->iconic_path.dotdot_button,
- ip->iconic_path.dotdot_button->core.x,
- ip->iconic_path.dotdot_button->core.y,
- (Dimension)MIN_WD(ip)/(Dimension)2,
- ip->iconic_path.dotdot_button->core.height, 0);
- }
- }
- else if (ip->iconic_path.large_shown != ip->iconic_path.large_icons)
- {
- xm_string = XmStringCreateLocalized("...");
- XtSetArg (args[0], XmNlabelString, xm_string);
- XtSetValues(ip->iconic_path.dotdot_button, args, 1);
- XmStringFree(xm_string);
- if (ip->iconic_path.dotdot_button->core.width < (Dimension)((Dimension)MIN_WD(ip)/(Dimension)2))
- {
- XmeConfigureObject(ip->iconic_path.dotdot_button,
- ip->iconic_path.dotdot_button->core.x,
- ip->iconic_path.dotdot_button->core.y,
- (Dimension)MIN_WD(ip)/(Dimension)2,
- ip->iconic_path.dotdot_button->core.height, 0);
- }
- }
- /* create StatuMsg, if necessary */
- if (ip->iconic_path.status_msg && ip->iconic_path.status_label == NULL)
- {
- /* create StatuMsg */
- n = 0;
- XtSetArg (args[n], XmNmarginHeight, 0); n++;
- XtSetArg (args[n], XmNhighlightThickness, 0); n++;
- ip->iconic_path.status_label =
- XmCreateLabelGadget((Widget)ip, "status_label", args, n);
- }
- foreground = ip->manager.foreground;
- background = ip->core.background_pixel;
- /* create DropZone, if necessary */
- if (ip->iconic_path.dropzone && ip->iconic_path.dropzone_icon == NULL)
- {
- /* create DropZone */
- if (change_view_pixmap == XmUNSPECIFIED_PIXMAP)
- {
- foreground = ip->manager.foreground;
- background = ip->core.background_pixel;
- change_view_pixmap = _DtGetPixmap(XtScreen(ip), CHANGE_VIEW_ICON_M,
- foreground, background);
- }
- n = 0;
- XtSetArg (args[n], XmNstring, NULL); n++;
- XtSetArg (args[n], XmNshadowThickness, 2); n++;
- XtSetArg (args[n], XmNfillOnArm, False); n++;
- XtSetArg (args[n], XmNhighlightThickness, 0); n++;
- XtSetArg (args[n], XmNpixmap, change_view_pixmap); n++;
- XtSetArg (args[n], XmNtraversalOn, False); n++;
- XtSetArg (args[n], XmNdropSiteOperations,
- XmDROP_MOVE | XmDROP_COPY | XmDROP_LINK); n++;
- ip->iconic_path.dropzone_icon =
- _DtCreateIcon ((Widget)ip, "change_view", args, n);
- XtAddCallback (ip->iconic_path.dropzone_icon, XmNdropCallback,
- DropOnChangeView, (XtPointer) file_mgr_rec);
- XtAddCallback (ip->iconic_path.dropzone_icon, XmNcallback,
- CurrentDirDropCallback, file_mgr_rec);
- }
- /* if the current directory changed, update component list */
- if (file_mgr_data != NULL && ip->iconic_path.current_directory != NULL &&
- ip->iconic_path.current_directory[0] == '/' &&
- (ip->iconic_path.directory_shown == NULL ||
- strcmp(ip->iconic_path.directory_shown,
- ip->iconic_path.current_directory) != 0 ||
- ip->iconic_path.large_shown != ip->iconic_path.large_icons ||
- ip->iconic_path.icons_changed))
- {
- /* store the new directory */
- XtFree(ip->iconic_path.directory_shown);
- ip->iconic_path.directory_shown =
- XtNewString(ip->iconic_path.current_directory);
- /* for restricted directory: compute length of unshown path */
- if (file_mgr_data->restricted_directory)
- {
- ptr = strrchr(file_mgr_data->restricted_directory, '/');
- if( ptr == file_mgr_data->restricted_directory )
- restricted_len = 1;
- else
- restricted_len = ptr? ptr - file_mgr_data->restricted_directory: 0;
- }
- else
- restricted_len = 0;
- /* get all path components */
- i = 0;
- ptr = ip->iconic_path.directory_shown;
- for (;;)
- {
- /* extract the next path component */
- if (ptr != NULL)
- *ptr = '\0';
- if (ip->iconic_path.directory_shown[0] == '\0')
- path = name = "/";
- else
- {
- path = ip->iconic_path.directory_shown;
- name = strrchr(path, '/') + 1;
- }
- /* don't show path components above a restricted directory */
- path_len = strlen(path);
- if (restricted_len && path_len <= restricted_len)
- goto next_component;
- /* in restricted mode: check if this component is above $HOME */
- forbidden = restrictMode
- && strncmp(path, users_home_dir, path_len) == 0
- && (path_len == 1 ||
- users_home_dir[path_len] == '/' &&
- users_home_dir[path_len + 1] != '\0');
- /* check if we need to add or update the path component */
- if (i >= ip->iconic_path.num_components)
- {
- /* create new component */
- INC_N_CHANGES();
- ip->iconic_path.components = (struct _IconicPathComponent *)
- XtRealloc((char *)ip->iconic_path.components,
- (i + 1)*sizeof(struct _IconicPathComponent));
- ip->iconic_path.components[i].path = XtNewString(path);
- pixmapData = GetPixmapData(file_mgr_rec,
- file_mgr_data,
- path,
- ip->iconic_path.large_icons);
- n = 0;
- XtSetArg (args[n], XmNstring, NULL); n++;
- if (pixmapData)
- {
- XtSetArg (args[n], XmNimageName, pixmapData->iconFileName);
- ip->iconic_path.components[i].icon_name =
- XtNewString(pixmapData->iconFileName);
- }
- else
- {
- XtSetArg (args[n], XmNimageName, NULL);
- ip->iconic_path.components[i].icon_name = NULL;
- }
- n++;
- if ( background == white_pixel )
- {
- XtSetArg (args[n], XmNbackground, white_pixel); n++;
- XtSetArg (args[n], XmNpixmapBackground, white_pixel); n++;
- XtSetArg (args[n], XmNpixmapForeground, black_pixel); n++;
- }
- else if ( background == black_pixel )
- {
- XtSetArg (args[n], XmNbackground, black_pixel); n++;
- XtSetArg (args[n], XmNpixmapBackground, white_pixel); n++;
- XtSetArg (args[n], XmNpixmapForeground, black_pixel); n++;
- }
- else
- {
- XtSetArg (args[n], XmNbackground, background); n++;
- }
- XtSetArg (args[n], XmNhighlightThickness, 0); n++;
- XtSetArg (args[n], XmNmarginHeight, 0); n++;
- XtSetArg (args[n], XmNmarginWidth, 0); n++;
- XtSetArg (args[n], XmNtraversalOn, False); n++;
- ip->iconic_path.components[i].icon =
- _DtCreateIcon ((Widget)ip, "iconic_path_icon", args, n);
- _DtCheckAndFreePixmapData(
- GetDirectoryLogicalType(file_mgr_data, path),
- file_mgr_rec->shell,
- (DtIconGadget) ip->iconic_path.components[i].icon,
- pixmapData);
- XtAddCallback (ip->iconic_path.components[i].icon, XmNcallback,
- ButtonCallback, ip);
- if (fileLabel = DtDtsDataTypeToAttributeValue(
- GetDirectoryLogicalType(file_mgr_data, path),
- DtDTS_DA_LABEL,
- NULL))
- {
- xm_string = XmStringCreateLocalized(fileLabel);
- DtDtsFreeAttributeValue(fileLabel);
- }
- else
- {
- xm_string = XmStringCreateLocalized(name);
- }
- n = 0;
- XtSetArg (args[n], XmNlabelString, xm_string); n++;
- XtSetArg (args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
- XtSetArg (args[n], XmNmarginHeight, 0); n++;
- XtSetArg (args[n], XmNhighlightThickness, 0); n++;
- if (ip->iconic_path.buttons)
- {
- XtSetArg (args[n], XmNshadowThickness, 1); n++;
- XtSetArg (args[n], XmNtraversalOn, False); n++;
- XtSetArg (args[n], XmNsensitive, !forbidden); n++;
- ip->iconic_path.components[i].button =
- XmCreatePushButtonGadget ((Widget)ip, "iconic_path_button",
- args, n);
- XtAddCallback(ip->iconic_path.components[i].button,
- XmNactivateCallback, ButtonCallback, ip);
- }
- else
- {
- ip->iconic_path.components[i].button =
- XmCreateLabelGadget((Widget)ip, "iconic_path_label", args, n);
- }
- XmStringFree(xm_string);
- }
- else
- {
- /* check if the existing component needs to be updated */
- /* check if the path has changed */
- if (strcmp(ip->iconic_path.components[i].path, path) != 0 ||
- ip->iconic_path.large_shown != ip->iconic_path.large_icons)
- {
- INC_N_CHANGES();
- XtFree(ip->iconic_path.components[i].path);
- ip->iconic_path.components[i].path = XtNewString(path);
- }
- if (fileLabel = DtDtsDataTypeToAttributeValue(
- GetDirectoryLogicalType(file_mgr_data, path),
- DtDTS_DA_LABEL,
- NULL))
- {
- xm_string = XmStringCreateLocalized(fileLabel);
- DtDtsFreeAttributeValue(fileLabel);
- }
- else
- {
- xm_string = XmStringCreateLocalized(name);
- }
- XtSetArg (args[0], XmNlabelString, xm_string);
- XtSetArg (args[1], XmNsensitive, !forbidden);
- XtSetValues(ip->iconic_path.components[i].button, args, 2);
- XmStringFree(xm_string);
- /* check if the icon has changed */
- pixmapData = GetPixmapData(file_mgr_rec,
- file_mgr_data,
- path,
- ip->iconic_path.large_icons);
- if (pixmapData)
- {
- if ((pixmapData->iconFileName == NULL) !=
- (ip->iconic_path.components[i].icon_name == NULL) ||
- pixmapData->iconFileName != NULL &&
- strcmp(pixmapData->iconFileName,
- ip->iconic_path.components[i].icon_name) != 0)
- {
- INC_N_CHANGES();
- XtFree(ip->iconic_path.components[i].icon_name);
- ip->iconic_path.components[i].icon_name =
- XtNewString(pixmapData->iconFileName);
- XtSetArg (args[0], XmNimageName, pixmapData->iconFileName);
- XtSetValues(ip->iconic_path.components[i].icon, args, 1);
-
- _DtCheckAndFreePixmapData(
- GetDirectoryLogicalType(file_mgr_data, path),
- file_mgr_rec->shell,
- (DtIconGadget) ip->iconic_path.components[i].icon,
- pixmapData);
- }
- }
- else
- {
- XtFree(ip->iconic_path.components[i].icon_name);
- ip->iconic_path.components[i].icon_name = NULL;
- XtSetArg (args[0], XmNimageName, NULL);
- XtSetValues(ip->iconic_path.components[i].icon, args, 1);
- }
- }
- /* update component count */
- i++;
- next_component:
- /* go to the next path component */
- if (ptr == NULL)
- break;
- /* restore '/' */
- *ptr = '/';
- /* find next component */
- if (strcmp(ptr, "/") == 0)
- break;
- ptr = DtStrchr(ptr + 1, '/');
- }
- /* free any leftover components */
- for (j = i; j < ip->iconic_path.num_components; j++)
- {
- INC_N_CHANGES();
- XtFree(ip->iconic_path.components[j].path);
- ip->iconic_path.components[j].path = NULL;
- XtFree(ip->iconic_path.components[j].icon_name);
- ip->iconic_path.components[j].icon_name = NULL;
- XtDestroyWidget(ip->iconic_path.components[j].icon);
- XtDestroyWidget(ip->iconic_path.components[j].button);
- }
- ip->iconic_path.num_components = i;
- ip->iconic_path.large_shown = ip->iconic_path.large_icons;
- }
- /* update component widths */
- for (i = 0; i < ip->iconic_path.num_components; i++)
- {
- /* determine width for this component */
- twidth = MIN_WD(ip);
- if (ip->iconic_path.components[i].icon->core.width > (Dimension)twidth)
- twidth = ip->iconic_path.components[i].icon->core.width;
- if (ip->iconic_path.components[i].button->core.width > (Dimension)twidth)
- twidth = ip->iconic_path.components[i].button->core.width;
- if (ip->iconic_path.components[i].button->core.width < (Dimension)twidth)
- {
- /* increment the change count */
- INC_N_CHANGES();
- /* resize */
- XmeConfigureObject(ip->iconic_path.components[i].button,
- ip->iconic_path.components[i].button->core.x,
- ip->iconic_path.components[i].button->core.y,
- twidth,
- ip->iconic_path.components[i].button->core.height,
- 0);
- }
- ip->iconic_path.components[i].width = twidth;
- }
- /* update the status message */
- if (file_mgr_data && ip->iconic_path.status_msg)
- GetStatusMsg(file_mgr_data, msg_buf);
- else
- strcpy(msg_buf, "");
- if (ip->iconic_path.msg_text == NULL ||
- strcmp(msg_buf, ip->iconic_path.msg_text) != 0)
- {
- /* remember the new status message text */
- XtFree(ip->iconic_path.msg_text);
- ip->iconic_path.msg_text = XtNewString(msg_buf);
- if (ip->iconic_path.status_label)
- {
- /* clear the area under the old status message text */
- if (XtIsRealized((Widget)ip) &&
- ip->iconic_path.status_label->core.x > 0)
- XClearArea(XtDisplay(ip), XtWindow(ip),
- ip->iconic_path.status_label->core.x,
- ip->iconic_path.status_label->core.y,
- ip->iconic_path.status_label->core.width,
- ip->iconic_path.status_label->core.height, False);
- /* set a new status message text */
- xm_string = XmStringCreateLocalized(msg_buf);
- XtSetArg (args[0], XmNlabelString, xm_string);
- XtSetValues(ip->iconic_path.status_label, args, 1);
- XmStringFree(xm_string);
- }
- }
- /* set widget size, if necessary */
- if (ip->core.width == 0)
- ip->core.width = DESIRED_WIDTH(ip);
- if (ip->core.height == 0)
- ip->core.height = DESIRED_HEIGHT(ip);
- /* for the layout: check how much of the path will fit */
- twidth = MWD(ip) + ip->iconic_path.dotdot_button->core.width + MWD(ip);
- if (ip->iconic_path.status_msg && ip->iconic_path.dropzone)
- {
- if (ip->iconic_path.status_label->core.width
- >= ip->iconic_path.dropzone_icon->core.width)
- twidth += ip->iconic_path.status_label->core.width + MWD(ip);
- else
- twidth += ip->iconic_path.dropzone_icon->core.width + MWD(ip);
- }
- else if (ip->iconic_path.status_msg)
- twidth += ip->iconic_path.status_label->core.width + MWD(ip);
- else if (ip->iconic_path.dropzone)
- twidth += ip->iconic_path.dropzone_icon->core.width + MWD(ip);
- for (i = ip->iconic_path.num_components; i > 0; i--)
- {
- twidth += SPC(ip) + ip->iconic_path.components[i - 1].width;
- if ((Dimension)twidth > ip->core.width)
- break;
- }
- if (i == 1 && (Dimension)(twidth - ip->iconic_path.dotdot_button->core.width - SPC(ip))
- <= ip->core.width)
- {
- i--;
- }
- if (i != ip->iconic_path.left_component)
- {
- INC_N_CHANGES();
- ip->iconic_path.left_component = i;
- }
- /* allocate list of to-be-managed children */
- manage = (Widget *)
- XtMalloc((2*(ip->iconic_path.num_components - i) + 2)*sizeof(Widget));
- nmanage = 0;
- /* position & manage the path components */
- x = MWD(ip);
- y = ip->core.height - MHT(ip) - ip->iconic_path.dotdot_button->core.height
- - SPC(ip);
- if (i > 0)
- {
- MOVE_OBJECT(ip->iconic_path.dotdot_button, x, y + SPC(ip));
- manage[nmanage++] = ip->iconic_path.dotdot_button;
- x += ip->iconic_path.dotdot_button->core.width + SPC(ip);
- }
- for (j = i; j < ip->iconic_path.num_components; j++)
- {
- MOVE_OBJECT(ip->iconic_path.components[j].icon,
- x + SPC(ip),
- y - ip->iconic_path.components[j].icon->core.height);
- MOVE_OBJECT(ip->iconic_path.components[j].button, x, y + SPC(ip));
- x += ip->iconic_path.components[j].width + SPC(ip);
- manage[nmanage++] = ip->iconic_path.components[j].icon;
- manage[nmanage++] = ip->iconic_path.components[j].button;
- }
- /* position & manage the status message label */
- if (ip->iconic_path.status_msg)
- {
- x = ip->core.width - MWD(ip) -
- (int)ip->iconic_path.status_label->core.width;
- if (x < 0)
- x = 0;
- y = ip->core.height - MHT(ip) -
- (int)ip->iconic_path.status_label->core.height;
- if (y < 0)
- y = 0;
- if (ip->iconic_path.status_label->core.x != x ||
- ip->iconic_path.status_label->core.y != y)
- {
- XmeConfigureObject(ip->iconic_path.status_label, x, y,
- ip->iconic_path.status_label->core.width,
- ip->iconic_path.status_label->core.height,
- ip->iconic_path.status_label->core.border_width);
- }
- manage[nmanage++] = ip->iconic_path.status_label;
- y -= SPC(ip);
- }
- else
- y = ip->core.height;
- /* position & manage the drop zone icon */
- if (ip->iconic_path.dropzone)
- {
- x = ip->core.width - MWD(ip) -
- (int)ip->iconic_path.dropzone_icon->core.width;
- if (x < 0)
- x = 0;
- y = (y - (int)ip->iconic_path.dropzone_icon->core.height + 1)/2;
- if (y < 0)
- y = 0;
- MOVE_OBJECT(ip->iconic_path.dropzone_icon, x, y);
- manage[nmanage++] = ip->iconic_path.dropzone_icon;
- }
- /* if all icons are there, manage the children */
- for (i = 0; i < ip->iconic_path.num_components; i++)
- if (ip->iconic_path.components[i].icon_name == NULL)
- break;
- if (file_mgr_data != NULL && i == ip->iconic_path.num_components)
- {
- DPRINTF2(("IconicPath.Update: manage %d children\n", nmanage));
- XtManageChildren(manage, nmanage);
- }
- XtFree((char *)manage);
- /* reset icons_changed flag */
- ip->iconic_path.icons_changed = False;
- return n_changes;
- }
- /*--------------------------------------------------------------------
- * Iconic path redraw function
- *------------------------------------------------------------------*/
- static void
- IconicPathRedraw(
- DtIconicPathWidget ip)
- {
- FileMgrRec *file_mgr_rec = (FileMgrRec *)ip->iconic_path.file_mgr_rec;
- DialogData * dialog_data;
- FileMgrData *file_mgr_data;
- int i;
- int x, y, l;
- if ((dialog_data = _DtGetInstanceData ((XtPointer)file_mgr_rec)) == NULL)
- return;
- file_mgr_data = (FileMgrData *) dialog_data->data;
- if (ip->iconic_path.gc == None)
- {
- XGCValues gc_values;
- gc_values.foreground = ip->manager.foreground;
- gc_values.line_width = 2;
- ip->iconic_path.gc = XCreateGC(XtDisplay(ip), XtWindow(ip),
- GCForeground | GCLineWidth, &gc_values);
- }
- x = MWD(ip);
- y = ip->core.height - MHT(ip) - ip->iconic_path.dotdot_button->core.height
- - SPC(ip) - ICON_HT(ip)/2;
- if (ip->iconic_path.left_component > 0)
- {
- XSetLineAttributes(XtDisplay(ip), ip->iconic_path.gc,
- 2, LineOnOffDash, CapNotLast, JoinMiter);
- XSetDashes(XtDisplay(ip), ip->iconic_path.gc, 0, "\04", 1);
- l = ip->iconic_path.dotdot_button->core.width + SPC(ip) - 3;
- l = (l/4) * 4;
- XDrawLine(XtDisplay(ip), XtWindow(ip), ip->iconic_path.gc,
- x + 2 + l, y, x + 2, y);
- x += ip->iconic_path.dotdot_button->core.width + SPC(ip);
- XSetLineAttributes(XtDisplay(ip), ip->iconic_path.gc,
- 2, LineSolid, CapNotLast, JoinMiter);
- }
- for (i = ip->iconic_path.left_component;
- i < ip->iconic_path.num_components - 1;
- i++)
- {
- if (ip->iconic_path.components[i].icon_name != NULL &&
- ip->iconic_path.components[i+1].icon_name != NULL)
- {
- XDrawLine(XtDisplay(ip), XtWindow(ip), ip->iconic_path.gc,
- x + SPC(ip) +
- ip->iconic_path.components[i].icon->core.width + 1,
- y,
- x + SPC(ip) +
- ip->iconic_path.components[i].width + SPC(ip) - 1,
- y);
- }
- x += ip->iconic_path.components[i].width + SPC(ip);
- }
- }
- /*--------------------------------------------------------------------
- * Class initialize
- *------------------------------------------------------------------*/
- static void
- ClassInitialize( void )
- {
- baseClassExtRec.record_type = XmQmotif ;
- }
- static void
- ClassPartInitialize(
- WidgetClass w_class )
- {
- _XmFastSubclassInit( w_class, XmDRAWING_AREA_BIT) ;
- return ;
- }
- /*--------------------------------------------------------------------
- * Instance initialize
- *------------------------------------------------------------------*/
- static void
- Initialize(
- Widget rw,
- Widget nw,
- ArgList args,
- Cardinal *num_args )
- {
- DtIconicPathWidget new_w = (DtIconicPathWidget) nw ;
- FileMgrRec *file_mgr_rec = (FileMgrRec *)new_w->iconic_path.file_mgr_rec;
- new_w->iconic_path.msg_text = NULL;
- new_w->iconic_path.current_directory = NULL;
- new_w->iconic_path.directory_shown = NULL;
- new_w->iconic_path.large_shown = False;
- new_w->iconic_path.status_label = NULL;
- new_w->iconic_path.dotdot_button = NULL;
- new_w->iconic_path.dropzone_icon = NULL;
- new_w->iconic_path.num_components = 0;
- new_w->iconic_path.components = NULL;
- new_w->iconic_path.left_component = 0;
- new_w->iconic_path.gc = None;
- Update(new_w, file_mgr_rec, NULL);
- return;
- }
- /*--------------------------------------------------------------------
- * Instance destroy
- *------------------------------------------------------------------*/
- static void
- Destroy(
- Widget w )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget) w;
- int i;
- /*
- XtFree(ip->iconic_path.current_directory);
- */
- ip->iconic_path.current_directory = NULL;
- XtFree(ip->iconic_path.msg_text);
- ip->iconic_path.msg_text = NULL;
- XtFree(ip->iconic_path.directory_shown);
- ip->iconic_path.directory_shown = NULL;
- for (i = 0; i < ip->iconic_path.num_components; i++)
- {
- XtFree(ip->iconic_path.components[i].path);
- ip->iconic_path.components[i].path = NULL;
- }
- XtFree((char *)ip->iconic_path.components);
- ip->iconic_path.components = NULL;
- return;
- }
- /*--------------------------------------------------------------------
- * General redisplay function called on exposure events
- *------------------------------------------------------------------*/
- static void
- Redisplay(
- Widget wid,
- XEvent *event,
- Region region )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget) wid ;
- IconicPathRedraw (ip);
- XmeRedisplayGadgets( (Widget) ip, event, region);
- return ;
- }
- /*--------------------------------------------------------------------
- * Resize
- *------------------------------------------------------------------*/
- static void
- Resize(
- Widget wid )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget) wid ;
- FileMgrRec *file_mgr_rec = (FileMgrRec *)ip->iconic_path.file_mgr_rec;
- DialogData *dialog_data;
- FileMgrData *file_mgr_data;
- if ((dialog_data = _DtGetInstanceData ((XtPointer)file_mgr_rec)) == NULL)
- return;
- file_mgr_data = (FileMgrData *) dialog_data->data;
- Update(ip, file_mgr_rec, file_mgr_data);
- return ;
- }
- /*--------------------------------------------------------------------
- * GeometryManager
- *------------------------------------------------------------------*/
- static XtGeometryResult
- GeometryManager(
- Widget w,
- XtWidgetGeometry *request,
- XtWidgetGeometry *reply )
- {
- DtIconicPathWidget ip;
- ip = (DtIconicPathWidget) w->core.parent;
- if (IsQueryOnly(request)) return XtGeometryYes;
- if (IsWidth(request)) w->core.width = request->width;
- if (IsHeight(request)) w->core.height = request->height;
- if (IsBorder(request)) w->core.border_width = request->border_width;
- /* @@@ adjust layout ? */
- return XtGeometryYes;
- }
- /*--------------------------------------------------------------------
- * Re-layout children
- *------------------------------------------------------------------*/
- static void
- ChangeManaged(
- Widget wid )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget) wid ;
- XtWidgetProc manager ;
- XmeNavigChangeManaged((Widget) ip) ;
- return;
- }
- /*--------------------------------------------------------------------
- * SetValues
- *------------------------------------------------------------------*/
- static Boolean
- SetValues(
- Widget cw,
- Widget rw,
- Widget nw,
- ArgList args,
- Cardinal *num_args )
- {
- DtIconicPathWidget current = (DtIconicPathWidget) cw ;
- DtIconicPathWidget ip = (DtIconicPathWidget) nw ;
- FileMgrRec *file_mgr_rec = (FileMgrRec *)ip->iconic_path.file_mgr_rec;
- DialogData *dialog_data;
- FileMgrData *file_mgr_data;
- Boolean redisplay;
- dialog_data = _DtGetInstanceData ((XtPointer)file_mgr_rec);
- file_mgr_data = dialog_data? (FileMgrData *) dialog_data->data: NULL;
- redisplay = (Update(ip, file_mgr_rec, file_mgr_data) > 0);
- if (XtHeight(ip) != DESIRED_HEIGHT(ip)
- || (Dimension)XtWidth(ip) < (Dimension)DESIRED_WIDTH(ip))
- {
- XtWidgetGeometry request;
- XtWidgetGeometry reply;
- request.request_mode = 0;
- if (XtHeight(ip) != DESIRED_HEIGHT(ip))
- {
- request.request_mode |= CWHeight;
- request.height = DESIRED_HEIGHT(ip);
- }
- if ((Dimension)XtWidth(ip) < (Dimension)DESIRED_WIDTH(ip))
- {
- request.request_mode |= CWWidth;
- request.width = DESIRED_WIDTH(ip);
- }
- if (XtMakeGeometryRequest(nw, &request, &reply) != XtGeometryNo)
- Update(ip, file_mgr_rec, file_mgr_data);
- redisplay = True;
- }
- return redisplay;
- }
- /*--------------------------------------------------------------------
- * QueryGeometry
- *------------------------------------------------------------------*/
- static XtGeometryResult
- QueryGeometry(
- Widget wid,
- XtWidgetGeometry *intended,
- XtWidgetGeometry *desired )
- {
- DtIconicPathWidget ip = (DtIconicPathWidget) wid ;
- desired->width = DESIRED_WIDTH(ip);
- desired->height = DESIRED_HEIGHT(ip);
- /* deal with user initial size setting */
- if (!XtIsRealized(wid))
- {
- if (XtWidth(wid) != 0) desired->width = XtWidth(wid) ;
- if (XtHeight(wid) != 0) desired->height = XtHeight(wid) ;
- }
- return XmeReplyToQueryGeometry(wid, intended, desired) ;
- }
- static XmNavigability
- WidgetNavigable(
- Widget wid)
- {
- if( wid->core.sensitive
- && wid->core.ancestor_sensitive
- && ((XmManagerWidget) wid)->manager.traversal_on )
- {
- XmNavigationType nav_type
- = ((XmManagerWidget) wid)->manager.navigation_type ;
- if( (nav_type == XmSTICKY_TAB_GROUP)
- || (nav_type == XmEXCLUSIVE_TAB_GROUP)
- || ( (nav_type == XmTAB_GROUP)
- && !_XmShellIsExclusive( wid)) )
- {
- return XmDESCENDANTS_TAB_NAVIGABLE ;
- }
- }
- return XmNOT_NAVIGABLE ;
- }
- /*--------------------------------------------------------------------
- * _DtCreateIconicPath: creates and returns a IconicPath widget.
- *------------------------------------------------------------------*/
- Widget
- _DtCreateIconicPath(
- Widget p,
- String name,
- ArgList args,
- Cardinal n )
- {
- return( XtCreateWidget( name, dtIconicPathWidgetClass, p, args, n)) ;
- }
- /*--------------------------------------------------------------------
- * UpdateIconicPath: update IconicPath widget.
- *------------------------------------------------------------------*/
- void
- DtUpdateIconicPath(
- FileMgrRec *file_mgr_rec,
- FileMgrData *file_mgr_data,
- Boolean icons_changed)
- {
- Arg args[8];
- XtSetArg (args[0], DtNfileMgrRec, file_mgr_rec);
- XtSetArg (args[1], DtNcurrentDirectory, file_mgr_data->current_directory);
- XtSetArg (args[2], DtNlargeIcons, file_mgr_data->view == BY_NAME_AND_ICON);
- XtSetArg (args[3], DtNiconsChanged, icons_changed);
- XtSetArg (args[4], "statusMsg", !file_mgr_data->show_status_line);
- XtSetValues(file_mgr_rec->iconic_path_da, args, 5);
- }
|