зеркало из https://github.com/mozilla/gecko-dev.git
backing out linux build bustage. see bug #6331
This commit is contained in:
Родитель
955042c9de
Коммит
9ae1f6b61f
|
@ -21,17 +21,24 @@
|
|||
#include "plevent.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsICmdLineService.h"
|
||||
#include "nsXPComCIID.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "nsIWidget.h"
|
||||
|
||||
//#define CMDLINEARGS
|
||||
|
||||
#ifdef CMDLINEARGS
|
||||
#include "nsICmdLineService.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
|
||||
|
||||
#ifdef CMDLINEARGS
|
||||
static NS_DEFINE_IID(kCmdLineServiceCID, NS_COMMANDLINE_SERVICE_CID);
|
||||
static NS_DEFINE_IID(kICmdLineServiceIID, NS_ICOMMANDLINE_SERVICE_IID);
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -83,31 +90,32 @@ static void event_processor_callback(gpointer data,
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifdef CMDLINEARGS
|
||||
NS_METHOD nsAppShell::Create(int *bac, char **bav)
|
||||
#else
|
||||
NS_METHOD nsAppShell::Create(int *argc, char **argv)
|
||||
#endif
|
||||
|
||||
{
|
||||
gchar *home;
|
||||
gchar *path;
|
||||
|
||||
#ifdef CMDLINEARGS
|
||||
int *argc;
|
||||
char **argv;
|
||||
// why do i get an error if this is defined here??
|
||||
// nsICmdLineService *cmdLineArgs=nsnull;
|
||||
nsICmdLineService *cmdLineArgs=nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
NS_WITH_SERVICE(nsICmdLineService, cmdLineArgs, kCmdLineServiceCID, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = cmdLineArgs->GetArgc(argc);
|
||||
if(NS_FAILED(rv))
|
||||
argc = bac;
|
||||
if(NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = cmdLineArgs->GetArgv(&argv);
|
||||
if(NS_FAILED(rv))
|
||||
argv = bav;
|
||||
} else {
|
||||
argc = bac;
|
||||
argv = bav;
|
||||
}
|
||||
if(NS_FAILED(rv)) return rv;
|
||||
|
||||
#endif
|
||||
gtk_set_locale ();
|
||||
|
||||
gtk_init (argc, &argv);
|
||||
|
@ -117,9 +125,9 @@ NS_METHOD nsAppShell::Create(int *bac, char **bav)
|
|||
gdk_rgb_init();
|
||||
|
||||
home = g_get_home_dir();
|
||||
if ((char*)nsnull != home) {
|
||||
if ( (char *) NULL != home ) {
|
||||
path = g_strdup_printf("%s%c%s", home, G_DIR_SEPARATOR, ".gtkrc");
|
||||
if ((char *)nsnull != path) {
|
||||
if ( (char *) NULL != path ) {
|
||||
gtk_rc_parse(path);
|
||||
g_free( path );
|
||||
}
|
||||
|
@ -228,6 +236,7 @@ void* nsAppShell::GetNativeData(PRUint32 aDataType)
|
|||
if (aDataType == NS_NATIVE_SHELL) {
|
||||
// this isn't accually used, but if it was, we need to gtk_widget_ref() it.
|
||||
|
||||
|
||||
// return mTopLevel;
|
||||
}
|
||||
return nsnull;
|
||||
|
@ -240,27 +249,23 @@ NS_METHOD nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *& aEvent)
|
|||
aEvent = 0;
|
||||
aRealEvent = PR_FALSE;
|
||||
event = gdk_event_peek();
|
||||
|
||||
if ((GdkEvent *) nsnull != event ) {
|
||||
if ( (GdkEvent *) NULL != event ) {
|
||||
aRealEvent = PR_TRUE;
|
||||
aEvent = event;
|
||||
} else
|
||||
g_main_iteration (PR_TRUE);
|
||||
|
||||
g_main_iteration (TRUE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
|
||||
{
|
||||
if ( aRealEvent == PR_TRUE )
|
||||
g_main_iteration (PR_TRUE);
|
||||
g_main_iteration (TRUE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsAppShell::EventIsForModalWindow(PRBool aRealEvent,
|
||||
void *aEvent,
|
||||
nsIWidget *aWidget,
|
||||
PRBool *aForWindow)
|
||||
NS_METHOD nsAppShell::EventIsForModalWindow(PRBool aRealEvent, void *aEvent,
|
||||
nsIWidget *aWidget, PRBool *aForWindow)
|
||||
{
|
||||
PRBool isInWindow, isMouseEvent;
|
||||
GdkEventAny *msg = (GdkEventAny *) aEvent;
|
||||
|
@ -278,7 +283,7 @@ NS_METHOD nsAppShell::EventIsForModalWindow(PRBool aRealEvent,
|
|||
|
||||
// Find top most window of event window
|
||||
GdkWindow *eWin = msg->window;
|
||||
if (nsnull != eWin) {
|
||||
if (NULL != eWin) {
|
||||
if (win == eWin) {
|
||||
isInWindow = PR_TRUE;
|
||||
}
|
||||
|
@ -286,16 +291,13 @@ NS_METHOD nsAppShell::EventIsForModalWindow(PRBool aRealEvent,
|
|||
}
|
||||
|
||||
isMouseEvent = PR_FALSE;
|
||||
switch (msg->type)
|
||||
{
|
||||
switch (msg->type) {
|
||||
case GDK_MOTION_NOTIFY:
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
isMouseEvent = PR_TRUE;
|
||||
default:
|
||||
isMouseEvent = PR_FALSE;
|
||||
}
|
||||
|
||||
*aForWindow = isInWindow == PR_TRUE ||
|
||||
|
|
Загрузка…
Ссылка в новой задаче