# Problem with layout\_iter\_copy with Pango 1.29.3

**URL:** <https://www.ruby-forum.com/t/problem-with-layout-iter-copy-with-pango-1-29-3/211828>\
**Category:** Ruby-Gnome 2\
**Created:** [September 14, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/problem-with-layout-iter-copy-with-pango-1-29-3/211828 "2011-09-14T15:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [September 14, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/problem-with-layout-iter-copy-with-pango-1-29-3/211828/1 "2011-09-14T15:32:31Z")

</div>

Hi!

It seems that PangoLayoutIter is an opaque type. Thus, the following  
code won’t work:

static PangoLayoutIter\*  
layout\_iter\_copy(const PangoLayoutIter _ref)  
{  
 #if PANGO\_CHECK\_VERSION(1,6,0)  
PangoLayoutIter_ new\_ref;  
g\_return\_val\_if\_fail (ref != NULL, NULL);  
/\* This may be broken on pango-1.2.x, but  
for backward compatibility. \*/  
new\_ref = g\_new(PangoLayoutIter, 1);  
\*new\_ref = _ref;  
return new\_ref;  
 #else  
return (PangoLayoutIter_)ref;  
#endif  
}

I am at a loss as to why this is set up as such, but my suggestion is  
that we simply remove the #if and return (PangoLayoutIter \*)ref;

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 3:09pm UTC](https://www.ruby-forum.com/t/problem-with-layout-iter-copy-with-pango-1-29-3/211828/2 "2011-09-15T15:09:04Z")

</div>

Hi,

In [CADdV=Ms3EF4d=9NaeApKPQUhnBhTTptN8nYeTAj=removed\_email\_address@domain.invalid](mailto:CADdV=Ms3EF4d=9NaeApKPQUhnBhTTptN8nYeTAj=removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Problem with layout\_iter\_copy with Pango  
1.29.3” on Wed, 14 Sep 2011 15:31:58 +0200,  
Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> for backward compatibility. */
> 
> ```
> 
> new\_ref = g\_new(PangoLayoutIter, 1);  
> \*new\_ref = _ref;  
> return new\_ref;  
> #else  
> return (PangoLayoutIter_)ref;  
> #endif  
> }
> 
> I am at a loss as to why this is set up as such, but my suggestion is  
> that we simply remove the #if and return (PangoLayoutIter \*)ref;

I agree with you. Please remove it!

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 5:03pm UTC](https://www.ruby-forum.com/t/problem-with-layout-iter-copy-with-pango-1-29-3/211828/3 "2011-09-15T17:03:30Z")

</div>

2011/9/15 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I am at a loss as to why this is set up as such, but my suggestion is  
> > that we simply remove the #if and return (PangoLayoutIter \*)ref;

> I agree with you. Please remove it!

Done.
