Skip to content

Commit fb8caad

Browse files
moulinskmeisthax
authored andcommitted
core: rename TInteractiveObject::{ibase => raw_interactive}(_mut)
To match with TDisplayObjectContainer::raw_container(_mut) introduced in previous commit.
1 parent 0bc01c2 commit fb8caad

File tree

7 files changed

+46
-25
lines changed

7 files changed

+46
-25
lines changed

core/src/display_object/avm1_button.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@ impl<'gc> TDisplayObjectContainer<'gc> for Avm1Button<'gc> {
414414
}
415415

416416
impl<'gc> TInteractiveObject<'gc> for Avm1Button<'gc> {
417-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
417+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
418418
Ref::map(self.0.read(), |r| &r.base)
419419
}
420420

421-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
421+
fn raw_interactive_mut(
422+
&self,
423+
mc: MutationContext<'gc, '_>,
424+
) -> RefMut<InteractiveObjectBase<'gc>> {
422425
RefMut::map(self.0.write(mc), |w| &mut w.base)
423426
}
424427

core/src/display_object/avm2_button.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,14 @@ impl<'gc> TDisplayObject<'gc> for Avm2Button<'gc> {
718718
}
719719

720720
impl<'gc> TInteractiveObject<'gc> for Avm2Button<'gc> {
721-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
721+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
722722
Ref::map(self.0.read(), |r| &r.base)
723723
}
724724

725-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
725+
fn raw_interactive_mut(
726+
&self,
727+
mc: MutationContext<'gc, '_>,
728+
) -> RefMut<InteractiveObjectBase<'gc>> {
726729
RefMut::map(self.0.write(mc), |w| &mut w.base)
727730
}
728731

core/src/display_object/edit_text.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,11 +1690,14 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> {
16901690
}
16911691

16921692
impl<'gc> TInteractiveObject<'gc> for EditText<'gc> {
1693-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
1693+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
16941694
Ref::map(self.0.read(), |r| &r.base)
16951695
}
16961696

1697-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
1697+
fn raw_interactive_mut(
1698+
&self,
1699+
mc: MutationContext<'gc, '_>,
1700+
) -> RefMut<InteractiveObjectBase<'gc>> {
16981701
RefMut::map(self.0.write(mc), |w| &mut w.base)
16991702
}
17001703

core/src/display_object/interactive.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,46 +116,49 @@ impl<'gc> Default for InteractiveObjectBase<'gc> {
116116
pub trait TInteractiveObject<'gc>:
117117
'gc + Clone + Copy + Collect + Debug + Into<InteractiveObject<'gc>>
118118
{
119-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>>;
119+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>>;
120120

121-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>>;
121+
fn raw_interactive_mut(
122+
&self,
123+
mc: MutationContext<'gc, '_>,
124+
) -> RefMut<InteractiveObjectBase<'gc>>;
122125

123126
fn as_displayobject(self) -> DisplayObject<'gc>;
124127

125128
/// Check if the interactive object accepts user input.
126129
fn mouse_enabled(self) -> bool {
127-
self.ibase()
130+
self.raw_interactive()
128131
.flags
129132
.contains(InteractiveObjectFlags::MOUSE_ENABLED)
130133
}
131134

132135
/// Set if the interactive object accepts user input.
133136
fn set_mouse_enabled(self, mc: MutationContext<'gc, '_>, value: bool) {
134-
self.ibase_mut(mc)
137+
self.raw_interactive_mut(mc)
135138
.flags
136139
.set(InteractiveObjectFlags::MOUSE_ENABLED, value)
137140
}
138141

139142
/// Check if the interactive object accepts double-click events.
140143
fn double_click_enabled(self) -> bool {
141-
self.ibase()
144+
self.raw_interactive()
142145
.flags
143146
.contains(InteractiveObjectFlags::DOUBLE_CLICK_ENABLED)
144147
}
145148

146149
// Set if the interactive object accepts double-click events.
147150
fn set_double_click_enabled(self, mc: MutationContext<'gc, '_>, value: bool) {
148-
self.ibase_mut(mc)
151+
self.raw_interactive_mut(mc)
149152
.flags
150153
.set(InteractiveObjectFlags::DOUBLE_CLICK_ENABLED, value)
151154
}
152155

153156
fn context_menu(self) -> Avm2Value<'gc> {
154-
self.ibase().context_menu
157+
self.raw_interactive().context_menu
155158
}
156159

157160
fn set_context_menu(self, mc: MutationContext<'gc, '_>, value: Avm2Value<'gc>) {
158-
self.ibase_mut(mc).context_menu = value;
161+
self.raw_interactive_mut(mc).context_menu = value;
159162
}
160163

161164
/// Filter the incoming clip event.
@@ -254,7 +257,7 @@ pub trait TInteractiveObject<'gc>:
254257
ClipEventResult::Handled
255258
}
256259
ClipEvent::Release => {
257-
let read = self.ibase();
260+
let read = self.raw_interactive();
258261
let last_click = read.last_click;
259262
let this_click = Instant::now();
260263

@@ -282,7 +285,7 @@ pub trait TInteractiveObject<'gc>:
282285
log::error!("Got error when dispatching {:?} to AVM2: {}", event, e);
283286
}
284287

