Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 939613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:49:04+00:00 2026-05-15T21:49:04+00:00

I’m quite new to objective-j and the framework so I was attempting to drill

  • 0

I’m quite new to objective-j and the framework so I was attempting to drill down and understand some code, but I’m getting lost with the object (or struct) CGRect.

Here is the full documentation: Cappuccino

Ok, now I’m drilling down and I try to learn how the CPView class works: CPView.j

Now, I see CGRect objects (or structures) everywhere and I simply CANNOT for the life me figure out where CGRect is defined. How does this work? I feel like I am missing something.

The closest thing I’ve found is CGGeometry.j and CGGeometry.h, but still no CGRect structure or object is defined.

Can someone help me out? How is it possible to instantiate a CGRect struct or object and where is it defined? What does it contain? etc etc…

I know that the main way to create a CGRect is to use the CGRectMake function as stated here.

I just don’t feel like I have a grasp on how this is working.

Thank you.

Update:

After looking at the code some more: line 23, line 30, and line 37, seem to look kinda like JavaScript object descriptions. Is this correct? I’m not sure… is whatever that is translating these .j files aware of what a CGRect is already? Is this the reason we can use (CGRect) type castes and objects? CGRects seem like they are not the same as any other object I’ve seen used so far, and I’d like to know why :).

Thanks, again.

00023 #define _CGPointMake(x_, y_) { x:x_, y:y_ }
00024 #define _CGPointMakeCopy(aPoint) _CGPointMake(aPoint.x, aPoint.y)
00025 #define _CGPointMakeZero() _CGPointMake(0.0, 0.0)
00026 
00027 #define _CGPointEqualToPoint(lhsPoint, rhsPoint) (lhsPoint.x == rhsPoint.x && lhsPoint.y == rhsPoint.y)
00028 #define _CGStringFromPoint(aPoint) ("{" + aPoint.x + ", " + aPoint.y + "}")
00029 
00030 #define _CGSizeMake(width_, height_) { width:width_, height:height_ }
00031 #define _CGSizeMakeCopy(aSize) _CGSizeMake(aSize.width, aSize.height)
00032 #define _CGSizeMakeZero() _CGSizeMake(0.0, 0.0)
00033 
00034 #define _CGSizeEqualToSize(lhsSize, rhsSize) (lhsSize.width == rhsSize.width && lhsSize.height == rhsSize.height)
00035 #define _CGStringFromSize(aSize) ("{" + aSize.width + ", " + aSize.height + "}")
00036 
00037 #define _CGRectMake(x, y, width, height) { origin: _CGPointMake(x, y), size: _CGSizeMake(width, height) }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:49:05+00:00Added an answer on May 15, 2026 at 9:49 pm

    The short answer is yes, CGRects are unlike other Cappuccino objects. CGRects are not CPObjects but simply Javascript objects with x, y, width and height members. When you create one, such as with CGRectMake, you’re actually invoking a simple function which looks something like this:

    function CGRectMake(_x, _y, _width, _height) 
    { 
        return { 
            origin: { x:_x, y:_y }, 
            size: { width: _width, height: _height } 
        };
    }
    

    The declarations you found are the macros which Cappuccino itself uses to inline the CGRectMake function for better performance. The macros are used at the end of the day to actually define the exported CGRectMake function used in your own code (which is why my snippet above is merely an approximation.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.