Implement part of GSAutoLayoutEngine dependency management logic (#178)

* Implement part of GSAutoLayoutEngine dependency management logic

* Fix formatting of GSAutoLayoutEngine, GSCSFloatComparator and GSCSSolution

* Address PR feedback

* Address PR feedback

* Replace assignment with ASSIGN macro and fix makefile

* Add back dealloc in GSAutoLayoutEngine.m and GSCSSolution.m
This commit is contained in:
Benjamin Johnson 2023-04-19 17:06:53 +10:00 committed by GitHub
parent a913346b83
commit 2be7334ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 870 additions and 18 deletions

View file

@ -20,8 +20,9 @@
Boston, MA 02110 USA.
*/
#import "AppKit/NSLayoutConstraint.h"
#import <Foundation/Foundation.h>
#import "AppKit/NSLayoutConstraint.h"
#import "GSCassowarySolver.h"
@class NSView;
@class NSLayoutConstraint;
@ -30,6 +31,22 @@
#define _GS_AUTO_LAYOUT_ENGINE_H
@interface GSAutoLayoutEngine : NSObject
{
GSCassowarySolver *_solver;
NSMapTable *_variablesByKey;
NSMutableArray *_solverConstraints;
NSMapTable *_constraintsByAutoLayoutConstaintHash;
NSMapTable *_layoutConstraintsBySolverConstraint;
NSMutableArray *_trackedViews;
NSMutableDictionary *_viewIndexByViewHash;
NSMutableDictionary *_viewAlignmentRectByViewIndex;
NSMutableDictionary *_constraintsByViewIndex;
NSMapTable *_internalConstraintsByViewIndex;
NSMapTable *_supportingConstraintsByConstraint;
int _viewCounter;
}
- (instancetype) initWithSolver: (GSCassowarySolver*)solver;
- (void) addConstraint: (NSLayoutConstraint *)constraint;