Bug 1152066 - Remove ugly dynamic loading code now that we can assume this symbol exists. r=roc

This commit is contained in:
Blake Kaplan 2015-04-07 16:53:30 -07:00
parent ce7fa7a16c
commit 91218174b8

View File

@ -10,11 +10,6 @@
#include "nsBidiKeyboard.h"
#include <gtk/gtk.h>
#if (MOZ_WIDGET_GTK == 2)
typedef gboolean (*GdkKeymapHaveBidiLayoutsType)(GdkKeymap *keymap);
static GdkKeymapHaveBidiLayoutsType GdkKeymapHaveBidiLayouts = nullptr;
#endif
NS_IMPL_ISUPPORTS(nsBidiKeyboard, nsIBidiKeyboard)
nsBidiKeyboard::nsBidiKeyboard()
@ -25,32 +20,12 @@ nsBidiKeyboard::nsBidiKeyboard()
NS_IMETHODIMP
nsBidiKeyboard::Reset()
{
#if (MOZ_WIDGET_GTK == 2)
PRLibrary *gtklib = nullptr;
#if defined(MOZ_X11)
if (!GdkKeymapHaveBidiLayouts) {
GdkKeymapHaveBidiLayouts = (GdkKeymapHaveBidiLayoutsType)
PR_FindFunctionSymbolAndLibrary("gdk_keymap_have_bidi_layouts",
&gtklib);
if (gtklib)
PR_UnloadLibrary(gtklib);
}
#endif
mHaveBidiKeyboards = false;
if (GdkKeymapHaveBidiLayouts)
mHaveBidiKeyboards = (*GdkKeymapHaveBidiLayouts)(nullptr);
#else
mHaveBidiKeyboards = gdk_keymap_have_bidi_layouts(gdk_keymap_get_default());
#endif
return NS_OK;
}
nsBidiKeyboard::~nsBidiKeyboard()
{
#if (MOZ_WIDGET_GTK == 2)
GdkKeymapHaveBidiLayouts = nullptr;
#endif
}
NS_IMETHODIMP