зеркало из https://github.com/mozilla/gecko-dev.git
Move all hardcoded strings into allxpstr. Bug fix from tenthumbs@cybernex.net in isNodeEditable(). HT Properties dialog changes (pretty, now). Better color support.
This commit is contained in:
Родитель
684762559e
Коммит
2eb40cf651
|
@ -125,6 +125,8 @@ typedef HT_NotificationStruct* HT_Notification;
|
|||
#define HT_EVENT_VIEW_WORKSPACE_REFRESH 0x00001000UL
|
||||
#define HT_EVENT_NODE_EDIT 0x00002000UL
|
||||
#define HT_EVENT_WORKSPACE_EDIT 0x00004000UL
|
||||
#define HT_EVENT_VIEW_HTML_ADD 0x00008000UL
|
||||
#define HT_EVENT_VIEW_HTML_REMOVE 0x00010000UL
|
||||
#define HT_EVENT_NO_NOTIFICATION_MASK 0x00000000UL
|
||||
#define HT_EVENT_DEFAULT_NOTIFICATION_MASK 0xFFFFFFFFUL
|
||||
|
||||
|
@ -477,6 +479,8 @@ PR_PUBLIC_API(RDF) RDF_GetNavCenterDB();
|
|||
PR_PUBLIC_API(void) HT_InformRDFOfNewDocument(char* address);
|
||||
|
||||
PR_PUBLIC_API(PRBool) HT_HasHTMLPane(HT_View htView);
|
||||
PR_PUBLIC_API(char *) HT_HTMLPaneHeight(HT_View htView);
|
||||
|
||||
PR_PUBLIC_API(void) HT_AddSitemapFor(HT_Pane htPane, char *pUrl, char *pSitemapUrl, char* name);
|
||||
PR_PUBLIC_API(void) HT_AddRelatedLinksFor(HT_Pane htPane, char *pUrl);
|
||||
PR_PUBLIC_API(void) HT_ExitPage(HT_Pane htPane, char *pUrl);
|
||||
|
|
|
@ -71,6 +71,7 @@ typedef struct _RDF_NCVocabStruct {
|
|||
RDF_Resource RDF_largeIcon;
|
||||
RDF_Resource RDF_Guide;
|
||||
RDF_Resource RDF_HTMLURL;
|
||||
RDF_Resource RDF_HTMLHeight;
|
||||
RDF_Resource RDF_LocalFiles;
|
||||
RDF_Resource RDF_Appletalk;
|
||||
RDF_Resource RDF_Mail;
|
||||
|
@ -90,6 +91,7 @@ typedef struct _RDF_NCVocabStruct {
|
|||
RDF_Resource RDF_resultType;
|
||||
RDF_Resource RDF_HTMLType;
|
||||
RDF_Resource RDF_Command;
|
||||
RDF_Resource RDF_URLShortcut;
|
||||
|
||||
/* NavCenter appearance styles */
|
||||
|
||||
|
|
|
@ -247,9 +247,7 @@ setAtalkResourceName(RDF_Resource u)
|
|||
{
|
||||
if (u == gNavCenter->RDF_Appletalk)
|
||||
{
|
||||
/* XXX localization */
|
||||
|
||||
val = copyString("Appletalk Zones and File Servers");
|
||||
val = copyString(XP_GetString(RDF_APPLETALK_TOP_NAME));
|
||||
}
|
||||
else if (startsWith("virtualzone://", resourceID(u)))
|
||||
{
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
/* atalk.c data structures and defines */
|
||||
|
||||
extern int RDF_APPLETALK_TOP_NAME;
|
||||
|
||||
|
||||
/* atalk.c function prototypes */
|
||||
|
||||
|
|
|
@ -59,17 +59,17 @@ ColumnsGetSlotValue(RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type
|
|||
if ((s == gCoreVocab->RDF_name) && (type == RDF_STRING_TYPE)
|
||||
&& (!inversep) && (tv))
|
||||
{
|
||||
/* XXX localization */
|
||||
if (u == gCoreVocab->RDF_name) val = copyString("Name");
|
||||
else if (u == gWebData->RDF_URL) val = copyString("URL");
|
||||
else if (u == gWebData->RDF_description) val = copyString("Description");
|
||||
else if (u == gWebData->RDF_firstVisitDate) val = copyString("First Visit");
|
||||
else if (u == gWebData->RDF_lastVisitDate) val = copyString("Last Visit");
|
||||
else if (u == gWebData->RDF_numAccesses) val = copyString("Accesses");
|
||||
else if (u == gWebData->RDF_creationDate) val = copyString("Created");
|
||||
else if (u == gWebData->RDF_lastModifiedDate) val = copyString("Modified");
|
||||
else if (u == gWebData->RDF_size) val = copyString("Size");
|
||||
else if (u == gNavCenter->RDF_bookmarkAddDate) val = copyString("Added");
|
||||
if (u == gCoreVocab->RDF_name) val = copyString(XP_GetString(RDF_NAME_STR));
|
||||
else if (u == gNavCenter->RDF_URLShortcut) val = copyString(XP_GetString(RDF_SHORTCUT_STR));
|
||||
else if (u == gWebData->RDF_URL) val = copyString(XP_GetString(RDF_URL_STR));
|
||||
else if (u == gWebData->RDF_description) val = copyString(XP_GetString(RDF_DESCRIPTION_STR));
|
||||
else if (u == gWebData->RDF_firstVisitDate) val = copyString(XP_GetString(RDF_FIRST_VISIT_STR));
|
||||
else if (u == gWebData->RDF_lastVisitDate) val = copyString(XP_GetString(RDF_LAST_VISIT_STR));
|
||||
else if (u == gWebData->RDF_numAccesses) val = copyString(XP_GetString(RDF_NUM_ACCESSES_STR));
|
||||
else if (u == gWebData->RDF_creationDate) val = copyString(XP_GetString(RDF_CREATED_ON_STR));
|
||||
else if (u == gWebData->RDF_lastModifiedDate) val = copyString(XP_GetString(RDF_LAST_MOD_STR));
|
||||
else if (u == gWebData->RDF_size) val = copyString(XP_GetString(RDF_SIZE_STR));
|
||||
else if (u == gNavCenter->RDF_bookmarkAddDate) val = copyString(XP_GetString(RDF_ADDED_ON_STR));
|
||||
else val = copyString(resourceID(u));
|
||||
}
|
||||
else if ((s == gNavCenter->RDF_ColumnDataType) &&
|
||||
|
@ -127,18 +127,32 @@ ColumnsNextValue (RDFT rdf, RDF_Cursor c)
|
|||
case 1: arc = gWebData->RDF_URL; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else do
|
||||
{
|
||||
switch(c->count)
|
||||
{
|
||||
case 0: arc = gCoreVocab->RDF_name; break;
|
||||
case 1: arc = gWebData->RDF_URL; break;
|
||||
case 2: arc = gWebData->RDF_description; break;
|
||||
case 3: arc = gNavCenter->RDF_bookmarkAddDate; break;
|
||||
case 4: arc = gWebData->RDF_lastVisitDate; break;
|
||||
case 5: arc = gWebData->RDF_lastModifiedDate; break;
|
||||
case 1:
|
||||
if ((idenEqual(c->u, gNavCenter->RDF_BookmarkFolderCategory)) ||
|
||||
((!startsWith("http://", resourceID(c->u))) && endsWith(".rdf", resourceID(c->u))))
|
||||
{
|
||||
arc = gNavCenter->RDF_URLShortcut;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* disallow shortcuts from external RDF graphs, so skip to next column */
|
||||
arc = NULL;
|
||||
++(c->count);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: arc = gWebData->RDF_URL; break;
|
||||
case 3: arc = gWebData->RDF_description; break;
|
||||
case 4: arc = gNavCenter->RDF_bookmarkAddDate; break;
|
||||
case 5: arc = gWebData->RDF_lastVisitDate; break;
|
||||
case 6: arc = gWebData->RDF_lastModifiedDate; break;
|
||||
}
|
||||
}
|
||||
} while ((c->count <= 6) && (arc == NULL));
|
||||
break;
|
||||
|
||||
case HISTORY_RT:
|
||||
|
|
|
@ -22,13 +22,18 @@
|
|||
|
||||
#include "xp.h"
|
||||
#include "xpassert.h"
|
||||
#include "xpgetstr.h"
|
||||
#include "rdf-int.h"
|
||||
#include "htrdf.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
|
||||
/* columns.c data structures */
|
||||
|
||||
extern int RDF_NAME_STR, RDF_SHORTCUT_STR, RDF_URL_STR, RDF_DESCRIPTION_STR;
|
||||
extern int RDF_FIRST_VISIT_STR, RDF_LAST_VISIT_STR, RDF_NUM_ACCESSES_STR;
|
||||
extern int RDF_CREATED_ON_STR, RDF_LAST_MOD_STR, RDF_SIZE_STR, RDF_ADDED_ON_STR;
|
||||
|
||||
|
||||
/* columns.c function prototypes */
|
||||
|
|
|
@ -206,6 +206,7 @@ deleteWorkspace(HT_Pane pane, RDF_Resource r)
|
|||
void
|
||||
htrdfNotifFunc (RDF_Event ns, void* pdata)
|
||||
{
|
||||
HT_Event theEvent;
|
||||
HT_Pane pane;
|
||||
HT_Resource htr;
|
||||
PRHashTable *hash;
|
||||
|
@ -266,11 +267,19 @@ htrdfNotifFunc (RDF_Event ns, void* pdata)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (aev->s == gNavCenter->RDF_HTMLURL)
|
||||
{
|
||||
theEvent = HT_EVENT_VIEW_HTML_ADD;
|
||||
}
|
||||
else
|
||||
{
|
||||
theEvent = HT_EVENT_NODE_VPROP_CHANGED;
|
||||
}
|
||||
htr = PR_HashTableLookup(hash, aev->u);
|
||||
while (htr != NULL)
|
||||
{
|
||||
resynchItem(htr, aev->s, aev->v, TRUE);
|
||||
sendNotification(htr, HT_EVENT_NODE_VPROP_CHANGED);
|
||||
sendNotification(htr, theEvent);
|
||||
htr = htr->nextItem;
|
||||
}
|
||||
}
|
||||
|
@ -299,11 +308,19 @@ htrdfNotifFunc (RDF_Event ns, void* pdata)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (uev->s == gNavCenter->RDF_HTMLURL)
|
||||
{
|
||||
theEvent = HT_EVENT_VIEW_HTML_REMOVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
theEvent = HT_EVENT_NODE_VPROP_CHANGED;
|
||||
}
|
||||
htr = PR_HashTableLookup(hash, (RDF_Resource)uev->u);
|
||||
while (htr != NULL)
|
||||
{
|
||||
resynchItem(htr, uev->s, uev->v, FALSE);
|
||||
sendNotification(htr, HT_EVENT_NODE_VPROP_CHANGED);
|
||||
sendNotification(htr, theEvent);
|
||||
htr = htr->nextItem;
|
||||
}
|
||||
}
|
||||
|
@ -4212,7 +4229,7 @@ HT_GetNodeData (HT_Resource node, void *token, uint32 tokenType, void **nodeData
|
|||
{
|
||||
if (token == gWebData->RDF_URL)
|
||||
{
|
||||
data = resourceID(node->node);
|
||||
data = resourceID(node->node);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4227,7 +4244,10 @@ HT_GetNodeData (HT_Resource node, void *token, uint32 tokenType, void **nodeData
|
|||
}
|
||||
#endif
|
||||
|
||||
foundData = true;
|
||||
if (data != NULL)
|
||||
{
|
||||
foundData = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (values = (HT_Value)getMem(sizeof(HT_ValueStruct)))
|
||||
|
@ -4351,7 +4371,8 @@ HT_IsNodeDataEditable(HT_Resource node, void *token, uint32 tokenType)
|
|||
if (((token == gCoreVocab->RDF_name) && (!htIsOpLocked(node, gNavCenter->RDF_NameLock))) ||
|
||||
((token == gNavCenter->RDF_largeIcon) && (!htIsOpLocked(node, gNavCenter->RDF_IconLock))) ||
|
||||
((token == gNavCenter->RDF_smallIcon) && (!htIsOpLocked(node, gNavCenter->RDF_IconLock))) ||
|
||||
(token == gWebData->RDF_description) ||
|
||||
(token == gWebData->RDF_description) || (token == gNavCenter->RDF_URLShortcut) ||
|
||||
(token == gNavCenter->RDF_HTMLURL) || (token == gNavCenter->RDF_HTMLHeight) ||
|
||||
(token == gNavCenter->treeFGColor) || (token == gNavCenter->treeBGColor) ||
|
||||
(token == gNavCenter->treeBGURL) || (token == gNavCenter->showTreeConnections) ||
|
||||
(token == gNavCenter->treeConnectionFGColor) || (token == gNavCenter->treeOpenTriggerIconURL) ||
|
||||
|
@ -4370,13 +4391,13 @@ HT_IsNodeDataEditable(HT_Resource node, void *token, uint32 tokenType)
|
|||
(token == gNavCenter->RDF_Password) ||
|
||||
#endif
|
||||
((gMissionControlEnabled == true) &&
|
||||
(token == gNavCenter->RDF_AddLock) ||
|
||||
((token == gNavCenter->RDF_AddLock) ||
|
||||
(token == gNavCenter->RDF_DeleteLock) ||
|
||||
(token == gNavCenter->RDF_IconLock) ||
|
||||
(token == gNavCenter->RDF_NameLock) ||
|
||||
(token == gNavCenter->RDF_CopyLock) ||
|
||||
(token == gNavCenter->RDF_MoveLock) ||
|
||||
(token == gNavCenter->RDF_WorkspacePosLock)))
|
||||
(token == gNavCenter->RDF_WorkspacePosLock))))
|
||||
{
|
||||
if (tokenType == HT_COLUMN_STRING)
|
||||
{
|
||||
|
@ -4841,7 +4862,8 @@ rdfProcDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned in
|
|||
_htmlElementPtr htmlElement;
|
||||
int loop;
|
||||
void *data = NULL;
|
||||
char *dynStr = NULL;
|
||||
char *dynStr = NULL, *preHTMLdynStr = NULL, *postHTMLdynStr = NULL;
|
||||
PRInt32 val;
|
||||
|
||||
switch(button)
|
||||
{
|
||||
|
@ -4918,14 +4940,26 @@ rdfProcDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned in
|
|||
{
|
||||
dirty = TRUE;
|
||||
}
|
||||
if (dirty == TRUE)
|
||||
{
|
||||
HT_SetNodeData (htmlElement->node,
|
||||
htmlElement->token,
|
||||
htmlElement->tokenType,
|
||||
argv[loop+1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (dirty == TRUE)
|
||||
{
|
||||
HT_SetNodeData (htmlElement->node,
|
||||
htmlElement->token,
|
||||
htmlElement->tokenType,
|
||||
argv[loop+1]);
|
||||
|
||||
case HT_COLUMN_INT:
|
||||
val = atol(argv[loop+1]);
|
||||
if (dirty == TRUE)
|
||||
{
|
||||
HT_SetNodeData (htmlElement->node,
|
||||
htmlElement->token,
|
||||
htmlElement->tokenType,
|
||||
&val);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -4940,6 +4974,10 @@ rdfProcDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned in
|
|||
|
||||
case XP_DIALOG_MOREINFO_BUTTON:
|
||||
node = htmlElementList->node;
|
||||
|
||||
preHTMLdynStr = constructHTMLTagData(preHTMLdynStr, RDF_SETCOLOR_JS, NULL);
|
||||
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_INFOHEADER_STR, XP_GetString(RDF_TREE_COLORS_TITLE));
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->treeFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->treeBGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->treeBGURL, HT_COLUMN_STRING);
|
||||
|
@ -4947,10 +4985,21 @@ rdfProcDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned in
|
|||
dynStr = constructHTML(dynStr, node, gNavCenter->treeConnectionFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->treeOpenTriggerIconURL, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->treeClosedTriggerIconURL, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->triggerPlacement, HT_COLUMN_STRING);
|
||||
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_EMPTYHEADER_STR, "");
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_INFOHEADER_STR, XP_GetString(RDF_TITLEBAR_COLORS_TITLE));
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarBGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarBGURL, HT_COLUMN_STRING);
|
||||
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_EMPTYHEADER_STR, "");
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_INFOHEADER_STR, XP_GetString(RDF_SELECTION_COLORS_TITLE));
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->selectionFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->selectionBGColor, HT_COLUMN_STRING);
|
||||
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_EMPTYHEADER_STR, "");
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_INFOHEADER_STR, XP_GetString(RDF_COLUMN_COLORS_TITLE));
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->columnHeaderFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->columnHeaderBGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->columnHeaderBGURL, HT_COLUMN_STRING);
|
||||
|
@ -4961,20 +5010,45 @@ rdfProcDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned in
|
|||
dynStr = constructHTML(dynStr, node, gNavCenter->sortColumnFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->sortColumnBGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->showColumnHilite, HT_COLUMN_STRING);
|
||||
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarFGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarBGColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->titleBarBGURL, HT_COLUMN_STRING);
|
||||
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->showDivider, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->dividerColor, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, gNavCenter->triggerPlacement, HT_COLUMN_STRING);
|
||||
|
||||
strings = XP_GetDialogStrings(RDF_HTML_STR);
|
||||
if (strings != NULL && dynStr != NULL)
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->treeFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->treeFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->treeBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->treeBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->treeConnectionFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->treeConnectionFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->titleBarFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->titleBarFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->titleBarBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->titleBarBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->selectionFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->selectionFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->selectionBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->selectionBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->columnHeaderFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->columnHeaderFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->columnHeaderBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->columnHeaderBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->selectedColumnHeaderFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->selectedColumnHeaderFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->selectedColumnHeaderBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->selectedColumnHeaderBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->sortColumnFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->sortColumnFGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->sortColumnBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->sortColumnBGColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_COLOR_LAYER, resourceID(gNavCenter->dividerColor));
|
||||
postHTMLdynStr = constructHTMLTagData(postHTMLdynStr, RDF_DEFAULTCOLOR_JS, resourceID(gNavCenter->dividerColor));
|
||||
|
||||
strings = XP_GetDialogStrings(RDF_HTMLCOLOR_STR);
|
||||
if ((strings != NULL) && (dynStr != NULL))
|
||||
{
|
||||
XP_CopyDialogString(strings, 0, dynStr);
|
||||
XP_MakeHTMLDialog(NULL, &rdfColorPropDialogInfo, 0,
|
||||
if (preHTMLdynStr != NULL) XP_CopyDialogString(strings, 0, preHTMLdynStr);
|
||||
XP_CopyDialogString(strings, 1, dynStr);
|
||||
if (postHTMLdynStr != NULL) XP_CopyDialogString(strings, 2, postHTMLdynStr);
|
||||
XP_MakeHTMLDialog(NULL, &rdfColorPropDialogInfo, RDF_COLOR_TITLE,
|
||||
strings, node, PR_FALSE);
|
||||
}
|
||||
if (dynStr != NULL) XP_FREE(dynStr);
|
||||
|
@ -5076,14 +5150,44 @@ freeHtmlElement(void *token)
|
|||
|
||||
|
||||
|
||||
char *
|
||||
constructHTMLTagData(char *dynStr, int strID, char *data)
|
||||
{
|
||||
char *html, *temp1, *temp2;
|
||||
|
||||
if ((html = XP_GetString(strID)) != NULL)
|
||||
{
|
||||
/* yikes... need to find a better solution */
|
||||
if (data == NULL) data="";
|
||||
temp1 = PR_smprintf(html, data, data, data, data, data, data, data, data);
|
||||
if (temp1 != NULL)
|
||||
{
|
||||
if (dynStr != NULL)
|
||||
{
|
||||
temp2 = PR_smprintf("%s%s",dynStr, temp1);
|
||||
XP_FREE(temp1);
|
||||
XP_FREE(dynStr);
|
||||
dynStr = temp2;
|
||||
}
|
||||
else
|
||||
{
|
||||
dynStr = temp1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(dynStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *
|
||||
constructHTML(char *dynStr, HT_Resource node, void *token, uint32 tokenType)
|
||||
{
|
||||
struct tm *time;
|
||||
time_t dateVal;
|
||||
PRBool isEditable;
|
||||
char *html = NULL, *temp1, *temp2;
|
||||
void *data;
|
||||
char *html = NULL, *temp1 = NULL, *temp2;
|
||||
char *data = NULL, *tokenName;
|
||||
char buffer[128];
|
||||
|
||||
XP_ASSERT(node != NULL);
|
||||
|
@ -5143,6 +5247,25 @@ constructHTML(char *dynStr, HT_Resource node, void *token, uint32 tokenType)
|
|||
|
||||
addHtmlElement(node, token, tokenType);
|
||||
|
||||
tokenName = (char *) RDF_GetSlotValue(gNCDB, token,
|
||||
gCoreVocab->RDF_name,
|
||||
RDF_STRING_TYPE, false, true);
|
||||
#ifndef DEBUG_RDF_GetSlotValue_Memory_Needs_Freedom
|
||||
|
||||
if (tokenName != NULL)
|
||||
{
|
||||
tokenName = copyString(tokenName);
|
||||
}
|
||||
#endif
|
||||
if (tokenName == NULL)
|
||||
{
|
||||
tokenName = resourceID((RDF_Resource)token);
|
||||
if (tokenName != NULL)
|
||||
{
|
||||
tokenName = copyString(tokenName);
|
||||
}
|
||||
}
|
||||
|
||||
if (isEditable)
|
||||
{
|
||||
|
||||
|
@ -5153,31 +5276,62 @@ constructHTML(char *dynStr, HT_Resource node, void *token, uint32 tokenType)
|
|||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
if (token == gWebData->RDF_description)
|
||||
{
|
||||
html = XP_GetString(RDF_HTML_STR_5);
|
||||
}
|
||||
else {
|
||||
else if ((token == gNavCenter->treeFGColor) || (token == gNavCenter->treeBGColor) ||
|
||||
(token == gNavCenter->selectionFGColor) || (token == gNavCenter->selectionBGColor) ||
|
||||
(token == gNavCenter->columnHeaderFGColor) || (token == gNavCenter->columnHeaderBGColor) ||
|
||||
(token == gNavCenter->sortColumnFGColor) || (token == gNavCenter->sortColumnBGColor) ||
|
||||
(token == gNavCenter->titleBarFGColor) || (token == gNavCenter->titleBarBGColor) ||
|
||||
(token == gNavCenter->selectedColumnHeaderFGColor) || (token == gNavCenter->selectedColumnHeaderBGColor) ||
|
||||
(token == gNavCenter->treeConnectionFGColor) || (token == gNavCenter->dividerColor))
|
||||
{
|
||||
/* yikes... need to find a better solution */
|
||||
html = XP_GetString(RDF_HTML_COLOR_STR);
|
||||
temp1 = PR_smprintf(html, tokenName, resourceID((RDF_Resource)token),
|
||||
(data) ? data:"", resourceID((RDF_Resource)token),
|
||||
resourceID((RDF_Resource)token));
|
||||
}
|
||||
else if (token == gNavCenter->RDF_HTMLHeight)
|
||||
{
|
||||
html = XP_GetString(RDF_HTML_STR_NUMBER);
|
||||
}
|
||||
else
|
||||
{
|
||||
html = XP_GetString(RDF_HTML_STR_1);
|
||||
}
|
||||
temp1 = PR_smprintf(html, resourceID((RDF_Resource)token),
|
||||
resourceID((RDF_Resource)token), (data) ? data:"");
|
||||
if (temp1 == NULL)
|
||||
{
|
||||
temp1 = PR_smprintf(html, tokenName, resourceID((RDF_Resource)token), (data) ? data:"");
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ((data != NULL) && ((*data) != NULL))
|
||||
{
|
||||
html=XP_GetString(RDF_HTML_STR_3);
|
||||
temp1 = PR_smprintf(html, resourceID((RDF_Resource)token), (data) ? data:"");
|
||||
temp1 = PR_smprintf(html, tokenName, (data) ? data:"");
|
||||
}
|
||||
if (dynStr != NULL)
|
||||
|
||||
if (tokenName != NULL)
|
||||
{
|
||||
temp2 = PR_smprintf("%s%s",dynStr, temp1);
|
||||
XP_FREE(temp1);
|
||||
XP_FREE(dynStr);
|
||||
dynStr = temp2;
|
||||
freeMem(tokenName);
|
||||
}
|
||||
else
|
||||
|
||||
if (temp1 != NULL)
|
||||
{
|
||||
dynStr = temp1;
|
||||
if (dynStr != NULL)
|
||||
{
|
||||
temp2 = PR_smprintf("%s%s",dynStr, temp1);
|
||||
XP_FREE(temp1);
|
||||
XP_FREE(dynStr);
|
||||
dynStr = temp2;
|
||||
}
|
||||
else
|
||||
{
|
||||
dynStr = temp1;
|
||||
}
|
||||
}
|
||||
return(dynStr);
|
||||
}
|
||||
|
@ -5247,7 +5401,7 @@ HT_Properties (HT_Resource node)
|
|||
PRBool isContainer, showPermissions = false;
|
||||
XP_Bool mcEnabled = false;
|
||||
XPDialogStrings *strings = NULL;
|
||||
char *dynStr = NULL, *dynStr2 = NULL;
|
||||
char *dynStr = NULL, *postHTMLdynStr = NULL, *title;
|
||||
|
||||
XP_ASSERT(node != NULL);
|
||||
XP_ASSERT(node->node != NULL);
|
||||
|
@ -5266,6 +5420,13 @@ HT_Properties (HT_Resource node)
|
|||
showPermissions = true;
|
||||
}
|
||||
|
||||
title = HT_GetNodeName(node);
|
||||
if (title == NULL)
|
||||
{
|
||||
title = HT_GetNodeURL(node);
|
||||
}
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_MAININFOHEADER_STR, title );
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case RDF_RT:
|
||||
|
@ -5277,18 +5438,31 @@ HT_Properties (HT_Resource node)
|
|||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_Password, HT_COLUMN_STRING);
|
||||
#endif
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_bookmarkAddDate, HT_COLUMN_DATE_STRING);
|
||||
#ifdef HT_LARGE_ICON_SUPPORT
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_largeIcon, HT_COLUMN_STRING);
|
||||
#endif
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_smallIcon, HT_COLUMN_STRING);
|
||||
if (node->parent == NULL)
|
||||
{
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_HTMLURL, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_HTMLHeight, HT_COLUMN_STRING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dynStr = constructHTML(dynStr, node, (void *)gCoreVocab->RDF_name, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, (void *)gWebData->RDF_URL, HT_COLUMN_STRING);
|
||||
if (HT_IsLocalData(node))
|
||||
{
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_URLShortcut, HT_COLUMN_STRING);
|
||||
}
|
||||
dynStr = constructHTML(dynStr, node, (void *)gWebData->RDF_description, HT_COLUMN_STRING);
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_bookmarkAddDate, HT_COLUMN_DATE_STRING);
|
||||
dynStr = constructHTML(dynStr, node, (void *)gWebData->RDF_lastVisitDate, HT_COLUMN_DATE_STRING);
|
||||
dynStr = constructHTML(dynStr, node, (void *)gWebData->RDF_lastModifiedDate, HT_COLUMN_DATE_STRING);
|
||||
#ifdef HT_LARGE_ICON_SUPPORT
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_largeIcon, HT_COLUMN_STRING);
|
||||
#endif
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_smallIcon, HT_COLUMN_STRING);
|
||||
}
|
||||
break;
|
||||
|
@ -5312,7 +5486,9 @@ HT_Properties (HT_Resource node)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef HT_LARGE_ICON_SUPPORT
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_largeIcon, HT_COLUMN_STRING);
|
||||
#endif
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_smallIcon, HT_COLUMN_STRING);
|
||||
}
|
||||
}
|
||||
|
@ -5336,7 +5512,9 @@ HT_Properties (HT_Resource node)
|
|||
{
|
||||
showPermissions = true;
|
||||
dynStr = constructHTML(dynStr, node, (void *)gCoreVocab->RDF_name, HT_COLUMN_STRING);
|
||||
#ifdef HT_LARGE_ICON_SUPPORT
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_largeIcon, HT_COLUMN_STRING);
|
||||
#endif
|
||||
dynStr = constructHTML(dynStr, node, (void *)gNavCenter->RDF_smallIcon, HT_COLUMN_STRING);
|
||||
}
|
||||
}
|
||||
|
@ -5369,18 +5547,22 @@ HT_Properties (HT_Resource node)
|
|||
|
||||
if (showPermissions == true)
|
||||
{
|
||||
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_EMPTYHEADER_STR, "");
|
||||
dynStr = constructHTMLTagData(dynStr, RDF_HTML_INFOHEADER_STR, XP_GetString(RDF_MISSION_CONTROL_TITLE));
|
||||
|
||||
if (HT_IsContainer(node) && (resourceType(node->node) == RDF_RT))
|
||||
{
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_AddLock, XP_GetString(RDF_ADDITIONS_ALLOWED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_AddLock, XP_GetString(RDF_ADDITIONS_ALLOWED));
|
||||
}
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_DeleteLock, XP_GetString(RDF_DELETION_ALLOWED));
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_IconLock, XP_GetString(RDF_ICON_URL_LOCKED));
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_NameLock, XP_GetString(RDF_NAME_LOCKED));
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_CopyLock, XP_GetString(RDF_COPY_ALLOWED));
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_MoveLock, XP_GetString(RDF_MOVE_ALLOWED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_DeleteLock, XP_GetString(RDF_DELETION_ALLOWED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_IconLock, XP_GetString(RDF_ICON_URL_LOCKED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_NameLock, XP_GetString(RDF_NAME_LOCKED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_CopyLock, XP_GetString(RDF_COPY_ALLOWED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_MoveLock, XP_GetString(RDF_MOVE_ALLOWED));
|
||||
if (HT_IsContainer(node) && (node->parent == NULL))
|
||||
{
|
||||
dynStr2 = constructHTMLPermission(dynStr2, node, gNavCenter->RDF_WorkspacePosLock, XP_GetString(RDF_WORKSPACE_POS_LOCKED));
|
||||
postHTMLdynStr = constructHTMLPermission(postHTMLdynStr, node, gNavCenter->RDF_WorkspacePosLock, XP_GetString(RDF_WORKSPACE_POS_LOCKED));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5404,18 +5586,18 @@ HT_Properties (HT_Resource node)
|
|||
if (strings != NULL && dynStr != NULL)
|
||||
{
|
||||
XP_CopyDialogString(strings, 0, dynStr);
|
||||
if (dynStr2 != NULL)
|
||||
if (postHTMLdynStr != NULL)
|
||||
{
|
||||
XP_CopyDialogString(strings, 1, dynStr2);
|
||||
XP_CopyDialogString(strings, 1, postHTMLdynStr);
|
||||
}
|
||||
if (node->parent == NULL)
|
||||
{
|
||||
XP_MakeHTMLDialog(NULL, &rdfWorkspacePropDialogInfo, 0,
|
||||
XP_MakeHTMLDialog(NULL, &rdfWorkspacePropDialogInfo, RDF_MAIN_TITLE,
|
||||
strings, node, PR_FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
XP_MakeHTMLDialog(NULL, &rdfPropDialogInfo, 0,
|
||||
XP_MakeHTMLDialog(NULL, &rdfPropDialogInfo, RDF_MAIN_TITLE,
|
||||
strings, node, PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
@ -7397,26 +7579,46 @@ HT_AddRelatedLinksFor(HT_Pane htPane, char *pUrl)
|
|||
PR_PUBLIC_API(PRBool)
|
||||
HT_HasHTMLPane(HT_View htView)
|
||||
{
|
||||
RDF_Resource r;
|
||||
HT_Resource top;
|
||||
PRBool hasHTML = PR_FALSE;
|
||||
char *url = NULL;
|
||||
|
||||
XP_ASSERT(htView != NULL);
|
||||
|
||||
|
||||
if (htView != NULL)
|
||||
{
|
||||
r = htView->top->node;
|
||||
url = RDF_GetSlotValue (htView->pane->db, r, gNavCenter->RDF_HTMLURL,
|
||||
RDF_STRING_TYPE, 0, 1);
|
||||
if (url != NULL)
|
||||
if ((top = HT_TopNode(htView)) != NULL)
|
||||
{
|
||||
hasHTML = PR_TRUE;
|
||||
|
||||
#ifdef DEBUG_RDF_GetSlotValue_Memory_Needs_Freedom
|
||||
freeMem(url);
|
||||
#endif
|
||||
|
||||
HT_GetNodeData (top, gNavCenter->RDF_HTMLURL, HT_COLUMN_STRING, (void *)&url);
|
||||
if (url != NULL)
|
||||
{
|
||||
hasHTML = PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(hasHTML);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PR_PUBLIC_API(char *)
|
||||
HT_HTMLPaneHeight(HT_View htView)
|
||||
{
|
||||
HT_Resource top;
|
||||
PRBool hasHTML = PR_FALSE;
|
||||
char *paneHeightStr = NULL;
|
||||
|
||||
XP_ASSERT(htView != NULL);
|
||||
|
||||
if (htView != NULL)
|
||||
{
|
||||
if (HT_HasHTMLPane(htView))
|
||||
{
|
||||
if ((top = HT_TopNode(htView)) != NULL)
|
||||
{
|
||||
HT_GetNodeData (top, gNavCenter->RDF_HTMLHeight, HT_COLUMN_STRING, (void *)&paneHeightStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(paneHeightStr);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
/* external string references in allxpstr */
|
||||
extern int RDF_HTML_STR, RDF_HTML_STR_1, RDF_HTML_STR_2, RDF_HTML_STR_3;
|
||||
extern int RDF_HTML_STR_4, RDF_HTML_STR_5;
|
||||
extern int RDF_HTML_STR_4, RDF_HTML_STR_5, RDF_HTML_STR_NUMBER;
|
||||
extern int RDF_HTML_WINDATE, RDF_HTML_MACDATE, RDF_CMD_0, RDF_DATA_1, RDF_DATA_2;
|
||||
extern int RDF_DELETEFILE, RDF_UNABLETODELETEFILE, RDF_DELETEFOLDER;
|
||||
extern int RDF_UNABLETODELETEFOLDER, RDF_SITEMAPNAME;
|
||||
|
@ -62,6 +62,11 @@ extern int RDF_NEWWORKSPACEPROMPT, RDF_DELETEWORKSPACE;
|
|||
extern int RDF_ADDITIONS_ALLOWED, RDF_DELETION_ALLOWED;
|
||||
extern int RDF_ICON_URL_LOCKED, RDF_NAME_LOCKED, RDF_COPY_ALLOWED;
|
||||
extern int RDF_MOVE_ALLOWED, RDF_WORKSPACE_POS_LOCKED;
|
||||
extern int RDF_MAIN_TITLE, RDF_COLOR_TITLE, RDF_HTML_INFOHEADER_STR;
|
||||
extern int RDF_MISSION_CONTROL_TITLE, RDF_TREE_COLORS_TITLE, RDF_SELECTION_COLORS_TITLE;
|
||||
extern int RDF_COLUMN_COLORS_TITLE, RDF_TITLEBAR_COLORS_TITLE, RDF_HTML_MAININFOHEADER_STR;
|
||||
extern int RDF_HTML_EMPTYHEADER_STR, RDF_HTML_COLOR_STR, RDF_SETCOLOR_JS, RDF_DEFAULTCOLOR_JS;
|
||||
extern int RDF_COLOR_LAYER, RDF_HTMLCOLOR_STR;
|
||||
|
||||
#ifdef HT_PASSWORD_RTNS
|
||||
extern int RDF_NEWPASSWORD, RDF_CONFIRMPASSWORD;
|
||||
|
@ -269,6 +274,7 @@ void addHtmlElement(HT_Resource node, RDF_Resource token, uint32 tokenType);
|
|||
void freeHtmlElementList();
|
||||
_htmlElementPtr findHtmlElement(void *token);
|
||||
void freeHtmlElement(void *token);
|
||||
char * constructHTMLTagData(char *dynStr, int strID, char *data);
|
||||
char * constructHTML(char *dynStr, HT_Resource node, void *token, uint32 tokenType);
|
||||
char * constructHTMLPermission(char *dynStr, HT_Resource node, RDF_Resource token, char *permText);
|
||||
PRBool htIsOpLocked(HT_Resource node, RDF_Resource token);
|
||||
|
|
|
@ -107,9 +107,9 @@ readInBookmarksOnInit(RDFFile f)
|
|||
addSlotValue(f, ptFolder, gCoreVocab->RDF_parent,
|
||||
gNavCenter->RDF_BookmarkFolderCategory,
|
||||
RDF_RESOURCE_TYPE, true);
|
||||
/* XXX localization */
|
||||
addSlotValue(f, ptFolder, gCoreVocab->RDF_name,
|
||||
"Personal Toolbar", RDF_STRING_TYPE, true );
|
||||
copyString(XP_GetString(RDF_PERSONAL_TOOLBAR_NAME)),
|
||||
RDF_STRING_TYPE, true );
|
||||
RDFUtil_SetPTFolder(ptFolder);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "xp.h"
|
||||
#include "mcom_ndbm.h"
|
||||
#include "xpassert.h"
|
||||
#include "xpgetstr.h"
|
||||
|
||||
|
||||
#if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
|
||||
|
@ -48,6 +49,8 @@
|
|||
|
||||
/* nlcstore.c data structures and defines */
|
||||
|
||||
extern int RDF_PERSONAL_TOOLBAR_NAME;
|
||||
|
||||
typedef struct _DBMAsStruct {
|
||||
uint8 size[3];
|
||||
char tag;
|
||||
|
|
|
@ -66,6 +66,20 @@ RDF_Init(RDF_InitParams params)
|
|||
char* navCenterURL;
|
||||
if ( sRDFInitedB )
|
||||
return -1;
|
||||
|
||||
XP_ASSERT(params->profileURL != NULL);
|
||||
XP_ASSERT(params->bookmarksURL != NULL);
|
||||
XP_ASSERT(params->globalHistoryURL != NULL);
|
||||
|
||||
/*
|
||||
copy init params out before doing anything else (such as creating vocabulary)
|
||||
to prevent any XP_GetString round-robin problems (ex: FE could be using XP_GetString
|
||||
to pass in the init strings, which createVocabs() could affect
|
||||
*/
|
||||
profileDirURL = copyString(params->profileURL);
|
||||
gBookmarkURL = copyString(params->bookmarksURL);
|
||||
gGlobalHistoryURL = copyString(params->globalHistoryURL);
|
||||
|
||||
resourceHash = PL_NewHashTable(500, PL_HashString, PL_CompareStrings, PL_CompareValues,
|
||||
NULL, NULL);
|
||||
RDFglueInitialize();
|
||||
|
@ -73,14 +87,6 @@ RDF_Init(RDF_InitParams params)
|
|||
createVocabs();
|
||||
sRDFInitedB = PR_TRUE;
|
||||
|
||||
XP_ASSERT(params->profileURL != NULL);
|
||||
XP_ASSERT(params->bookmarksURL != NULL);
|
||||
XP_ASSERT(params->globalHistoryURL != NULL);
|
||||
|
||||
profileDirURL = copyString(params->profileURL);
|
||||
gBookmarkURL = copyString(params->bookmarksURL);
|
||||
gGlobalHistoryURL = copyString(params->globalHistoryURL);
|
||||
|
||||
PREF_SetDefaultCharPref("browser.NavCenter", "http://rdf.netscape.com/rdf/navcntr.rdf");
|
||||
PREF_CopyCharPref("browser.NavCenter", &navCenterURL);
|
||||
if (!strchr(navCenterURL, ':')) {
|
||||
|
|
|
@ -373,7 +373,8 @@ lockedp (RDF_Resource r)
|
|||
|
||||
uint8
|
||||
resourceType (RDF_Resource r)
|
||||
{ return r->type;
|
||||
{
|
||||
return r->type;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -115,16 +115,17 @@ createNavCenterVocab () {
|
|||
setResourceType(gNavCenter->RDF_History, HISTORY_RT);
|
||||
setResourceType(gNavCenter->RDF_HistoryBySite, HISTORY_RT);
|
||||
setResourceType(gNavCenter->RDF_HistoryByDate, HISTORY_RT);
|
||||
gNavCenter->RDF_bookmarkAddDate = RDF_GetResource(gCoreDB, "bookmarkAddDate", true);
|
||||
gNavCenter->RDF_bookmarkAddDate = newResource("bookmarkAddDate", RDF_ADDED_ON_STR);
|
||||
gNavCenter->RDF_PersonalToolbarFolderCategory = RDF_GetResource(gCoreDB, "PersonalToolbarCat", true);
|
||||
gNavCenter->RDF_Column = RDF_GetResource(gCoreDB, "Column", true);
|
||||
gNavCenter->RDF_ColumnResource = RDF_GetResource(gCoreDB, "ColumnResource", true);
|
||||
gNavCenter->RDF_ColumnWidth = RDF_GetResource(gCoreDB, "ColumnWidth", true);
|
||||
gNavCenter->RDF_ColumnIconURL = RDF_GetResource(gCoreDB, "ColumnIconURL", true);
|
||||
gNavCenter->RDF_ColumnDataType = RDF_GetResource(gCoreDB, "ColumnDataType", true);
|
||||
gNavCenter->RDF_smallIcon = RDF_GetResource(gCoreDB, "smallIcon", true);
|
||||
gNavCenter->RDF_largeIcon = RDF_GetResource(gCoreDB, "largeIcon", true);
|
||||
gNavCenter->RDF_HTMLURL = RDF_GetResource(gCoreDB, "htmlURL", true);
|
||||
gNavCenter->RDF_smallIcon = newResource("smallIcon", RDF_ICON_URL_STR);
|
||||
gNavCenter->RDF_largeIcon = newResource("largeIcon", RDF_LARGE_ICON_URL_STR);
|
||||
gNavCenter->RDF_HTMLURL = newResource("htmlURL", RDF_HTML_URL_STR);
|
||||
gNavCenter->RDF_HTMLHeight = newResource("htmlHeight", RDF_HTML_HEIGHT_STR);
|
||||
gNavCenter->RDF_LocalFiles = RDF_GetResource(gCoreDB, "NC:LocalFiles", true);
|
||||
gNavCenter->RDF_Appletalk = createContainer("NC:Appletalk");
|
||||
setResourceType(gNavCenter->RDF_Appletalk, ATALKVIRTUAL_RT);
|
||||
|
@ -146,39 +147,35 @@ createNavCenterVocab () {
|
|||
gNavCenter->RDF_resultType = RDF_GetResource (gCoreDB, "resultType", true);
|
||||
gNavCenter->RDF_HTMLType = RDF_GetResource (gCoreDB, "HTMLPage", true);
|
||||
gNavCenter->RDF_Command = RDF_GetResource (gCoreDB, "Command", true);
|
||||
gNavCenter->RDF_URLShortcut = RDF_GetResource(gCoreDB, "URLShortcut", true);
|
||||
|
||||
/* NavCenter appearance styles */
|
||||
|
||||
gNavCenter->treeFGColor = RDF_GetResource (gCoreDB, "treeFGColor", true);
|
||||
gNavCenter->treeBGColor = RDF_GetResource (gCoreDB, "treeBGColor", true);
|
||||
gNavCenter->treeBGURL = RDF_GetResource (gCoreDB, "treeBGURL", true);
|
||||
gNavCenter->showTreeConnections = RDF_GetResource (gCoreDB, "showTreeConnections", true);
|
||||
gNavCenter->treeConnectionFGColor = RDF_GetResource (gCoreDB, "treeConnectionFGColor", true);
|
||||
gNavCenter->treeOpenTriggerIconURL = RDF_GetResource (gCoreDB, "treeOpenTriggerIconURL", true);
|
||||
gNavCenter->treeClosedTriggerIconURL = RDF_GetResource (gCoreDB, "treeClosedTriggerIconURL", true);
|
||||
|
||||
gNavCenter->selectionFGColor = RDF_GetResource (gCoreDB, "selectionFGColor", true);
|
||||
gNavCenter->selectionBGColor = RDF_GetResource (gCoreDB, "selectionBGColor", true);
|
||||
|
||||
gNavCenter->columnHeaderFGColor = RDF_GetResource (gCoreDB, "columnHeaderFGColor", true);
|
||||
gNavCenter->columnHeaderBGColor = RDF_GetResource (gCoreDB, "columnHeaderBGColor", true);
|
||||
gNavCenter->columnHeaderBGURL = RDF_GetResource (gCoreDB, "columnHeaderBGURL", true);
|
||||
gNavCenter->showColumnHeaders = RDF_GetResource (gCoreDB, "showColumnHeaders", true);
|
||||
gNavCenter->showColumnHeaderDividers = RDF_GetResource (gCoreDB, "showColumnHeaderDividers", true);
|
||||
|
||||
gNavCenter->sortColumnFGColor = RDF_GetResource (gCoreDB, "sortColumnFGColor", true);
|
||||
gNavCenter->sortColumnBGColor = RDF_GetResource (gCoreDB, "sortColumnBGColor", true);
|
||||
|
||||
gNavCenter->titleBarFGColor = RDF_GetResource (gCoreDB, "titleBarFGColor", true);
|
||||
gNavCenter->titleBarBGColor = RDF_GetResource (gCoreDB, "titleBarBGColor", true);
|
||||
gNavCenter->titleBarBGURL = RDF_GetResource (gCoreDB, "titleBarBGURL", true);
|
||||
|
||||
gNavCenter->dividerColor = RDF_GetResource (gCoreDB, "dividerColor", true);
|
||||
gNavCenter->showDivider = RDF_GetResource (gCoreDB, "showDivider", true);
|
||||
gNavCenter->selectedColumnHeaderFGColor = RDF_GetResource (gCoreDB, "selectedColumnHeaderFGColor", true);
|
||||
gNavCenter->selectedColumnHeaderBGColor = RDF_GetResource (gCoreDB, "selectedColumnHeaderBGColor", true);
|
||||
gNavCenter->showColumnHilite = RDF_GetResource (gCoreDB, "showColumnHilite", true);
|
||||
gNavCenter->triggerPlacement = RDF_GetResource (gCoreDB, "triggerPlacement", true);
|
||||
gNavCenter->treeFGColor = newResource("treeFGColor", RDF_FOREGROUND_COLOR_STR);
|
||||
gNavCenter->treeBGColor = newResource("treeBGColor", RDF_BACKGROUND_COLOR_STR);
|
||||
gNavCenter->treeBGURL = newResource("treeBGURL", RDF_BACKGROUND_IMAGE_STR);
|
||||
gNavCenter->showTreeConnections = newResource("showTreeConnections", RDF_SHOW_TREE_CONNECTIONS_STR);
|
||||
gNavCenter->treeConnectionFGColor = newResource("treeConnectionFGColor", RDF_CONNECTION_FG_COLOR_STR);
|
||||
gNavCenter->treeOpenTriggerIconURL = newResource("treeOpenTriggerIconURL", RDF_OPEN_TRIGGER_IMAGE_STR);
|
||||
gNavCenter->treeClosedTriggerIconURL = newResource("treeClosedTriggerIconURL", RDF_CLOSED_TRIGGER_IMAGE_STR);
|
||||
gNavCenter->selectionFGColor = newResource("selectionFGColor", RDF_FOREGROUND_COLOR_STR);
|
||||
gNavCenter->selectionBGColor = newResource("selectionBGColor", RDF_BACKGROUND_COLOR_STR);
|
||||
gNavCenter->columnHeaderFGColor = newResource("columnHeaderFGColor", RDF_FOREGROUND_COLOR_STR);
|
||||
gNavCenter->columnHeaderBGColor = newResource("columnHeaderBGColor", RDF_BACKGROUND_COLOR_STR);
|
||||
gNavCenter->columnHeaderBGURL = newResource("columnHeaderBGURL", RDF_BACKGROUND_IMAGE_STR);
|
||||
gNavCenter->showColumnHeaders = newResource("showColumnHeaders", RDF_SHOW_HEADERS_STR);
|
||||
gNavCenter->showColumnHeaderDividers = newResource("showColumnHeaderDividers", RDF_SHOW_HEADER_DIVIDERS_STR);
|
||||
gNavCenter->sortColumnFGColor = newResource("sortColumnFGColor", RDF_SORT_COLUMN_FG_COLOR_STR);
|
||||
gNavCenter->sortColumnBGColor = newResource("sortColumnBGColor", RDF_SORT_COLUMN_BG_COLOR_STR);
|
||||
gNavCenter->titleBarFGColor = newResource("titleBarFGColor", RDF_FOREGROUND_COLOR_STR);
|
||||
gNavCenter->titleBarBGColor = newResource("titleBarBGColor", RDF_BACKGROUND_COLOR_STR);
|
||||
gNavCenter->titleBarBGURL = newResource("titleBarBGURL", RDF_BACKGROUND_IMAGE_STR);
|
||||
gNavCenter->dividerColor = newResource("dividerColor", RDF_DIVIDER_COLOR_STR);
|
||||
gNavCenter->showDivider = newResource("showDivider", RDF_SHOW_COLUMN_DIVIDERS_STR);
|
||||
gNavCenter->selectedColumnHeaderFGColor = newResource("selectedColumnHeaderFGColor", RDF_SELECTED_HEADER_FG_COLOR_STR);
|
||||
gNavCenter->selectedColumnHeaderBGColor = newResource("selectedColumnHeaderBGColor", RDF_SELECTED_HEADER_BG_COLOR_STR);
|
||||
gNavCenter->showColumnHilite = newResource("showColumnHilite", RDF_SHOW_COLUMN_HILITING_STR);
|
||||
gNavCenter->triggerPlacement = newResource("triggerPlacement", RDF_TRIGGER_PLACEMENT_STR);
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,13 +184,35 @@ void
|
|||
createWebDataVocab ()
|
||||
{
|
||||
gWebData = (RDF_WDVocab) getMem(sizeof(RDF_WDVocabStruct));
|
||||
gWebData->RDF_URL = RDF_GetResource(gCoreDB, "URL", true);
|
||||
gWebData->RDF_description = RDF_GetResource(gCoreDB, "description", 1);
|
||||
gWebData->RDF_Container = RDF_GetResource(gCoreDB, "Container", 1);
|
||||
gWebData->RDF_firstVisitDate = RDF_GetResource(gCoreDB, "firstVisitDate", 1);
|
||||
gWebData->RDF_lastVisitDate = RDF_GetResource(gCoreDB, "lastVisitDate", 1);
|
||||
gWebData->RDF_numAccesses = RDF_GetResource(gCoreDB, "numAccesses", 1);
|
||||
gWebData->RDF_creationDate = RDF_GetResource(gCoreDB, "creationDate", 1);
|
||||
gWebData->RDF_lastModifiedDate = RDF_GetResource(gCoreDB, "lastModifiedDate", 1);
|
||||
gWebData->RDF_size = RDF_GetResource(gCoreDB, "size", 1);
|
||||
gWebData->RDF_URL = newResource("URL", RDF_URL_STR);
|
||||
gWebData->RDF_description = newResource("description", RDF_DESCRIPTION_STR);
|
||||
gWebData->RDF_Container = RDF_GetResource (gCoreDB, "Container", true);
|
||||
gWebData->RDF_firstVisitDate = newResource("firstVisitDate", RDF_FIRST_VISIT_STR);
|
||||
gWebData->RDF_lastVisitDate = newResource("lastVisitDate", RDF_LAST_VISIT_STR);
|
||||
gWebData->RDF_numAccesses = newResource("numAccesses", RDF_NUM_ACCESSES_STR);
|
||||
gWebData->RDF_creationDate = newResource("creationDate", RDF_CREATED_ON_STR);
|
||||
gWebData->RDF_lastModifiedDate = newResource("lastModifiedDate", RDF_LAST_MOD_STR);
|
||||
gWebData->RDF_size = newResource("size", RDF_SIZE_STR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
RDF_Resource
|
||||
newResource(char *id, int optionalNameStrID)
|
||||
{
|
||||
RDF_Resource r, RDF_name;
|
||||
char *optionalNameStr;
|
||||
|
||||
if ((r = RDF_GetResource(gCoreDB, id, true)) != NULL)
|
||||
{
|
||||
if ((optionalNameStr = XP_GetString(optionalNameStrID)) != NULL)
|
||||
{
|
||||
/* need to have our own private "name" resource */
|
||||
RDF_name = RDF_GetResource(gCoreDB, "name", 1);
|
||||
|
||||
remoteStoreAdd(gRemoteStore, r, RDF_name, copyString(optionalNameStr),
|
||||
RDF_STRING_TYPE, PR_TRUE);
|
||||
}
|
||||
}
|
||||
return(r);
|
||||
}
|
||||
|
|
|
@ -22,12 +22,21 @@
|
|||
|
||||
#include "rdf-int.h"
|
||||
#include "htrdf.h"
|
||||
#include "xpgetstr.h"
|
||||
|
||||
|
||||
|
||||
/* vocab.c data structures */
|
||||
|
||||
|
||||
extern int RDF_FOREGROUND_COLOR_STR, RDF_BACKGROUND_COLOR_STR, RDF_BACKGROUND_IMAGE_STR;
|
||||
extern int RDF_SHOW_TREE_CONNECTIONS_STR, RDF_CONNECTION_FG_COLOR_STR, RDF_OPEN_TRIGGER_IMAGE_STR;
|
||||
extern int RDF_CLOSED_TRIGGER_IMAGE_STR, RDF_SHOW_HEADERS_STR, RDF_SHOW_HEADER_DIVIDERS_STR;
|
||||
extern int RDF_SORT_COLUMN_FG_COLOR_STR, RDF_SORT_COLUMN_BG_COLOR_STR, RDF_DIVIDER_COLOR_STR;
|
||||
extern int RDF_SHOW_COLUMN_DIVIDERS_STR, RDF_SELECTED_HEADER_FG_COLOR_STR, RDF_SELECTED_HEADER_BG_COLOR_STR;
|
||||
extern int RDF_SHOW_COLUMN_HILITING_STR, RDF_TRIGGER_PLACEMENT_STR, RDF_URL_STR;
|
||||
extern int RDF_DESCRIPTION_STR, RDF_FIRST_VISIT_STR, RDF_LAST_VISIT_STR, RDF_NUM_ACCESSES_STR;
|
||||
extern int RDF_CREATED_ON_STR, RDF_LAST_MOD_STR, RDF_SIZE_STR, RDF_ADDED_ON_STR, RDF_ICON_URL_STR;
|
||||
extern int RDF_LARGE_ICON_URL_STR, RDF_HTML_URL_STR, RDF_HTML_HEIGHT_STR;
|
||||
|
||||
|
||||
/* vocab.c function prototypes */
|
||||
|
@ -38,6 +47,7 @@ void createVocabs ();
|
|||
void createCoreVocab ();
|
||||
void createNavCenterVocab ();
|
||||
void createWebDataVocab ();
|
||||
RDF_Resource newResource(char *id, int optionalNameStrID);
|
||||
|
||||
XP_END_PROTOS
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче