54
55
the accessible root object, this include would not be required */
55
56
#include "unity-util-accessible.h"
58
using namespace unity::switcher;
57
60
/* Set up vtable symbols */
58
COMPIZ_PLUGIN_20090315 (unityshell, UnityPluginVTable);
61
COMPIZ_PLUGIN_20090315(unityshell, UnityPluginVTable);
60
63
using ::unity::logger::Timer;
64
68
nux::logging::Logger logger("unity.shell");
66
70
UnityScreen* uScreen = 0;
68
72
void configure_logging();
69
void capture_g_log_calls(const gchar *log_domain,
73
void capture_g_log_calls(const gchar* log_domain,
70
74
GLogLevelFlags log_level,
72
76
gpointer user_data);
73
77
gboolean is_extension_supported(const gchar* extensions, const gchar* extension);
74
78
gfloat get_opengl_version_f32(const gchar* version_string);
78
UnityScreen::UnityScreen(CompScreen *screen)
79
: PluginClassHandler <UnityScreen, CompScreen> (screen)
81
, cScreen(CompositeScreen::get(screen))
82
, gScreen(GLScreen::get(screen))
84
, _edge_trigger_handle(0)
85
, doShellRepaint(false)
82
UnityScreen::UnityScreen(CompScreen* screen)
83
: PluginClassHandler <UnityScreen, CompScreen> (screen)
85
, cScreen(CompositeScreen::get(screen))
86
, gScreen(GLScreen::get(screen))
88
, _edge_trigger_handle(0)
89
, doShellRepaint(false)
90
, switcher_desktop_icon(0)
88
93
configure_logging();
89
94
LOG_DEBUG(logger) << __PRETTY_FUNCTION__;
90
95
_key_nav_mode_requested = false;
91
int (*old_handler) (Display *, XErrorEvent *);
92
old_handler = XSetErrorHandler (NULL);
95
dbus_g_thread_init ();
97
unity_a11y_preset_environment ();
99
XSetErrorHandler (old_handler);
96
int (*old_handler)(Display*, XErrorEvent*);
97
old_handler = XSetErrorHandler(NULL);
100
notify_init("unityshell");
103
dbus_g_thread_init();
105
unity_a11y_preset_environment();
107
XSetErrorHandler(old_handler);
101
109
/* Wrap compiz interfaces */
102
ScreenInterface::setHandler (screen);
103
CompositeScreenInterface::setHandler (cScreen);
104
GLScreenInterface::setHandler (gScreen);
106
PluginAdapter::Initialize (screen);
107
WindowManager::SetDefault (PluginAdapter::Default ());
109
StartupNotifyService::Default ()->SetSnDisplay (screen->snDisplay (), screen->screenNum ());
110
ScreenInterface::setHandler(screen);
111
CompositeScreenInterface::setHandler(cScreen);
112
GLScreenInterface::setHandler(gScreen);
114
PluginAdapter::Initialize(screen);
115
WindowManager::SetDefault(PluginAdapter::Default());
117
StartupNotifyService::Default()->SetSnDisplay(screen->snDisplay(), screen->screenNum());
111
119
nux::NuxInitialize(0);
112
wt = nux::CreateFromForeignWindow (cScreen->output (),
113
glXGetCurrentContext (),
114
&UnityScreen::initUnity,
117
wt->RedrawRequested.connect (sigc::mem_fun (this, &UnityScreen::onRedrawRequested));
119
unity_a11y_init (wt);
120
wt = nux::CreateFromForeignWindow(cScreen->output(),
121
glXGetCurrentContext(),
122
&UnityScreen::initUnity,
125
wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::onRedrawRequested));
121
129
newFocusedWindow = NULL;
122
130
lastFocusedWindow = NULL;
125
bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
126
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
133
bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
134
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
131
debugger = new DebugDBusInterface (this);
139
debugger = new DebugDBusInterface(this);
133
optionSetLauncherHideModeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
134
optionSetBacklightModeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
135
optionSetLaunchAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
136
optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
137
optionSetPanelOpacityNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
138
optionSetIconSizeNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
139
optionSetAutohideAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
140
optionSetDashBlurExperimentalNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
141
optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
142
optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
143
optionSetKeyboardFocusInitiate (boost::bind (&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3));
141
optionSetLauncherHideModeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
142
optionSetBacklightModeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
143
optionSetLaunchAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
144
optionSetUrgentAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
145
optionSetPanelOpacityNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
146
optionSetIconSizeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
147
optionSetAutohideAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
148
optionSetDashBlurExperimentalNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
149
optionSetShowLauncherInitiate(boost::bind(&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
150
optionSetShowLauncherTerminate(boost::bind(&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
151
optionSetKeyboardFocusInitiate(boost::bind(&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3));
144
152
//optionSetKeyboardFocusTerminate (boost::bind (&UnityScreen::setKeyboardFocusKeyTerminate, this, _1, _2, _3));
145
optionSetExecuteCommandInitiate (boost::bind (&UnityScreen::executeCommand, this, _1, _2, _3));
146
optionSetPanelFirstMenuInitiate (boost::bind (&UnityScreen::showPanelFirstMenuKeyInitiate, this, _1, _2, _3));
147
optionSetPanelFirstMenuTerminate(boost::bind (&UnityScreen::showPanelFirstMenuKeyTerminate, this, _1, _2, _3));
148
optionSetLauncherRevealEdgeInitiate (boost::bind (&UnityScreen::launcherRevealEdgeInitiate, this, _1, _2, _3));
149
optionSetAutomaximizeValueNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
153
optionSetExecuteCommandInitiate(boost::bind(&UnityScreen::executeCommand, this, _1, _2, _3));
154
optionSetAltTabForwardInitiate(boost::bind(&UnityScreen::altTabForwardInitiate, this, _1, _2, _3));
155
optionSetAltTabForwardTerminate(boost::bind(&UnityScreen::altTabForwardTerminate, this, _1, _2, _3));
156
optionSetAltTabPrevInitiate(boost::bind(&UnityScreen::altTabPrevInitiate, this, _1, _2, _3));
157
optionSetAltTabPrevTerminate(boost::bind(&UnityScreen::altTabPrevTerminate, this, _1, _2, _3));
158
optionSetPanelFirstMenuInitiate(boost::bind(&UnityScreen::showPanelFirstMenuKeyInitiate, this, _1, _2, _3));
159
optionSetPanelFirstMenuTerminate(boost::bind(&UnityScreen::showPanelFirstMenuKeyTerminate, this, _1, _2, _3));
160
optionSetLauncherRevealEdgeInitiate(boost::bind(&UnityScreen::launcherRevealEdgeInitiate, this, _1, _2, _3));
161
optionSetAutomaximizeValueNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
151
for (unsigned int i = 0; i < G_N_ELEMENTS (_ubus_handles); i++)
163
for (unsigned int i = 0; i < G_N_ELEMENTS(_ubus_handles); i++)
152
164
_ubus_handles[i] = 0;
154
UBusServer* ubus = ubus_server_get_default ();
155
_ubus_handles[0] = ubus_server_register_interest (ubus,
156
UBUS_LAUNCHER_START_KEY_NAV,
157
(UBusCallback)&UnityScreen::OnLauncherStartKeyNav,
160
_ubus_handles[1] = ubus_server_register_interest (ubus,
161
UBUS_LAUNCHER_END_KEY_NAV,
162
(UBusCallback)&UnityScreen::OnLauncherEndKeyNav,
165
_ubus_handles[2] = ubus_server_register_interest (ubus,
166
UBUS_QUICKLIST_END_KEY_NAV,
167
(UBusCallback)&UnityScreen::OnQuicklistEndKeyNav,
170
g_timeout_add (0, &UnityScreen::initPluginActions, this);
172
GeisAdapter::Default (screen)->Run ();
173
gestureEngine = new GestureEngine (screen);
175
CompString name (PKGDATADIR"/panel-shadow.png");
176
CompString pname ("unityshell");
177
CompSize size (1, 20);
178
_shadow_texture = GLTexture::readImageToTexture (name, pname, size);
166
UBusServer* ubus = ubus_server_get_default();
167
_ubus_handles[0] = ubus_server_register_interest(ubus,
168
UBUS_LAUNCHER_START_KEY_NAV,
169
(UBusCallback)&UnityScreen::OnLauncherStartKeyNav,
172
_ubus_handles[1] = ubus_server_register_interest(ubus,
173
UBUS_LAUNCHER_END_KEY_NAV,
174
(UBusCallback)&UnityScreen::OnLauncherEndKeyNav,
177
_ubus_handles[2] = ubus_server_register_interest(ubus,
178
UBUS_QUICKLIST_END_KEY_NAV,
179
(UBusCallback)&UnityScreen::OnQuicklistEndKeyNav,
182
g_timeout_add(0, &UnityScreen::initPluginActions, this);
184
GeisAdapter::Default(screen)->Run();
185
gestureEngine = new GestureEngine(screen);
187
CompString name(PKGDATADIR"/panel-shadow.png");
188
CompString pname("unityshell");
189
CompSize size(1, 20);
190
_shadow_texture = GLTexture::readImageToTexture(name, pname, size);
180
192
LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s";
287
foreach (GLTexture *tex, _shadow_texture)
301
foreach(GLTexture * tex, _shadow_texture)
290
glColor4f (1.0f, 1.0f, 1.0f, 1.0f);
292
GL::activeTexture (GL_TEXTURE0_ARB);
293
tex->enable (GLTexture::Fast);
295
glTexParameteri (tex->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
304
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
306
GL::activeTexture(GL_TEXTURE0_ARB);
307
tex->enable(GLTexture::Fast);
309
glTexParameteri(tex->target(), GL_TEXTURE_WRAP_S, GL_REPEAT);
299
glTexCoord2f(COMP_TEX_COORD_X (tex->matrix (), 0), COMP_TEX_COORD_Y (tex->matrix (), 0));
313
glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), 0), COMP_TEX_COORD_Y(tex->matrix(), 0));
300
314
glVertex2f(vc[0], vc[2]);
302
glTexCoord2f(COMP_TEX_COORD_X (tex->matrix (), 0), COMP_TEX_COORD_Y (tex->matrix (), h));
316
glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), 0), COMP_TEX_COORD_Y(tex->matrix(), h));
303
317
glVertex2f(vc[0], vc[3]);
305
glTexCoord2f(COMP_TEX_COORD_X (tex->matrix (), w), COMP_TEX_COORD_Y (tex->matrix (), h));
319
glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), w), COMP_TEX_COORD_Y(tex->matrix(), h));
306
320
glVertex2f(vc[1], vc[3]);
308
glTexCoord2f(COMP_TEX_COORD_X (tex->matrix (), w), COMP_TEX_COORD_Y (tex->matrix (), 0));
322
glTexCoord2f(COMP_TEX_COORD_X(tex->matrix(), w), COMP_TEX_COORD_Y(tex->matrix(), 0));
309
323
glVertex2f(vc[1], vc[2]);
314
glDisable (GL_BLEND);
319
void UnityScreen::paintDisplay(const CompRegion ®ion)
333
void UnityScreen::paintDisplay(const CompRegion& region)
322
CompOutput *output = _last_output;
323
nux::Geometry geo = nux::Geometry (output->x (), output->y (), output->width (), output->height ());
336
CompOutput* output = _last_output;
337
nux::Geometry geo = nux::Geometry(output->x(), output->y(), output->width(), output->height());
325
wt->RenderInterfaceFromForeignCmd (&geo);
339
wt->RenderInterfaceFromForeignCmd(&geo);
328
342
doShellRepaint = false;
331
346
/* called whenever we need to repaint parts of the screen */
602
bool UnityScreen::altTabForwardInitiate(CompAction* action,
603
CompAction::State state,
604
CompOption::Vector& options)
606
if (switcherController->Visible())
608
switcherController->MoveNext();
612
std::vector<AbstractLauncherIcon*> results;
614
if (!switcher_desktop_icon)
616
switcher_desktop_icon = new DesktopLauncherIcon(launcher);
617
switcher_desktop_icon->SinkReference();
620
results.push_back(switcher_desktop_icon);
622
LauncherModel::iterator it;
623
for (it = launcher->GetModel()->begin(); it != launcher->GetModel()->end(); it++)
624
if ((*it)->ShowInSwitcher())
625
results.push_back(*it);
627
// maybe check launcher position/hide state?
628
switcherController->SetWorkspace(nux::Geometry(_primary_monitor.x + 100,
629
_primary_monitor.y + 100,
630
_primary_monitor.width - 200,
631
_primary_monitor.height - 200));
632
switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results);
635
action->setState(action->state() | CompAction::StateTermKey);
639
bool UnityScreen::altTabForwardTerminate(CompAction* action,
640
CompAction::State state,
641
CompOption::Vector& options)
643
action->setState(action->state() & (unsigned)~(CompAction::StateTermKey));
644
switcherController->Hide();
648
bool UnityScreen::altTabPrevInitiate(CompAction* action,
649
CompAction::State state,
650
CompOption::Vector& options)
652
if (switcherController->Visible())
653
switcherController->MovePrev();
655
action->setState(action->state() | CompAction::StateTermKey);
659
bool UnityScreen::altTabPrevTerminate(CompAction* action,
660
CompAction::State state,
661
CompOption::Vector& options)
663
action->setState(action->state() & (unsigned)~(CompAction::StateTermKey));
577
667
void UnityScreen::OnLauncherStartKeyNav(GVariant* data, void* value)
579
669
UnityScreen* self = reinterpret_cast<UnityScreen*>(value);
580
self->startLauncherKeyNav ();
670
self->startLauncherKeyNav();
583
673
void UnityScreen::OnLauncherEndKeyNav(GVariant* data, void* value)
627
PluginAdapter::Default ()->SetExpoAction(expoActions);
717
PluginAdapter::Default()->SetExpoAction(expoActions);
630
p = CompPlugin::find ("scale");
720
p = CompPlugin::find("scale");
634
MultiActionList scaleActions (0);
724
MultiActionList scaleActions(0);
636
foreach (CompOption& option, p->vTable->getOptions ())
726
foreach(CompOption & option, p->vTable->getOptions())
638
if (option.name () == "initiate_all_key" ||
639
option.name () == "initiate_all_edge" ||
640
option.name () == "initiate_key" ||
641
option.name () == "initiate_button" ||
642
option.name () == "initiate_edge" ||
643
option.name () == "initiate_group_key" ||
644
option.name () == "initiate_group_button" ||
645
option.name () == "initiate_group_edge" ||
646
option.name () == "initiate_output_key" ||
647
option.name () == "initiate_output_button" ||
648
option.name () == "initiate_output_edge")
728
if (option.name() == "initiate_all_key" ||
729
option.name() == "initiate_all_edge" ||
730
option.name() == "initiate_key" ||
731
option.name() == "initiate_button" ||
732
option.name() == "initiate_edge" ||
733
option.name() == "initiate_group_key" ||
734
option.name() == "initiate_group_button" ||
735
option.name() == "initiate_group_edge" ||
736
option.name() == "initiate_output_key" ||
737
option.name() == "initiate_output_button" ||
738
option.name() == "initiate_output_edge")
650
CompAction* action = &option.value ().action ();
651
scaleActions.AddNewAction (action, false);
740
CompAction* action = &option.value().action();
741
scaleActions.AddNewAction(action, false);
653
else if (option.name () == "initiate_all_button")
743
else if (option.name() == "initiate_all_button")
655
CompAction* action = &option.value ().action ();
656
scaleActions.AddNewAction (action, true);
745
CompAction* action = &option.value().action();
746
scaleActions.AddNewAction(action, true);
660
PluginAdapter::Default ()->SetScaleAction (scaleActions);
750
PluginAdapter::Default()->SetScaleAction(scaleActions);
663
p = CompPlugin::find ("unitymtgrabhandles");
753
p = CompPlugin::find("unitymtgrabhandles");
667
foreach (CompOption &option, p->vTable->getOptions ())
757
foreach(CompOption & option, p->vTable->getOptions())
669
if (option.name () == "show_handles_key")
670
PluginAdapter::Default ()->SetShowHandlesAction (&option.value ().action ());
671
else if (option.name () == "hide_handles_key")
672
PluginAdapter::Default ()->SetHideHandlesAction (&option.value ().action ());
673
else if (option.name () == "toggle_handles_key")
674
PluginAdapter::Default ()->SetToggleHandlesAction (&option.value ().action ());
759
if (option.name() == "show_handles_key")
760
PluginAdapter::Default()->SetShowHandlesAction(&option.value().action());
761
else if (option.name() == "hide_handles_key")
762
PluginAdapter::Default()->SetHideHandlesAction(&option.value().action());
763
else if (option.name() == "toggle_handles_key")
764
PluginAdapter::Default()->SetToggleHandlesAction(&option.value().action());
992
1096
self->launcherWindow->ShowWindow(true);
993
1097
self->launcherWindow->EnableInputWindow(true, "launcher", false, false);
994
1098
self->launcherWindow->InputWindowEnableStruts(true);
995
self->launcherWindow->SetEnterFocusInputArea (self->launcher);
1099
self->launcherWindow->SetEnterFocusInputArea(self->launcher);
1101
self->switcherController = new SwitcherController();
997
1102
/* FIXME: this should not be manual, should be managed with a
998
1103
show/hide callback like in GAIL*/
999
if (unity_a11y_initialized () == TRUE)
1000
unity_util_accessible_add_window (self->launcherWindow);
1104
if (unity_a11y_initialized() == TRUE)
1105
unity_util_accessible_add_window(self->launcherWindow);
1002
self->launcher->SetIconSize (54, 48);
1003
self->launcher->SetBacklightMode (Launcher::BACKLIGHT_ALWAYS_ON);
1107
self->launcher->SetIconSize(54, 48);
1108
self->launcher->SetBacklightMode(Launcher::BACKLIGHT_ALWAYS_ON);
1005
1110
LOG_INFO(logger) << "initLauncher-Launcher " << timer.ElapsedSeconds() << "s";
1007
1112
/* Setup panel */
1009
self->panelController = new PanelController ();
1010
self->AddChild (self->panelController);
1114
self->panelController = new PanelController();
1115
self->AddChild(self->panelController);
1011
1116
LOG_INFO(logger) << "initLauncher-Panel " << timer.ElapsedSeconds() << "s";
1013
1118
/* Setup Places */
1014
self->placesController = new PlacesController ();
1119
self->placesController = new PlacesController();
1016
1121
/* FIXME: this should not be manual, should be managed with a
1017
1122
show/hide callback like in GAIL*/
1018
if (unity_a11y_initialized () == TRUE)
1020
AtkObject *atk_obj = NULL;
1022
atk_obj = unity_util_accessible_add_window (self->placesController->GetWindow ());
1024
atk_object_set_name (atk_obj, _("Places"));
1027
self->launcher->SetHideMode (Launcher::LAUNCHER_HIDE_DODGE_WINDOWS);
1028
self->launcher->SetLaunchAnimation (Launcher::LAUNCH_ANIMATION_PULSE);
1029
self->launcher->SetUrgentAnimation (Launcher::URGENT_ANIMATION_WIGGLE);
1030
self->ScheduleRelayout (0);
1032
self->OnLauncherHiddenChanged ();
1123
if (unity_a11y_initialized() == TRUE)
1125
AtkObject* atk_obj = NULL;
1127
atk_obj = unity_util_accessible_add_window(self->placesController->GetWindow());
1129
atk_object_set_name(atk_obj, _("Places"));
1132
self->launcher->SetHideMode(Launcher::LAUNCHER_HIDE_DODGE_WINDOWS);
1133
self->launcher->SetLaunchAnimation(Launcher::LAUNCH_ANIMATION_PULSE);
1134
self->launcher->SetUrgentAnimation(Launcher::URGENT_ANIMATION_WIGGLE);
1135
self->ScheduleRelayout(0);
1137
self->OnLauncherHiddenChanged();
1035
1140
/* Window init */
1036
1141
UnityWindow::UnityWindow(CompWindow* window)
1037
: PluginClassHandler<UnityWindow, CompWindow>(window)
1039
, gWindow(GLWindow::get(window))
1142
: PluginClassHandler<UnityWindow, CompWindow>(window)
1144
, gWindow(GLWindow::get(window))
1041
WindowInterface::setHandler (window);
1042
GLWindowInterface::setHandler (gWindow);
1146
WindowInterface::setHandler(window);
1147
GLWindowInterface::setHandler(gWindow);
1045
1150
UnityWindow::~UnityWindow()
1047
UnityScreen *us = UnityScreen::get (screen);
1048
if (us->newFocusedWindow && (UnityWindow::get (us->newFocusedWindow) == this))
1152
UnityScreen* us = UnityScreen::get(screen);
1153
if (us->newFocusedWindow && (UnityWindow::get(us->newFocusedWindow) == this))
1049
1154
us->newFocusedWindow = NULL;
1050
if (us->lastFocusedWindow && (UnityWindow::get (us->lastFocusedWindow) == this))
1155
if (us->lastFocusedWindow && (UnityWindow::get(us->lastFocusedWindow) == this))
1051
1156
us->lastFocusedWindow = NULL;
1057
1162
gfloat version;
1058
1163
gchar* extensions;
1060
if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1062
if (!CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
1064
if (!CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
1165
if (!CompPlugin::checkPluginABI("core", CORE_ABIVERSION))
1167
if (!CompPlugin::checkPluginABI("composite", COMPIZ_COMPOSITE_ABI))
1169
if (!CompPlugin::checkPluginABI("opengl", COMPIZ_OPENGL_ABI))
1067
1172
/* Ensure OpenGL version is 1.4+. */
1068
version = get_opengl_version_f32 ((const gchar*) glGetString (GL_VERSION));
1173
version = get_opengl_version_f32((const gchar*) glGetString(GL_VERSION));
1069
1174
if (version < 1.4f)
1071
compLogMessage ("unityshell", CompLogLevelError,
1072
"OpenGL 1.4+ not supported\n");
1176
compLogMessage("unityshell", CompLogLevelError,
1177
"OpenGL 1.4+ not supported\n");
1076
1181
/* Ensure OpenGL extensions required by the Unity plugin are available. */
1077
extensions = (gchar*) glGetString (GL_EXTENSIONS);
1078
if (!is_extension_supported (extensions, "GL_ARB_vertex_program"))
1080
compLogMessage ("unityshell", CompLogLevelError,
1081
"GL_ARB_vertex_program not supported\n");
1084
if (!is_extension_supported (extensions, "GL_ARB_fragment_program"))
1086
compLogMessage ("unityshell", CompLogLevelError,
1087
"GL_ARB_fragment_program not supported\n");
1090
if (!is_extension_supported (extensions, "GL_ARB_vertex_buffer_object"))
1092
compLogMessage ("unityshell", CompLogLevelError,
1093
"GL_ARB_vertex_buffer_object not supported\n");
1096
if (!is_extension_supported (extensions, "GL_ARB_framebuffer_object"))
1098
if (!is_extension_supported (extensions, "GL_EXT_framebuffer_object"))
1182
extensions = (gchar*) glGetString(GL_EXTENSIONS);
1183
if (!is_extension_supported(extensions, "GL_ARB_vertex_program"))
1185
compLogMessage("unityshell", CompLogLevelError,
1186
"GL_ARB_vertex_program not supported\n");
1189
if (!is_extension_supported(extensions, "GL_ARB_fragment_program"))
1191
compLogMessage("unityshell", CompLogLevelError,
1192
"GL_ARB_fragment_program not supported\n");
1195
if (!is_extension_supported(extensions, "GL_ARB_vertex_buffer_object"))
1197
compLogMessage("unityshell", CompLogLevelError,
1198
"GL_ARB_vertex_buffer_object not supported\n");
1201
if (!is_extension_supported(extensions, "GL_ARB_framebuffer_object"))
1203
if (!is_extension_supported(extensions, "GL_EXT_framebuffer_object"))
1100
compLogMessage ("unityshell", CompLogLevelError,
1101
"GL_ARB_framebuffer_object or GL_EXT_framebuffer_object "
1205
compLogMessage("unityshell", CompLogLevelError,
1206
"GL_ARB_framebuffer_object or GL_EXT_framebuffer_object "
1106
if (!is_extension_supported (extensions, "GL_ARB_texture_non_power_of_two"))
1211
if (!is_extension_supported(extensions, "GL_ARB_texture_non_power_of_two"))
1108
if (!is_extension_supported (extensions, "GL_ARB_texture_rectangle"))
1213
if (!is_extension_supported(extensions, "GL_ARB_texture_rectangle"))
1110
compLogMessage ("unityshell", CompLogLevelError,
1111
"GL_ARB_texture_non_power_of_two or "
1112
"GL_ARB_texture_rectangle not supported\n");
1215
compLogMessage("unityshell", CompLogLevelError,
1216
"GL_ARB_texture_non_power_of_two or "
1217
"GL_ARB_texture_rectangle not supported\n");