Changeset 183 for trunk/desktop


Ignore:
Timestamp:
Jan 7, 2007, 10:36:52 PM (19 years ago)
Author:
cinc
Message:

New methods and additions all over the place.

Location:
trunk/desktop
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/Makefile

    r178 r183  
    2525                        -I $(FOUNDATIONPATH)/include
    2626
    27 ADDLIBS         =        -l$(OBJDIR)/nobjtk -l$(OBJDIR)/voywp
     27ADDLIBS         =        -l$(OBJDIR)/nobjtk -l$(OBJDIR)/voyfcls -l$(OBJDIR)/voywp
    2828CLASSDLLLIBS    =       -l$(OBJDIR)/nobjtk -l$(OBJDIR)/voyguitk -l$(OBJDIR)/voyfcls
    2929GCLIB           =       -l$(OBJDIR)/gc
  • trunk/desktop/class_c/wpfilesystem.c

    r146 r183  
    4343
    4444#include <string.h>
     45#include "gtk/gtk.h"
     46/* Gui stuff */
     47#include "nomguitk.h"
     48#include "nomwindow.h"
     49#include "desktoptypes.h"
     50
     51#include "nomfolderwindow.h"
     52
     53
    4554#include "wpfilesystem.ih"
    4655
     
    5463}
    5564
    56 NOM_Scope PNOMPath NOMLINK impl_WPFileSystem_wpQueryRealName(WPFileSystem* nomSelf, const CORBA_boolean bFullPath,
     65NOM_Scope PNOMPath NOMLINK impl_WPFileSystem_wpQueryFileName(WPFileSystem* nomSelf, const CORBA_boolean bFullPath,
    5766                                                             CORBA_Environment *ev)
    5867{
    5968  WPFileSystemData* nomThis=WPFileSystemGetData(nomSelf);
    60   PNOMPath nomRetval=NOMPathNew();
    61  
    62   NOMPath_assignCString(nomRetval, _pszFullPath, ev);
     69  PNOMPath nomRetval;
     70  PNOMPath nomPath;
     71  PWPFolder wpParent;
    6372
    64   return nomRetval;
     73  if(!bFullPath){
     74    nomRetval=NOMPathNew();
     75    return (PNOMPath) NOMPath_assignCString(nomRetval, _pszFullPath, ev);
     76  }
     77
     78  /* we are interested in the full path */
     79
     80  /* Get parent folder */
     81  wpParent=WPFileSystem_wpQueryFolder(nomSelf, NULLHANDLE);
     82
     83  if(NULLHANDLE==wpParent)
     84    {
     85      /* We are root folder */
     86      nomRetval=NOMPathNew();
     87      return (PNOMPath) NOMPath_assignCString(nomRetval, _pszFullPath, ev);
     88    }
     89
     90  /* We area folder somwhere in the chain */
     91  nomRetval=WPFileSystem_wpQueryFileName((WPFileSystem*)wpParent, bFullPath, NULLHANDLE);
     92  nomPath=NOMPathNew();
     93  nomPath= (PNOMPath) NOMPath_assignCString(nomPath, _pszFullPath, ev);
     94
     95  return (PNOMPath)NOMPath_appendPath(nomRetval, nomPath, NULLHANDLE);
    6596}
    6697
  • trunk/desktop/class_c/wpfolder.c

    r172 r183  
    5959/* Gui stuff */
    6060#include "nomguitk.h"
     61#include "nomwindow.h"
     62#include "desktoptypes.h"
     63
    6164#include "nomfolderwindow.h"
    6265
     
    6568#include "desktop.h"
    6669#include "helper.h"
    67 #include "desktoptypes.h"
     70
    6871
    6972
     
    249252
    250253#warning !!!!! Path taken from a test location !!!!!
    251         WPFolder_wpPopulate(nomSelf, 0L, NOMPath_getCString(WPFolder_wpQueryRealName(nomSelf, TRUE, ev) , ev), FALSE,  ev);
     254        WPFolder_wpPopulate(nomSelf, 0L, NOMPath_queryCString(WPFolder_wpQueryFileName(nomSelf, TRUE, ev) , ev), FALSE,  ev);
    252255        break;
    253256
  • trunk/desktop/class_c/wpobject.c

    r176 r183  
    6161#endif
    6262
     63#ifndef WPFolder
     64typedef struct WPFolder_struct {
     65  struct nomMethodTabStruct  *mtab;
     66  gulong body[1];
     67} WPFolderObj;
     68#define WPFolder WPFolderObj
     69typedef WPFolder *PWPFolder;
     70#endif
     71
    6372#include "nomwindow.h"
    6473#include "desktoptypes.h"
     
    186195
    187196  g_return_val_if_fail(NULLHANDLE!=wpObject, FALSE);
     197
     198  WPObject_wpSaveDeferred(wpObject, NULLHANDLE);
    188199
    189200  WPObject_wpDeleteFromObjUseList(wpObject, pUseItem, NULLHANDLE);
     
    445456
    446457  /* Create a new title */
    447   NOMString_assignString(tmpString, pnomStrNewTitle, ev);
     458  NOMString_assign(tmpString, pnomStrNewTitle, ev);
    448459
    449460  /* It may happen that someone changed the title from another thread. We may either
     
    472483  tmpPtr=g_atomic_pointer_get(&_pnomStringTitle);
    473484
    474   return NOMString_copyString(tmpPtr, ev);
     485  return NOMString_copy(tmpPtr, ev);
    475486}
    476487
     
    656667}
    657668
    658 
    659 
    660 
     669NOM_Scope CORBA_boolean NOMLINK impl_WPObject_wpSaveDeferred(WPObject* nomSelf, CORBA_Environment *ev)
     670{
     671/* WPObjectData* nomThis=WPObjectGetData(nomSelf); */
     672
     673  g_message("%s not implemented", __FUNCTION__);
     674
     675  return TRUE;
     676}
     677
     678NOM_Scope CORBA_boolean NOMLINK impl_WPObject_wpSaveImmediate(WPObject* nomSelf, CORBA_Environment *ev)
     679{
     680/* WPObjectData* nomThis=WPObjectGetData(nomSelf); */
     681
     682  g_message("%s not implemented", __FUNCTION__);
     683
     684  return TRUE;
     685}
     686
     687NOM_Scope void NOMLINK impl_WPObject_wpSetFolder(WPObject* nomSelf, const PWPFolder wpParentFolder,
     688                                                 CORBA_Environment *ev)
     689{
     690  WPObjectData* nomThis=WPObjectGetData(nomSelf);
     691
     692  _wpParentFldr=wpParentFolder;
     693}
     694
     695NOM_Scope PWPFolder NOMLINK impl_WPObject_wpQueryFolder(WPObject* nomSelf, CORBA_Environment *ev)
     696{
     697  WPObjectData* nomThis=WPObjectGetData(nomSelf);
     698
     699  return _wpParentFldr;
     700}
     701
  • trunk/desktop/idl/wpfilesystem.idl

    r146 r183  
    3636#define wpfsys_idl
    3737
     38#include "nombase.idl"
     39
     40NOMCLASSNAME(WPFileSystem);
     41
    3842#include "wpobject.idl"
    3943#include "nomfilepath.idl"
     
    4549
    4650  void tstSetFullPath(in string fullPath);   
    47   PNOMPath wpQueryRealName(in boolean bFullPath);
     51  PNOMPath wpQueryFileName(in boolean bFullPath);
    4852
    4953#if 0
  • trunk/desktop/idl/wpfolder.idl

    r166 r183  
    3636#define WPFOLDER_IDL_INCLUDED
    3737
     38#include "nombase.idl"
     39
     40NOMCLASSNAME(WPFolder);
     41
    3842#include "wpfilesystem.idl"
    3943#include "nomfilepath.idl"
     
    4549#endif
    4650
    47 NOMCLASSNAME(WPFolder);
     51//NOMCLASSNAME(WPFolder);
    4852
    4953interface WPFolder : WPFileSystem
  • trunk/desktop/idl/wpobject.idl

    r176 r183  
    3838#include <nomobj.idl>
    3939
     40NOMCLASSNAME(WPObject);
     41
    4042#include "wpnativetypes.idl"
    4143#include "nomstring.idl"
     
    4951#endif
    5052
    51 NOMCLASSNAME(WPObject);
     53#if 0
     54#ifndef WPFolder_defined
     55#define WPFolder_defined
     56native PWPFolder;
     57#endif
     58#endif
     59
     60#ifndef WPFOLDER_IDL_INCLUDED
     61native PWPFolder;
     62#endif
     63
     64//NOMCLASSNAME(WPObject);
    5265
    5366#include "wpnotebook.idl"
     
    7083  unsigned long  wpRequestObjectMutexSem(in unsigned long ulReserved);
    7184  unsigned long  wpReleaseObjectMutexSem();
    72   /*  boolean wpSetFolder(in WPFolder wpParentFolder); */
    7385
    7486  PNOMString wpSetTitle(in PNOMString pnomStrNewTitle);
     
    98110  PVIEWITEM wpFindViewItem(in gulong flViews,in PVIEWITEM pCurrentItem);
    99111
     112  boolean wpSaveDeferred();
     113  boolean wpSaveImmediate();
     114
     115  void wpSetFolder(in PWPFolder wpParentFolder);
     116  PWPFolder wpQueryFolder();
     117
    100118  /* Methods overriden by this class */
    101119  NOMOVERRIDE(nomInit);
     
    108126  NOMINSTANCEVAR(PGSList glstObjectInUse);
    109127  NOMINSTANCEVAR(PNOMString pnomStringTitle);
    110 
     128  NOMINSTANCEVAR(PWPFolder wpParentFldr);
    111129};
    112130
  • trunk/desktop/src/vdesktop.c

    r166 r183  
    3838#define INCL_DOSERRORS
    3939#define INCL_PM
     40
    4041#include <os2.h>
    4142#include <stdio.h>
    4243#include <stdlib.h>
    4344#include <string.h>
     45
    4446#include <gtk/gtk.h>
    4547#include "debug_window.h"
     
    5052#include "nomgc.h"
    5153#include "nomguitk.h"
     54#include "nomwindow.h"
     55#include "desktoptypes.h"
     56
    5257#include "nomfolderwindow.h"
    5358#include "wpobject.h"
    5459#include "wpfolder.h"
    55 #include "desktoptypes.h"
     60#include "nomfilepath.h"
     61
    5662
    5763int createQuitWindow(void);
     
    6874  return FALSE;
    6975}
     76
     77WPFolder* wpRootFolder;
    7078
    7179/*
     
    8593  /* Desktop folder */
    8694  WPFolder *wpDesktop;
    87  
     95  WPFolder *wpTempFolder;
     96  PNOMPath nomPath; 
     97  PNOMPath np;
     98
    8899  hReg=nomBeginRegisterDLLWithGC();
    89100  if(NULLHANDLE==hReg)
     
    117128  /* Query current dir */
    118129  g_strlcpy(desktopDir, g_get_current_dir(), sizeof(desktopDir));
    119   dbgPrintf("Desktop: %s", desktopDir);
     130  g_message("Desktop: %s", desktopDir);
    120131
    121132  /*
     
    133144  NOMClassMgrObject=nomEnvironmentNew();
    134145  //dbgPrintf( "NOMClassMgrObject: %x", NOMClassMgrObject);
    135  
     146
     147  nomPath=NOMPathNew();
     148  NOMPath_assignCString(nomPath, desktopDir, NULLHANDLE);
     149  /* Make sure there's no '/' at the end */
     150  nomPath=NOMPath_stripSeparator(nomPath, NULLHANDLE);
     151
     152  /* Create root folder */
     153  wpRootFolder=WPFolderNew();
     154  WPFolder_tstSetFullPath(wpRootFolder, NOMPath_queryCString(NOMPath_queryRoot(nomPath, NULLHANDLE),NULLHANDLE),
     155                          NULLHANDLE);
     156  wpTempFolder=wpRootFolder;
     157
     158  nomPath=NOMPath_erasePathBegin(nomPath, NULLHANDLE);
     159
     160  /* Now create all folders up the chain */
     161  while(NOMPath_length(nomPath, NULLHANDLE)>0)
     162    {
     163      NOMPath* np;
     164      WPFolder* wpFolder;
     165      np=NOMPath_queryPathBegin(nomPath, NULLHANDLE);
     166
     167      wpFolder=WPFolderNew();
     168      WPFolder_tstSetFullPath(wpFolder, NOMPath_queryCString(np,NULLHANDLE),
     169                              NULLHANDLE);
     170      WPFolder_wpSetFolder(wpFolder, wpTempFolder, NULLHANDLE);
     171      wpTempFolder=wpFolder;
     172      nomPath=NOMPath_erasePathBegin(nomPath, NULLHANDLE);
     173      WPFolder_wpQueryFileName(wpFolder, TRUE, NULLHANDLE);
     174      //g_message("   path: %s", NOMPath_queryCString(WPFolder_wpQueryFileName(wpFolder, TRUE, NULLHANDLE),
     175      //                                            NULLHANDLE));
     176    };
     177
     178  g_message("   --> Desktop dir: %s", NOMPath_queryCString(WPFolder_wpQueryFileName(wpTempFolder, TRUE, NULLHANDLE),
     179                                                            NULLHANDLE));
     180
    136181  /* Create desktop folder */
    137   wpDesktop=WPFolderNew();
    138 
    139   dbgPrintf( "Created desktop object: %x", wpDesktop);
    140   WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE);
    141  
     182  wpDesktop=wpTempFolder;//WPFolderNew();
     183
     184  //WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE);
     185  //WPFolder_tstSetFullPath(wpDesktop, "r:", NULLHANDLE);
    142186  WPFolder_wpOpen(wpDesktop, NULL, OPEN_DEFAULT,  NULL, NULL);
    143187  /*    WPFolder_wpPopulate(wpObject, 0,"blabla 2", 0,  NULL);  */
Note: See TracChangeset for help on using the changeset viewer.