Mercurial > dwindows
comparison mac/dw.m @ 721:56053f1af9ee
Fixes for dw_container/filessystem_get_column_type from Mark Hessling... adding him to the copyright section.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 13 Mar 2011 16:50:40 +0000 |
parents | 357b59e57a31 |
children | 5a8d5161651d |
comparison
equal
deleted
inserted
replaced
720:357b59e57a31 | 721:56053f1af9ee |
---|---|
1 /* | 1 /* |
2 * Dynamic Windows: | 2 * Dynamic Windows: |
3 * A GTK like implementation of the MacOS GUI using Cocoa | 3 * A GTK like implementation of the MacOS GUI using Cocoa |
4 * | 4 * |
5 * (C) 2011 Brian Smith <brian@dbsoft.org> | 5 * (C) 2011 Brian Smith <brian@dbsoft.org> |
6 * (C) 2011 Mark Hessling <mark@rexx.org> | |
6 * | 7 * |
7 * Using garbage collection so requires 10.5 or later. | 8 * Using garbage collection so requires 10.5 or later. |
8 * clang -std=c99 -g -o dwtest -D__MAC__ -I. dwtest.c mac/dw.m -framework Cocoa -framework WebKit -fobjc-gc-only | 9 * clang -std=c99 -g -o dwtest -D__MAC__ -I. dwtest.c mac/dw.m -framework Cocoa -framework WebKit -fobjc-gc-only |
9 */ | 10 */ |
10 #import <Cocoa/Cocoa.h> | 11 #import <Cocoa/Cocoa.h> |
4322 */ | 4323 */ |
4323 int API dw_container_get_column_type(HWND handle, int column) | 4324 int API dw_container_get_column_type(HWND handle, int column) |
4324 { | 4325 { |
4325 int _locked_by_me = FALSE; | 4326 int _locked_by_me = FALSE; |
4326 DW_MUTEX_LOCK; | 4327 DW_MUTEX_LOCK; |
4327 DWContainer *cont = handle; | 4328 DWContainer *cont = handle; |
4328 int result = [cont cellType:column]; | 4329 int rc; |
4330 int flag = [cont cellType:column]; | |
4331 if(flag & DW_CFA_BITMAPORICON) | |
4332 rc = DW_CFA_BITMAPORICON; | |
4333 else if(flag & DW_CFA_STRING) | |
4334 rc = DW_CFA_STRING; | |
4335 else if(flag & DW_CFA_ULONG) | |
4336 rc = DW_CFA_ULONG; | |
4337 else if(flag & DW_CFA_DATE) | |
4338 rc = DW_CFA_DATE; | |
4339 else if(flag & DW_CFA_TIME) | |
4340 rc = DW_CFA_TIME; | |
4341 else | |
4342 rc = 0; | |
4329 DW_MUTEX_UNLOCK; | 4343 DW_MUTEX_UNLOCK; |
4330 return result; | 4344 return rc; |
4331 } | 4345 } |
4332 | 4346 |
4333 /* | 4347 /* |
4334 * Gets column type for a filesystem container column | 4348 * Gets column type for a filesystem container column |
4335 * Parameters: | 4349 * Parameters: |
4336 * handle: Handle to the container window (widget). | 4350 * handle: Handle to the container window (widget). |
4337 * column: Zero based column. | 4351 * column: Zero based column. |
4338 */ | 4352 */ |
4339 int API dw_filesystem_get_column_type(HWND handle, int column) | 4353 int API dw_filesystem_get_column_type(HWND handle, int column) |
4340 { | 4354 { |
4341 int _locked_by_me = FALSE; | 4355 return dw_container_get_column_type(handle, column+2); |
4342 DW_MUTEX_LOCK; | |
4343 DWContainer *cont = handle; | |
4344 int result = [cont cellType:column+2]; | |
4345 DW_MUTEX_UNLOCK; | |
4346 return result; | |
4347 } | 4356 } |
4348 | 4357 |
4349 /* | 4358 /* |
4350 * Sets the width of a column in the container. | 4359 * Sets the width of a column in the container. |
4351 * Parameters: | 4360 * Parameters: |