Mercurial > hg > octave-nkf
comparison libgui/graphics/ObjectFactory.cc @ 18847:fe0e34be5576
maint: untabify recently added code files.
* Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc, Canvas.h,
CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc, Figure.cc,
Figure.h, GLCanvas.h, ListBoxControl.cc, Menu.cc, MouseModeActionGroup.cc,
Object.cc, Object.h, ObjectFactory.cc, ObjectProxy.cc, Panel.cc,
PopupMenuControl.cc, PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc,
QtHandlesUtils.h, RadioButtonControl.cc, SliderControl.cc, TextControl.cc,
ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, ToolBarButton.cc,
__init_qt__.cc, pt-jit.cc, ov-classdef.cc, ov-classdef.h: Untabify code.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 27 Apr 2014 18:02:47 -0700 |
parents | fb96b7f55242 |
children | 3cc0734283dc |
comparison
equal
deleted
inserted
replaced
18846:9a6646cc7c3e | 18847:fe0e34be5576 |
---|---|
60 static bool s_instanceCreated = false; | 60 static bool s_instanceCreated = false; |
61 | 61 |
62 if (! s_instanceCreated) | 62 if (! s_instanceCreated) |
63 { | 63 { |
64 if (QThread::currentThread () != QApplication::instance ()->thread ()) | 64 if (QThread::currentThread () != QApplication::instance ()->thread ()) |
65 s_instance.moveToThread (QApplication::instance ()->thread ()); | 65 s_instance.moveToThread (QApplication::instance ()->thread ()); |
66 s_instanceCreated = true; | 66 s_instanceCreated = true; |
67 } | 67 } |
68 | 68 |
69 return &s_instance; | 69 return &s_instance; |
70 } | 70 } |
76 graphics_object go (gh_manager::get_object (graphics_handle (handle))); | 76 graphics_object go (gh_manager::get_object (graphics_handle (handle))); |
77 | 77 |
78 if (go.valid_object ()) | 78 if (go.valid_object ()) |
79 { | 79 { |
80 if (go.get_properties ().is_beingdeleted ()) | 80 if (go.get_properties ().is_beingdeleted ()) |
81 qWarning ("ObjectFactory::createObject: object is being deleted"); | 81 qWarning ("ObjectFactory::createObject: object is being deleted"); |
82 else | 82 else |
83 { | 83 { |
84 ObjectProxy* proxy = Backend::toolkitObjectProxy (go); | 84 ObjectProxy* proxy = Backend::toolkitObjectProxy (go); |
85 | 85 |
86 if (proxy) | 86 if (proxy) |
87 { | 87 { |
88 Logger::debug ("ObjectFactory::createObject: " | 88 Logger::debug ("ObjectFactory::createObject: " |
89 "create %s from thread %08x", | 89 "create %s from thread %08x", |
90 go.type ().c_str (), QThread::currentThreadId ()); | 90 go.type ().c_str (), QThread::currentThreadId ()); |
91 | 91 |
92 Object* obj = 0; | 92 Object* obj = 0; |
93 | 93 |
94 if (go.isa ("figure")) | 94 if (go.isa ("figure")) |
95 obj = Figure::create (go); | 95 obj = Figure::create (go); |
96 else if (go.isa ("uicontrol")) | 96 else if (go.isa ("uicontrol")) |
97 { | 97 { |
98 uicontrol::properties& up = | 98 uicontrol::properties& up = |
99 Utils::properties<uicontrol> (go); | 99 Utils::properties<uicontrol> (go); |
100 | 100 |
101 if (up.style_is ("pushbutton")) | 101 if (up.style_is ("pushbutton")) |
102 obj = PushButtonControl::create (go); | 102 obj = PushButtonControl::create (go); |
103 else if (up.style_is ("edit")) | 103 else if (up.style_is ("edit")) |
104 obj = EditControl::create (go); | 104 obj = EditControl::create (go); |
105 else if (up.style_is ("checkbox")) | 105 else if (up.style_is ("checkbox")) |
106 obj = CheckBoxControl::create (go); | 106 obj = CheckBoxControl::create (go); |
107 else if (up.style_is ("radiobutton")) | 107 else if (up.style_is ("radiobutton")) |
108 obj = RadioButtonControl::create (go); | 108 obj = RadioButtonControl::create (go); |
109 else if (up.style_is ("togglebutton")) | 109 else if (up.style_is ("togglebutton")) |
110 obj = ToggleButtonControl::create (go); | 110 obj = ToggleButtonControl::create (go); |
111 else if (up.style_is ("text")) | 111 else if (up.style_is ("text")) |
112 obj = TextControl::create (go); | 112 obj = TextControl::create (go); |
113 else if (up.style_is ("popupmenu")) | 113 else if (up.style_is ("popupmenu")) |
114 obj = PopupMenuControl::create (go); | 114 obj = PopupMenuControl::create (go); |
115 else if (up.style_is ("slider")) | 115 else if (up.style_is ("slider")) |
116 obj = SliderControl::create (go); | 116 obj = SliderControl::create (go); |
117 else if (up.style_is ("listbox")) | 117 else if (up.style_is ("listbox")) |
118 obj = ListBoxControl::create (go); | 118 obj = ListBoxControl::create (go); |
119 } | 119 } |
120 else if (go.isa ("uipanel")) | 120 else if (go.isa ("uipanel")) |
121 obj = Panel::create (go); | 121 obj = Panel::create (go); |
122 else if (go.isa ("uimenu")) | 122 else if (go.isa ("uimenu")) |
123 obj = Menu::create (go); | 123 obj = Menu::create (go); |
124 else if (go.isa ("uicontextmenu")) | 124 else if (go.isa ("uicontextmenu")) |
125 obj = ContextMenu::create (go); | 125 obj = ContextMenu::create (go); |
126 else if (go.isa ("uitoolbar")) | 126 else if (go.isa ("uitoolbar")) |
127 obj = ToolBar::create (go); | 127 obj = ToolBar::create (go); |
128 else if (go.isa ("uipushtool")) | 128 else if (go.isa ("uipushtool")) |
129 obj = PushTool::create (go); | 129 obj = PushTool::create (go); |
130 else if (go.isa ("uitoggletool")) | 130 else if (go.isa ("uitoggletool")) |
131 obj = ToggleTool::create (go); | 131 obj = ToggleTool::create (go); |
132 else | 132 else |
133 qWarning ("ObjectFactory::createObject: unsupported type `%s'", | 133 qWarning ("ObjectFactory::createObject: unsupported type `%s'", |
134 go.type ().c_str ()); | 134 go.type ().c_str ()); |
135 | 135 |
136 if (obj) | 136 if (obj) |
137 proxy->setObject (obj); | 137 proxy->setObject (obj); |
138 } | 138 } |
139 else | 139 else |
140 qWarning ("ObjectFactory::createObject: no proxy for handle %g", | 140 qWarning ("ObjectFactory::createObject: no proxy for handle %g", |
141 handle); | 141 handle); |
142 } | 142 } |
143 } | 143 } |
144 else | 144 else |
145 qWarning ("ObjectFactory::createObject: invalid object for handle %g", | 145 qWarning ("ObjectFactory::createObject: invalid object for handle %g", |
146 handle); | 146 handle); |
147 } | 147 } |
148 | 148 |
149 }; | 149 }; |