Renamed NSRepository to nsRepository.

This commit is contained in:
warren%netscape.com 1998-09-01 00:26:28 +00:00
Родитель 4dbedbd8ce
Коммит b89e7efaca
49 изменённых файлов: 381 добавлений и 381 удалений

Просмотреть файл

@ -285,18 +285,18 @@ static void InitializeNGLayout() {
NS_DEFINE_IID(kCCheckButtonIID, NS_CHECKBUTTON_CID);
NS_DEFINE_IID(kCChildIID, NS_CHILD_CID);
NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCHScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCCheckButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCHScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCCheckButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
@ -304,19 +304,19 @@ static void InitializeNGLayout() {
NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NS_DEFINE_IID(kCRegionIID, NS_REGION_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRegionIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRegionIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NS_DEFINE_IID(kCViewManagerCID, NS_VIEW_MANAGER_CID);
NS_DEFINE_IID(kCViewCID, NS_VIEW_CID);
NS_DEFINE_IID(kCScrollingViewCID, NS_SCROLLING_VIEW_CID);
NSRepository::RegisterFactory(kCViewManagerCID, VIEW_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollingViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCViewManagerCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollingViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
}
#endif /* MOZ_NGLAYOUT */

Просмотреть файл

@ -204,7 +204,7 @@ nsHTMLDocument::StartDocumentLoad(nsIURL *aURL,
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = NSRepository::CreateInstance(kCParserCID,
rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);

Просмотреть файл

@ -305,7 +305,7 @@ nsresult nsWebShell::CreatePluginHost(void)
if (nsnull == mPluginManager)
{
rv = NSRepository::CreateInstance(kCPluginHostCID, nsnull,
rv = nsRepository::CreateInstance(kCPluginHostCID, nsnull,
kIPluginManagerIID,
(void**)&mPluginManager);
if (NS_OK == rv)
@ -544,7 +544,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
NS_RELEASE(parentLoader);
}
} else {
rv = NSRepository::CreateInstance(kDocumentLoaderCID,
rv = nsRepository::CreateInstance(kDocumentLoaderCID,
nsnull,
kIDocumentLoaderIID,
(void**)&mDocLoader);
@ -556,7 +556,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDocLoader->AddObserver((nsIDocumentLoaderObserver*)this);
// Create device context
rv = NSRepository::CreateInstance(kDeviceContextCID, nsnull,
rv = nsRepository::CreateInstance(kDeviceContextCID, nsnull,
kIDeviceContextIID,
(void **)&mDeviceContext);
if (NS_OK != rv) {
@ -573,7 +573,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDeviceContext->SetGamma(1.0f);
// Create a Native window for the shell container...
rv = NSRepository::CreateInstance(kChildCID,
rv = nsRepository::CreateInstance(kChildCID,
(nsISupports*)((nsIWebShell*)this),
kISupportsIID,
(void**)&mInnerWindow);

Просмотреть файл

@ -479,7 +479,7 @@ nsIRegion * pRegion ;
static NS_DEFINE_IID(kCRegionCID, NS_REGION_CID);
static NS_DEFINE_IID(kIRegionIID, NS_IREGION_IID);
nsresult rv = NSRepository::CreateInstance(kCRegionCID,nsnull, kIRegionIID, (void **)aRegion);
nsresult rv = nsRepository::CreateInstance(kCRegionCID,nsnull, kIRegionIID, (void **)aRegion);
if (NS_OK == rv)
{

Просмотреть файл

@ -485,7 +485,7 @@ void nsRenderingContextUnix :: GetClipRegion(nsIRegion **aRegion)
static NS_DEFINE_IID(kCRegionCID, NS_REGION_CID);
static NS_DEFINE_IID(kIRegionIID, NS_IREGION_IID);
nsresult rv = NSRepository::CreateInstance(kCRegionCID,
nsresult rv = nsRepository::CreateInstance(kCRegionCID,
nsnull,
kIRegionIID,
(void **)aRegion);

Просмотреть файл

@ -97,7 +97,7 @@ NS_IMETHODIMP FontCacheImpl :: GetMetricsFor(const nsFont& aFont, nsIFontMetrics
static NS_DEFINE_IID(kFontMetricsIID, NS_IFONT_METRICS_IID);
nsIFontMetrics* fm;
nsresult rv = NSRepository::CreateInstance(kFontMetricsCID, nsnull,
nsresult rv = nsRepository::CreateInstance(kFontMetricsCID, nsnull,
kFontMetricsIID, (void **)&fm);
if (NS_OK != rv) {
aMetrics = nsnull;

Просмотреть файл

@ -81,7 +81,7 @@ ImageRendererImpl::NewPixmap(void* aDisplayContext,
static NS_DEFINE_IID(kImageIID, NS_IIMAGE_IID);
// Create a new image object
rv = NSRepository::CreateInstance(kImageCID, nsnull, kImageIID, (void **)&img);
rv = nsRepository::CreateInstance(kImageCID, nsnull, kImageIID, (void **)&img);
if (NS_OK != rv) {
// XXX What about error handling?
return;

Просмотреть файл

@ -290,7 +290,7 @@ nsresult rv;
gSobits = (HBITMAP)::SelectObject(gSrcdc, gSrcbits);
gDobits = (HBITMAP)::SelectObject(gDestdc, gDestbits);
rv = NSRepository::CreateInstance(kBlenderCID, nsnull, kBlenderIID, (void **)&gImageblender);
rv = nsRepository::CreateInstance(kBlenderCID, nsnull, kBlenderIID, (void **)&gImageblender);
gImageblender->Init(gSrcdc,gDestdc);
}
}
@ -1102,7 +1102,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
nsRect rect(0, 0, aWidth, aHeight);
nsresult rv = NSRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
nsresult rv = nsRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
if (NS_OK == rv)
@ -1111,14 +1111,14 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
}
// something for input
NSRepository::RegisterFactory(kCTextFieldCID, "raptorwidget.dll", PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, "raptorwidget.dll", PR_FALSE, PR_FALSE);
rect.SetRect(25, 370, 40, 25);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gBlendMessage);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gBlendMessage);
gBlendMessage->Create(gWindow, rect, nsnull, nsnull);
gBlendMessage->SetText("50");
rect.SetRect(70,370,40,25);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gQualMessage);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gQualMessage);
gQualMessage->Create(gWindow, rect, nsnull, nsnull);
gQualMessage->SetText("3");
@ -1137,9 +1137,9 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int nCmdShow
{
gInstance = instance;
NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
@ -1147,11 +1147,11 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int nCmdShow
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
static NS_DEFINE_IID(kCBlenderIID, NS_BLENDER_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCBlenderIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCBlenderIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
if (!prevInstance) {
WNDCLASS wndClass;

Просмотреть файл

@ -216,7 +216,7 @@ extern "C" NS_EXPORT int DebugRobot(
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = NSRepository::CreateInstance(kCParserCID,
rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);

Просмотреть файл

@ -22,7 +22,7 @@ int main(int argc, char **argv)
}
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
NSRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
return DebugRobot(gWorkList, nsnull);
}

Просмотреть файл

@ -111,7 +111,7 @@ void parseFile (const char* aFilename,int size)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = NSRepository::CreateInstance(kCParserCID,
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -197,7 +197,7 @@ int main(int argc, char* argv [])
else _getcwd(buffer,_MAX_PATH);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
NSRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
walkDirectoryTree(buffer);
return 0;

Просмотреть файл

@ -44,8 +44,8 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
static void SetupRegistry()
{
NSRepository::RegisterFactory(kParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kLoggingSinkCID, PARSER_DLL,PR_FALSE,PR_FALSE);
nsRepository::RegisterFactory(kParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kLoggingSinkCID, PARSER_DLL,PR_FALSE,PR_FALSE);
}
//----------------------------------------------------------------------
@ -61,7 +61,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a parser
nsIParser* parser;
nsresult rv = NSRepository::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
nsresult rv = nsRepository::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
if (NS_OK != rv) {
cout << "Unable to create a parser (" << rv << ")" <<endl;
return -1;
@ -69,7 +69,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a sink
nsILoggingSink* sink;
rv = NSRepository::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
rv = nsRepository::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
if (NS_OK != rv) {
cout << "Unable to create a sink (" << rv << ")" <<endl;
return -1;

Просмотреть файл

@ -1096,7 +1096,7 @@ PresShell::VerifyIncrementalReflow()
void* nativeParentWidget = rootWidget->GetNativeData(NS_NATIVE_WIDGET);
// Create a new view manager.
rv = NSRepository::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
rv = nsRepository::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
(void**) &vm);
if ((NS_OK != rv) || (NS_OK != vm->Init(dc))) {
NS_ASSERTION(NS_OK == rv, "failed to create view manager");
@ -1109,7 +1109,7 @@ PresShell::VerifyIncrementalReflow()
nsRect tbounds;
mPresContext->GetVisibleArea(tbounds);
// tbounds *= mPresContext->GetPixelsToTwips();
rv = NSRepository::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
rv = nsRepository::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
(void **) &view);
if ((NS_OK != rv) || (NS_OK != view->Init(vm, tbounds, nsnull, &kWidgetCID,
nsnull, nativeParentWidget))) {

Просмотреть файл

@ -108,7 +108,7 @@ nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
// Create our view and widget
nsresult result =
NSRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != result) {
return result;

Просмотреть файл

@ -806,7 +806,7 @@ nsIView* nsBodyFrame::CreateAbsoluteView(const nsStylePosition* aPosition,
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
// Create the view
nsresult result = NSRepository::CreateInstance(kViewCID,
nsresult result = nsRepository::CreateInstance(kViewCID,
nsnull,
kIViewIID,
(void **)&view);

Просмотреть файл

@ -93,7 +93,7 @@ nsHTMLBase::CreateViewForFrame(nsIPresContext* aPresContext,
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult result = NSRepository::CreateInstance(kViewCID,
nsresult result = nsRepository::CreateInstance(kViewCID,
nsnull,
kIViewIID,
(void **)&view);

Просмотреть файл

@ -108,7 +108,7 @@ nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
// Create our view and widget
nsresult result =
NSRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != result) {
return result;

Просмотреть файл

@ -222,7 +222,7 @@ RootContentFrame::RootContentFrame(nsIContent* aContent, nsIFrame* aParent)
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult result = NSRepository::CreateInstance(kViewCID,
nsresult result = nsRepository::CreateInstance(kViewCID,
nsnull,
kIViewIID,
(void **)&view);

Просмотреть файл

@ -351,7 +351,7 @@ nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
nsIViewManager* viewManager;
parentView->GetViewManager(viewManager);
nsresult rv = NSRepository::CreateInstance(kScrollingViewCID,
nsresult rv = nsRepository::CreateInstance(kScrollingViewCID,
nsnull,
kIViewIID,
(void **)&view);

Просмотреть файл

@ -204,7 +204,7 @@ nsHTMLDocument::StartDocumentLoad(nsIURL *aURL,
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = NSRepository::CreateInstance(kCParserCID,
rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);

Просмотреть файл

@ -475,7 +475,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
nsHTMLFrame* content;
GetParentContent(content);
rv = NSRepository::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
rv = nsRepository::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
(void**)&mWebShell);
if (NS_OK != rv) {
NS_ASSERTION(0, "could not create web widget");
@ -526,7 +526,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
// create, init, set the parent of the view
nsIView* view;
rv = NSRepository::CreateInstance(kCViewCID, nsnull, kIViewIID,
rv = nsRepository::CreateInstance(kCViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != rv) {
NS_ASSERTION(0, "Could not create view for nsHTMLFrame");

Просмотреть файл

@ -86,7 +86,7 @@ void nsInputFileFrame::MouseClicked(nsIPresContext* aPresContext)
nsIFileWidget *fileWidget;
nsString title("FileWidget Title <here> mode = save");
NSRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsString titles[] = {"all files"};
nsString filters[] = {"*.*"};

Просмотреть файл

@ -253,7 +253,7 @@ nsInputFrame::Reflow(nsIPresContext& aPresContext,
GetStyleContext(&aPresContext, mStyleContext);
}
nsresult result =
NSRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != result) {
NS_ASSERTION(0, "Could not create view for button");

Просмотреть файл

@ -1587,7 +1587,7 @@ int main(int argc, char** argv)
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
nsresult rv = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&dx);
nsresult rv = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&dx);
if (NS_OK == rv) {
dx->Init(nsull);

Просмотреть файл

@ -425,7 +425,7 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
nsresult rv = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&dx);
nsresult rv = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&dx);
if (NS_OK == rv) {
dx->Init(nsnull);
@ -449,7 +449,7 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID);
static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID);
status = NSRepository::CreateInstance(kViewManagerCID,
status = nsRepository::CreateInstance(kViewManagerCID,
nsnull,
kIViewManagerIID,
(void **)&vm);
@ -467,7 +467,7 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
status = NSRepository::CreateInstance(kScrollingViewCID,
status = nsRepository::CreateInstance(kScrollingViewCID,
nsnull,
kIViewIID,
(void **)&rootView);

Просмотреть файл

@ -216,7 +216,7 @@ extern "C" NS_EXPORT int DebugRobot(
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = NSRepository::CreateInstance(kCParserCID,
rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);

Просмотреть файл

@ -22,7 +22,7 @@ int main(int argc, char **argv)
}
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
NSRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
return DebugRobot(gWorkList, nsnull);
}

Просмотреть файл

@ -111,7 +111,7 @@ void parseFile (const char* aFilename,int size)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = NSRepository::CreateInstance(kCParserCID,
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -197,7 +197,7 @@ int main(int argc, char* argv [])
else _getcwd(buffer,_MAX_PATH);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
NSRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
walkDirectoryTree(buffer);
return 0;

Просмотреть файл

@ -44,8 +44,8 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
static void SetupRegistry()
{
NSRepository::RegisterFactory(kParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kLoggingSinkCID, PARSER_DLL,PR_FALSE,PR_FALSE);
nsRepository::RegisterFactory(kParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kLoggingSinkCID, PARSER_DLL,PR_FALSE,PR_FALSE);
}
//----------------------------------------------------------------------
@ -61,7 +61,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a parser
nsIParser* parser;
nsresult rv = NSRepository::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
nsresult rv = nsRepository::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
if (NS_OK != rv) {
cout << "Unable to create a parser (" << rv << ")" <<endl;
return -1;
@ -69,7 +69,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a sink
nsILoggingSink* sink;
rv = NSRepository::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
rv = nsRepository::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
if (NS_OK != rv) {
cout << "Unable to create a sink (" << rv << ")" <<endl;
return -1;

Просмотреть файл

@ -942,7 +942,7 @@ nsresult nsView :: LoadWidget(const nsCID &aClassIID)
nsresult rv;
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
rv = NSRepository::CreateInstance(aClassIID, nsnull, kISupportsIID, (void**)&window);
rv = nsRepository::CreateInstance(aClassIID, nsnull, kISupportsIID, (void**)&window);
if (NS_OK == rv) {
// get a pointer to the nsIWidget* interface

Просмотреть файл

@ -83,7 +83,7 @@ nsViewManager :: ~nsViewManager()
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kIRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
nsresult rv = NSRepository::CreateInstance(kRenderingContextCID,
nsresult rv = nsRepository::CreateInstance(kRenderingContextCID,
nsnull,
kIRenderingContextIID,
(void **)&rc);
@ -1234,7 +1234,7 @@ void nsViewManager :: AddRectToDirtyRegion(nsRect &aRect)
static NS_DEFINE_IID(kRegionCID, NS_REGION_CID);
static NS_DEFINE_IID(kIRegionIID, NS_IREGION_IID);
nsresult rv = NSRepository::CreateInstance(kRegionCID,
nsresult rv = nsRepository::CreateInstance(kRegionCID,
nsnull,
kIRegionIID,
(void **)&mDirtyRegion);

Просмотреть файл

@ -483,7 +483,7 @@ nsresult DocumentViewerImpl::MakeWindow(nsNativeWidget aNativeParent,
{
nsresult rv;
rv = NSRepository::CreateInstance(kViewManagerCID,
rv = nsRepository::CreateInstance(kViewManagerCID,
nsnull,
kIViewManagerIID,
(void **)&mViewManager);
@ -501,7 +501,7 @@ nsresult DocumentViewerImpl::MakeWindow(nsNativeWidget aNativeParent,
// Create a child window of the parent that is our "root view/window"
// Create a view
rv = NSRepository::CreateInstance(kScrollingViewCID,
rv = nsRepository::CreateInstance(kScrollingViewCID,
nsnull,
kIViewIID,
(void **)&mView);

Просмотреть файл

@ -317,7 +317,7 @@ nsThrobber::Init(nsIWidget* aParent, const nsRect& aBounds)
mHeight = aBounds.height;
// Create widget
nsresult rv = NSRepository::CreateInstance(kChildCID,
nsresult rv = nsRepository::CreateInstance(kChildCID,
(nsIThrobber *)this,
kISupportsIID,
(void**)&mInnerWidget);

Просмотреть файл

@ -305,7 +305,7 @@ nsresult nsWebShell::CreatePluginHost(void)
if (nsnull == mPluginManager)
{
rv = NSRepository::CreateInstance(kCPluginHostCID, nsnull,
rv = nsRepository::CreateInstance(kCPluginHostCID, nsnull,
kIPluginManagerIID,
(void**)&mPluginManager);
if (NS_OK == rv)
@ -544,7 +544,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
NS_RELEASE(parentLoader);
}
} else {
rv = NSRepository::CreateInstance(kDocumentLoaderCID,
rv = nsRepository::CreateInstance(kDocumentLoaderCID,
nsnull,
kIDocumentLoaderIID,
(void**)&mDocLoader);
@ -556,7 +556,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDocLoader->AddObserver((nsIDocumentLoaderObserver*)this);
// Create device context
rv = NSRepository::CreateInstance(kDeviceContextCID, nsnull,
rv = nsRepository::CreateInstance(kDeviceContextCID, nsnull,
kIDeviceContextIID,
(void **)&mDeviceContext);
if (NS_OK != rv) {
@ -573,7 +573,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDeviceContext->SetGamma(1.0f);
// Create a Native window for the shell container...
rv = NSRepository::CreateInstance(kChildCID,
rv = nsRepository::CreateInstance(kChildCID,
(nsISupports*)((nsIWebShell*)this),
kISupportsIID,
(void**)&mInnerWindow);

Просмотреть файл

@ -338,7 +338,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,
nsRect rect(0, 0, aWidth, aHeight);
nsresult rv = NSRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
nsresult rv = nsRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
if (NS_OK == rv) {
gWindow->Create((nsNativeWidget)window, rect, MyHandleEvent, NULL);
@ -357,19 +357,19 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int nCmdShow
{
gInstance = instance;
NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
if (!prevInstance) {
WNDCLASS wndClass;

Просмотреть файл

@ -404,7 +404,7 @@ static PRBool GetFileNameFromFileSelector(nsIWidget* aParentWindow,
PRBool selectedFileName = PR_FALSE;
nsIFileWidget *fileWidget;
nsString title("Open HTML");
nsresult rv = NSRepository::CreateInstance(kFileWidgetCID,
nsresult rv = nsRepository::CreateInstance(kFileWidgetCID,
nsnull,
kIFileWidgetIID,
(void**)&fileWidget);
@ -612,7 +612,7 @@ nsBrowserWindow::DoFind()
nsRect rect;
rect.SetRect(0, 0, 380, 110);
NSRepository::CreateInstance(kDialogCID, nsnull, kIDialogIID, (void**)&mDialog);
nsRepository::CreateInstance(kDialogCID, nsnull, kIDialogIID, (void**)&mDialog);
mDialog->Create(mWindow, rect, HandleEvent, NULL);
mDialog->SetLabel("Find");
mDialog->SetClientData(this);
@ -620,7 +620,7 @@ nsBrowserWindow::DoFind()
nscoord xx = 5;
// Create Label
rect.SetRect(xx, 8, 75, 24);
NSRepository::CreateInstance(kLabelCID, nsnull, kILabelIID, (void**)&mLabel);
nsRepository::CreateInstance(kLabelCID, nsnull, kILabelIID, (void**)&mLabel);
mLabel->SetAlignment(eAlign_Right);
mLabel->Create(mDialog, rect, HandleEvent, NULL);
mLabel->SetLabel("Find what:");
@ -631,7 +631,7 @@ nsBrowserWindow::DoFind()
// Create TextField
rect.SetRect(xx, 5, 200, 24);
NSRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID, (void**)&mTextField);
nsRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID, (void**)&mTextField);
mTextField->Create(mDialog, rect, HandleEvent, NULL);
mTextField->SetBackgroundColor(NS_RGB(255,255,255));
mTextField->SetFont(font);
@ -646,7 +646,7 @@ nsBrowserWindow::DoFind()
// Create Up RadioButton
rect.SetRect(x, y, w, h);
NSRepository::CreateInstance(kRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&mUpRadioBtn);
nsRepository::CreateInstance(kRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&mUpRadioBtn);
mUpRadioBtn->Create(mDialog, rect, HandleEvent, NULL);
mUpRadioBtn->SetLabel("Up");
mUpRadioBtn->SetFont(font);
@ -656,7 +656,7 @@ nsBrowserWindow::DoFind()
// Create Up RadioButton
rect.SetRect(x, y, w, h);
NSRepository::CreateInstance(kRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&mDwnRadioBtn);
nsRepository::CreateInstance(kRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&mDwnRadioBtn);
mDwnRadioBtn->Create(mDialog, rect, HandleEvent, NULL);
mDwnRadioBtn->SetLabel("Down");
mDwnRadioBtn->SetFont(font);
@ -665,7 +665,7 @@ nsBrowserWindow::DoFind()
// Create Match CheckButton
rect.SetRect(5, y, 125, 24);
NSRepository::CreateInstance(kCheckButtonCID, nsnull, kICheckButtonIID, (void**)&mMatchCheckBtn);
nsRepository::CreateInstance(kCheckButtonCID, nsnull, kICheckButtonIID, (void**)&mMatchCheckBtn);
mMatchCheckBtn->Create(mDialog, rect, HandleEvent, NULL);
mMatchCheckBtn->SetLabel("Match Case");
mMatchCheckBtn->SetFont(font);
@ -677,7 +677,7 @@ nsBrowserWindow::DoFind()
// Create Find Next Button
rect.SetRect(xx, 5, 75, 24);
NSRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID, (void**)&mFindBtn);
nsRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID, (void**)&mFindBtn);
mFindBtn->Create(mDialog, rect, HandleEvent, NULL);
mFindBtn->SetLabel("Find Next");
mFindBtn->SetFont(font);
@ -686,7 +686,7 @@ nsBrowserWindow::DoFind()
// Create Cancel Button
rect.SetRect(xx, 35, 75, 24);
NSRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID, (void**)&mCancelBtn);
nsRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID, (void**)&mCancelBtn);
mCancelBtn->Create(mDialog, rect, HandleEvent, NULL);
mCancelBtn->SetLabel("Cancel");
mCancelBtn->SetFont(font);
@ -800,7 +800,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
mAllowPlugins = aAllowPlugins;
// Create top level window
nsresult rv = NSRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
nsresult rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
(void**)&mWindow);
if (NS_OK != rv) {
return rv;
@ -811,7 +811,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
mWindow->GetBounds(r);
// Create web shell
rv = NSRepository::CreateInstance(kWebShellCID, nsnull,
rv = nsRepository::CreateInstance(kWebShellCID, nsnull,
kIWebShellIID,
(void**)&mWebShell);
if (NS_OK != rv) {
@ -876,7 +876,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth)
NS_RELEASE(dc);
// Create and place back button
rv = NSRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID,
rv = nsRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID,
(void**)&mBack);
if (NS_OK != rv) {
return rv;
@ -889,7 +889,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth)
// Create and place forward button
r.SetRect(BUTTON_WIDTH, 0, BUTTON_WIDTH, BUTTON_HEIGHT);
rv = NSRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID,
rv = nsRepository::CreateInstance(kButtonCID, nsnull, kIButtonIID,
(void**)&mForward);
if (NS_OK != rv) {
return rv;
@ -903,7 +903,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth)
r.SetRect(2*BUTTON_WIDTH, 0,
aWidth - 2*BUTTON_WIDTH - THROBBER_WIDTH,
BUTTON_HEIGHT);
rv = NSRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID,
rv = nsRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID,
(void**)&mLocation);
if (NS_OK != rv) {
return rv;
@ -918,7 +918,7 @@ nsBrowserWindow::CreateToolBar(PRInt32 aWidth)
// Create and place throbber
r.SetRect(aWidth - THROBBER_WIDTH, 0,
THROBBER_WIDTH, THROBBER_HEIGHT);
rv = NSRepository::CreateInstance(kThrobberCID, nsnull, kIThrobberIID,
rv = nsRepository::CreateInstance(kThrobberCID, nsnull, kIThrobberIID,
(void**)&mThrobber);
if (NS_OK != rv) {
return rv;
@ -943,7 +943,7 @@ nsBrowserWindow::CreateStatusBar(PRInt32 aWidth)
NS_RELEASE(dc);
nsRect r(0, 0, aWidth, THROBBER_HEIGHT);
rv = NSRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID,
rv = nsRepository::CreateInstance(kTextFieldCID, nsnull, kITextWidgetIID,
(void**)&mStatus);
if (NS_OK != rv) {
return rv;
@ -1451,7 +1451,7 @@ nsBrowserWindow::DoCopy()
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = NSRepository::CreateInstance(kCParserCID,
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -1813,7 +1813,7 @@ static PRBool GetSaveFileNameFromFileSelector(nsIWidget* aParentWindow,
PRBool selectedFileName = PR_FALSE;
nsIFileWidget *fileWidget;
nsString title("Save HTML");
nsresult rv = NSRepository::CreateInstance(kFileWidgetCID,
nsresult rv = nsRepository::CreateInstance(kFileWidgetCID,
nsnull,
kIFileWidgetIID,
(void**)&fileWidget);
@ -1880,7 +1880,7 @@ nsBrowserWindow::DoDebugSave()
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = NSRepository::CreateInstance(kCParserCID,
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);

Просмотреть файл

@ -95,33 +95,33 @@ static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
extern "C" void
NS_SetupRegistry()
{
NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCHScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDialogCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCLabelCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCCheckButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRegionIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCViewManagerCID, VIEW_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCScrollingViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kWebShellCID, WEB_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDocumentLoaderCID, WEB_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kThrobberCID, WEB_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kPrefCID, PREF_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCPluginHostCID, PLUGIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCHScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDialogCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCLabelCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCCheckButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildIID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRegionIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCViewManagerCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCScrollingViewCID, VIEW_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kWebShellCID, WEB_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDocumentLoaderCID, WEB_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kThrobberCID, WEB_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kPrefCID, PREF_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCPluginHostCID, PLUGIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCParserCID, PARSER_DLL, PR_FALSE, PR_FALSE);
}

Просмотреть файл

@ -108,7 +108,7 @@ nsViewerApp::SetupRegistry()
// Register our browser window factory
nsIFactory* bwf;
NS_NewBrowserWindowFactory(&bwf);
NSRepository::RegisterFactory(kBrowserWindowCID, bwf, PR_FALSE);
nsRepository::RegisterFactory(kBrowserWindowCID, bwf, PR_FALSE);
return NS_OK;
}
@ -124,7 +124,7 @@ nsViewerApp::Initialize(int argc, char** argv)
}
// Create widget application shell
rv = NSRepository::CreateInstance(kAppShellCID, nsnull, kIAppShellIID,
rv = nsRepository::CreateInstance(kAppShellCID, nsnull, kIAppShellIID,
(void**)&mAppShell);
if (NS_OK != rv) {
return rv;
@ -133,7 +133,7 @@ nsViewerApp::Initialize(int argc, char** argv)
mAppShell->SetDispatchListener((nsDispatchListener*) this);
// Load preferences
rv = NSRepository::CreateInstance(kPrefCID, NULL, kIPrefIID,
rv = nsRepository::CreateInstance(kPrefCID, NULL, kIPrefIID,
(void **) &mPrefs);
if (NS_OK != rv) {
return rv;
@ -362,7 +362,7 @@ nsViewerApp::OpenWindow()
// browser window. For the time being the reference is released by the
// browser event handling code during processing of the NS_DESTROY event...
nsBrowserWindow* bw = nsnull;
nsresult rv = NSRepository::CreateInstance(kBrowserWindowCID, nsnull,
nsresult rv = nsRepository::CreateInstance(kBrowserWindowCID, nsnull,
kIBrowserWindowIID,
(void**) &bw);
bw->SetApp(this);
@ -402,7 +402,7 @@ nsViewerApp::OpenWindow(PRUint32 aNewChromeMask, nsIBrowserWindow*& aNewWindow)
{
// Create browser window
nsBrowserWindow* bw = nsnull;
nsresult rv = NSRepository::CreateInstance(kBrowserWindowCID, nsnull,
nsresult rv = nsRepository::CreateInstance(kBrowserWindowCID, nsnull,
kIBrowserWindowIID,
(void**) &bw);
bw->SetApp(this);

Просмотреть файл

@ -295,7 +295,7 @@ void nsWindow::InitDeviceContext(nsIDeviceContext *aContext,nsNativeWidget aPare
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
res = NSRepository::CreateInstance(kDeviceContextCID,
res = nsRepository::CreateInstance(kDeviceContextCID,
nsnull,
kDeviceContextIID,
(void **)&mContext);
@ -725,7 +725,7 @@ nsIRenderingContext* nsWindow::GetRenderingContext()
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
res = NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&ctx);
res = nsRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&ctx);
if (NS_OK == res)
{
@ -948,7 +948,7 @@ nsRect rr;
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
if (NS_OK == NSRepository::CreateInstance(kRenderingContextCID,
if (NS_OK == nsRepository::CreateInstance(kRenderingContextCID,
nsnull,
kRenderingContextIID,
(void **)&event.renderingContext))

Просмотреть файл

@ -280,7 +280,7 @@ void nsWindow::InitDeviceContext(nsIDeviceContext *aContext,
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
//res = !NS_OK;
res = NSRepository::CreateInstance(kDeviceContextCID,
res = nsRepository::CreateInstance(kDeviceContextCID,
nsnull,
kDeviceContextIID,
(void **)&mContext);
@ -1030,7 +1030,7 @@ nsIRenderingContext* nsWindow::GetRenderingContext()
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
res = NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&ctx);
res = nsRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&ctx);
if (NS_OK == res)
ctx->Init(mContext, this);
@ -1300,7 +1300,7 @@ PRBool nsWindow::OnPaint(nsPaintEvent &event)
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
if (NS_OK == NSRepository::CreateInstance(kRenderingContextCID,
if (NS_OK == nsRepository::CreateInstance(kRenderingContextCID,
nsnull,
kRenderingContextIID,
(void **)&event.renderingContext))

Просмотреть файл

@ -494,7 +494,7 @@ void nsWindow::Create(nsIWidget *aParent,
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext);
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext);
if (NS_OK == res)
mContext->Init(nsnull);
@ -605,7 +605,7 @@ void nsWindow::Create(nsNativeWidget aParent,
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext);
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext);
if (NS_OK == res)
mContext->Init(nsnull);
@ -1239,7 +1239,7 @@ nsRect bounds;
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
res = NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&renderingCtx);
res = nsRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&renderingCtx);
if (NS_OK == res)
renderingCtx->Init(mContext, this);
@ -1882,7 +1882,7 @@ PRBool nsWindow::OnPaint()
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
if (NS_OK == NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&event.renderingContext))
if (NS_OK == nsRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&event.renderingContext))
{
event.renderingContext->Init(mContext, this);
result = DispatchEvent(&event);

Просмотреть файл

@ -413,10 +413,10 @@ nsresult CreateApplication(int * argc, char ** argv)
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
// register widget classes
static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID);
@ -433,20 +433,20 @@ nsresult CreateApplication(int * argc, char ** argv)
static NS_DEFINE_IID(kCTextFieldCID, NS_TEXTFIELD_CID);
static NS_DEFINE_IID(kCLookAndFeelCID, NS_LOOKANDFEEL_CID);
NSRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCLookAndFeelCID, WIDGET_DLL, PR_FALSE, PR_FALSE)
nsRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCLookAndFeelCID, WIDGET_DLL, PR_FALSE, PR_FALSE)
;
//NS_InitToolkit(PR_GetCurrentThread());
@ -455,7 +455,7 @@ nsresult CreateApplication(int * argc, char ** argv)
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&scribbleData.mContext);
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&scribbleData.mContext);
if (NS_OK == res)
scribbleData.mContext->Init(nsnull);
@ -463,18 +463,18 @@ nsresult CreateApplication(int * argc, char ** argv)
// Create an application shell
nsIAppShell *appShell;
NSRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID,
nsRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID,
(void**)&appShell);
appShell->Create(argc, argv);
//nsILookAndFeel *laf;
//NSRepository::CreateInstance(kCLookAndFeelCID, nsnull, kILookAndFeelIID,(void**)&laf);
//nsRepository::CreateInstance(kCLookAndFeelCID, nsnull, kILookAndFeelIID,(void**)&laf);
//
// create the main window
//
NSRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID,
nsRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID,
(void **)&(scribbleData.mainWindow));
nsRect rect(100, 100, 600, 700);
scribbleData.mainWindow->Create((nsIWidget*)NULL,
@ -491,7 +491,7 @@ nsresult CreateApplication(int * argc, char ** argv)
//
nsIWidget *controlPane;
rect.SetRect(0, 0, 200, 700);
NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void **)&controlPane);
nsRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void **)&controlPane);
controlPane->Create(scribbleData.mainWindow, rect, HandleEventControlPane, NULL);
//controlPane->SetBackgroundColor(laf->GetColor(nsLAF::WindowBackground));
controlPane->SetBackgroundColor(NS_RGB(0,0,255));
@ -505,7 +505,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "Scribble" check button
rect.SetRect(50, 50, 100, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void **)&(scribbleData.scribble));
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void **)&(scribbleData.scribble));
scribbleData.scribble->Create(controlPane, rect, HandleEventRadioButton, NULL);
nsString cbLabel("Scribble");
scribbleData.scribble->SetLabel(cbLabel);
@ -516,7 +516,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "Lines" check button
rect.SetRect(50, 75, 100, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void **)&(scribbleData.lines));
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void **)&(scribbleData.lines));
scribbleData.lines->Create(controlPane, rect, HandleEventRadioButton, NULL);
nsString cbLabel1("Lines");
scribbleData.lines->SetLabel(cbLabel1);
@ -531,7 +531,7 @@ nsresult CreateApplication(int * argc, char ** argv)
nsICheckButton * checkButton;
rect.SetRect(50, 200, 100, 25);
NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void **)&checkButton);
nsRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void **)&checkButton);
checkButton->Create(controlPane, rect, HandleEventCheck, NULL);
nsString cbLabel2("Circles");
checkButton->SetLabel(cbLabel2);
@ -542,7 +542,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "Rectangles" check button
rect.SetRect(50, 225, 100, 25);
NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void **)&checkButton);
nsRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void **)&checkButton);
checkButton->Create(controlPane, rect, HandleEventCheck, NULL);
nsString cbLabel3("Rectangles");
checkButton->SetLabel(cbLabel3);
@ -558,7 +558,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "red" text widget
rect.SetRect(100, y, 50, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.red));
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.red));
scribbleData.red->Create(controlPane, rect, HandleEventText, NULL);
nsString initText("0");
scribbleData.red->SetText(initText);
@ -569,7 +569,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "green" text widget
rect.SetRect(100, y, 50, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.green));
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.green));
scribbleData.green->Create(controlPane, rect, HandleEventText, NULL);
scribbleData.green->SetText(initText);
scribbleData.green->SetBackgroundColor(NS_RGB(255, 0, 0));
@ -579,7 +579,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the "blue" text widget
rect.SetRect(100, y, 50, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.blue));
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void **)&(scribbleData.blue));
scribbleData.blue->Create(controlPane, rect, HandleEventText, NULL);
scribbleData.blue->SetText(initText);
scribbleData.blue->SetBackgroundColor(NS_RGB(0, 255, 0));
@ -592,7 +592,7 @@ nsresult CreateApplication(int * argc, char ** argv)
//
nsIButton *button;
rect.SetRect(50, 500, 100, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **)&button);
button->Create(controlPane, rect, HandleEventButton, NULL);
nsString label("Clear");
button->SetLabel(label);
@ -605,7 +605,7 @@ nsresult CreateApplication(int * argc, char ** argv)
// create the draw pane
//
rect.SetRect(200, 0, 400, 700);
NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void **)&scribbleData.drawPane);
nsRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void **)&scribbleData.drawPane);
scribbleData.drawPane->Create(scribbleData.mainWindow, rect, HandleEventGraphicPane, NULL);
//scribbleData.drawPane->SetBackgroundColor(laf->GetColor(nsLAF::WindowBackground));
scribbleData.drawPane->SetBackgroundColor(NS_RGB(255,250,250));

Просмотреть файл

@ -397,7 +397,7 @@ int createTestButton(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsIButton *button;
nsRect rect(aX, aY, aWidth, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **) &button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **) &button);
button->Create(window, rect, aHandleEventFunction, NULL);
nsString label(aTitle);
button->SetLabel(label);
@ -417,7 +417,7 @@ nsIButton* createSimpleButton(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsIButton *button;
nsRect rect(aX, aY, aWidth, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(aWin, rect, aHandleEventFunction, NULL);
nsString label(aTitle);
button->SetLabel(label);
@ -438,7 +438,7 @@ nsITooltipWidget* createTooltipWindow(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsITooltipWidget *tooltip;
nsRect rect(aX, aY, aWidth, 40);
NSRepository::CreateInstance(kCTooltipWidgetCID, nsnull, kITooltipWidgetIID, (void**)&tooltip);
nsRepository::CreateInstance(kCTooltipWidgetCID, nsnull, kITooltipWidgetIID, (void**)&tooltip);
tooltip->Create((nsIWidget*)NULL, rect, aHandleEventFunction, NULL);
nsIButton *toolTipButton = createSimpleButton(tooltip, "tooltip",5, 5, 80, 0);
tooltip->Show(PR_TRUE);
@ -970,7 +970,7 @@ nsEventStatus PR_CALLBACK HandleFileButtonEvent(nsGUIEvent *aEvent)
nsIFileWidget *fileWidget;
nsString title("FileWidget Title <here> mode = save");
NSRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsString titles[] = {"all files","html","executables" };
nsString filters[] = {"*.*", "*.html", "*.exe" };
@ -1124,24 +1124,24 @@ nsresult WidgetTest(int *argc, char **argv)
}
// register widget classes
NSRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
#ifdef NOTNOW
NSRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTabWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTooltipWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTabWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTooltipWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
@ -1150,10 +1150,10 @@ nsresult WidgetTest(int *argc, char **argv)
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
#endif
@ -1163,14 +1163,14 @@ nsresult WidgetTest(int *argc, char **argv)
//static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
//NSRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
//NSRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
//NSRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
//nsRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
//nsRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
//nsRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
// Create a application shell
nsIAppShell *appShell;
NSRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID, (void**)&appShell);
nsRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID, (void**)&appShell);
if (appShell != nsnull) {
appShell->Create(argc, argv);
} else {
@ -1188,7 +1188,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
// create the main window
//
NSRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (void**)&window);
nsRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (void**)&window);
nsRect rect(100, 100, 600, 700);
//nsRect rect(100, 100, 600, 600);
window->Create((nsIWidget*) nsnull, rect, HandleEvent,
@ -1201,7 +1201,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
// Create Device Context based on main window
//
res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&deviceContext);
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&deviceContext);
if (NS_OK == res)
{
@ -1219,7 +1219,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
nsIButton *button;
rect.SetRect(x, y, 60, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, HandleEvent, NULL);
nsString label("Slider");
button->SetLabel(label);
@ -1262,7 +1262,7 @@ nsresult WidgetTest(int *argc, char **argv)
int y = 10;
rect.SetRect(x, y, 100, 100);
NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void**)&child);
nsRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void**)&child);
#if 0
child->SetBorderStyle(eBorderStyle_dialog);
@ -1288,7 +1288,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsICheckButton * checkButton;
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void**)&checkButton);
nsRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void**)&checkButton);
checkButton->Create(window, rect, CheckButtonTestHandleEvent, NULL);
nsString cbLabel("CheckButton");
checkButton->SetLabel(cbLabel);
@ -1303,7 +1303,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * textWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&textWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&textWidget);
textWidget->Create(window, rect, HandleEvent, deviceContext);
@ -1329,7 +1329,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * ptextWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&ptextWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&ptextWidget);
ptextWidget->SetPassword(PR_TRUE);
ptextWidget->Create(window, rect, HandleEvent, NULL);
nsString pinitialText("password text");
@ -1360,7 +1360,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * rtextWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&rtextWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&rtextWidget);
rtextWidget->SetReadOnly(PR_TRUE);
rtextWidget->Create(window, rect, HandleEvent, NULL);
nsString rinitialText("This is readonly");
@ -1374,7 +1374,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextAreaWidget * textAreaWidget;
rect.SetRect(x, y, 150, 100);
NSRepository::CreateInstance(kCTextAreaCID, nsnull, kITextAreaWidgetIID, (void**)&textAreaWidget);
nsRepository::CreateInstance(kCTextAreaCID, nsnull, kITextAreaWidgetIID, (void**)&textAreaWidget);
textAreaWidget->Create(window, rect, HandleEvent, NULL);
nsString textAreaInitialText("Text Area Widget");
textWidgetInstance = textAreaWidget;
@ -1391,7 +1391,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a scrollbar
//
rect.SetRect(x, 10, 25, 300);
NSRepository::CreateInstance(kCVertScrollbarCID, nsnull, kIScrollbarIID, (void**)&scrollbar);
nsRepository::CreateInstance(kCVertScrollbarCID, nsnull, kIScrollbarIID, (void**)&scrollbar);
scrollbar->Create(window, rect, HandleEvent, NULL);
scrollbar->SetMaxRange(300);
scrollbar->SetThumbSize(50);
@ -1403,7 +1403,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
y = 10;
rect.SetRect(x, y, 350, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&statusText);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&statusText);
statusText->Create(window, rect, HandleEvent, deviceContext);
statusText->Show(PR_TRUE);
y += rect.height + 5;
@ -1412,7 +1412,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a Failed Button
//
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, FailedButtonHandleEvent, NULL);
nsString failedLabel("Failed");
button->SetLabel(failedLabel);
@ -1420,7 +1420,7 @@ nsresult WidgetTest(int *argc, char **argv)
//NS_RELEASE(button);
rect.SetRect(x, y+30, 150, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, DoSelfTests, NULL);
nsString selfTestLabel("Perform Self Tests");
button->SetLabel(selfTestLabel);
@ -1431,7 +1431,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a Succeeded Button
//
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, SucceededButtonHandleEvent, NULL);
nsString succeededLabel("Succeeded");
button->SetLabel(succeededLabel);
@ -1445,7 +1445,7 @@ nsresult WidgetTest(int *argc, char **argv)
y = saveY;
x = saveX;
rect.SetRect(x, y, 150, 100);
NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&listBox);
nsRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&listBox);
listBox->Create(window, rect, HandleEvent, NULL);
listBox->Show(PR_TRUE);
char str[256];
@ -1469,7 +1469,7 @@ nsresult WidgetTest(int *argc, char **argv)
rect.SetRect(x, y, 150, 100);
//#ifdef XP_PC
NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&gMultiListBox);
nsRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&gMultiListBox);
// Notice the extra agrument PR_TRUE below which indicates that
// the list widget is multi-select
gMultiListBox->SetMultipleSelection(PR_TRUE);
@ -1494,7 +1494,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(300, 500, 200, 50);
#ifdef XP_PC
NSRepository::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (void**)&tabWidget);
nsRepository::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (void**)&tabWidget);
tabWidget->Create(window, rect, HandleTabEvent, NULL);
nsString tabs[] = {"low", "medium", "high" };
@ -1508,7 +1508,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsIRadioButton * radioButton;
rect.SetRect(x, y, 120, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
radioButton->Create(window, rect, HandleEvent, NULL);
nsString rbLabel("RadioButton1");
radioButton->SetLabel(rbLabel);
@ -1522,7 +1522,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(x, y, 120, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
radioButton->Create(window, rect, HandleEvent, NULL);
nsString rbLabel2("RadioButton2");
radioButton->SetLabel(rbLabel2);
@ -1538,7 +1538,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(x, y, 120, 100);
NSRepository::CreateInstance(kCComboBoxCID, nsnull, kIComboBoxIID, (void**)&comboBox);
nsRepository::CreateInstance(kCComboBoxCID, nsnull, kIComboBoxIID, (void**)&comboBox);
comboBox->Create(window, rect, HandleEvent, NULL);
comboBox->Show(PR_TRUE);
for (i=0;i<NUM_COMBOBOX_ITEMS;i++) {

Просмотреть файл

@ -397,7 +397,7 @@ int createTestButton(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsIButton *button;
nsRect rect(aX, aY, aWidth, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **) &button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void **) &button);
button->Create(window, rect, aHandleEventFunction, NULL);
nsString label(aTitle);
button->SetLabel(label);
@ -417,7 +417,7 @@ nsIButton* createSimpleButton(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsIButton *button;
nsRect rect(aX, aY, aWidth, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(aWin, rect, aHandleEventFunction, NULL);
nsString label(aTitle);
button->SetLabel(label);
@ -438,7 +438,7 @@ nsITooltipWidget* createTooltipWindow(nsIWidget * aWin,
EVENT_CALLBACK aHandleEventFunction) {
nsITooltipWidget *tooltip;
nsRect rect(aX, aY, aWidth, 40);
NSRepository::CreateInstance(kCTooltipWidgetCID, nsnull, kITooltipWidgetIID, (void**)&tooltip);
nsRepository::CreateInstance(kCTooltipWidgetCID, nsnull, kITooltipWidgetIID, (void**)&tooltip);
tooltip->Create((nsIWidget*)NULL, rect, aHandleEventFunction, NULL);
nsIButton *toolTipButton = createSimpleButton(tooltip, "tooltip",5, 5, 80, 0);
tooltip->Show(PR_TRUE);
@ -969,7 +969,7 @@ nsEventStatus PR_CALLBACK HandleFileButtonEvent(nsGUIEvent *aEvent)
nsIFileWidget *fileWidget;
nsString title("FileWidget Title <here> mode = save");
NSRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsString titles[] = {"all files","html","executables" };
nsString filters[] = {"*.*", "*.html", "*.exe" };
@ -1123,22 +1123,22 @@ nsresult WidgetTest(int *argc, char **argv)
}
// register widget classes
NSRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTabWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCTooltipWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTabWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCTooltipWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCAppShellCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
@ -1147,14 +1147,14 @@ nsresult WidgetTest(int *argc, char **argv)
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
// Create a application shell
nsIAppShell *appShell;
NSRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID, (void**)&appShell);
nsRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID, (void**)&appShell);
if (appShell != nsnull) {
appShell->Create(argc, argv);
} else {
@ -1172,7 +1172,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
// create the main window
//
NSRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (void**)&window);
nsRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (void**)&window);
nsRect rect(100, 100, 600, 700);
window->Create((nsIWidget*) nsnull, rect, HandleEvent,
(nsIDeviceContext *) nsnull,
@ -1184,7 +1184,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
// Create Device Context based on main window
//
res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&deviceContext);
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&deviceContext);
if (NS_OK == res)
{
@ -1214,7 +1214,7 @@ nsresult WidgetTest(int *argc, char **argv)
int y = 10;
rect.SetRect(x, y, 100, 100);
NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void**)&child);
nsRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (void**)&child);
#if 0
child->SetBorderStyle(eBorderStyle_dialog);
@ -1234,7 +1234,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
nsIButton *button;
rect.SetRect(x, y, 60, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, HandleEvent, NULL);
nsString label("Slider");
button->SetLabel(label);
@ -1263,7 +1263,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsICheckButton * checkButton;
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void**)&checkButton);
nsRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (void**)&checkButton);
checkButton->Create(window, rect, CheckButtonTestHandleEvent, NULL);
nsString cbLabel("CheckButton");
checkButton->SetLabel(cbLabel);
@ -1278,7 +1278,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * textWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&textWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&textWidget);
textWidget->Create(window, rect, HandleEvent, deviceContext);
@ -1304,7 +1304,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * ptextWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&ptextWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&ptextWidget);
ptextWidget->SetPassword(PR_TRUE);
ptextWidget->Create(window, rect, HandleEvent, NULL);
nsString pinitialText("password text");
@ -1335,7 +1335,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextWidget * rtextWidget;
rect.SetRect(x, y, 100, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&rtextWidget);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&rtextWidget);
rtextWidget->SetReadOnly(PR_TRUE);
rtextWidget->Create(window, rect, HandleEvent, NULL);
nsString rinitialText("This is readonly");
@ -1349,7 +1349,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsITextAreaWidget * textAreaWidget;
rect.SetRect(x, y, 150, 100);
NSRepository::CreateInstance(kCTextAreaCID, nsnull, kITextAreaWidgetIID, (void**)&textAreaWidget);
nsRepository::CreateInstance(kCTextAreaCID, nsnull, kITextAreaWidgetIID, (void**)&textAreaWidget);
textAreaWidget->Create(window, rect, HandleEvent, NULL);
nsString textAreaInitialText("Text Area Widget");
textWidgetInstance = textAreaWidget;
@ -1366,7 +1366,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a scrollbar
//
rect.SetRect(x, 10, 25, 300);
NSRepository::CreateInstance(kCVertScrollbarCID, nsnull, kIScrollbarIID, (void**)&scrollbar);
nsRepository::CreateInstance(kCVertScrollbarCID, nsnull, kIScrollbarIID, (void**)&scrollbar);
scrollbar->Create(window, rect, HandleEvent, NULL);
scrollbar->SetMaxRange(300);
scrollbar->SetThumbSize(50);
@ -1378,7 +1378,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
y = 10;
rect.SetRect(x, y, 350, TEXT_HEIGHT);
NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&statusText);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&statusText);
statusText->Create(window, rect, HandleEvent, deviceContext);
statusText->Show(PR_TRUE);
y += rect.height + 5;
@ -1387,7 +1387,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a Failed Button
//
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, FailedButtonHandleEvent, NULL);
nsString failedLabel("Failed");
button->SetLabel(failedLabel);
@ -1395,7 +1395,7 @@ nsresult WidgetTest(int *argc, char **argv)
//NS_RELEASE(button);
rect.SetRect(x, y+30, 150, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, DoSelfTests, NULL);
nsString selfTestLabel("Perform Self Tests");
button->SetLabel(selfTestLabel);
@ -1406,7 +1406,7 @@ nsresult WidgetTest(int *argc, char **argv)
// create a Succeeded Button
//
rect.SetRect(x, y, 100, 25);
NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
nsRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (void**)&button);
button->Create(window, rect, SucceededButtonHandleEvent, NULL);
nsString succeededLabel("Succeeded");
button->SetLabel(succeededLabel);
@ -1420,7 +1420,7 @@ nsresult WidgetTest(int *argc, char **argv)
y = saveY;
x = saveX;
rect.SetRect(x, y, 150, 100);
NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&listBox);
nsRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&listBox);
listBox->Create(window, rect, HandleEvent, NULL);
listBox->Show(PR_TRUE);
char str[256];
@ -1444,7 +1444,7 @@ nsresult WidgetTest(int *argc, char **argv)
rect.SetRect(x, y, 150, 100);
//#ifdef XP_PC
NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&gMultiListBox);
nsRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (void**)&gMultiListBox);
// Notice the extra agrument PR_TRUE below which indicates that
// the list widget is multi-select
gMultiListBox->SetMultipleSelection(PR_TRUE);
@ -1469,7 +1469,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(300, 500, 200, 50);
#ifdef XP_PC
NSRepository::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (void**)&tabWidget);
nsRepository::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (void**)&tabWidget);
tabWidget->Create(window, rect, HandleTabEvent, NULL);
nsString tabs[] = {"low", "medium", "high" };
@ -1483,7 +1483,7 @@ nsresult WidgetTest(int *argc, char **argv)
nsIRadioButton * radioButton;
rect.SetRect(x, y, 120, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
radioButton->Create(window, rect, HandleEvent, NULL);
nsString rbLabel("RadioButton1");
radioButton->SetLabel(rbLabel);
@ -1497,7 +1497,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(x, y, 120, 25);
NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
nsRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (void**)&radioButton);
radioButton->Create(window, rect, HandleEvent, NULL);
nsString rbLabel2("RadioButton2");
radioButton->SetLabel(rbLabel2);
@ -1513,7 +1513,7 @@ nsresult WidgetTest(int *argc, char **argv)
//
rect.SetRect(x, y, 120, 100);
NSRepository::CreateInstance(kCComboBoxCID, nsnull, kIComboBoxIID, (void**)&comboBox);
nsRepository::CreateInstance(kCComboBoxCID, nsnull, kIComboBoxIID, (void**)&comboBox);
comboBox->Create(window, rect, HandleEvent, NULL);
comboBox->Show(PR_TRUE);
for (i=0;i<NUM_COMBOBOX_ITEMS;i++) {

Просмотреть файл

@ -37,8 +37,8 @@
#endif
#endif
nsHashtable *NSRepository::factories = NULL;
PRMonitor *NSRepository::monitor = NULL;
nsHashtable *nsRepository::factories = NULL;
PRMonitor *nsRepository::monitor = NULL;
static PRLogModuleInfo *logmodule = NULL;
@ -220,7 +220,7 @@ static FactoryEntry *platformFind(const nsCID &aCID)
#endif // USE_NSREG
nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
nsresult nsRepository::loadFactory(FactoryEntry *aEntry,
nsIFactory **aFactory)
{
if (aFactory == NULL) {
@ -230,7 +230,7 @@ nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
if (aEntry->instance == NULL) {
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: + Loading \"%s\".", aEntry->library));
("nsRepository: + Loading \"%s\".", aEntry->library));
aEntry->instance = PR_LoadLibrary(aEntry->library);
}
if (aEntry->instance != NULL) {
@ -241,28 +241,28 @@ nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
return res;
}
PR_LOG(logmodule, PR_LOG_ERROR,
("NSRepository: NSGetFactory entrypoint not found."));
("nsRepository: NSGetFactory entrypoint not found."));
}
PR_LOG(logmodule, PR_LOG_ERROR,
("NSRepository: Library load unsuccessful."));
("nsRepository: Library load unsuccessful."));
return NS_ERROR_FACTORY_NOT_LOADED;
}
nsresult NSRepository::FindFactory(const nsCID &aClass,
nsresult nsRepository::FindFactory(const nsCID &aClass,
nsIFactory **aFactory)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Finding Factory.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Finding Factory.");
PR_LogPrint("nsRepository: + %s",
buf);
delete [] buf;
}
if (aFactory == NULL) {
PR_LOG(logmodule, PR_LOG_ERROR, ("NSRepository: !! NULL pointer."));
PR_LOG(logmodule, PR_LOG_ERROR, ("nsRepository: !! NULL pointer."));
return NS_ERROR_NULL_POINTER;
}
@ -296,13 +296,13 @@ nsresult NSRepository::FindFactory(const nsCID &aClass,
}
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Find Factory %s",
("nsRepository: ! Find Factory %s",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
nsresult NSRepository::checkInitialized(void)
nsresult nsRepository::checkInitialized(void)
{
nsresult res = NS_OK;
if (factories == NULL) {
@ -311,7 +311,7 @@ nsresult NSRepository::checkInitialized(void)
return res;
}
nsresult NSRepository::Initialize(void)
nsresult nsRepository::Initialize(void)
{
if (factories == NULL) {
factories = new nsHashtable();
@ -320,18 +320,18 @@ nsresult NSRepository::Initialize(void)
monitor = PR_NewMonitor();
}
if (logmodule == NULL) {
logmodule = PR_NewLogModule("NSRepository");
logmodule = PR_NewLogModule("nsRepository");
}
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: Initialized."));
("nsRepository: Initialized."));
#ifdef USE_NSREG
NR_StartupRegistry();
#endif
return NS_OK;
}
nsresult NSRepository::CreateInstance(const nsCID &aClass,
nsresult nsRepository::CreateInstance(const nsCID &aClass,
nsISupports *aDelegate,
const nsIID &aIID,
void **aResult)
@ -339,8 +339,8 @@ nsresult NSRepository::CreateInstance(const nsCID &aClass,
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Creating Instance.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Creating Instance.");
PR_LogPrint("nsRepository: + %s",
buf);
delete [] buf;
}
@ -361,7 +361,7 @@ nsresult NSRepository::CreateInstance(const nsCID &aClass,
return NS_ERROR_FACTORY_NOT_REGISTERED;
}
nsresult NSRepository::CreateInstance2(const nsCID &aClass,
nsresult nsRepository::CreateInstance2(const nsCID &aClass,
nsISupports *aDelegate,
const nsIID &aIID,
void *aSignature,
@ -369,10 +369,10 @@ nsresult NSRepository::CreateInstance2(const nsCID &aClass,
{
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Creating Instance.");
PR_LogPrint("NSRepository: + %s.",
PR_LogPrint("nsRepository: Creating Instance.");
PR_LogPrint("nsRepository: + %s.",
buf);
PR_LogPrint("NSRepository: + Signature = %p.",
PR_LogPrint("nsRepository: + Signature = %p.",
aSignature);
delete [] buf;
}
@ -403,17 +403,17 @@ nsresult NSRepository::CreateInstance2(const nsCID &aClass,
return NS_ERROR_FACTORY_NOT_REGISTERED;
}
nsresult NSRepository::RegisterFactory(const nsCID &aClass,
nsresult nsRepository::RegisterFactory(const nsCID &aClass,
nsIFactory *aFactory,
PRBool aReplace)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Registering Factory.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Registering Factory.");
PR_LogPrint("nsRepository: + %s",
buf);
PR_LogPrint("NSRepository: + Replace = %d.",
PR_LogPrint("nsRepository: + Replace = %d.",
(int) aReplace);
delete [] buf;
}
@ -425,7 +425,7 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
old->Release();
if (!aReplace) {
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory already registered."));
("nsRepository: ! Factory already registered."));
return NS_ERROR_FACTORY_EXISTS;
}
}
@ -438,12 +438,12 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory register succeeded."));
("nsRepository: ! Factory register succeeded."));
return NS_OK;
}
nsresult NSRepository::RegisterFactory(const nsCID &aClass,
nsresult nsRepository::RegisterFactory(const nsCID &aClass,
const char *aLibrary,
PRBool aReplace,
PRBool aPersist)
@ -451,10 +451,10 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Registering Factory.");
PR_LogPrint("NSRepository: + %s in \"%s\".",
PR_LogPrint("nsRepository: Registering Factory.");
PR_LogPrint("nsRepository: + %s in \"%s\".",
buf, aLibrary);
PR_LogPrint("NSRepository: + Replace = %d, Persist = %d.",
PR_LogPrint("nsRepository: + Replace = %d, Persist = %d.",
(int) aReplace, (int) aPersist);
delete [] buf;
}
@ -465,7 +465,7 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
old->Release();
if (!aReplace) {
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory already registered."));
("nsRepository: ! Factory already registered."));
return NS_ERROR_FACTORY_EXISTS;
}
}
@ -486,19 +486,19 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory register succeeded."));
("nsRepository: ! Factory register succeeded."));
return NS_OK;
}
nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
nsresult nsRepository::UnregisterFactory(const nsCID &aClass,
nsIFactory *aFactory)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Unregistering Factory.");
PR_LogPrint("NSRepository: + %s.", buf);
PR_LogPrint("nsRepository: Unregistering Factory.");
PR_LogPrint("nsRepository: + %s.", buf);
delete [] buf;
}
@ -522,20 +522,20 @@ nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
}
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory unregister %s.",
("nsRepository: ! Factory unregister %s.",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
nsresult nsRepository::UnregisterFactory(const nsCID &aClass,
const char *aLibrary)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Unregistering Factory.");
PR_LogPrint("NSRepository: + %s in \"%s\".", buf,
PR_LogPrint("nsRepository: Unregistering Factory.");
PR_LogPrint("nsRepository: + %s in \"%s\".", buf,
aLibrary);
delete [] buf;
}
@ -566,13 +566,13 @@ nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory unregister %s.",
("nsRepository: ! Factory unregister %s.",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData, void* closure)
{
FactoryEntry *entry = (FactoryEntry *) aData;
@ -583,7 +583,7 @@ static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
PRBool res = proc();
if (res) {
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: + Unloading \"%s\".", entry->library));
("nsRepository: + Unloading \"%s\".", entry->library));
PR_UnloadLibrary(entry->instance);
entry->instance = NULL;
}
@ -593,12 +593,12 @@ static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
return PR_TRUE;
}
nsresult NSRepository::FreeLibraries(void)
nsresult nsRepository::FreeLibraries(void)
{
PR_EnterMonitor(monitor);
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: Freeing Libraries."));
("nsRepository: Freeing Libraries."));
factories->Enumerate(freeLibraryEnum);
PR_ExitMonitor(monitor);