285-
self.ibase_mut(context.gc_context).last_click = None;
288+
self.raw_interactive_mut(context.gc_context).last_click = None;
286289
} else {
287290
let avm2_event = Avm2EventObject::mouse_event(
288291
&mut activation,
@@ -298,7 +301,7 @@ pub trait TInteractiveObject<'gc>:
298301
log::error!("Got error when dispatching {:?} to AVM2: {}", event, e);
299302
}
300303

301-
self.ibase_mut(context.gc_context).last_click = Some(this_click);
304+
self.raw_interactive_mut(context.gc_context).last_click = Some(this_click);
302305
}
303306

304307
ClipEventResult::Handled
@@ -316,7 +319,7 @@ pub trait TInteractiveObject<'gc>:
316319
log::error!("Got error when dispatching {:?} to AVM2: {}", event, e);
317320
}
318321

319-
self.ibase_mut(context.gc_context).last_click = None;
322+
self.raw_interactive_mut(context.gc_context).last_click = None;
320323

321324
ClipEventResult::Handled
322325
}
@@ -359,7 +362,7 @@ pub trait TInteractiveObject<'gc>:
359362
rollover_target = tgt.parent();
360363
}
361364

362-
self.ibase_mut(context.gc_context).last_click = None;
365+
self.raw_interactive_mut(context.gc_context).last_click = None;
363366

364367
ClipEventResult::Handled
365368
}

core/src/display_object/loader_display.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ impl<'gc> TDisplayObject<'gc> for LoaderDisplay<'gc> {
8383
}
8484

8585
impl<'gc> TInteractiveObject<'gc> for LoaderDisplay<'gc> {
86-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
86+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
8787
Ref::map(self.0.read(), |r| &r.base)
8888
}
8989

90-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
90+
fn raw_interactive_mut(
91+
&self,
92+
mc: MutationContext<'gc, '_>,
93+
) -> RefMut<InteractiveObjectBase<'gc>> {
9194
RefMut::map(self.0.write(mc), |w| &mut w.base)
9295
}
9396

core/src/display_object/movie_clip.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,11 +2624,14 @@ impl<'gc> TDisplayObjectContainer<'gc> for MovieClip<'gc> {
26242624
}
26252625

26262626
impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> {
2627-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
2627+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
26282628
Ref::map(self.0.read(), |r| &r.base)
26292629
}
26302630

2631-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
2631+
fn raw_interactive_mut(
2632+
&self,
2633+
mc: MutationContext<'gc, '_>,
2634+
) -> RefMut<InteractiveObjectBase<'gc>> {
26322635
RefMut::map(self.0.write(mc), |w| &mut w.base)
26332636
}
26342637

core/src/display_object/stage.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,11 +754,14 @@ impl<'gc> TDisplayObjectContainer<'gc> for Stage<'gc> {
754754
}
755755

756756
impl<'gc> TInteractiveObject<'gc> for Stage<'gc> {
757-
fn ibase(&self) -> Ref<InteractiveObjectBase<'gc>> {
757+
fn raw_interactive(&self) -> Ref<InteractiveObjectBase<'gc>> {
758758
Ref::map(self.0.read(), |r| &r.base)
759759
}
760760

761-
fn ibase_mut(&self, mc: MutationContext<'gc, '_>) -> RefMut<InteractiveObjectBase<'gc>> {
761+
fn raw_interactive_mut(
762+
&self,
763+
mc: MutationContext<'gc, '_>,
764+
) -> RefMut<InteractiveObjectBase<'gc>> {
762765
RefMut::map(self.0.write(mc), |w| &mut w.base)
763766
}
764767

0 commit comments

Comments
 (0)