Changeset 146


Ignore:
Timestamp:
Dec 3, 2006, 9:54:12 PM (19 years ago)
Author:
cinc
Message:

Improvements to WPFolder and fixes to related classes.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/Makefile

    r141 r146  
    1818
    1919TKIDLDIR        =       $(NOMPATH)/idl  # The object TK lives here
    20 IDLINC          =       --include=$(FOUNDATIONPATH)/idl
     20IDLINC          =       -include=$(FOUNDATIONPATH)/idl -include=$(TKIDLDIR) \
     21                        -include=$(GUITKPATH)/idl
    2122
    22 #INC            =       ./include -I $(NOMPATH)/include -I $(NOMPATH)/class_h
    23 INC             =       ./include -I ./class_h -I $(NOMPATH)/class_h -I $(NOMPATH)/include \
     23INC             =       ./include -I ./class_h -I $(NOMPATH)/class_h -I $(NOMPATH)/include\
    2424                        -I $(GUITKPATH)/class_h -I $(GUITKPATH)/include -I $(FOUNDATIONPATH)/class_h \
    2525                        -I $(FOUNDATIONPATH)/include
     
    6868###################################
    6969
    70 BASE_NOMCOMPILEH        =       $(IDLCOMP) -include=$(TKIDLDIR) $(IDLINC) --showcpperrors --header --output-dir=$(CLASSINC) $<
    71 BASE_NOMCOMPILEIH       =       $(IDLCOMP) -include=$(TKIDLDIR) $(IDLINC) --showcpperrors --ihfile --output-dir=$(CLASSINC) $<
    72 BASE_NOMCOMPILEC        =       $(IDLCOMP) -include=$(TKIDLDIR) $(IDLINC) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
     70BASE_NOMCOMPILEH        =       $(IDLCOMP) $(IDLINC) --showcpperrors --header --output-dir=$(CLASSINC) $<
     71BASE_NOMCOMPILEIH       =       $(IDLCOMP) $(IDLINC) --showcpperrors --ihfile --output-dir=$(CLASSINC) $<
     72BASE_NOMCOMPILEC        =       $(IDLCOMP) $(IDLINC) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
    7373
    7474
  • trunk/desktop/class_c/wpfilesystem.c

    r141 r146  
    4545#include "wpfilesystem.ih"
    4646
    47 NOM_Scope void NOMLINK impl_WPFileSystem_tstSetFullPath(WPFileSystem* nomSelf, const CORBA_char * fullPath, CORBA_Environment *ev)
     47NOM_Scope void NOMLINK impl_WPFileSystem_tstSetFullPath(WPFileSystem* nomSelf, const CORBA_char * fullPath,
     48                                                        CORBA_Environment *ev)
    4849{
    49 /* WPFileSystemData* nomThis=WPFileSystemGetData(nomSelf); */
     50  WPFileSystemData* nomThis=WPFileSystemGetData(nomSelf);
    5051
    5152  nomPrintf("thePath: ---> %s \n", fullPath);
     53  _pszFullPath=fullPath;
    5254}
    5355
     56NOM_Scope PNOMPath NOMLINK impl_WPFileSystem_wpQueryRealName(WPFileSystem* nomSelf, const CORBA_boolean bFullPath,
     57                                                             CORBA_Environment *ev)
     58{
     59  WPFileSystemData* nomThis=WPFileSystemGetData(nomSelf);
     60  PNOMPath nomRetval=NOMPathNew();
     61 
     62  NOMPath_assignCString(nomRetval, _pszFullPath, ev);
     63
     64  return nomRetval;
     65}
     66
  • trunk/desktop/class_c/wpfolder.c

    r141 r146  
    5757}PRIVFOLDERDATA, *PPRIVFOLDERDATA;
    5858
     59/* Gui stuff */
     60#include "nomguitk.h"
     61#include "nomfolderwindow.h"
     62
    5963#include "wpfolder.ih"
    6064#include "wpdatafile.h"
     
    6367#include "desktoptypes.h"
    6468
    65 /* Gui stuff */
    66 #include "nomguitk.h"
    67 #include "nomfolderwindow.h"
    6869
    6970/* Enum for the folder store */
    7071enum
    7172{
     73  COL_OBJECT_PTR,
    7274  COL_PATH,
    7375  COL_DISPLAY_NAME,
     
    8284
    8385  store = gtk_list_store_new (NUM_COLS,
    84                               G_TYPE_STRING,
    85                               G_TYPE_STRING,
    86                               GDK_TYPE_PIXBUF,
    87                               G_TYPE_BOOLEAN);
    88 
     86                              G_TYPE_POINTER,
     87                              G_TYPE_STRING,
     88                              G_TYPE_STRING,
     89                              GDK_TYPE_PIXBUF,
     90                              G_TYPE_BOOLEAN);
     91  g_message("%s: store: %x", __FUNCTION__, store);
    8992  return store;
    9093}
     
    131134
    132135                  gtk_list_store_set (store, &iter,
     136                                      COL_OBJECT_PTR, wpFolder,
    133137                                      COL_PATH, path,
    134138                                      COL_DISPLAY_NAME, display_name,
     
    153157                  nomPrintf("Icon ptr: %x\n", _wpQueryIcon((WPObject*)wpDataFile, NULLHANDLE));
    154158                  gtk_list_store_set (store, &iter,
     159                                      COL_OBJECT_PTR, wpDataFile,
    155160                                      COL_PATH, path,
    156161                                      COL_DISPLAY_NAME, display_name,
     
    185190  g_log("WPFolder", G_LOG_LEVEL_DEBUG, "%s: Populating %s\n", __FUNCTION__, pszPath);
    186191
    187 #warning !!!!! Window creation must be done elsewhere !!!!!
    188   _wpCreateFolderWindow(nomSelf, NULLHANDLE);
    189192
    190193#if 0
     
    215218  gtk_icon_view_set_model(GTK_ICON_VIEW (priv->gtkIconView), GTK_TREE_MODEL (priv->gstoreFldContents));
    216219
    217   /* We now set which model columns that correspont to the text
     220  /* We now set which model columns that correspond to the text
    218221   * and pixbuf of each item
    219222   */
     
    228231}
    229232
    230 
    231 NOM_Scope void NOMLINK impl_WPFolder_wpInitData(WPFolder* nomSelf, CORBA_Environment *ev)
    232 {
    233   gulong ulErr;
    234   WPFolderData* nomThis=WPFolderGetData(nomSelf);
    235 
    236   /* orbit-idl-c-stubs.c, VoyagerWriteProtoForParentCall line 84 */
    237   WPFolder_wpInitData_parent((WPObject*)nomSelf,  ev);
    238 
    239   nomPrintf("    Entering %s with nomSelf: 0x%x. nomSelf is: %s.\n",
    240             __FUNCTION__, nomSelf , nomSelf->mtab->nomClassName);
    241   _privFolderData=_wpAllocMem((WPObject*)nomSelf, sizeof(PRIVFOLDERDATA), (CORBA_unsigned_long*)&ulErr, NULLHANDLE);
    242 }
    243 
    244233NOM_Scope gpointer NOMLINK impl_WPFolder_wpOpen(WPFolder* nomSelf, const gpointer ptrReserved,
    245234                                                const CORBA_unsigned_long ulView, const gpointer ptrParams,
     
    253242    case OPEN_DEFAULT:
    254243      {
    255         WPFolder_wpCreateFolderWindow(nomSelf, ev);
     244        NOMFolderWindow * nomFldrWindow;
     245
     246#warning !!!!! Folder window must be inserted into inuse list !!!!!
     247        nomFldrWindow=WPFolder_wpCreateFolderWindow(nomSelf, ev);
     248        NOMFolderWindow_setWPFolderObject(nomFldrWindow, nomSelf, ev);
     249
     250#warning !!!!! Path taken from a test location !!!!!
     251        WPFolder_wpPopulate(nomSelf, 0L, NOMPath_getCString(WPFolder_wpQueryRealName(nomSelf, TRUE, ev) , ev), FALSE,  ev);
     252        break;
     253
    256254#if 0
    257255        char path[CCHMAXPATH];
     
    271269        if(!hwndFolder)
    272270          return NULLHANDLE;
    273        
    274         somPrintf("somSelf: %x, hwndFolder: %x\n", somSelf, hwndFolder);
    275         /* Set object pointer */
    276         /*          dw_window_set_data(hwndFolder, "thisObject", somSelf);
    277                     msg("somSelf 2: %x, hwnd: %x", dw_window_get_data(hwndFolder, "thisObject"), hwndFolder); */
    278271
    279272        /* populate the folder */
     
    316309  models and stuff.
    317310*/
    318 NOM_Scope gpointer NOMLINK impl_WPFolder_wpCreateFolderWindow(WPFolder* nomSelf, CORBA_Environment *ev)
     311NOM_Scope PNOMFolderWindow NOMLINK impl_WPFolder_wpCreateFolderWindow(WPFolder* nomSelf, CORBA_Environment *ev)
    319312{
    320313  NOMFolderWindow * nomFldrWindow;
     
    329322  priv->gtkIconView=NOMFolderWindow_getContainerHandle(nomFldrWindow, ev);
    330323
     324  /* Show the new window */
    331325  NOMFolderWindow_show(nomFldrWindow, ev);
    332326
    333   return NOMFolderWindow_getWindowHandle(nomFldrWindow, ev);;
    334 }
    335 
    336 
    337 NOM_Scope void NOMLINK impl_WPFolder_tstSetFolderPath(WPFolder* nomSelf, const CORBA_char * thePath, CORBA_Environment *ev)
    338 {
    339 /* WPFolderData* nomThis=WPFolderGetData(nomSelf); */
    340 
    341 
    342 }
    343 
    344 
    345 
    346 
     327  return nomFldrWindow;
     328}
     329
     330NOM_Scope void NOMLINK impl_WPFolder_wpInitData(WPFolder* nomSelf, CORBA_Environment *ev)
     331{
     332  gulong ulErr;
     333  WPFolderData* nomThis=WPFolderGetData(nomSelf);
     334
     335  WPFolder_wpInitData_parent((WPObject*)nomSelf,  ev);
     336
     337  nomPrintf("    Entering %s with nomSelf: 0x%x. nomSelf is: %s.\n",
     338            __FUNCTION__, nomSelf , nomSelf->mtab->nomClassName);
     339  _privFolderData=_wpAllocMem((WPObject*)nomSelf, sizeof(PRIVFOLDERDATA), (CORBA_unsigned_long*)&ulErr, NULLHANDLE);
     340}
     341
     342
     343
  • trunk/desktop/idl/wpfilesystem.idl

    r98 r146  
    3737
    3838#include "wpobject.idl"
     39#include "nomfilepath.idl"
    3940
    4041interface WPFileSystem : WPObject
     
    4445
    4546  void tstSetFullPath(in string fullPath);   
     47  PNOMPath wpQueryRealName(in boolean bFullPath);
    4648
    4749#if 0
    48     ULONG cbEASize;
     50  ULONG cbEASize;
    4951#endif
    50     NOMINSTANCEVAR(string pszFullPath);  /* ONLY FOR TESTING!!! */ 
    51     NOMINSTANCEVAR(string pszType);
     52  NOMINSTANCEVAR(string pszFullPath);  /* ONLY FOR TESTING!!! */ 
     53  NOMINSTANCEVAR(string pszType);
    5254};
    5355
  • trunk/desktop/idl/wpfolder.idl

    r141 r146  
    3838#include "wpfilesystem.idl"
    3939#include "nomfilepath.idl"
     40/*#include "nomfolderwindow.idl"*/
     41
     42native PNOMFolderWindow;
    4043
    4144NOMCLASSNAME(WPFolder);
     
    4649
    4750  boolean wpPopulate(in unsigned long ulReserved,
    48                   in string pszPath,
    49                   in boolean fFoldersOnly);
    50   gpointer wpCreateFolderWindow();
    51   void tstSetFolderPath(in string thePath); /* Only for testing */
     51                     in string pszPath,
     52                     in boolean fFoldersOnly);
     53  PNOMFolderWindow wpCreateFolderWindow();
     54
    5255#if 0
    5356  WPObject wpQueryContent(in WPObject Object,
     
    6265
    6366  NOMINSTANCEVAR(PPRIVFOLDERDATA privFolderData);
    64   NOMINSTANCEVAR(PNOMPath pnomPath);
     67  NOMINSTANCEVAR(PNOMPath pnomPath_);
    6568};
    6669
  • trunk/foundation/class_c/nomfilepath.c

    r129 r146  
     1/* ***** BEGIN LICENSE BLOCK *****
     2* Version: CDDL 1.0/LGPL 2.1
     3*
     4* The contents of this file are subject to the COMMON DEVELOPMENT AND
     5* DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6* this file except in compliance with the License. You may obtain a copy of
     7* the License at http://www.sun.com/cddl/
     8*
     9* Software distributed under the License is distributed on an "AS IS" basis,
     10* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11* for the specific language governing rights and limitations under the
     12* License.
     13*
     14* The Original Code is "NOM" Netlabs Object Model
     15*
     16* The Initial Developer of the Original Code is
     17* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
     18* Portions created by the Initial Developer are Copyright (C) 2006
     19* the Initial Developer. All Rights Reserved.
     20*
     21* Contributor(s):
     22*
     23* Alternatively, the contents of this file may be used under the terms of
     24* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
     25* case the provisions of the LGPL are applicable instead of those above. If
     26* you wish to allow use of your version of this file only under the terms of
     27* the LGPL, and not to allow others to use your version of this file under
     28* the terms of the CDDL, indicate your decision by deleting the provisions
     29* above and replace them with the notice and other provisions required by the
     30* LGPL. If you do not delete the provisions above, a recipient may use your
     31* version of this file under the terms of any one of the CDDL or the LGPL.
     32*
     33* ***** END LICENSE BLOCK ***** */
    134/*
    2  * This file was generated by orbit-idl-2 for Voyager - DO NOT EDIT!
    3  *
    4  *
    535 * And remember, phase 3 is near...
    636 */
  • trunk/foundation/class_c/nomstring.c

    r142 r146  
    1616* The Initial Developer of the Original Code is
    1717* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
    18 * Portions created by the Initial Developer are Copyright (C) 2005-2006
     18* Portions created by the Initial Developer are Copyright (C) 2006
    1919* the Initial Developer. All Rights Reserved.
    2020*
  • trunk/foundation/exports.def

    r122 r146  
    99        NOMStringNewClass   
    1010
     11        _NOMPathClassData 
     12        _NOMPathCClassData
     13        NOMPathNewClass   
  • trunk/gui/Makefile

    r126 r146  
    1717IDLDIR          =       ./idl
    1818
    19 TKIDLDIR        =       $(NOMPATH)/idl  # The object TK lives here
    20 
    21 INC             =       ./include -I ./class_h -I $(NOMPATH)/class_h -I $(NOMPATH)/include
     19# The object TK lives here
     20TKIDLDIR        =       $(NOMPATH)/idl
     21IDLINC          =       -include=$(TKIDLDIR) -include=$(DESKTOPPATH)/idl -include=$(FOUNDATIONPATH)/idl
     22 
     23INC             =       ./include -I ./class_h \
     24                        -I $(NOMPATH)/class_h -I $(NOMPATH)/include \
     25                        -I $(DESKTOPPATH)/class_h -I $(DESKTOPPATH)/include \
     26                        -I $(FOUNDATIONPATH)/class_h -I $(FOUNDATIONPATH)/include
    2227
    2328ADDLIBS         =        -l$(OBJDIR)/nobjtk
     
    4954###################################
    5055
    51 BASE_NOMCOMPILEH        =       $(IDLCOMP) -include=$(TKIDLDIR) --showcpperrors --header --output-dir=$(CLASSINC) $<
    52 BASE_NOMCOMPILEIH       =       $(IDLCOMP) -include=$(TKIDLDIR) --showcpperrors --ihfile --output-dir=$(CLASSINC) $<
    53 BASE_NOMCOMPILEC        =       $(IDLCOMP) -include=$(TKIDLDIR) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
     56BASE_NOMCOMPILEH        =       $(IDLCOMP) $(IDLINC) --showcpperrors --header --output-dir=$(CLASSINC) $<
     57BASE_NOMCOMPILEIH       =       $(IDLCOMP) $(IDLINC) --showcpperrors --ihfile --output-dir=$(CLASSINC) $<
     58BASE_NOMCOMPILEC        =       $(IDLCOMP) $(IDLINC) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
    5459
    5560
  • trunk/gui/class_c/nomfolderwindow.c

    r127 r146  
    4646#include "nomfolderwindow.ih"
    4747
     48#warning !!!!! nomIsObj() must be globaly defined !!!!!
     49#define nomIsObj(a) ((a)!= 0)
     50
     51
    4852NOM_Scope PGtkWidget NOMLINK impl_NOMFolderWindow_getContainerHandle(NOMFolderWindow* nomSelf, CORBA_Environment *ev)
    4953{
    5054  NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf);
    5155
    52   return _pgContainerHandle;
     56  return (PGtkWidget) g_atomic_pointer_get(&_pgContainerHandle);
    5357}
    5458
     
    6165}
    6266
     67NOM_Scope void NOMLINK impl_NOMFolderWindow_setWPFolderObject(NOMFolderWindow* nomSelf, const PWPFolder pWPFolderObject,
     68                                                              CORBA_Environment *ev)
     69{
     70  NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf);
     71
     72  if(!nomIsObj(pWPFolderObject))
     73    return;
     74
     75  _pWPFolderObj=pWPFolderObject;
     76}
     77
     78NOM_Scope PWPFolder NOMLINK impl_NOMFolderWindow_getWPFolderObject(NOMFolderWindow* nomSelf, CORBA_Environment *ev)
     79{
     80  NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf);
     81
     82  return _pWPFolderObj;
     83}
    6384
    6485static void
     
    104125  if(fldr_checkContextButton(event))
    105126    {
     127      PNOMFolderWindow pWindow;
     128      GtkTreePath* treePath;
     129
    106130      DosBeep(5000, 100);
     131      pWindow=(NOMFolderWindow*)user_data;
     132
     133      treePath=gtk_icon_view_get_path_at_pos(GTK_ICON_VIEW(widget), event->x, event->y );
     134      if(NULL==treePath)
     135        {
     136          /* Click on white space */
     137          WPFolder* wpFolder;
     138          wpFolder=NOMFolderWindow_getWPFolderObject(pWindow, NULLHANDLE);
     139          g_message("%s: %s", __FUNCTION__, wpFolder->mtab->nomClassName);
     140        }
     141      else
     142        {
     143          GtkTreeIter iter;
     144          GtkTreeModel* model;
     145          WPObject *wpObject;
     146          /* Click on an icon */
     147
     148          g_message("%s: %s", __FUNCTION__, gtk_tree_path_to_string(treePath));
     149
     150          model=gtk_icon_view_get_model(GTK_ICON_VIEW(widget));
     151          g_message("%s: model: %x", __FUNCTION__, model);
     152
     153          gtk_tree_model_get_iter(model , &iter, treePath);
     154
     155          gtk_tree_model_get(model, &iter,
     156                             0, &wpObject,
     157                             -1);
     158          g_message("%s: %s", __FUNCTION__, wpObject->mtab->nomClassName);
     159
     160        }
     161
    107162#if 0     
    108163      /* This is the folder object not the object on which a click occured */
     
    208263}
    209264
     265
     266
     267
     268
     269
     270
     271
     272
     273
  • trunk/gui/class_c/nomwindow.c

    r127 r146  
    5353  NOMWindowData* nomThis=NOMWindowGetData(nomSelf);
    5454
    55 
    56   return _pgWindowHandle;
     55  return (PGtkWidget) g_atomic_pointer_get(&_pgWindowHandle);
    5756}
    5857
  • trunk/gui/idl/nomfolderwindow.idl

    r127 r146  
    3737
    3838#include "nomwindow.idl"
     39#include "wpfolder.idl"
    3940
    4041interface NOMFolderWindow : NOMWindow
     
    4445  PGtkWidget getContainerHandle();
    4546  void setContainerHandle(in PGtkWidget pgWidget);   
     47  void setWPFolderObject(in PWPFolder pWPFolderObject);
     48  PWPFolder getWPFolderObject();
    4649
    4750  NOMOVERRIDE(nomInit);
    4851
    49   NOMINSTANCEVAR(PGtkWidget _pgContainerHandle);
     52  NOMINSTANCEVAR(PGtkWidget pgContainerHandle);
     53  NOMINSTANCEVAR(PWPFolder pWPFolderObj);
     54
    5055};
    5156
Note: See TracChangeset for help on using the changeset viewer.