Tweaks to remove XFE dependencies from other parts of the tree. Approved by {gagan,malmer,ramiro}%netscape.com.

This commit is contained in:
cls%seawood.org 1998-09-02 07:02:04 +00:00
Родитель efc4421e7b
Коммит 52c74ded1d
5 изменённых файлов: 62 добавлений и 44 удалений

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

@ -5623,7 +5623,7 @@ fe_PrintDialog (MWContext *context)
*/
int
XFE_AskStreamQuestion (MWContext *context)
FE_AskStreamQuestion (MWContext *context)
{
struct fe_confirm_data data;
Widget mainw = CONTEXT_WIDGET (context);

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

@ -43,6 +43,9 @@
#include <stddef.h>
#include <pwd.h>
#include <Xm/Xm.h>
#undef Bool
#include "mozilla.h"
#include "xfe.h"
#include "fonts.h"
@ -1913,3 +1916,46 @@ Bool fe_CheckVersionAndSavePrefs(char *filename,
return (XFE_SavePrefs ((char *) fe_globalData.user_prefs_file, prefs));
}
}
extern
XP_Bool
FE_GetLabelAndMnemonic(char* name, char** str, void* v_xm_str, void* v_mnemonic)
{
XmString *xm_str = (XmString*)v_xm_str;
KeySym *mnemonic = (KeySym*)v_mnemonic;
char buf[256];
char* _str;
char* p1;
char* p2;
XP_ASSERT(name);
XP_ASSERT(str);
XP_ASSERT(xm_str);
if ( name == NULL || str == NULL || xm_str == NULL ) return FALSE;
_str = NULL;
*str = NULL;
*xm_str = NULL;
*mnemonic = '\0';
strncpy(buf, name, 200);
strcat(buf, ".label");
PREF_CopyConfigString(buf, &_str);
if ( _str == NULL || *_str == '\0' ) return FALSE;
/* Strip out ampersands */
if ( strchr(_str, '&') != NULL ) {
for ( p1 = _str, p2 = _str; *p2; p1++, p2++ ) {
if ( *p1 == '&' && *(++p1) != '&' ) *mnemonic = *p1;
*p2 = *p1;
}
}
*str = _str;
*xm_str = XmStringCreateLtoR(_str, XmFONTLIST_DEFAULT_TAG);
return ( *xm_str != NULL );
}

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

@ -1326,6 +1326,17 @@ PRBool FE_IsNetscapeDefault(void);
PRBool FE_MakeNetscapeDefault(void);
#endif
#ifdef XP_UNIX
/* This should be a FE specific feature. -cls */
extern XP_Bool
FE_GetLabelAndMnemonic(char* name, char** str, void* v_xm_str, void* v_mnemonic
);
/* To stream or not to stream, that is the question to the FE. -cls */
extern int
FE_AskStreamQuestion(MWContext* window_id);
#endif
XP_END_PROTOS
#endif /* _FrontEnd_ */

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

@ -25,8 +25,7 @@
#include "jsapi.h"
#include "jsbuffer.h"
#include "xpassert.h"
#include <Xm/Xm.h>
#include "fe_proto.h"
extern PRLibrary* pref_LoadAutoAdminLib(void);
extern PRLibrary* m_AutoAdminLib;
@ -79,50 +78,14 @@ PREF_AlterSplashIcon(struct fe_icon_data* icon)
}
}
/*
* PREF_GetLabelAndMnemonic
*/
XP_Bool
PREF_GetLabelAndMnemonic(char* name, char** str, void* v_xm_str, void* v_mnemonic)
{
XmString *xm_str = (XmString*)v_xm_str;
KeySym *mnemonic = (KeySym*)v_mnemonic;
char buf[256];
char* _str;
char* p1;
char* p2;
XP_ASSERT(name);
XP_ASSERT(str);
XP_ASSERT(xm_str);
if ( name == NULL || str == NULL || xm_str == NULL ) return FALSE;
_str = NULL;
*str = NULL;
*xm_str = NULL;
*mnemonic = '\0';
strncpy(buf, name, 200);
strcat(buf, ".label");
PREF_CopyConfigString(buf, &_str);
if ( _str == NULL || *_str == '\0' ) return FALSE;
/* Strip out ampersands */
if ( strchr(_str, '&') != NULL ) {
for ( p1 = _str, p2 = _str; *p2; p1++, p2++ ) {
if ( *p1 == '&' && *(++p1) != '&' ) *mnemonic = *p1;
*p2 = *p1;
}
}
*str = _str;
*xm_str = XmStringCreateLtoR(_str, XmFONTLIST_DEFAULT_TAG);
return ( *xm_str != NULL );
/* Code moved to where it should have been. */
return FE_GetLabelAndMnemonic(name, str, v_xm_str, v_mnemonic);
}

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

@ -439,12 +439,10 @@ NET_ExtViewerConverter (int format_out,
* 0 No, don't stream data, play from the file
* 1 Yes, stream the data from the network
*/
int XFE_AskStreamQuestion(MWContext * window_id); /* definition */
if (NET_URL_Type (URL_s->address) == ABOUT_TYPE_URL)
yes_stream = 1;
else
yes_stream = XFE_AskStreamQuestion(window_id);
yes_stream = FE_AskStreamQuestion(window_id);
if(yes_stream == -1)
{