Просмотреть файл

@ -37,8 +37,8 @@
#endif
#endif
nsHashtable *NSRepository::factories = NULL;
PRMonitor *NSRepository::monitor = NULL;
nsHashtable *nsRepository::factories = NULL;
PRMonitor *nsRepository::monitor = NULL;
static PRLogModuleInfo *logmodule = NULL;
@ -220,7 +220,7 @@ static FactoryEntry *platformFind(const nsCID &aCID)
#endif // USE_NSREG
nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
nsresult nsRepository::loadFactory(FactoryEntry *aEntry,
nsIFactory **aFactory)
{
if (aFactory == NULL) {
@ -230,7 +230,7 @@ nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
if (aEntry->instance == NULL) {
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: + Loading \"%s\".", aEntry->library));
("nsRepository: + Loading \"%s\".", aEntry->library));
aEntry->instance = PR_LoadLibrary(aEntry->library);
}
if (aEntry->instance != NULL) {
@ -241,28 +241,28 @@ nsresult NSRepository::loadFactory(FactoryEntry *aEntry,
return res;
}
PR_LOG(logmodule, PR_LOG_ERROR,
("NSRepository: NSGetFactory entrypoint not found."));
("nsRepository: NSGetFactory entrypoint not found."));
}
PR_LOG(logmodule, PR_LOG_ERROR,
("NSRepository: Library load unsuccessful."));
("nsRepository: Library load unsuccessful."));
return NS_ERROR_FACTORY_NOT_LOADED;
}
nsresult NSRepository::FindFactory(const nsCID &aClass,
nsresult nsRepository::FindFactory(const nsCID &aClass,
nsIFactory **aFactory)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Finding Factory.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Finding Factory.");
PR_LogPrint("nsRepository: + %s",
buf);
delete [] buf;
}
if (aFactory == NULL) {
PR_LOG(logmodule, PR_LOG_ERROR, ("NSRepository: !! NULL pointer."));
PR_LOG(logmodule, PR_LOG_ERROR, ("nsRepository: !! NULL pointer."));
return NS_ERROR_NULL_POINTER;
}
@ -296,13 +296,13 @@ nsresult NSRepository::FindFactory(const nsCID &aClass,
}
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Find Factory %s",
("nsRepository: ! Find Factory %s",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
nsresult NSRepository::checkInitialized(void)
nsresult nsRepository::checkInitialized(void)
{
nsresult res = NS_OK;
if (factories == NULL) {
@ -311,7 +311,7 @@ nsresult NSRepository::checkInitialized(void)
return res;
}
nsresult NSRepository::Initialize(void)
nsresult nsRepository::Initialize(void)
{
if (factories == NULL) {
factories = new nsHashtable();
@ -320,18 +320,18 @@ nsresult NSRepository::Initialize(void)
monitor = PR_NewMonitor();
}
if (logmodule == NULL) {
logmodule = PR_NewLogModule("NSRepository");
logmodule = PR_NewLogModule("nsRepository");
}
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: Initialized."));
("nsRepository: Initialized."));
#ifdef USE_NSREG
NR_StartupRegistry();
#endif
return NS_OK;
}
nsresult NSRepository::CreateInstance(const nsCID &aClass,
nsresult nsRepository::CreateInstance(const nsCID &aClass,
nsISupports *aDelegate,
const nsIID &aIID,
void **aResult)
@ -339,8 +339,8 @@ nsresult NSRepository::CreateInstance(const nsCID &aClass,
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Creating Instance.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Creating Instance.");
PR_LogPrint("nsRepository: + %s",
buf);
delete [] buf;
}
@ -361,7 +361,7 @@ nsresult NSRepository::CreateInstance(const nsCID &aClass,
return NS_ERROR_FACTORY_NOT_REGISTERED;
}
nsresult NSRepository::CreateInstance2(const nsCID &aClass,
nsresult nsRepository::CreateInstance2(const nsCID &aClass,
nsISupports *aDelegate,
const nsIID &aIID,
void *aSignature,
@ -369,10 +369,10 @@ nsresult NSRepository::CreateInstance2(const nsCID &aClass,
{
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Creating Instance.");
PR_LogPrint("NSRepository: + %s.",
PR_LogPrint("nsRepository: Creating Instance.");
PR_LogPrint("nsRepository: + %s.",
buf);
PR_LogPrint("NSRepository: + Signature = %p.",
PR_LogPrint("nsRepository: + Signature = %p.",
aSignature);
delete [] buf;
}
@ -403,17 +403,17 @@ nsresult NSRepository::CreateInstance2(const nsCID &aClass,
return NS_ERROR_FACTORY_NOT_REGISTERED;
}
nsresult NSRepository::RegisterFactory(const nsCID &aClass,
nsresult nsRepository::RegisterFactory(const nsCID &aClass,
nsIFactory *aFactory,
PRBool aReplace)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Registering Factory.");
PR_LogPrint("NSRepository: + %s",
PR_LogPrint("nsRepository: Registering Factory.");
PR_LogPrint("nsRepository: + %s",
buf);
PR_LogPrint("NSRepository: + Replace = %d.",
PR_LogPrint("nsRepository: + Replace = %d.",
(int) aReplace);
delete [] buf;
}
@ -425,7 +425,7 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
old->Release();
if (!aReplace) {
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory already registered."));
("nsRepository: ! Factory already registered."));
return NS_ERROR_FACTORY_EXISTS;
}
}
@ -438,12 +438,12 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory register succeeded."));
("nsRepository: ! Factory register succeeded."));
return NS_OK;
}
nsresult NSRepository::RegisterFactory(const nsCID &aClass,
nsresult nsRepository::RegisterFactory(const nsCID &aClass,
const char *aLibrary,
PRBool aReplace,
PRBool aPersist)
@ -451,10 +451,10 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Registering Factory.");
PR_LogPrint("NSRepository: + %s in \"%s\".",
PR_LogPrint("nsRepository: Registering Factory.");
PR_LogPrint("nsRepository: + %s in \"%s\".",
buf, aLibrary);
PR_LogPrint("NSRepository: + Replace = %d, Persist = %d.",
PR_LogPrint("nsRepository: + Replace = %d, Persist = %d.",
(int) aReplace, (int) aPersist);
delete [] buf;
}
@ -465,7 +465,7 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
old->Release();
if (!aReplace) {
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory already registered."));
("nsRepository: ! Factory already registered."));
return NS_ERROR_FACTORY_EXISTS;
}
}
@ -486,19 +486,19 @@ nsresult NSRepository::RegisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory register succeeded."));
("nsRepository: ! Factory register succeeded."));
return NS_OK;
}
nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
nsresult nsRepository::UnregisterFactory(const nsCID &aClass,
nsIFactory *aFactory)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Unregistering Factory.");
PR_LogPrint("NSRepository: + %s.", buf);
PR_LogPrint("nsRepository: Unregistering Factory.");
PR_LogPrint("nsRepository: + %s.", buf);
delete [] buf;
}
@ -522,20 +522,20 @@ nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
}
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory unregister %s.",
("nsRepository: ! Factory unregister %s.",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
nsresult nsRepository::UnregisterFactory(const nsCID &aClass,
const char *aLibrary)
{
checkInitialized();
if (PR_LOG_TEST(logmodule, PR_LOG_ALWAYS)) {
char *buf = aClass.ToString();
PR_LogPrint("NSRepository: Unregistering Factory.");
PR_LogPrint("NSRepository: + %s in \"%s\".", buf,
PR_LogPrint("nsRepository: Unregistering Factory.");
PR_LogPrint("nsRepository: + %s in \"%s\".", buf,
aLibrary);
delete [] buf;
}
@ -566,13 +566,13 @@ nsresult NSRepository::UnregisterFactory(const nsCID &aClass,
PR_ExitMonitor(monitor);
PR_LOG(logmodule, PR_LOG_WARNING,
("NSRepository: ! Factory unregister %s.",
("nsRepository: ! Factory unregister %s.",
res == NS_OK ? "succeeded" : "failed"));
return res;
}
static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData, void* closure)
{
FactoryEntry *entry = (FactoryEntry *) aData;
@ -583,7 +583,7 @@ static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
PRBool res = proc();
if (res) {
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: + Unloading \"%s\".", entry->library));
("nsRepository: + Unloading \"%s\".", entry->library));
PR_UnloadLibrary(entry->instance);
entry->instance = NULL;
}
@ -593,12 +593,12 @@ static PRBool freeLibraryEnum(nsHashKey *aKey, void *aData)
return PR_TRUE;
}
nsresult NSRepository::FreeLibraries(void)
nsresult nsRepository::FreeLibraries(void)
{
PR_EnterMonitor(monitor);
PR_LOG(logmodule, PR_LOG_ALWAYS,
("NSRepository: Freeing Libraries."));
("nsRepository: Freeing Libraries."));
factories->Enumerate(freeLibraryEnum);
PR_ExitMonitor(monitor);

Просмотреть файл

@ -56,10 +56,10 @@ typedef nsresult (*nsUnregisterProc)(const char *path);
class FactoryEntry;
/*
* NSRepository class
* nsRepository class
*/
class NS_COM NSRepository {
class NS_COM nsRepository {
private:
static nsHashtable *factories;
static PRMonitor *monitor;

Просмотреть файл

@ -30,7 +30,7 @@ int main(int argc, char **argv) {
RegisterTestFactories();
ITestClass *t = NULL;
NSRepository::CreateInstance(kTestFactoryCID,
nsRepository::CreateInstance(kTestFactoryCID,
NULL,
kTestClassIID,
(void **) &t);
@ -44,7 +44,7 @@ int main(int argc, char **argv) {
t = NULL;
NSRepository::CreateInstance(kTestLoadedFactoryCID,
nsRepository::CreateInstance(kTestLoadedFactoryCID,
NULL,
kTestClassIID,
(void **) &t);
@ -56,7 +56,7 @@ int main(int argc, char **argv) {
cout << "Dynamic CreateInstance failed\n";
}
NSRepository::FreeLibraries();
nsRepository::FreeLibraries();
return 0;
}
@ -130,12 +130,12 @@ nsresult TestFactory::CreateInstance(nsISupports *aDelegate,
*/
extern "C" void RegisterTestFactories() {
NSRepository::RegisterFactory(kTestFactoryCID, new TestFactory(),
nsRepository::RegisterFactory(kTestFactoryCID, new TestFactory(),
PR_FALSE);
// Windows can use persistant registry
#ifndef USE_NSREG
NSRepository::RegisterFactory(kTestLoadedFactoryCID,
nsRepository::RegisterFactory(kTestLoadedFactoryCID,
"libtestdynamic.so",
PR_FALSE,
PR_TRUE);

Просмотреть файл

@ -128,11 +128,11 @@ extern "C" NS_EXPORT PRBool NSCanUnload() {
extern "C" NS_EXPORT nsresult NSRegisterSelf(const char *path)
{
return NSRepository::RegisterFactory(kTestLoadedFactoryCID, path,
return nsRepository::RegisterFactory(kTestLoadedFactoryCID, path,
PR_TRUE, PR_TRUE);
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(const char *path)
{
return NSRepository::UnregisterFactory(kTestLoadedFactoryCID, path);
return nsRepository::UnregisterFactory(kTestLoadedFactoryCID, path);
}