updated license boilerplate to xPL v1.1
This commit is contained in:
Родитель
ed4e5a107e
Коммит
0a0b71b9c3
35
cmd/Makefile
35
cmd/Makefile
|
@ -1,35 +0,0 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ..
|
||||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
ifndef NO_X11
|
||||
DIRS = xfe
|
||||
else
|
||||
|
||||
# Rhapsody needs to be able to go to both xfe (Mozilla/x11)
|
||||
# and ybfe (NGLayout).
|
||||
ifeq ($(OS_ARCH),Rhapsody)
|
||||
DIRS = ybfe
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
ifdef MOZ_FE
|
||||
DIRS = $(addsuffix fe, $(MOZ_FE))
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,230 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnome_bm.c --- gnome functions dealing with front-end
|
||||
bookmarks handling.
|
||||
*/
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
#include "g-util.h"
|
||||
|
||||
/* The list of bookmarks has changed somehow, so any "bookmarks" menu needs to
|
||||
be recreated. This should be a cheap call, just setting a flag in the FE so
|
||||
that it knows to recreate the menu later (like, when the user tries to view
|
||||
it). Recreating it immediately would be bad, because this can get called
|
||||
much more often than is reasonable. */
|
||||
void
|
||||
BMFE_BookmarkMenuInvalid(MWContext* context)
|
||||
{
|
||||
printf("BMFE_BookmarkMenuInvalid (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
/* Edit the given item in the bookmarks property window. If there is no
|
||||
bookmarks property window currently, then the FE should ignore this call.
|
||||
If the bookmarks property window is currently displaying some other entry,
|
||||
then it should save any changes made to that entry (by calling BM_SetName,
|
||||
etc.) before loading up this entry. */
|
||||
void
|
||||
BMFE_EditItem(MWContext* context,
|
||||
BM_Entry* entry)
|
||||
{
|
||||
printf("BMFE_EditItem (empty)\n");
|
||||
}
|
||||
|
||||
/* Use these to know when to allow refresh */
|
||||
void
|
||||
BMFE_StartBatch(MWContext* context)
|
||||
{
|
||||
printf("BMFE_StartBatch (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
BMFE_EndBatch(MWContext* context)
|
||||
{
|
||||
printf("BMFE_EndBatch (empty)\n");
|
||||
}
|
||||
|
||||
/* The given entry is no longer valid (i.e., the user just deleted it). So,
|
||||
the given pointer is about to become invalid, and the FE should remove any
|
||||
references to it it may have. In particular, if it is the one being edited
|
||||
in the bookmarks property window, then the FE should clear that window. */
|
||||
void
|
||||
BMFE_EntryGoingAway(MWContext* context,
|
||||
BM_Entry* entry)
|
||||
{
|
||||
printf("BMFE_EntryGoingAway (empty)\n");
|
||||
}
|
||||
|
||||
/* We've finished processing What's Changed. The What's Changed window should
|
||||
change to display the summary of what happened. It should look something
|
||||
like this:
|
||||
|
||||
Done checking <157> Bookmarks.
|
||||
<134> documents were reached.
|
||||
<27> documents have changed and are marked in blue.
|
||||
|
||||
[ OK ]
|
||||
|
||||
When the user clicks on the OK, the FE should just take down the window.
|
||||
(It doesn't matter if the FE calls BM_CancelWhatsChanged(); it will be a
|
||||
no-op in this situtation.) */
|
||||
|
||||
void
|
||||
BMFE_FinishedWhatsChanged(MWContext* context,
|
||||
int32 totalchecked,
|
||||
int32 numreached,
|
||||
int32 numchanged)
|
||||
{
|
||||
printf("BMFE_FinishedWhatsChanged (empty)\n");
|
||||
}
|
||||
|
||||
/* return the clipboard contents */
|
||||
void*
|
||||
BMFE_GetClipContents(MWContext* context,
|
||||
int32* length)
|
||||
{
|
||||
printf("BMFE_GetClipContents (empty)\n");
|
||||
}
|
||||
|
||||
/* The user has requested to view the given url. Show it to him in, using some
|
||||
appropriate context. Url may be targeted to a different window */
|
||||
void
|
||||
BMFE_GotoBookmark(MWContext* context,
|
||||
const char* url,
|
||||
const char* target)
|
||||
{
|
||||
printf("BMFE_GotoBookmark (empty)\n");
|
||||
}
|
||||
|
||||
/* measure the item and assign the width and height required to draw it into
|
||||
the widget into width and height. This is used only by BM_WidestEntry(); if
|
||||
you don't need that call, you can just make this an empty stub. */
|
||||
void
|
||||
BMFE_MeasureEntry(MWContext* context,
|
||||
BM_Entry* entry,
|
||||
uint32* width,
|
||||
uint32* height)
|
||||
{
|
||||
printf("BMFE_MeasureEntry (empty)\n");
|
||||
}
|
||||
|
||||
/* Create the bookmarks property window. If one already exists, just bring it
|
||||
to the front. This will always be immediately followed by a call to
|
||||
BMFE_EditItem(). */
|
||||
void
|
||||
BMFE_OpenBookmarksWindow(MWContext* context)
|
||||
{
|
||||
printf("BMFE_OpenBookmarksWindow (empty)\n");
|
||||
}
|
||||
|
||||
/* Create the find dialog, and fill it in as specified in the given
|
||||
structure. When the user hits the "Find" button in the dialog, call
|
||||
BM_DoFindBookmark. */
|
||||
/*
|
||||
void*
|
||||
BMFE_OpenFindWindow(MWContext* context,
|
||||
BM_FindInfo* findInfo)
|
||||
{
|
||||
printf("BMFE_OpenFindWindow (empty)\n");
|
||||
}
|
||||
*/
|
||||
/* Refresh each cell between and including first and last in the bookmarks
|
||||
widget (if now is TRUE, the FE is expected to redraw them BEFORE returning,
|
||||
otherwise the FE can simply invalidate them and wait for the redraw to
|
||||
happen). If BM_LAST_CELL is passed in as last, then it means paint from
|
||||
the first to the end. */
|
||||
void
|
||||
BMFE_RefreshCells(MWContext* context,
|
||||
int32 first,
|
||||
int32 last,
|
||||
XP_Bool now)
|
||||
{
|
||||
MozBookmarkView *view = find_bookmark_view(context);
|
||||
XP_ASSERT(view);
|
||||
|
||||
moz_bookmark_view_refresh_cells(view, first, last, now);
|
||||
}
|
||||
|
||||
/* Make sure that the given entry is visible. */
|
||||
void
|
||||
BMFE_ScrollIntoView(MWContext* context,
|
||||
BM_Entry* entry)
|
||||
{
|
||||
MozBookmarkView *view = find_bookmark_view(context);
|
||||
XP_ASSERT(view);
|
||||
|
||||
moz_bookmark_view_scroll_into_view(view, entry);
|
||||
}
|
||||
|
||||
/* Save the given bucket o' bits as the clipboard. This same bucket needs to
|
||||
be returned later if BMFE_GetClipContents() is called. */
|
||||
void
|
||||
BMFE_SetClipContents(MWContext* context,
|
||||
void* buffer,
|
||||
int32 length)
|
||||
{
|
||||
printf("BMFE_SetClipContents (empty)\n");
|
||||
}
|
||||
|
||||
/* Resize the widget to accomodate "visibleCount" number of entries vertically
|
||||
and the width of widest entry the actual widget should NOT change size, just
|
||||
the size of the scrollable area under it */
|
||||
void
|
||||
BMFE_SyncDisplay(MWContext* context)
|
||||
{
|
||||
printf("BMFE_SyncDisplay (empty)\n");
|
||||
}
|
||||
|
||||
/* We're in the process of doing a What's Changed operation. The What's
|
||||
Changed window should update to display the URL, the percentage (calculate
|
||||
as done*100/total), and the total estimated time (given here as a
|
||||
pre-formatted string). The What's Changed window should end up looking
|
||||
something like this:
|
||||
|
||||
Checking <URL>... (<13> left)
|
||||
{===================== } (progress bar)
|
||||
|
||||
Estimated time remaining: <2 hours 13 minutes>
|
||||
(Remaining time depends on the sites selected and
|
||||
the network traffic).
|
||||
|
||||
|
||||
[ Cancel ]
|
||||
|
||||
It's up to the FE to notice the first time this is called and change its
|
||||
window to display the info instead of the initial What's Changed screen.
|
||||
|
||||
If the user ever hits Cancel (or does something equivilant, like destroys
|
||||
the window), the FE must call BM_CancelWhatsChanged(). */
|
||||
|
||||
void
|
||||
BMFE_UpdateWhatsChanged(MWContext* context,
|
||||
const char* url, /* If NULL, just display
|
||||
"Checking..." */
|
||||
int32 done,
|
||||
int32 total,
|
||||
const char* totaltime)
|
||||
{
|
||||
printf("BMFE_UpdateWhatsChanged (empty)\n");
|
||||
}
|
||||
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "net.h"
|
||||
|
||||
void
|
||||
fe_RegisterConverters (void)
|
||||
{
|
||||
#ifdef NEW_DECODERS
|
||||
NET_ClearAllConverters ();
|
||||
#endif /* NEW_DECODERS */
|
||||
|
||||
#if 0
|
||||
if (fe_encoding_extensions)
|
||||
{
|
||||
int i = 0;
|
||||
while (fe_encoding_extensions [i])
|
||||
free (fe_encoding_extensions [i++]);
|
||||
free (fe_encoding_extensions);
|
||||
fe_encoding_extensions = 0;
|
||||
}
|
||||
|
||||
/* register X specific decoders
|
||||
*/
|
||||
if (fe_globalData.encoding_filters)
|
||||
{
|
||||
char *copy = strdup (fe_globalData.encoding_filters);
|
||||
char *rest = copy;
|
||||
char *end = rest + strlen (rest);
|
||||
|
||||
int exts_count = 0;
|
||||
int exts_size = 10;
|
||||
char **all_exts = (char **) malloc (sizeof (char *) * exts_size);
|
||||
|
||||
while (rest < end)
|
||||
{
|
||||
char *start;
|
||||
char *eol, *colon;
|
||||
char *input, *output, *extensions, *command;
|
||||
eol = strchr (rest, '\n');
|
||||
if (eol) *eol = 0;
|
||||
|
||||
rest = fe_StringTrim (rest);
|
||||
if (! *rest)
|
||||
/* blank lines are ok */
|
||||
continue;
|
||||
|
||||
start = rest;
|
||||
|
||||
colon = strchr (rest, ':');
|
||||
if (! colon) goto LOSER;
|
||||
*colon = 0;
|
||||
input = fe_StringTrim (rest);
|
||||
rest = colon + 1;
|
||||
|
||||
colon = strchr (rest, ':');
|
||||
if (! colon) goto LOSER;
|
||||
*colon = 0;
|
||||
output = fe_StringTrim (rest);
|
||||
rest = colon + 1;
|
||||
|
||||
colon = strchr (rest, ':');
|
||||
if (! colon) goto LOSER;
|
||||
*colon = 0;
|
||||
extensions = fe_StringTrim (rest);
|
||||
rest = colon + 1;
|
||||
|
||||
command = fe_StringTrim (rest);
|
||||
rest = colon + 1;
|
||||
|
||||
if (*command)
|
||||
{
|
||||
/* First save away the extensions. */
|
||||
char *rest = extensions;
|
||||
while (*rest)
|
||||
{
|
||||
char *start;
|
||||
char *comma, *end;
|
||||
while (isspace (*rest))
|
||||
rest++;
|
||||
start = rest;
|
||||
comma = XP_STRCHR (start, ',');
|
||||
end = (comma ? comma - 1 : start + strlen (start));
|
||||
while (end >= start && isspace (*end))
|
||||
end--;
|
||||
if (comma) end++;
|
||||
if (start < end)
|
||||
{
|
||||
all_exts [exts_count] =
|
||||
(char *) malloc (end - start + 1);
|
||||
strncpy (all_exts [exts_count], start, end - start);
|
||||
all_exts [exts_count][end - start] = 0;
|
||||
if (++exts_count == exts_size)
|
||||
all_exts = (char **)
|
||||
realloc (all_exts,
|
||||
sizeof (char *) * (exts_size += 10));
|
||||
}
|
||||
rest = (comma ? comma + 1 : end);
|
||||
}
|
||||
all_exts [exts_count] = 0;
|
||||
fe_encoding_extensions = all_exts;
|
||||
|
||||
/* Now register the converter. */
|
||||
NET_RegisterExternalDecoderCommand (input, output, command);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOSER:
|
||||
fprintf (stderr,
|
||||
XP_GetString(XFE_COMMANDS_UNPARSABLE_ENCODING_FILTER_SPEC),
|
||||
fe_progname, start);
|
||||
}
|
||||
rest = (eol ? eol + 1 : end);
|
||||
}
|
||||
free (copy);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Register standard decoders
|
||||
This must come AFTER all calls to NET_RegisterExternalDecoderCommand(),
|
||||
(at least in the `NEW_DECODERS' world.)
|
||||
*/
|
||||
NET_RegisterMIMEDecoders ();
|
||||
|
||||
#if 0 /* XXX toshok - for now. */
|
||||
/* How to save to disk. */
|
||||
NET_RegisterContentTypeConverter ("*", FO_SAVE_AS, NULL,
|
||||
fe_MakeSaveAsStream);
|
||||
|
||||
/* Saving any binary format as type `text' should save as `source' instead.
|
||||
*/
|
||||
NET_RegisterContentTypeConverter ("*", FO_SAVE_AS_TEXT, NULL,
|
||||
fe_MakeSaveAsStreamNoPrompt);
|
||||
NET_RegisterContentTypeConverter ("*", FO_QUOTE_MESSAGE, NULL,
|
||||
fe_MakeSaveAsStreamNoPrompt);
|
||||
|
||||
/* default presentation converter - offer to save unknown types. */
|
||||
NET_RegisterContentTypeConverter ("*", FO_PRESENT, NULL,
|
||||
fe_MakeSaveAsStream);
|
||||
#endif
|
||||
|
||||
#ifndef NO_MOCHA_CONVERTER_HACK
|
||||
/* libmocha:LM_InitMocha() installs this convert. We blow away all
|
||||
* converters that were installed and hence these mocha default converters
|
||||
* dont get recreated. And mocha has no call to re-register them.
|
||||
* So this hack. - dp/brendan
|
||||
*/
|
||||
NET_RegisterContentTypeConverter(APPLICATION_JAVASCRIPT, FO_PRESENT, 0,
|
||||
NET_CreateMochaConverter);
|
||||
#endif /* NO_MOCHA_CONVERTER_HACK */
|
||||
|
||||
/* Parse stuff out of the .mime.types and .mailcap files.
|
||||
* We dont have to check dates of files for modified because all that
|
||||
* would have been done by the caller. The only place time checking
|
||||
* happens is
|
||||
* (1) Helperapp page is created
|
||||
* (2) Helpers are being saved (OK button pressed on the General Prefs).
|
||||
*/
|
||||
NET_InitFileFormatTypes (NULL /* XXX fe_globalPrefs.private_mime_types_file */,
|
||||
NULL /* XXX fe_globalPrefs.global_mime_types_file*/);
|
||||
#if 0 /* XXX toshok - for now. */
|
||||
fe_isFileChanged(fe_globalPrefs.private_mime_types_file, 0,
|
||||
&fe_globalData.privateMimetypeFileModifiedTime);
|
||||
|
||||
NET_RegisterConverters (fe_globalPrefs.private_mailcap_file,
|
||||
fe_globalPrefs.global_mailcap_file);
|
||||
fe_isFileChanged(fe_globalPrefs.private_mailcap_file, 0,
|
||||
&fe_globalData.privateMailcapFileModifiedTime);
|
||||
|
||||
fe_RegisterPrefConverters();
|
||||
|
||||
#ifndef NO_WEB_FONTS
|
||||
/* Register webfont converters */
|
||||
NF_RegisterConverters();
|
||||
#endif /* NO_WEB_FONTS */
|
||||
|
||||
/* Plugins go on top of all this */
|
||||
fe_RegisterPluginConverters();
|
||||
#endif
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <nspr.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
char *fe_GetConfigDir(void)
|
||||
{
|
||||
char *result, *home;
|
||||
|
||||
home = getenv("HOME");
|
||||
if(!home) {
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
|
||||
home = pw ? pw->pw_dir : "/";
|
||||
}
|
||||
|
||||
result = PR_smprintf("%s/%s", home, MOZ_USER_DIR);
|
||||
return result;
|
||||
}
|
||||
|
||||
char *fe_GetConfigDirFilename(char *filename)
|
||||
{
|
||||
return fe_GetConfigDirFilenameWithPrefix("", filename);
|
||||
}
|
||||
|
||||
char *fe_GetConfigDirFilenameWithPrefix(char *prefix, char *filename)
|
||||
{
|
||||
return PR_smprintf("%s%s/%s", prefix, fe_GetConfigDir(), filename);
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,261 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomedlgs.c --- gnome fe handling of dialog requests from backend (prompt for
|
||||
password, alerts, messages, etc.)
|
||||
*/
|
||||
|
||||
#include "gnome.h"
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "fe_proto.h"
|
||||
|
||||
/*
|
||||
** FE_Alert - put up an alert dialog containing the given msg, over
|
||||
** context.
|
||||
**
|
||||
** This method should return immediately, without waiting for user
|
||||
** input.
|
||||
*/
|
||||
void
|
||||
FE_Alert(MWContext *context,
|
||||
const char *msg)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gnome_message_box_new((char*)msg,
|
||||
GNOME_MESSAGE_BOX_ERROR,
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
NULL);
|
||||
|
||||
gtk_widget_show(dialog);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_Message - put up an information dialog containing the given msg,
|
||||
** over context.
|
||||
**
|
||||
** This method should return immediately, without waiting for user
|
||||
** input.
|
||||
*/
|
||||
void
|
||||
FE_Message(MWContext *context,
|
||||
const char *msg)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gnome_message_box_new((char*)msg,
|
||||
GNOME_MESSAGE_BOX_INFO,
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
NULL);
|
||||
|
||||
gtk_widget_show(dialog);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** FE_Prompt - Put up a prompt dialog with the given message, a text
|
||||
** field (with the value defaulted to dflt). The user's response
|
||||
** should be returned.
|
||||
**
|
||||
** This method should not return until the user has clicked Ok (the
|
||||
** return value should not be NULL) or they clicked Cancel (the return
|
||||
** value should be NULL.)
|
||||
*/
|
||||
char*
|
||||
FE_Prompt(MWContext *context,
|
||||
const char *msg,
|
||||
const char *dflt)
|
||||
{
|
||||
printf ("FE_Prompt\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_PromptPassword - Put up a prompt dialog with the given message,
|
||||
** a text field. The user's response should be returned.
|
||||
**
|
||||
** The text field should not show the characters as the user types them.
|
||||
** Display them as X's, *'s, spaces, etc.
|
||||
**
|
||||
** This method should not return until the user has clicked Ok (the
|
||||
** return value should not be NULL) or they clicked Cancel (the return
|
||||
** value should be NULL.)
|
||||
*/
|
||||
char*
|
||||
FE_PromptPassword(MWContext *context,
|
||||
const char *msg)
|
||||
{
|
||||
printf ("FE_PromptPassword\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_PromptMessageSubject - Put up a prompt dialog with the given
|
||||
** message, a text field. The user's response should be returned.
|
||||
**
|
||||
** The default value in the text field should be "(No Subject)",
|
||||
** localized to the user's locale.
|
||||
**
|
||||
** This method should not return until the user has clicked Ok (the
|
||||
** return value should not be NULL) or they clicked Cancel (the return
|
||||
** value should be NULL.)
|
||||
*/
|
||||
char*
|
||||
FE_PromptMessageSubject(MWContext *context)
|
||||
{
|
||||
printf ("FE_PromptMessageSubject\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_PromptUsernameAndPassword - Put up a prompt dialog with the given
|
||||
** message, a two text fields. It should return TRUE if Ok was clicked
|
||||
** and FALSE if Cancel was clicked.
|
||||
**
|
||||
** The password text field should not show the characters as the user
|
||||
** types them. Display them as X's, *'s, spaces, etc.
|
||||
**
|
||||
** This method should not return until the user has clicked Ok or Cancel.
|
||||
*/
|
||||
Bool
|
||||
FE_PromptUsernameAndPassword(MWContext *context,
|
||||
const char *msg,
|
||||
char **username,
|
||||
char **password)
|
||||
{
|
||||
|
||||
printf("FE_PromptUsernameAndPassword (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** FE_PromptForFileNam - Put up a file selection dialog with the given
|
||||
** prompt string,
|
||||
**
|
||||
** the file selection box should open up viewing default_path.
|
||||
**
|
||||
** if file_must_exist_p, the user should not be allowed to close the
|
||||
** dialog with an invalid path selected.
|
||||
**
|
||||
** if directories_allowed_p, directories can be selected.
|
||||
**
|
||||
** After the user has clicked ok or cancel or given some other gesture
|
||||
** to bring down the filesb, the ReadFileNameCallbackFunction should
|
||||
** be called with the context, the textual path name, and the closure, as in
|
||||
** 'fn(context, path, closure);'
|
||||
**
|
||||
** Lastly, the function should return 0 if the path was acceptable and -1 if it
|
||||
** was not.
|
||||
**
|
||||
** This method should not return until the user has clicked Ok or Cancel.
|
||||
*/
|
||||
int
|
||||
FE_PromptForFileName(MWContext *context,
|
||||
const char *prompt_string,
|
||||
const char *default_path,
|
||||
XP_Bool file_must_exist_p,
|
||||
XP_Bool directories_allowed_p,
|
||||
ReadFileNameCallbackFunction fn,
|
||||
void *closure)
|
||||
{
|
||||
|
||||
printf("FE_PromptForFileName (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SaveDialog - Put up a dialog that basically says "I'm saving
|
||||
** <foo> right now", cancel?
|
||||
**
|
||||
** This function should not block, but should return after putting up the dialog.
|
||||
**
|
||||
** If the user clicks cancel, the callback should call EDT_SaveCancel.
|
||||
**
|
||||
** Note: This function has been overloaded for use in publishing as well. There
|
||||
** are three instances where this function will be called:
|
||||
** 1) Saving remote files to disk.
|
||||
** 2) Preparing to publish files remotely.
|
||||
** 3) Publishing files to a remote server.
|
||||
*/
|
||||
void
|
||||
FE_SaveDialogCreate(MWContext *context,
|
||||
int file_count,
|
||||
ED_SaveDialogType save_type)
|
||||
{
|
||||
|
||||
printf("FE_SaveDialogCreate (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SaveDialogSetFilename - for a save dialog that has been put up above the given
|
||||
** context, set the filename being saved/published.
|
||||
*/
|
||||
void
|
||||
FE_SaveDialogSetFilename(MWContext *context,
|
||||
char *filename)
|
||||
{
|
||||
|
||||
printf("FE_SaveDialogSetFilename (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SaveDialogDestroy - the backend calls this function to let us
|
||||
** know that the save/publish operation has completed. We should
|
||||
** destroy the save dialog that has been used above the given context.
|
||||
*/
|
||||
void
|
||||
FE_SaveDialogDestroy(MWContext *context,
|
||||
int status,
|
||||
char *filename)
|
||||
{
|
||||
|
||||
printf("FE_SaveDialogDestroy (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SaveFileExistsDialog - put up the standard dialog saying:
|
||||
** "<foo> exists - overwrite?" Yes to All, Yes, No, No to All.
|
||||
**
|
||||
** return ED_SAVE_OVERWRITE_THIS if the user clicks Yes.
|
||||
** return ED_SAVE_OVERWRITE_ALL if the user clicks Yes to All.
|
||||
** return ED_SAVE_DONT_OVERWRITE_THIS if the user clicks No.
|
||||
** return ED_SAVE_DONT_OVERWRITE_ALL if the user clicks No to All.
|
||||
*/
|
||||
ED_SaveOption
|
||||
FE_SaveFileExistsDialog(MWContext *context,
|
||||
char *filename)
|
||||
{
|
||||
|
||||
printf("FE_SaveFileExistsDialog (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SaveErrorContinueDialog - put up a dialog that gives some
|
||||
** textual represenation of the error status, and allow the user
|
||||
** to decide if they want to continue or not.
|
||||
**
|
||||
** Return TRUE if we should continue, and FALSE if we shouldn't.
|
||||
*/
|
||||
Bool
|
||||
FE_SaveErrorContinueDialog(MWContext *context,
|
||||
char *filename,
|
||||
ED_FileError error)
|
||||
{
|
||||
|
||||
printf("FE_SaveErrorContinueDialog (empty)\n");
|
||||
}
|
|
@ -1,185 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeedit.c --- stub functions for fe
|
||||
specific editor stuff.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "edttypes.h"
|
||||
#include "edt.h"
|
||||
|
||||
ED_CharsetEncode FE_EncodingDialog(MWContext *context)
|
||||
{
|
||||
ED_CharsetEncode retval = ED_ENCODE_CANCEL;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
FE_DisplayTextCaret(MWContext* context,
|
||||
int loc,
|
||||
LO_TextStruct* text_data,
|
||||
int char_offset)
|
||||
{
|
||||
printf("FE_DisplayTextCaret (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DisplayImageCaret(MWContext* context,
|
||||
LO_ImageStruct* pImageData,
|
||||
ED_CaretObjectPosition caretPos)
|
||||
{
|
||||
printf("FE_DisplayImageCaret (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DisplayGenericCaret(MWContext* context,
|
||||
LO_Any* pLoAny,
|
||||
ED_CaretObjectPosition caretPos)
|
||||
{
|
||||
printf("FE_DisplayGenericCaret (empty)\n");
|
||||
}
|
||||
|
||||
Bool
|
||||
FE_GetCaretPosition(MWContext* context,
|
||||
LO_Position* where,
|
||||
int32* caretX,
|
||||
int32* caretYLow,
|
||||
int32* caretYHigh)
|
||||
{
|
||||
printf("FE_GetCaretPosition (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DestroyCaret(MWContext* pContext)
|
||||
{
|
||||
printf("FE_DestroyCaret (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ShowCaret(MWContext* pContext)
|
||||
{
|
||||
printf("FE_ShowCaret (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DocumentChanged(MWContext* context,
|
||||
int32 iStartY,
|
||||
int32 iHeight)
|
||||
{
|
||||
printf("FE_DocumentChanged (empty)\n");
|
||||
}
|
||||
|
||||
MWContext*
|
||||
FE_CreateNewEditWindow(MWContext* pContext,
|
||||
URL_Struct* pURL)
|
||||
{
|
||||
printf("FE_CreateNewEditWindow (empty)\n");
|
||||
}
|
||||
|
||||
char*
|
||||
FE_URLToLocalName(char* url)
|
||||
{
|
||||
printf("FE_URLToLocalName (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_EditorDocumentLoaded(MWContext* context)
|
||||
{
|
||||
printf("FE_EditorDocumentLoaded (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_GetDocAndWindowPosition(MWContext * context,
|
||||
int32 *pX,
|
||||
int32 *pY,
|
||||
int32 *pWidth,
|
||||
int32 *pHeight)
|
||||
{
|
||||
printf("FE_GetDocAndWindowPosition (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_SetNewDocumentProperties(MWContext* context)
|
||||
{
|
||||
printf("FE_SetNewDocumentProperties (empty)\n");
|
||||
}
|
||||
|
||||
Bool
|
||||
FE_CheckAndSaveDocument(MWContext* context)
|
||||
{
|
||||
printf("FE_CheckAndSaveDocument (empty)\n");
|
||||
}
|
||||
|
||||
Bool
|
||||
FE_CheckAndAutoSaveDocument(MWContext *context)
|
||||
{
|
||||
printf("FE_CheckAndAutoSaveDocument (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_FinishedSave(MWContext* context,
|
||||
int status,
|
||||
char *pDestURL,
|
||||
int iFileNumber)
|
||||
{
|
||||
printf("FE_FinishedSave (empty)\n");
|
||||
}
|
||||
|
||||
char *
|
||||
XP_BackupFileName (const char *url)
|
||||
{
|
||||
printf("XP_BackupFileName (empty)\n");
|
||||
}
|
||||
|
||||
Bool
|
||||
XP_ConvertUrlToLocalFile (const char *url,
|
||||
char **localName)
|
||||
{
|
||||
printf("XP_ConvertUrlToLocalFile (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ImageLoadDialog(MWContext* context)
|
||||
{
|
||||
printf("FE_ImageLoadDialog (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ImageLoadDialogDestroy(MWContext* context)
|
||||
{
|
||||
printf("FE_ImageLoadDialogDestroy (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DisplayAddRowOrColBorder(MWContext * pMWContext,
|
||||
XP_Rect *pRect,
|
||||
XP_Bool bErase)
|
||||
{
|
||||
printf("FE_DisplayAddRowOrColBorder (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DisplayEntireTableOrCell(MWContext * pMWContext,
|
||||
LO_Element * pLoElement)
|
||||
{
|
||||
printf("FE_DisplayEntireTableOrCell (empty)\n");
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeenc.c --- encoding stuff specific to the stub fe.
|
||||
*/
|
||||
|
||||
char **fe_encoding_extensions = 0; /* gag. used by mkcache.c. */
|
|
@ -1,296 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeform.c --- stub functions dealing with front-end
|
||||
handling of form elements.
|
||||
*/
|
||||
|
||||
#include "g-util.h"
|
||||
#include "g-html-view.h"
|
||||
#include "gnome-form.h"
|
||||
|
||||
/*
|
||||
** FE_GetFormElementInfo - create the FE representation of a form
|
||||
** element.
|
||||
**
|
||||
** Note : This method can be called more than once for the same front
|
||||
** end form element.
|
||||
**
|
||||
** In those cases we don't reallocate the FEData*, and also don't
|
||||
** recreate the widget, but we do set the form and context pointers in
|
||||
** FEData, and we call the get_size method.
|
||||
**
|
||||
** Two cases I know of where layout calls this function more than once
|
||||
** are: 1) when laying out a table with form elements in it -- layout
|
||||
** moves our fe data over to a new LO_FormElementStruct. So, you
|
||||
** should always sync up pointers to the LO_FormElementStruct
|
||||
** contained in your fe data. 2) when we're on a page with frames in
|
||||
** it and the user goes back and forth. In this case, the context is
|
||||
** different, so you always need to sync that up as well.
|
||||
**
|
||||
** Also, layout could have told us to hide the widget without freeing
|
||||
** our fe_data* (this happens when hide is TRUE in
|
||||
** FE_GetFormElementValue.) In this case, we need to do anything
|
||||
** necessary to show the widget again.
|
||||
**
|
||||
** Also, this routine is responsible for setting the initial value of
|
||||
** the form element.
|
||||
**
|
||||
** yuck. :)
|
||||
*/
|
||||
void
|
||||
GNOMEFE_GetFormElementInfo (MWContext * context,
|
||||
LO_FormElementStruct * form_element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_get_form_element_info(view,
|
||||
form_element);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** FE_GetFormElementValue - copy the value inside the fe
|
||||
** representation into the FormElementStruct.
|
||||
**
|
||||
** if hide is TRUE, hide the form element after doing the copy. In
|
||||
** the XFE, hide is taken to mean "delete" - so, if hide is TRUE, the
|
||||
** XFE deletes the form element widget. This is not strictly
|
||||
** necessary, as you are guaranteed to have FE_FreeFormElement if the
|
||||
** form element is *really* going away.
|
||||
**
|
||||
** But, given that this is called with hide == TRUE in the face of
|
||||
** going back and forth in frame documents, it's probably safer to
|
||||
** always delete the widget when hide == TRUE, as the widget's parent
|
||||
** is destroyed and recreated.
|
||||
*/
|
||||
void
|
||||
GNOMEFE_GetFormElementValue (MWContext * context,
|
||||
LO_FormElementStruct * form_element,
|
||||
XP_Bool hide)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_get_form_element_value(view,
|
||||
form_element,
|
||||
hide);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_ResetFormElement - reset the value of the form element to the default
|
||||
** value stored in the LO_FormElementStruct.
|
||||
*/
|
||||
void
|
||||
GNOMEFE_ResetFormElement (MWContext * context,
|
||||
LO_FormElementStruct * form_element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_reset_form_element(view,
|
||||
form_element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SetFormElementToggle - set the toggle or radio button's state to
|
||||
** the toggle parameter.
|
||||
**
|
||||
** only called on CHECKBOX and RADIO form elements.
|
||||
*/
|
||||
void
|
||||
GNOMEFE_SetFormElementToggle (MWContext * context,
|
||||
LO_FormElementStruct * form_element,
|
||||
XP_Bool toggle)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_set_form_element_toggle(view,
|
||||
form_element,
|
||||
toggle);
|
||||
}
|
||||
|
||||
void
|
||||
GNOMEFE_DisplayFormElement (MWContext * context,
|
||||
int iLocation,
|
||||
LO_FormElementStruct * form_element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_display_form_element(view,
|
||||
form_element);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** FE_FreeFormElement - free up all memory associated with the front
|
||||
** end representation for this form element.
|
||||
*/
|
||||
void
|
||||
FE_FreeFormElement(MWContext *context,
|
||||
LO_FormElementData *form)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_free_form_element(view,
|
||||
form);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_BlurInputElement - force input to be defocused from the given
|
||||
** element. It's ok if the element didn't have the input focus.
|
||||
*/
|
||||
void
|
||||
FE_BlurInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_blur_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_FocusInputElement - force input to be focused on the given element.
|
||||
** It's ok if the element already has the input focus.
|
||||
*/
|
||||
void
|
||||
FE_FocusInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_focus_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SelectInputElement - select the contents of a form element.
|
||||
**
|
||||
** Only called on TEXT, TEXTAREA, PASSWORD, and FILE form elements (anything
|
||||
** with text in it.)
|
||||
**
|
||||
** This function should select the entire text contained in the FE widget.
|
||||
*/
|
||||
void
|
||||
FE_SelectInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_select_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_ClickInputElement - Simulate a click on a form element.
|
||||
**
|
||||
** Note: This function also handles clicks on HREF anchored LO_IMAGE
|
||||
** and LO_TEXT LO_Elements. In these cases, this function should
|
||||
** simulate a user clicking on the LO_Element in question.
|
||||
*/
|
||||
void
|
||||
FE_ClickInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_click_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_ChangeInputElement - handle change in form element value(s)
|
||||
**
|
||||
** This function should update the front end value for a given form
|
||||
** element, including (in the case of TEXT-like elements) just the
|
||||
** value, or (in the case of SELECT elements) both the list of
|
||||
** allowable values as well as the selected value.
|
||||
*/
|
||||
void
|
||||
FE_ChangeInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_change_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SubmitInputElement -
|
||||
**
|
||||
** Tell the FE that a form is being submitted without a UI gesture indicating
|
||||
** that fact, i.e., in a Mocha-automated fashion ("document.myform.submit()").
|
||||
** The FE is responsible for emulating whatever happens when the user hits the
|
||||
** submit button, or auto-submits by typing Enter in a single-field form.
|
||||
*/
|
||||
void
|
||||
FE_SubmitInputElement(MWContext *context,
|
||||
LO_Element *element)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
XP_ASSERT(view);
|
||||
if (!view) return; /* XXX */
|
||||
|
||||
moz_html_view_submit_input_element(view,
|
||||
(LO_FormElementStruct*)element);
|
||||
}
|
||||
|
||||
int
|
||||
FE_ClickAnyElement(MWContext *context,
|
||||
LO_Element *element,
|
||||
int haveXY,
|
||||
int32 xx,
|
||||
int32 yy)
|
||||
{
|
||||
printf ("GNOMEFE_ClickAnyElement\n");
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
XP_BEGIN_PROTOS
|
||||
|
||||
extern void GNOMEFE_GetFormElementInfo (MWContext * context, LO_FormElementStruct * form_element);
|
||||
extern void GNOMEFE_DisplayFormElement (MWContext * context, int iLocation, LO_FormElementStruct * form_element);
|
||||
extern void GNOMEFE_GetFormElementValue (MWContext * context, LO_FormElementStruct * form_element,
|
||||
XP_Bool hide);
|
||||
extern void GNOMEFE_ResetFormElement (MWContext * context, LO_FormElementStruct * form_element);
|
||||
extern void GNOMEFE_SetFormElementToggle (MWContext * context, LO_FormElementStruct * form_element,
|
||||
XP_Bool toggle);
|
||||
|
||||
XP_END_PROTOS
|
|
@ -1,91 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomegrid.c --- gnome fe handling of Grid windows
|
||||
(FRAMESET's and FRAME).
|
||||
*/
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "xpassert.h"
|
||||
#include "proto.h"
|
||||
#include "fe_proto.h"
|
||||
|
||||
void
|
||||
FE_LoadGridCellFromHistory(MWContext *context,
|
||||
void *hist,
|
||||
NET_ReloadMethod force_reload)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_LoadGridCellFromHistory (empty)\n");
|
||||
}
|
||||
|
||||
void*
|
||||
FE_FreeGridWindow(MWContext *context,
|
||||
XP_Bool save_history)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_FreeGridWindow (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_RestructureGridWindow(MWContext *context,
|
||||
int32 x,
|
||||
int32 y,
|
||||
int32 width,
|
||||
int32 height)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_RestructureGridWindow (empty)\n");
|
||||
}
|
||||
|
||||
MWContext *
|
||||
FE_MakeGridWindow(MWContext *old_context,
|
||||
void *hist_list,
|
||||
void *history,
|
||||
int32 x,
|
||||
int32 y,
|
||||
int32 width,
|
||||
int32 height,
|
||||
char *url_str,
|
||||
char *window_name,
|
||||
int8 scrolling,
|
||||
NET_ReloadMethod force_reload,
|
||||
Bool no_edge)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_MakeGridWindow (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_GetFullWindowSize(MWContext *context,
|
||||
int32 *width,
|
||||
int32 *height)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_GetFullWindowSize (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_GetEdgeMinSize(MWContext *context,
|
||||
int32 *size)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("FE_GetEdgeMinSize (empty)\n");
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
gnomehelp.c --- gnome fe stuff for NetHelp.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
char *
|
||||
FE_GetNetHelpDir()
|
||||
{
|
||||
printf("FE_GetNetHelpDir (empty)\n");
|
||||
}
|
||||
|
||||
MWContext *
|
||||
FE_GetNetHelpContext()
|
||||
{
|
||||
printf("FE_GetNetHelpContext (empty)\n");
|
||||
}
|
|
@ -1,750 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeimg.c --- gnome functions for fe
|
||||
specific images stuff.
|
||||
*/
|
||||
|
||||
#define JMC_INIT_IMGCB_ID
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
#include "libimg.h"
|
||||
#include "il_util.h"
|
||||
#include "prtypes.h"
|
||||
#include "g-util.h"
|
||||
#include "g-types.h"
|
||||
#include "gnomefe.h"
|
||||
#include "g-html-view.h"
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/X.h>
|
||||
|
||||
#define HOWMANY(x, r) (((x) + ((r) - 1)) / (r))
|
||||
#define ROUNDUP(x, r) (HOWMANY(x, r) * (r))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkPixmap *x_pixmap;
|
||||
GdkGC *gc;
|
||||
int32 x_clip_offset, y_clip_offset;
|
||||
XP_Rect *fill_rect;
|
||||
} fe_FillTiledPixmapClosure;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkPixmap *img_x_pixmap;
|
||||
GdkPixmap *mask_x_pixmap;
|
||||
GdkWindow *drawable;
|
||||
GdkGC *gc;
|
||||
GdkGC *mask_gc;
|
||||
int32 img_x_offset, img_y_offset;
|
||||
XP_Rect *fill_rect;
|
||||
} fe_FillPixmapClosure;
|
||||
|
||||
static GdkPixmap *
|
||||
fe_TiledMaskWithClipRegion(GdkWindow *drawable,
|
||||
GdkPixmap *mask_x_pixmap,
|
||||
unsigned int width, unsigned int height,
|
||||
int x_tile_offset, int y_tile_offset,
|
||||
int x_clip_offset, int y_clip_offset,
|
||||
GdkRegion **clip_region);
|
||||
|
||||
static void
|
||||
fe_DrawMaskedImageWithClipRegion(GdkWindow *drawable,
|
||||
GdkPixmap *img_x_pixmap, GdkPixmap *mask_x_pixmap,
|
||||
unsigned int width, unsigned int height,
|
||||
int img_x_offset, int img_y_offset,
|
||||
int x_offset, int y_offset,
|
||||
GdkRegion **clip_region);
|
||||
|
||||
static void
|
||||
fe_FillTiledPixmapRectFunc(void *closure, XP_Rect *clip_rect)
|
||||
{
|
||||
fe_FillTiledPixmapClosure *fill_closure =
|
||||
(fe_FillTiledPixmapClosure*)closure;
|
||||
GdkPixmap *x_pixmap = fill_closure->x_pixmap;
|
||||
GdkGC *gc = fill_closure->gc;
|
||||
int32 x_clip_offset = fill_closure->x_clip_offset;
|
||||
int32 y_clip_offset = fill_closure->y_clip_offset;
|
||||
XP_Rect *fill_rect = fill_closure->fill_rect;
|
||||
XP_Rect sub_rect;
|
||||
uint32 sub_rect_width, sub_rect_height;
|
||||
|
||||
/* Convert the clip rect's coordinates to be relative to the pixmap's
|
||||
origin. */
|
||||
XP_OffsetRect(clip_rect, x_clip_offset, y_clip_offset);
|
||||
XP_IntersectRect(clip_rect, fill_rect, &sub_rect);
|
||||
|
||||
/* Compute the width and height of the actual area to be drawn. If either
|
||||
dimension is zero, we have nothing to do. */
|
||||
sub_rect_width = sub_rect.right - sub_rect.left;
|
||||
sub_rect_height = sub_rect.bottom - sub_rect.top;
|
||||
if (!sub_rect_width || !sub_rect_height)
|
||||
return;
|
||||
|
||||
/* Draw a sub_rect of the temporary mask. */
|
||||
gdk_draw_rectangle(x_pixmap, gc, TRUE, sub_rect.left, sub_rect.top,
|
||||
sub_rect_width, sub_rect_height);
|
||||
}
|
||||
|
||||
static void
|
||||
fe_FillPixmapRectFunc(void *closure, XP_Rect *clip_rect)
|
||||
{
|
||||
fe_FillPixmapClosure *fill_closure = (fe_FillPixmapClosure*)closure;
|
||||
GdkPixmap *img_x_pixmap = fill_closure->img_x_pixmap;
|
||||
GdkPixmap *mask_x_pixmap = fill_closure->mask_x_pixmap;
|
||||
GdkWindow *drawable = fill_closure->drawable;
|
||||
GdkGC *gc = fill_closure->gc;
|
||||
GdkGC *mask_gc = fill_closure->mask_gc;
|
||||
int32 img_x_offset = fill_closure->img_x_offset;
|
||||
int32 img_y_offset = fill_closure->img_y_offset;
|
||||
XP_Rect *fill_rect = fill_closure->fill_rect;
|
||||
XP_Rect sub_rect;
|
||||
GdkPixmap *tmp_pixmap;
|
||||
unsigned long flags;
|
||||
int32 sub_rect_x_offset, sub_rect_y_offset; /* Offsets wrt image origin. */
|
||||
uint32 sub_rect_width, sub_rect_height;
|
||||
|
||||
/* Rectangle coordinates are all relative to the drawable origin. */
|
||||
XP_IntersectRect(clip_rect, fill_rect, &sub_rect);
|
||||
|
||||
/* Compute the width and height of the actual area to be drawn. If either
|
||||
dimension is zero, we have nothing to do. */
|
||||
sub_rect_width = sub_rect.right - sub_rect.left;
|
||||
sub_rect_height = sub_rect.bottom - sub_rect.top;
|
||||
if (!sub_rect_width || !sub_rect_height)
|
||||
return;
|
||||
|
||||
/* Compute the offsets, wrt the image origin, of the area to be drawn. */
|
||||
sub_rect_x_offset = sub_rect.left - img_x_offset;
|
||||
sub_rect_y_offset = sub_rect.top - img_y_offset;
|
||||
|
||||
/* Create a temporary mask pixmap which is the size of the area to be
|
||||
drawn. */
|
||||
tmp_pixmap = gdk_pixmap_new(drawable, sub_rect_width, sub_rect_height,
|
||||
1);
|
||||
gdk_window_copy_area(tmp_pixmap, mask_gc, 0, 0, mask_x_pixmap,
|
||||
sub_rect_x_offset, sub_rect_y_offset,
|
||||
sub_rect_width, sub_rect_height);
|
||||
|
||||
/* Use the temporary mask as the GC's clip mask, instead of using the
|
||||
entire image mask. For complicated masks, this has a significant
|
||||
performance benefit on X servers which convert clip_masks to
|
||||
rectangle lists. */
|
||||
gdk_gc_set_clip_mask(gc, tmp_pixmap);
|
||||
gdk_gc_set_clip_origin(gc, sub_rect.left, sub_rect.top);
|
||||
|
||||
/* Draw a sub_rect of the image. */
|
||||
gdk_window_copy_area(drawable, gc, sub_rect.left, sub_rect.top,
|
||||
img_x_pixmap,
|
||||
sub_rect_x_offset, sub_rect_y_offset,
|
||||
sub_rect_width, sub_rect_height);
|
||||
|
||||
/* Clean up. */
|
||||
gdk_pixmap_unref(tmp_pixmap);
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_init(struct IMGCB* self, JMCException* *exception)
|
||||
{
|
||||
printf ("_IMGCB_init (nothing to do)\n");
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void*)
|
||||
_IMGCB_getBackwardCompatibleInterface(struct IMGCB* self,
|
||||
const JMCInterfaceID* iid,
|
||||
JMCException* *exception)
|
||||
{
|
||||
printf ("_IMGCB_getBackwardCompatibleInterface (nothing to do)\n");
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_NewPixmap(IMGCB* img_cb, jint op, void *dpy_cx, jint width, jint height,
|
||||
IL_Pixmap *image, IL_Pixmap *mask)
|
||||
{
|
||||
MWContext *context = (MWContext *)dpy_cx; /* XXX This should be the FE's
|
||||
display context. */
|
||||
uint8 img_depth;
|
||||
NI_PixmapHeader *img_header = &image->header;
|
||||
NI_PixmapHeader *mask_header = mask ? &mask->header : NULL;
|
||||
fe_PixmapClientData *img_client_data, *mask_client_data = NULL;
|
||||
MozHTMLView *view = 0;
|
||||
unsigned int visual_depth;
|
||||
fe_Drawable *fe_drawable;
|
||||
|
||||
/*
|
||||
printf ("_IMGCB_NewPixmap (context %p, image %p, width %d, height %d)\n",
|
||||
context, image, (int) width, (int) height);
|
||||
*/
|
||||
/* Allocate the client data structures for the IL_Pixmaps. */
|
||||
img_client_data = XP_NEW_ZAP(fe_PixmapClientData);
|
||||
if (!img_client_data) {
|
||||
image->bits = NULL;
|
||||
mask->bits = NULL;
|
||||
return;
|
||||
}
|
||||
if (mask) {
|
||||
mask_client_data = XP_NEW_ZAP(fe_PixmapClientData);
|
||||
if (!mask_client_data) {
|
||||
image->bits = NULL;
|
||||
mask->bits = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* try to get the required display parameters from the html view */
|
||||
view = find_html_view(context);
|
||||
XP_ASSERT(view);
|
||||
fe_drawable = view->drawable;
|
||||
visual_depth = gdk_visual_get_best_depth();
|
||||
|
||||
/* Override the image and mask dimensions with the requested target
|
||||
dimensions. This instructs the image library to do any necessary
|
||||
scaling. */
|
||||
img_header->width = width;
|
||||
img_header->height = height;
|
||||
if (mask) {
|
||||
mask_header->width = width;
|
||||
mask_header->height = height;
|
||||
}
|
||||
|
||||
/* Override the image colorspace with the display colorspace. This
|
||||
instructs the image library to decode to the display colorspace
|
||||
instead of decoding to the image's source colorspace. */
|
||||
IL_ReleaseColorSpace(img_header->color_space);
|
||||
img_header->color_space = context->color_space;
|
||||
IL_AddRefToColorSpace(img_header->color_space);
|
||||
|
||||
/* Compute the number of bytes per scan line for the image and mask,
|
||||
and make sure it is quadlet aligned. */
|
||||
|
||||
img_depth = img_header->color_space->pixmap_depth;
|
||||
XP_ASSERT(img_depth == visual_depth);
|
||||
img_header->widthBytes = (img_header->width * img_depth + 7) / 8;
|
||||
img_header->widthBytes = ROUNDUP(img_header->widthBytes, 4);
|
||||
if (mask) {
|
||||
mask_header->widthBytes = (mask_header->width + 7) / 8;
|
||||
mask_header->widthBytes = ROUNDUP(mask_header->widthBytes, 4);
|
||||
}
|
||||
|
||||
/* Allocate memory for the image bits, and for the mask bits (if
|
||||
required.) */
|
||||
image->bits = calloc(img_header->widthBytes * img_header->height, 1);
|
||||
if (!image->bits)
|
||||
return;
|
||||
if (mask) {
|
||||
mask->bits = calloc(mask_header->widthBytes * mask_header->height, 1);
|
||||
if (!mask->bits) {
|
||||
free(image->bits);
|
||||
image->bits = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create an X pixmap for the image, and for the mask (if required.) */
|
||||
img_client_data->gdk_pixmap =
|
||||
gdk_pixmap_new(view->scrolled_window->window,
|
||||
img_header->width,
|
||||
img_header->height,
|
||||
visual_depth);
|
||||
/*
|
||||
printf("\tNewpixmap: width, height = %d, %d\n",
|
||||
img_header->width,
|
||||
img_header->height);
|
||||
*/
|
||||
if (mask)
|
||||
{
|
||||
mask_client_data->gdk_pixmap =
|
||||
gdk_pixmap_new(view->scrolled_window->window,
|
||||
mask_header->width,
|
||||
mask_header->height,
|
||||
1);
|
||||
/*
|
||||
printf("Newbitmap: width, height = %d, %d\n",
|
||||
mask_header->width,
|
||||
mask_header->height);
|
||||
*/
|
||||
}
|
||||
|
||||
/* Fill in the pixmap client_data. */
|
||||
image->client_data = (void *)img_client_data;
|
||||
if (mask)
|
||||
mask->client_data = (void *)mask_client_data;
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_UpdatePixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* pixmap,
|
||||
jint x_offset, jint y_offset, jint width, jint height)
|
||||
{
|
||||
uint32 widthBytes;
|
||||
MWContext *context = (MWContext *)dpy_cx; /* XXX This should be the FE's
|
||||
display context. */
|
||||
unsigned int visual_depth;
|
||||
unsigned int pixmap_depth; /* Depth of the IL_Pixmap. */
|
||||
Visual *visual;
|
||||
Pixmap x_pixmap;
|
||||
Display *dpy;
|
||||
XImage *x_image;
|
||||
GC gc;
|
||||
XGCValues gcv;
|
||||
IL_ColorSpace *color_space = pixmap->header.color_space;
|
||||
char *bits;
|
||||
fe_PixmapClientData *pixmap_client_data;
|
||||
fe_Drawable *fe_drawable;
|
||||
MozHTMLView *view = 0;
|
||||
GdkPixmap *gdk_pixmap;
|
||||
GdkImage *gdk_image;
|
||||
GdkGC *gdk_gc;
|
||||
GdkGCValues *gdkgc_values;
|
||||
|
||||
/*
|
||||
printf ("_IMGCB_UpdatePixmap (context %p, image %p, width %d, height %d)\n",
|
||||
context, pixmap, (int)width, (int)height) ;
|
||||
*/
|
||||
if (!context)
|
||||
return;
|
||||
|
||||
/* get the client data */
|
||||
pixmap_client_data = (fe_PixmapClientData *)pixmap->client_data;
|
||||
view = find_html_view(context);
|
||||
XP_ASSERT(view);
|
||||
fe_drawable = view->drawable;
|
||||
|
||||
gdk_pixmap = pixmap_client_data->gdk_pixmap;
|
||||
|
||||
/* try to get the required display parameters from the pixmap */
|
||||
visual_depth = gdk_visual_get_best_depth();
|
||||
dpy = GDK_WINDOW_XDISPLAY(pixmap_client_data->gdk_pixmap);
|
||||
visual = GDK_VISUAL_XVISUAL(gnomefe_visual);
|
||||
|
||||
/* Check for zero dimensions. */
|
||||
if (width == 0 || height == 0)
|
||||
return;
|
||||
|
||||
/* Get the depth of the IL_Pixmap. This should be the same as the
|
||||
visual_pixmap_depth if the IL_Pixmap is an image, or 1 if the
|
||||
IL_Pixmap is a mask. */
|
||||
pixmap_depth = color_space->pixmap_depth;
|
||||
|
||||
widthBytes = pixmap->header.widthBytes;
|
||||
bits = (unsigned char *)pixmap->bits + widthBytes * y_offset;
|
||||
|
||||
x_image = XCreateImage(dpy, visual,
|
||||
((pixmap_depth == 1) ? 1 : visual_depth),
|
||||
((pixmap_depth == 1) ? XYPixmap : ZPixmap),
|
||||
x_offset, /* offset */
|
||||
bits,
|
||||
width,
|
||||
height,
|
||||
8, /* bitmap_pad */
|
||||
widthBytes); /* bytes_per_line */
|
||||
|
||||
if (pixmap_depth == 1) {
|
||||
/* Image library always places pixels left-to-right MSB to LSB */
|
||||
x_image->bitmap_bit_order = MSBFirst;
|
||||
|
||||
/* This definition doesn't depend on client byte ordering
|
||||
because the image library ensures that the bytes in
|
||||
bitmask data are arranged left to right on the screen,
|
||||
low to high address in memory. */
|
||||
x_image->byte_order = MSBFirst;
|
||||
}
|
||||
else {
|
||||
#if defined(IS_LITTLE_ENDIAN)
|
||||
x_image->byte_order = LSBFirst;
|
||||
#elif defined (IS_BIG_ENDIAN)
|
||||
x_image->byte_order = MSBFirst;
|
||||
#else
|
||||
ERROR! Endianness is unknown;
|
||||
#endif
|
||||
}
|
||||
|
||||
pixmap_client_data = (fe_PixmapClientData *)pixmap->client_data;
|
||||
x_pixmap = GDK_WINDOW_XWINDOW(pixmap_client_data->gdk_pixmap);
|
||||
|
||||
memset(&gcv, ~0, sizeof(XGCValues));
|
||||
gcv.function = GXcopy;
|
||||
|
||||
/* The pixmap_depth does not correspond to that of the GCs in the
|
||||
cache, so create a new GC. */
|
||||
gc = XCreateGC(dpy, x_pixmap, GCFunction, &gcv);
|
||||
|
||||
XPutImage(dpy, x_pixmap, gc, x_image, x_offset, 0, x_offset,
|
||||
y_offset, width, height);
|
||||
|
||||
XFreeGC(dpy, gc);
|
||||
x_image->data = 0; /* Don't free the IL_Pixmap's bits. */
|
||||
XDestroyImage(x_image);
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_ControlPixmapBits(IMGCB* img_cb, jint op, void* dpy_cx,
|
||||
IL_Pixmap* pixmap, IL_PixmapControl message)
|
||||
{
|
||||
if (message == IL_RELEASE_BITS) {
|
||||
printf ("_IMGCB_ControlPixmapBits (image complete)\n");
|
||||
}
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_DestroyPixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* pixmap)
|
||||
{
|
||||
fe_PixmapClientData *pixmap_client_data;
|
||||
|
||||
/* printf ("_IMGCB_DestroyPixmap\n"); */
|
||||
pixmap_client_data = (fe_PixmapClientData *)pixmap->client_data;
|
||||
if (!pixmap_client_data)
|
||||
return;
|
||||
if (pixmap_client_data->gdk_pixmap)
|
||||
gdk_pixmap_unref(pixmap_client_data->gdk_pixmap);
|
||||
if (pixmap->bits) {
|
||||
free(pixmap->bits);
|
||||
pixmap->bits = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_DisplayPixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* image,
|
||||
IL_Pixmap* mask, jint x, jint y, jint x_offset,
|
||||
jint y_offset, jint width, jint height, jint j, jint k)
|
||||
{
|
||||
|
||||
MWContext *context = (MWContext *)dpy_cx; /* XXX This should be the FE's
|
||||
display context. */
|
||||
|
||||
int32 img_x_offset, img_y_offset; /* Offset of image in drawable. */
|
||||
int32 rect_x_offset, rect_y_offset; /* Offset of update rect in
|
||||
drawable. */
|
||||
NI_PixmapHeader *img_header = &image->header;
|
||||
uint32 img_width = img_header->width; /* Image width. */
|
||||
uint32 img_height = img_header->height; /* Image height. */
|
||||
|
||||
fe_Drawable *fe_drawable = find_html_view(context)->drawable;
|
||||
GdkDrawable *drawable = fe_drawable->drawable;
|
||||
fe_PixmapClientData *img_client_data, *mask_client_data;
|
||||
|
||||
GdkPixmap *img_x_pixmap=NULL, *mask_x_pixmap=NULL;
|
||||
GdkGC *gc;
|
||||
XP_Bool tiling_required = FALSE;
|
||||
GdkWindow * window = (GdkWindow *)fe_drawable->drawable;
|
||||
|
||||
/*
|
||||
printf ("_IMGCB_DisplayPixmap (context %p, image %p, width %d, height %d)\n",
|
||||
context, image, (int)width, (int)height);
|
||||
*/
|
||||
/* Check for zero display area. */
|
||||
if (width == 0 || height == 0)
|
||||
return;
|
||||
|
||||
/* Retrieve the server pixmaps. */
|
||||
img_client_data = (fe_PixmapClientData *)image->client_data;
|
||||
if (!img_client_data)
|
||||
return;
|
||||
img_x_pixmap = img_client_data->gdk_pixmap;
|
||||
if (!img_x_pixmap)
|
||||
return;
|
||||
if (mask) {
|
||||
mask_client_data = (fe_PixmapClientData *)mask->client_data;
|
||||
mask_x_pixmap = mask_client_data->gdk_pixmap;
|
||||
}
|
||||
|
||||
/* Determine whether tiling is required. */
|
||||
if ((x_offset + width > img_width) || (y_offset + height > img_height))
|
||||
tiling_required = TRUE;
|
||||
|
||||
/* Compute the offset into the drawable of the image origin. */
|
||||
img_x_offset = x - find_html_view(context)->doc_x +
|
||||
fe_drawable->x_origin;
|
||||
img_y_offset = y - find_html_view(context)->doc_y +
|
||||
fe_drawable->y_origin;
|
||||
|
||||
/* Compute the offset into the drawable for the area to be drawn. */
|
||||
rect_x_offset = img_x_offset + x_offset;
|
||||
rect_y_offset = img_y_offset + y_offset;
|
||||
|
||||
/* Do the actual drawing. There are several cases to be dealt with:
|
||||
transparent vs non-transparent, tiled vs non-tiled and clipped by
|
||||
compositor's clip region vs not clipped. */
|
||||
|
||||
if (mask) /* image is transparent */
|
||||
{
|
||||
if (tiling_required)
|
||||
{
|
||||
/* Offsets are measured wrt the origin of the tiled mask to
|
||||
be generated. */
|
||||
int x_tile_offset = img_x_offset - rect_x_offset;
|
||||
int y_tile_offset = img_y_offset - rect_y_offset;
|
||||
GdkPixmap *tmp_pixmap = NULL;
|
||||
GdkGC *tmp_gc;
|
||||
/* Create the mask by tiling the mask_x_pixmap and computing
|
||||
the intersection with the compositor's clip region. */
|
||||
tmp_pixmap =
|
||||
fe_TiledMaskWithClipRegion(fe_drawable->drawable,
|
||||
mask_x_pixmap,
|
||||
width, height,
|
||||
x_tile_offset, y_tile_offset,
|
||||
-rect_x_offset, -rect_y_offset,
|
||||
fe_drawable->clip_region);
|
||||
tmp_gc = gdk_gc_new(window);
|
||||
gdk_gc_set_fill(tmp_gc, GDK_TILED);
|
||||
gdk_gc_set_tile(tmp_gc, img_x_pixmap);
|
||||
gdk_gc_set_ts_origin(tmp_gc, img_x_offset, img_y_offset);
|
||||
gdk_gc_set_clip_mask(tmp_gc, tmp_pixmap);
|
||||
gdk_gc_set_clip_origin(tmp_gc, rect_x_offset, rect_y_offset);
|
||||
gdk_draw_rectangle(window, tmp_gc, TRUE, rect_x_offset, rect_y_offset,
|
||||
width, height);
|
||||
gdk_gc_unref(tmp_gc);
|
||||
gdk_pixmap_unref(tmp_pixmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
if (fe_drawable->clip_region)
|
||||
{
|
||||
fe_DrawMaskedImageWithClipRegion(window,
|
||||
img_x_pixmap, mask_x_pixmap,
|
||||
width, height,
|
||||
img_x_offset, img_y_offset,
|
||||
x_offset, y_offset,
|
||||
fe_drawable->clip_region);
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
gc = gdk_gc_new(window);
|
||||
gdk_gc_set_clip_mask(gc, mask_x_pixmap);
|
||||
gdk_gc_set_clip_origin(gc, img_x_offset, img_y_offset);
|
||||
gdk_draw_pixmap(drawable, gc, img_x_pixmap,
|
||||
x_offset, y_offset,
|
||||
rect_x_offset, rect_y_offset,
|
||||
width, height);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* image is not transparent */
|
||||
if (tiling_required)
|
||||
{
|
||||
GdkGC *tmp_gc;
|
||||
tmp_gc = gdk_gc_new(window);
|
||||
gdk_gc_set_fill(tmp_gc, GDK_TILED);
|
||||
gdk_gc_set_tile(tmp_gc, img_x_pixmap);
|
||||
gdk_gc_set_ts_origin(tmp_gc, img_x_offset, img_y_offset);
|
||||
gdk_draw_rectangle(window, tmp_gc, TRUE,
|
||||
rect_x_offset, rect_y_offset, width, height);
|
||||
gdk_gc_unref(tmp_gc);
|
||||
}
|
||||
else /* tiling not required */
|
||||
{
|
||||
GdkGC *tmp_gc;
|
||||
tmp_gc = gdk_gc_new(window);
|
||||
gdk_window_copy_area(window, tmp_gc, rect_x_offset, rect_y_offset,
|
||||
img_x_pixmap, x_offset, y_offset, width, height);
|
||||
gdk_gc_unref(tmp_gc);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
gc = gdk_gc_new(window);
|
||||
if (mask)
|
||||
{
|
||||
gdk_gc_set_clip_mask(gc, mask_x_pixmap);
|
||||
gdk_gc_set_clip_origin(gc, img_x_offset, img_y_offset);
|
||||
}
|
||||
else if ((fe_drawable->clip_region) && (tiling_required == FALSE))
|
||||
{
|
||||
/*printf("draw_pixmap: using clip region at %p\n", fe_drawable->clip_region); */
|
||||
gdk_gc_set_clip_region(gc, *(GdkRegion **)fe_drawable->clip_region);
|
||||
}
|
||||
if (tiling_required)
|
||||
{
|
||||
GdkPixmap *tmp_pixmap;
|
||||
int cur_x = 0;
|
||||
int cur_y = 0;
|
||||
int draw_width = 0;
|
||||
int draw_height = 0;
|
||||
tmp_pixmap = gdk_pixmap_new((GdkWindow *)fe_drawable->drawable,
|
||||
width, height,
|
||||
img_header->color_space->pixmap_depth);
|
||||
printf("DrawPixmap: Create tmp image width %d height %d from img_width %d img_height %d x_offset %d y_offset %d rect_x_offset %d rect_y_offset %d\n",
|
||||
width, height, img_width, img_height, x_offset, y_offset, rect_x_offset, rect_y_offset);
|
||||
while (cur_y < height)
|
||||
{
|
||||
while (cur_x < width)
|
||||
{
|
||||
if ((width - cur_x) < img_width)
|
||||
draw_width = (width - cur_x);
|
||||
else
|
||||
draw_width = img_width;
|
||||
if ((height - cur_y) < img_height)
|
||||
draw_height = ( height - cur_y );
|
||||
else
|
||||
draw_height = img_height;
|
||||
printf("DrawPixmap: drawing tile at cur_x %d cur_y %d draw_width %d draw_height %d\n",
|
||||
cur_x, cur_y, draw_width, draw_height);
|
||||
gdk_draw_pixmap(tmp_pixmap, gc, img_x_pixmap,
|
||||
x_offset, y_offset,
|
||||
cur_x, cur_y,
|
||||
draw_width, draw_height);
|
||||
cur_x += img_width;
|
||||
}
|
||||
cur_y += img_height;
|
||||
cur_x = 0;
|
||||
}
|
||||
gdk_draw_pixmap(drawable, gc, tmp_pixmap,
|
||||
x_offset, y_offset,
|
||||
rect_x_offset, rect_y_offset,
|
||||
width, height);
|
||||
}
|
||||
else {
|
||||
/*
|
||||
printf("draw_pixmap (xo %d, yo %d, rxo %d, ryo %d, w %d, h %d)\n",
|
||||
x_offset, y_offset,
|
||||
rect_x_offset, rect_y_offset,
|
||||
width, height);
|
||||
*/
|
||||
gdk_draw_pixmap(drawable, gc, img_x_pixmap,
|
||||
x_offset, y_offset,
|
||||
rect_x_offset, rect_y_offset,
|
||||
width, height);
|
||||
}
|
||||
|
||||
/* Clean up. */
|
||||
gdk_gc_destroy(gc);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_GetIconDimensions(IMGCB* img_cb, jint op, void* dpy_cx, int* width,
|
||||
int* height, jint icon_number)
|
||||
{
|
||||
printf ("_IMGCB_GetIconDimensions\n");
|
||||
}
|
||||
|
||||
JMC_PUBLIC_API(void)
|
||||
_IMGCB_DisplayIcon(IMGCB* img_cb, jint op, void* dpy_cx, jint x, jint y,
|
||||
jint icon_number)
|
||||
{
|
||||
printf ("_IMGCB_DisplayIcon\n");
|
||||
}
|
||||
|
||||
/* Mocha image group observer callback. */
|
||||
void
|
||||
FE_MochaImageGroupObserver(XP_Observable observable, XP_ObservableMsg message,
|
||||
void *message_data, void *closure)
|
||||
{
|
||||
printf("FE_MochaImageGroupObserver (empty)\n");
|
||||
}
|
||||
|
||||
/* Generate a tiled mask for the case where the fe_Drawable has a clip
|
||||
region. Offset arguments are wrt the origin of the tiled mask. */
|
||||
static GdkPixmap *
|
||||
fe_TiledMaskWithClipRegion(GdkWindow *drawable,
|
||||
GdkPixmap *mask_x_pixmap,
|
||||
unsigned int width, unsigned int height,
|
||||
int x_tile_offset, int y_tile_offset,
|
||||
int x_clip_offset, int y_clip_offset,
|
||||
GdkRegion **clip_region)
|
||||
{
|
||||
GdkGC *gc;
|
||||
XGCValues gcv;
|
||||
unsigned long flags;
|
||||
XP_Rect fill_rect;
|
||||
GdkPixmap *ret_x_pixmap;
|
||||
fe_FillTiledPixmapClosure fill_closure;
|
||||
|
||||
|
||||
ret_x_pixmap = gdk_pixmap_new(drawable, width, height, 1);
|
||||
|
||||
/* The pixmap must be cleared since it may cover areas which do not
|
||||
belong to the clip region. */
|
||||
gc = gdk_gc_new(drawable);
|
||||
gdk_gc_set_function(gc, GDK_CLEAR);
|
||||
gdk_draw_rectangle(ret_x_pixmap, gc, TRUE, 0, 0, width, height);
|
||||
|
||||
/* Set up the GC. */
|
||||
gdk_gc_set_function(gc, GDK_COPY);
|
||||
gdk_gc_set_fill(gc, GDK_TILED);
|
||||
gdk_gc_set_tile(gc, mask_x_pixmap);
|
||||
gdk_gc_set_ts_origin(gc, x_tile_offset, y_tile_offset);
|
||||
|
||||
/* Tile the mask_pixmap into the tiled_mask_pixmap, but only do so for
|
||||
areas in the clip region's rectangle list. */
|
||||
fill_rect.left = 0;
|
||||
fill_rect.top = 0;
|
||||
fill_rect.right = width;
|
||||
fill_rect.bottom = height;
|
||||
fill_closure.fill_rect = &fill_rect;
|
||||
fill_closure.x_pixmap = ret_x_pixmap;
|
||||
fill_closure.gc = gc;
|
||||
fill_closure.x_clip_offset = x_clip_offset;
|
||||
fill_closure.y_clip_offset = y_clip_offset;
|
||||
FE_ForEachRectInRegion(clip_region, fe_FillTiledPixmapRectFunc,
|
||||
&fill_closure);
|
||||
|
||||
/* Clean up. */
|
||||
gdk_gc_unref(gc);
|
||||
|
||||
return ret_x_pixmap;
|
||||
}
|
||||
|
||||
/* Draw the masked image for each rectangle in the compositor's clip region.
|
||||
x_offset and y_offset are wrt the image origin, while rect_x_offset and
|
||||
rect_y_offset are wrt the drawable origin. */
|
||||
static void
|
||||
fe_DrawMaskedImageWithClipRegion(GdkWindow *drawable,
|
||||
GdkPixmap *img_x_pixmap, GdkPixmap *mask_x_pixmap,
|
||||
unsigned int width, unsigned int height,
|
||||
int img_x_offset, int img_y_offset,
|
||||
int x_offset, int y_offset,
|
||||
GdkRegion **clip_region)
|
||||
{
|
||||
GdkGC *gc;
|
||||
GdkGC *mask_gc;
|
||||
XP_Rect fill_rect;
|
||||
fe_FillPixmapClosure fill_closure;
|
||||
|
||||
/* Set up the GCs. */
|
||||
gc = gdk_gc_new(drawable);
|
||||
mask_gc = gdk_gc_new(drawable);
|
||||
|
||||
/* Draw the masked image into the drawable, but only do so for areas in
|
||||
the clip region's rectangle list. */
|
||||
fill_rect.left = img_x_offset + x_offset;
|
||||
fill_rect.top = img_y_offset + y_offset;
|
||||
fill_rect.right = fill_rect.left + width;
|
||||
fill_rect.bottom = fill_rect.top + height;
|
||||
fill_closure.fill_rect = &fill_rect;
|
||||
fill_closure.img_x_pixmap = img_x_pixmap;
|
||||
fill_closure.mask_x_pixmap = mask_x_pixmap;
|
||||
fill_closure.drawable = drawable;
|
||||
fill_closure.gc = gc;
|
||||
fill_closure.mask_gc = mask_gc;
|
||||
fill_closure.img_x_offset = img_x_offset;
|
||||
fill_closure.img_y_offset = img_y_offset;
|
||||
FE_ForEachRectInRegion(clip_region, fe_FillPixmapRectFunc, &fill_closure);
|
||||
|
||||
/* Clean up. */
|
||||
gdk_gc_unref(gc);
|
||||
gdk_gc_unref(mask_gc);
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeedit.c --- gnome functions for fe
|
||||
specific editor stuff.
|
||||
*/
|
||||
|
||||
#include "libimg.h" /* Image Library public API. */
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "lo_ele.h"
|
||||
|
||||
#include "layers.h"
|
||||
|
||||
#include "g-util.h"
|
||||
#include "g-font-select.h"
|
||||
|
||||
void
|
||||
FE_ReleaseTextAttrFeData(MWContext *context,
|
||||
LO_TextAttr *attr)
|
||||
{
|
||||
printf ("FE_ReleaseTextAttrFeData\n");
|
||||
moz_font_release_text_attribute(attr);
|
||||
}
|
||||
|
||||
PRBool
|
||||
FE_HandleLayerEvent(MWContext *context,
|
||||
CL_Layer *layer,
|
||||
CL_Event *event)
|
||||
{
|
||||
MozHTMLView *view = find_html_view(context);
|
||||
|
||||
switch(event->type)
|
||||
{
|
||||
case CL_EVENT_MOUSE_MOVE:
|
||||
html_view_handle_pointer_motion_for_layer(view, layer, event);
|
||||
return TRUE;
|
||||
break;
|
||||
case CL_EVENT_MOUSE_BUTTON_DOWN:
|
||||
html_view_handle_button_press_for_layer(view, layer, event);
|
||||
return TRUE;
|
||||
break;
|
||||
case CL_EVENT_MOUSE_BUTTON_UP:
|
||||
html_view_handle_button_release_for_layer(view, layer, event);
|
||||
return TRUE;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
FE_HandleEmbedEvent(MWContext *context,
|
||||
LO_EmbedStruct *embed,
|
||||
CL_Event *event)
|
||||
{
|
||||
printf ("FE_HandleEmbedEvent\n");
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeloc.c --- gnome fe handling of locale specific stuff.
|
||||
*/
|
||||
|
||||
#include "xplocale.h"
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "xpassert.h"
|
||||
#include "proto.h"
|
||||
#include "fe_proto.h"
|
||||
|
||||
#include "libi18n.h"
|
||||
|
||||
#include "csid.h"
|
||||
|
||||
|
||||
int16 fe_LocaleCharSetID = CS_LATIN1;
|
||||
|
||||
/*
|
||||
** FE_StrfTime - format a struct tm to a character string, depending
|
||||
** on the value of the format parameter.
|
||||
**
|
||||
** Values for format (and their mapping to unix strftime format
|
||||
** strings) include:
|
||||
**
|
||||
** XP_TIME_FORMAT - "%H:%M"
|
||||
** XP_WEEKDAY_TIME_FORMAT - "%a %H:%M"
|
||||
** XP_DATE_TIME_FORMAT - "%x %H:%M"
|
||||
** XP_LONG_DATE_TIME_FORMAT - "%c"
|
||||
** anything else - "%c"
|
||||
*/
|
||||
size_t
|
||||
FE_StrfTime(MWContext *context,
|
||||
char *result,
|
||||
size_t maxsize,
|
||||
int format,
|
||||
const struct tm *timeptr)
|
||||
{
|
||||
printf("FE_StrfTime (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_StrColl - call into the platform specific strcoll function.
|
||||
**
|
||||
** Make sure strcoll() or equivalent works properly. For example,
|
||||
** the XFE has a check to make sure it does work, and if it doesn't
|
||||
** it defaults to strcasecmp.
|
||||
*/
|
||||
int
|
||||
FE_StrColl(const char *s1, const char *s2)
|
||||
{
|
||||
printf("FE_StrColl (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** INTL_ResourceCharSet - return the ascii name for the locale's
|
||||
** character set id.
|
||||
**
|
||||
** Use INTL_CharSetIDToName to retrieve the name given a CSID.
|
||||
**
|
||||
** Note: This is a silly function, IMO. It should just return the
|
||||
** CSID, and the libi18n stuff could convert it to a name if it wants
|
||||
** to.
|
||||
*/
|
||||
char *
|
||||
INTL_ResourceCharSet()
|
||||
{
|
||||
printf("INTL_ResourceCharSet (empty)\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** INTL_DefaultDocCharSetID - return the default character set id for
|
||||
** a given context.
|
||||
**
|
||||
** It should first try to extract the csid from the document being shown in
|
||||
** the context. using LO_GetDocumentCharacterSetInfo and INTL_GetCSIDocCSID.
|
||||
**
|
||||
** If this fails, and the user has specified an encoding (using the View|Encoding
|
||||
** menu, is should return the CSID for that.
|
||||
**
|
||||
** Otherwise, it should return the FE's default preference for CSID.
|
||||
*/
|
||||
int16
|
||||
INTL_DefaultDocCharSetID(MWContext *cxt)
|
||||
{
|
||||
printf("INTL_DefaultDocCharSetID\n");
|
||||
return (CS_LATIN1);
|
||||
}
|
||||
|
||||
/*
|
||||
** INTL_Relayout - relayout a given context, as the character encoding
|
||||
** has changed.
|
||||
*/
|
||||
void
|
||||
INTL_Relayout(MWContext *pContext)
|
||||
{
|
||||
printf("INTL_Relayout (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
INTLCharSetID
|
||||
FE_GetCharSetID(INTL_CharSetID_Selector selector)
|
||||
{
|
||||
INTLCharSetID charsetID = CS_DEFAULT;
|
||||
|
||||
switch (selector)
|
||||
{
|
||||
case INTL_FileNameCsidSel:
|
||||
case INTL_DefaultTextWidgetCsidSel:
|
||||
charsetID = (INTLCharSetID) fe_LocaleCharSetID;
|
||||
break;
|
||||
case INTL_OldBookmarkCsidSel:
|
||||
charsetID = (INTLCharSetID) INTL_DocToWinCharSetID(fe_LocaleCharSetID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
XP_ASSERT(CS_DEFAULT != charsetID);
|
||||
|
||||
return charsetID;
|
||||
}
|
|
@ -1,229 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomemail.c --- gnome functions for fe
|
||||
specific mail/news stuff.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "msgcom.h"
|
||||
#include "addrbook.h"
|
||||
#include "dirprefs.h"
|
||||
|
||||
const char*
|
||||
FE_UsersMailAddress()
|
||||
{
|
||||
printf("FE_UsersMailAddress (empty)\n");
|
||||
}
|
||||
|
||||
const char*
|
||||
FE_UsersFullName()
|
||||
{
|
||||
printf("FE_UsersFullName (empty)\n");
|
||||
}
|
||||
|
||||
const char *
|
||||
FE_UsersOrganization()
|
||||
{
|
||||
printf("FE_UsersOrganization (empty)\n");
|
||||
}
|
||||
|
||||
const char*
|
||||
FE_UsersSignature()
|
||||
{
|
||||
printf("FE_UsersSignature (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ListChangeStarting(MSG_Pane* pane,
|
||||
XP_Bool asynchronous,
|
||||
MSG_NOTIFY_CODE notify,
|
||||
MSG_ViewIndex where,
|
||||
int32 num)
|
||||
{
|
||||
printf("FE_ListChangeStarting (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ListChangeFinished(MSG_Pane* pane,
|
||||
XP_Bool asynchronous,
|
||||
MSG_NOTIFY_CODE notify,
|
||||
MSG_ViewIndex where,
|
||||
int32 num)
|
||||
{
|
||||
printf("FE_ListChangeFinished (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_PaneChanged(MSG_Pane *pane,
|
||||
XP_Bool asynchronous,
|
||||
MSG_PANE_CHANGED_NOTIFY_CODE notify_code,
|
||||
int32 value)
|
||||
{
|
||||
printf("FE_PaneChanged (empty)\n");
|
||||
}
|
||||
|
||||
char*
|
||||
FE_GetTempFileFor(MWContext* context,
|
||||
const char* fname,
|
||||
XP_FileType ftype,
|
||||
XP_FileType* rettype)
|
||||
{
|
||||
printf("FE_GetTempFileFor (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_UpdateBiff(MSG_BIFF_STATE state)
|
||||
{
|
||||
printf("FE_UpdateBiff (empty)\n");
|
||||
}
|
||||
|
||||
uint32
|
||||
FE_DiskSpaceAvailable (MWContext* context,
|
||||
const char* dir)
|
||||
{
|
||||
printf("FE_DiskSpaceAvailable (empty)\n");
|
||||
}
|
||||
|
||||
MSG_Pane*
|
||||
FE_CreateCompositionPane(MWContext* old_context,
|
||||
MSG_CompositionFields* fields,
|
||||
const char* initialText,
|
||||
MSG_EditorType editorType)
|
||||
{
|
||||
printf("FE_CreateCompositionPane (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_UpdateCompToolbar(MSG_Pane* comppane)
|
||||
{
|
||||
printf("FE_UpdateCompToolbar (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_DestroyMailCompositionContext(MWContext* context)
|
||||
{
|
||||
printf("FE_DestroyMailCompositionContext (empty)\n");
|
||||
}
|
||||
|
||||
MWContext*
|
||||
FE_GetAddressBookContext(MSG_Pane* pane,
|
||||
XP_Bool viewnow)
|
||||
{
|
||||
printf("FE_GetAddressBookContext (empty)\n");
|
||||
}
|
||||
|
||||
ABook*
|
||||
FE_GetAddressBook(MSG_Pane* pane)
|
||||
{
|
||||
printf("FE_GetAddressBook (empty)\n");
|
||||
}
|
||||
|
||||
int
|
||||
FE_ShowPropertySheetFor (MWContext* context,
|
||||
ABID entryID,
|
||||
PersonEntry* pPerson)
|
||||
{
|
||||
printf("FE_ShowPropertySheetFor (empty)\n");
|
||||
}
|
||||
|
||||
XP_List*
|
||||
FE_GetDirServers(void)
|
||||
{
|
||||
printf("FE_GetDirServers (empty)\n");
|
||||
}
|
||||
|
||||
MSG_Master*
|
||||
FE_GetMaster()
|
||||
{
|
||||
printf("FE_GetMaster (empty)\n");
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
FE_IsAltMailUsed(MWContext* context)
|
||||
{
|
||||
printf("FE_IsAltMailUsed (empty)\n");
|
||||
}
|
||||
|
||||
MSG_IMAPUpgradeType
|
||||
FE_PromptIMAPSubscriptionUpgrade(MWContext* context, const char *host)
|
||||
{
|
||||
printf("FE_PromptIMAPSubscriptionUpgrade (empty)\n");
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
FE_CreateSubscribePaneOnHost(MSG_Master* master,
|
||||
MWContext* parentContext,
|
||||
MSG_Host* host)
|
||||
{
|
||||
printf("FE_CreateSubscribePaneOnHost (empty)\n");
|
||||
}
|
||||
|
||||
const char *
|
||||
FE_UsersRealMailAddress()
|
||||
{
|
||||
printf("FE_UsersRealMailAddress (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_RememberPopPassword(MWContext* context,
|
||||
const char* password)
|
||||
{
|
||||
printf("FE_RememberPopPassword (empty)\n");
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
FE_NewsDownloadPrompt(MWContext *context,
|
||||
int32 numMessagesToDownload,
|
||||
XP_Bool *downloadAll)
|
||||
{
|
||||
printf("FE_NewsDownloadPrompt (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_MsgShowHeaders(MSG_Pane *pPane,
|
||||
MSG_HEADER_SET mhsHeaders)
|
||||
{
|
||||
printf("FE_MsgShowHeaders (empty)\n");
|
||||
}
|
||||
|
||||
/* If we're set up to deliver mail/news by running a program rather
|
||||
than by talking to SMTP/NNTP, this does it.
|
||||
|
||||
Returns positive if delivery via program was successful;
|
||||
Returns negative if delivery failed;
|
||||
Returns 0 if delivery was not attempted (in which case we
|
||||
should use SMTP/NNTP instead.)
|
||||
|
||||
$NS_MSG_DELIVERY_HOOK names a program which is invoked with one argument,
|
||||
a tmp file containing a message. (Lines are terminated with CRLF.)
|
||||
This program is expected to parse the To, CC, BCC, and Newsgroups headers,
|
||||
and effect delivery to mail and/or news. It should exit with status 0
|
||||
iff successful.
|
||||
|
||||
#### This really wants to be defined in libmsg, but it wants to
|
||||
be able to use fe_perror, so...
|
||||
*/
|
||||
int
|
||||
msg_DeliverMessageExternally(MWContext *context, const char *msg_file)
|
||||
{
|
||||
printf("msg_DeliverMessageExternally (empty)\n");
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeplug.c --- gnome functions for fe
|
||||
specific plugin stuff.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "nppriv.h"
|
||||
|
||||
void
|
||||
FE_RegisterPlugins()
|
||||
{
|
||||
printf("FE_RegisterPlugins (empty)\n");
|
||||
}
|
||||
|
||||
NPPluginFuncs*
|
||||
FE_LoadPlugin(void *plugin,
|
||||
NPNetscapeFuncs *funcs,
|
||||
struct _np_handle* handle)
|
||||
{
|
||||
printf("FE_LoadPlugin (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_UnloadPlugin(void *plugin,
|
||||
struct _np_handle *handle)
|
||||
{
|
||||
printf("FE_UnloadPlugin (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_EmbedURLExit(URL_Struct *urls,
|
||||
int status,
|
||||
MWContext *cx)
|
||||
{
|
||||
printf("FE_EmbedURLExit (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_ShowScrollBars(MWContext *context,
|
||||
XP_Bool show)
|
||||
{
|
||||
printf("FE_ShowScrollBars (empty)\n");
|
||||
}
|
||||
|
||||
NPError
|
||||
FE_PluginGetValue(void *pdesc,
|
||||
NPNVariable variable,
|
||||
void *r_value)
|
||||
{
|
||||
printf("FE_PluginGetValue (empty)\n");
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* gnome-posixfe.c --- stuff that should live in posixfe */
|
||||
|
||||
#include "structs.h"
|
||||
|
||||
void fe_GetProgramDirectory(char *path, int len)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
FE_ShowMinibuffer(MWContext *context)
|
||||
{
|
||||
printf("FE_ShowMinibuffer (empty)\n");
|
||||
}
|
||||
|
||||
void FEU_StayingAlive(void)
|
||||
{
|
||||
}
|
||||
|
||||
void FE_AlternateCompose(
|
||||
char * from, char * reply_to, char * to, char * cc, char * bcc,
|
||||
char * fcc, char * newsgroups, char * followup_to,
|
||||
char * organization, char * subject, char * references,
|
||||
char * other_random_headers, char * priority,
|
||||
char * attachment, char * newspost_url, char * body)
|
||||
{
|
||||
}
|
||||
|
||||
extern
|
||||
XP_Bool
|
||||
FE_GetLabelAndMnemonic(char* name, char** str, void* v_xm_str, void* v_mnemonic)
|
||||
|
||||
{
|
||||
printf( "FE_GetLabelAndMnemonic %s, %p, %p, %p\n",
|
||||
name, str, v_xm_str, v_mnemonic);
|
||||
return 0;
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomeps.c --- gnome functions for fe
|
||||
specific ps printing stuff.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
/* Get the dimensions of an icon in pixels for the PostScript front end. */
|
||||
extern void
|
||||
FE_GetPSIconDimensions(int icon_number,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
printf("FE_GetPSIconDimensions (empty)\n");
|
||||
}
|
||||
|
||||
/* Fill in the bits of an icon for the PostScript front end. */
|
||||
extern XP_Bool
|
||||
FE_GetPSIconData(int icon_number,
|
||||
IL_Pixmap *image,
|
||||
IL_Pixmap *mask)
|
||||
{
|
||||
printf("FE_GetPSIconData (empty)\n");
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
gnomerdf.c --- gnome functions for fe
|
||||
specific rdf stuff.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "g-browser-frame.h"
|
||||
|
||||
|
||||
MWContext*
|
||||
FE_GetRDFContext()
|
||||
{
|
||||
#if 0
|
||||
MozBrowserFrame * frame;
|
||||
frame = moz_browser_frame_create();
|
||||
|
||||
moz_frame_show(MOZ_FRAME(frame));
|
||||
|
||||
printf("FE_GetRDFContext (done?)\n");
|
||||
return moz_frame_get_context(MOZ_FRAME(frame));
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
|
@ -1,400 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* gnomergn.c --- gnome functions dealing with front-end */
|
||||
|
||||
#include "fe_rgn.h"
|
||||
#include "xpassert.h"
|
||||
|
||||
#include "gnome.h"
|
||||
#include <gdk/gdkprivate.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <X11/X.h>
|
||||
#include "gnomefe.h"
|
||||
|
||||
/* oh, how we love hacking around in x internals */
|
||||
|
||||
#include "x_region.h"
|
||||
|
||||
/* typedef to make working with GdkRegion** a bit easier */
|
||||
typedef GdkRegion **GdkRegionHandle;
|
||||
|
||||
/* Creates an empty region. Returns NULL if region can't be created */
|
||||
FE_Region
|
||||
FE_CreateRegion()
|
||||
{
|
||||
GdkRegionHandle hdl;
|
||||
GdkRegion *new_region = gdk_region_new();
|
||||
|
||||
if (new_region == NULL)
|
||||
return NULL;
|
||||
|
||||
hdl = (GdkRegionHandle)(malloc(sizeof(GdkRegionHandle)));
|
||||
(GdkRegion*)(*hdl) = new_region;
|
||||
/* printf("empty Region created at %p\n", hdl); */
|
||||
return (FE_Region)hdl;
|
||||
}
|
||||
|
||||
/* Creates a region from a rectangle. Returns NULL if region can't be created */
|
||||
FE_Region
|
||||
FE_CreateRectRegion(XP_Rect *rect)
|
||||
{
|
||||
GdkPoint points[4];
|
||||
GdkRegion *new_region;
|
||||
GdkRegionHandle hdl;
|
||||
|
||||
points[0].x = points[3].x = (short)rect->left; /* points[] corresponds to */
|
||||
points[0].y = points[1].y = (short)rect->top; /* top-left, top-right, */
|
||||
points[1].x = points[2].x = (short)rect->right; /* bot-left and bot-right */
|
||||
points[3].y = points[2].y = (short)rect->bottom;/* respectively. */
|
||||
|
||||
new_region = gdk_region_polygon(points, 4, GDK_EVEN_ODD_RULE);
|
||||
if (new_region == NULL)
|
||||
return NULL;
|
||||
hdl = (GdkRegionHandle)(malloc(sizeof(GdkRegionHandle)));
|
||||
*hdl=new_region;
|
||||
/* printf("Region created from rectangle at %p\n", hdl); */
|
||||
/* printf("dimension are %d %d %d %d\n", rect->left, rect->top,
|
||||
rect->right, rect->bottom); */
|
||||
return (FE_Region)hdl;
|
||||
/* Fill rule is irrelevant since there */
|
||||
/* should be no self overlap. */
|
||||
}
|
||||
|
||||
/* Set an existing region to a rectangle. */
|
||||
/* The purpose of this routine is to avoid the overhead of destroying and */
|
||||
/* recreating a region on the Windows platform. Unfortunately, it doesn't */
|
||||
/* do much for X. */
|
||||
FE_Region
|
||||
FE_SetRectRegion(FE_Region region, XP_Rect *rect)
|
||||
{
|
||||
GdkRectangle rectangle;
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
GdkRegionHandle hdl;
|
||||
|
||||
XP_ASSERT(reg);
|
||||
|
||||
if ( !gdk_region_empty(reg) )
|
||||
reg = gdk_regions_subtract(reg, reg);
|
||||
|
||||
XP_ASSERT(gdk_empty_region(reg));
|
||||
|
||||
rectangle.x = (short)rect->left;
|
||||
rectangle.y = (short)rect->top;
|
||||
rectangle.width = (unsigned short)(rect->right - rect->left);
|
||||
rectangle.height = (unsigned short)(rect->bottom - rect->top);
|
||||
|
||||
reg = gdk_region_union_with_rect(reg, &rectangle);
|
||||
hdl = (GdkRegionHandle)(malloc(sizeof(GdkRegionHandle)));
|
||||
XP_ASSERT(hdl);
|
||||
*hdl = reg;
|
||||
/* printf("setrectregion done for %p\n", hdl); */
|
||||
|
||||
return (FE_Region)hdl;
|
||||
}
|
||||
|
||||
/* Destroys region */
|
||||
void
|
||||
FE_DestroyRegion(FE_Region region)
|
||||
{
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
XP_ASSERT(reg);
|
||||
|
||||
gdk_region_destroy(reg);
|
||||
free(region);
|
||||
/* printf("region freed at %p\n", region); */
|
||||
}
|
||||
|
||||
/* Make a copy of a region */
|
||||
FE_Region
|
||||
FE_CopyRegion(FE_Region src, FE_Region dst)
|
||||
{
|
||||
|
||||
GdkRegion *srcRegion = (GdkRegion*)(*(GdkRegionHandle)src);
|
||||
GdkRegion *dstRegion = (GdkRegion*)(*(GdkRegionHandle)dst);
|
||||
GdkRegionHandle hdl;
|
||||
GdkRegionHandle cpy;
|
||||
|
||||
XP_ASSERT(src);
|
||||
XP_ASSERT(srcRegion);
|
||||
|
||||
if (dst != NULL)
|
||||
{
|
||||
cpy = dst;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create an empty region and assign it to the cpy handle*/
|
||||
GdkRegion *copyRegion = gdk_region_new();
|
||||
cpy = (GdkRegionHandle)malloc( sizeof(GdkRegionHandle ));
|
||||
if (copyRegion == NULL || cpy == NULL)
|
||||
return NULL;
|
||||
*cpy = copyRegion;
|
||||
}
|
||||
|
||||
/* Copy the region */
|
||||
(GdkRegion*)(*cpy) = gdk_regions_union(srcRegion, srcRegion);
|
||||
/* wierd: union between two same regions? */
|
||||
/* XUnionRegion((Region)src, (Region)src, (Region)copyRegion); */
|
||||
|
||||
/* printf("FE_CopyRegion called and done\n"); */
|
||||
return cpy;
|
||||
}
|
||||
|
||||
/* dst = src1 intersect sr2 */
|
||||
/* dst can be one of src1 or src2 */
|
||||
void
|
||||
FE_IntersectRegion(FE_Region src1, FE_Region src2, FE_Region dst)
|
||||
{
|
||||
GdkRegion *src1Region = (GdkRegion*)(*(GdkRegionHandle)src1);
|
||||
GdkRegion *src2Region = (GdkRegion*)(*(GdkRegionHandle)src2);
|
||||
GdkRegion *dstRegion = (GdkRegion*)(*(GdkRegionHandle)dst);
|
||||
GdkRegion *newRegion;
|
||||
|
||||
XP_ASSERT(src1Region);
|
||||
XP_ASSERT(src2Region);
|
||||
XP_ASSERT(dstRegion);
|
||||
|
||||
newRegion = gdk_regions_intersect(src1Region, src2Region);
|
||||
if (dstRegion == src1Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src1 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else if (dstRegion == src2Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src2 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)dst = newRegion;
|
||||
}
|
||||
/* printf("done region intersect\n"); */
|
||||
/* XIntersectRegion((Region)src1, (Region)src2, (Region)dst); */
|
||||
}
|
||||
|
||||
/* dst = src1 union src2 */
|
||||
/* dst can be one of src1 or src2 */
|
||||
void
|
||||
FE_UnionRegion(FE_Region src1, FE_Region src2, FE_Region dst)
|
||||
{
|
||||
GdkRegion *src1Region = (GdkRegion*)(*(GdkRegionHandle)src1);
|
||||
GdkRegion *src2Region = (GdkRegion*)(*(GdkRegionHandle)src2);
|
||||
GdkRegion *dstRegion = (GdkRegion*)(*(GdkRegionHandle)dst);
|
||||
GdkRegion *newRegion;
|
||||
|
||||
XP_ASSERT(src1Region);
|
||||
XP_ASSERT(src2Region);
|
||||
XP_ASSERT(dstRegion);
|
||||
|
||||
newRegion = gdk_regions_union(src1Region, src2Region);
|
||||
/* XUnionRegion((Region)src1, (Region)src2, (Region)dst); */
|
||||
if (dstRegion == src1Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src1 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else if (dstRegion == src2Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src2 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)dst = newRegion;
|
||||
}
|
||||
/* printf("done union regions\n"); */
|
||||
}
|
||||
|
||||
/* dst = src1 - src2 */
|
||||
/* dst can be one of src1 or src2 */
|
||||
void
|
||||
FE_SubtractRegion(FE_Region src1, FE_Region src2, FE_Region dst)
|
||||
{
|
||||
GdkRegion *src1Region = (GdkRegion*)(*(GdkRegionHandle)src1);
|
||||
GdkRegion *src2Region = (GdkRegion*)(*(GdkRegionHandle)src2);
|
||||
GdkRegion *dstRegion = (GdkRegion*)(*(GdkRegionHandle)dst);
|
||||
GdkRegion *newRegion;
|
||||
|
||||
XP_ASSERT(src1Region);
|
||||
XP_ASSERT(src2Region);
|
||||
XP_ASSERT(dstRegion);
|
||||
|
||||
newRegion = gdk_regions_subtract(src1Region, src2Region);
|
||||
/* XSubtractRegion((Region)src1, (Region)src2, (Region)dst); */
|
||||
if (dstRegion == src1Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src1 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else if (dstRegion == src2Region)
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)src2 =
|
||||
(GdkRegion*)*(GdkRegionHandle)dst =
|
||||
newRegion;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_region_destroy(dstRegion);
|
||||
(GdkRegion*)*(GdkRegionHandle)dst = newRegion;
|
||||
}
|
||||
/* printf("done subtract region\n"); */
|
||||
}
|
||||
|
||||
/* Returns TRUE if the region contains no pixels */
|
||||
XP_Bool
|
||||
FE_IsEmptyRegion(FE_Region region)
|
||||
{
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
XP_ASSERT(reg);
|
||||
|
||||
return (XP_Bool)gdk_region_empty(reg);
|
||||
}
|
||||
|
||||
/* Returns the bounding rectangle of the region */
|
||||
void
|
||||
FE_GetRegionBoundingBox(FE_Region region, XP_Rect *bbox)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
|
||||
XP_ASSERT(reg);
|
||||
XP_ASSERT(bbox);
|
||||
|
||||
gdk_region_get_clipbox(reg, &rect);
|
||||
|
||||
bbox->left = (int32)rect.x;
|
||||
bbox->top = (int32)rect.y;
|
||||
bbox->right = (int32)(rect.x + rect.width);
|
||||
bbox->bottom = (int32)(rect.y + rect.height);
|
||||
|
||||
/* printf("done boundingbox at %p\n", region); */
|
||||
}
|
||||
|
||||
/* TRUE if rgn1 == rgn2 */
|
||||
XP_Bool
|
||||
FE_IsEqualRegion(FE_Region rgn1, FE_Region rgn2)
|
||||
{
|
||||
GdkRegion *reg1 = (GdkRegion*)(*(GdkRegionHandle)rgn1);
|
||||
GdkRegion *reg2 = (GdkRegion*)(*(GdkRegionHandle)rgn2);
|
||||
XP_ASSERT(reg1);
|
||||
XP_ASSERT(reg2);
|
||||
|
||||
/* printf ("done isequal\n"); */
|
||||
return (XP_Bool)gdk_region_equal(reg1,reg2);
|
||||
}
|
||||
|
||||
/* Moves a region by the specified offsets */
|
||||
void
|
||||
FE_OffsetRegion(FE_Region region, int32 x_offset, int32 y_offset)
|
||||
{
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
gdk_region_offset(reg, x_offset, y_offset);
|
||||
}
|
||||
|
||||
/* Returns TRUE if any part of the rectangle is in the specified region */
|
||||
XP_Bool
|
||||
FE_RectInRegion(FE_Region region, XP_Rect *rect)
|
||||
{
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
GdkOverlapType result;
|
||||
GdkRectangle box;
|
||||
|
||||
XP_ASSERT(reg);
|
||||
XP_ASSERT(rect);
|
||||
|
||||
box.x = (short)rect->left;
|
||||
box.y = (short)rect->top;
|
||||
box.width = (unsigned short)(rect->right - rect->left);
|
||||
box.height = (unsigned short)(rect->bottom - rect->top);
|
||||
|
||||
result = gdk_region_rect_in(reg, &box);
|
||||
|
||||
/* printf ("done rectinregion\n"); */
|
||||
if (result == GDK_OVERLAP_RECTANGLE_OUT)
|
||||
return FALSE;
|
||||
else /* result == RectangleIn || result == RectanglePart */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Calls the specified function for each rectangle that makes up the region */
|
||||
void
|
||||
FE_ForEachRectInRegion(FE_Region region, FE_RectInRegionFunc func,
|
||||
void *closure)
|
||||
{
|
||||
GdkRegion *reg = (GdkRegion*)(*(GdkRegionHandle)region);
|
||||
Region pRegion;
|
||||
register int nbox;
|
||||
register BOX *pbox;
|
||||
XP_Rect rect;
|
||||
|
||||
XP_ASSERT(reg);
|
||||
XP_ASSERT(func);
|
||||
|
||||
pRegion = (Region)((GdkRegionPrivate *)reg)->xregion;
|
||||
pbox = pRegion->rects;
|
||||
nbox = pRegion->numRects;
|
||||
|
||||
while(nbox--)
|
||||
{
|
||||
rect.left = pbox->x1;
|
||||
rect.right = pbox->x2;
|
||||
rect.top = pbox->y1;
|
||||
rect.bottom = pbox->y2;
|
||||
(*func)(closure, &rect);
|
||||
pbox++;
|
||||
}
|
||||
/* printf("done foreachrectinregion\n"); */
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
void
|
||||
FE_HighlightRect(void *c, XP_Rect *rect, int how_much)
|
||||
{
|
||||
printf("FE_HighlightRect (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_HighlightRegion(void *c, FE_Region region, int how_much)
|
||||
{
|
||||
printf("FE_HighlightRegion (empty)\n");
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* gnomesec.c --- gnome fe handling of FE security related stuff. */
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "xpassert.h"
|
||||
#include "proto.h"
|
||||
#include "fe_proto.h"
|
||||
|
||||
Bool
|
||||
FE_SecurityDialog(MWContext* context,
|
||||
int message,
|
||||
XP_Bool* prefs_toggle)
|
||||
{
|
||||
printf("FE_SecurityDialog (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_SecurityOptionsChanged(MWContext *context)
|
||||
{
|
||||
printf("FE_SecurityOptionsChanged (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
FE_SetPasswordEnabled(MWContext *context, PRBool usePW)
|
||||
{
|
||||
printf("FE_SetPasswordEnabled (empty)\n");
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
MODULE = gnuzilla
|
||||
|
||||
LIBRARY_NAME = gnuzilla
|
||||
|
||||
REQUIRES = nspr layer js jtools applet security img util parse layout hook pref java libfont ldap lay style xfeicons rdf xpcom plug mariner gnuzilla-widgets
|
||||
|
||||
CSRCS = g-bookmark-frame.c \
|
||||
g-bookmark-view.c \
|
||||
g-browser-frame.c \
|
||||
g-commands.c \
|
||||
g-component.c \
|
||||
g-editor-frame.c \
|
||||
g-editor-view.c \
|
||||
g-frame.c \
|
||||
g-history-frame.c \
|
||||
g-history-view.c \
|
||||
g-html-forms.c \
|
||||
g-html-view.c \
|
||||
g-navcenter-view.c \
|
||||
g-paned-view.c \
|
||||
g-tagged.c \
|
||||
g-util.c \
|
||||
g-view.c \
|
||||
g-font-select.c
|
||||
|
||||
EXPORTS = g-bookmark-frame.h \
|
||||
g-bookmark-view.h \
|
||||
g-browser-frame.h \
|
||||
g-commands.h \
|
||||
g-component.h \
|
||||
g-editor-frame.h \
|
||||
g-editor-view.h \
|
||||
g-frame.h \
|
||||
g-history-frame.h \
|
||||
g-history-view.h \
|
||||
g-html-view.h \
|
||||
g-navcenter-view.h \
|
||||
g-paned-view.h \
|
||||
g-tagged.h \
|
||||
g-types.h \
|
||||
g-util.h \
|
||||
g-view.h \
|
||||
g-font-select.h
|
||||
|
||||
GNOME_CFLAGS := $(shell gnome-config --cflags gnomeui)
|
||||
INCLUDES += -I$(OBJDIR) -I.. -I. $(GNOME_CFLAGS)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
|
@ -1,76 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
MODULE = gnuzilla
|
||||
|
||||
LIBRARY_NAME = gnuzilla
|
||||
|
||||
REQUIRES = layer js jtools applet security img util parse layout hook pref java libfont ldap lay style xfeicons rdf xpcom plug mariner gnuzilla-widgets
|
||||
|
||||
CSRCS = g-bookmark-frame.c \
|
||||
g-bookmark-view.c \
|
||||
g-browser-frame.c \
|
||||
g-commands.c \
|
||||
g-component.c \
|
||||
g-editor-frame.c \
|
||||
g-editor-view.c \
|
||||
g-frame.c \
|
||||
g-history-frame.c \
|
||||
g-history-view.c \
|
||||
g-html-forms.c \
|
||||
g-html-view.c \
|
||||
g-navcenter-view.c \
|
||||
g-paned-view.c \
|
||||
g-tagged.c \
|
||||
g-util.c \
|
||||
g-view.c \
|
||||
g-font-select.c
|
||||
|
||||
EXPORTS = g-bookmark-frame.h \
|
||||
g-bookmark-view.h \
|
||||
g-browser-frame.h \
|
||||
g-commands.h \
|
||||
g-component.h \
|
||||
g-editor-frame.h \
|
||||
g-editor-view.h \
|
||||
g-frame.h \
|
||||
g-history-frame.h \
|
||||
g-history-view.h \
|
||||
g-html-view.h \
|
||||
g-navcenter-view.h \
|
||||
g-paned-view.h \
|
||||
g-tagged.h \
|
||||
g-types.h \
|
||||
g-util.h \
|
||||
g-view.h \
|
||||
g-font-select.h
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
GNOME_CFLAGS := $(FE_GNOME_CFLAGS)
|
||||
INCLUDES += -I$(OBJDIR) -I$(srcdir)/.. -I$(srcdir)/. $(GNOME_CFLAGS)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -1,136 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-bookmark-frame.c -- bookmark windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 13-Apr-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "g-commands.h"
|
||||
#include "g-bookmark-frame.h"
|
||||
#include "g-bookmark-view.h"
|
||||
|
||||
static void
|
||||
callback(GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
/* blah */
|
||||
}
|
||||
|
||||
static GnomeUIInfo file_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo edit_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo view_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo window_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Navigation Center", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Navigator", NULL, moz_open_browser, NULL, NULL },
|
||||
|
||||
#ifdef EDITOR
|
||||
{ GNOME_APP_UI_ITEM, "Composer", NULL, callback, NULL, NULL },
|
||||
#endif
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Bookmarks", NULL, moz_open_bookmarks, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "History", NULL, moz_open_history, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "View Security", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo help_submenu[] = {
|
||||
{ GNOME_APP_UI_HELP, "HelpStuff", NULL, "GnuZilla" },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo menubar_info[] = {
|
||||
{ GNOME_APP_UI_SUBTREE, "File", NULL, file_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Edit", NULL, edit_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "View", NULL, view_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Window", NULL, window_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Help", NULL, help_submenu },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
void
|
||||
moz_bookmark_frame_init(MozBookmarkFrame *frame)
|
||||
{
|
||||
/* call our superclass's init method first. */
|
||||
moz_frame_init(MOZ_FRAME(frame),
|
||||
menubar_info,
|
||||
NULL);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(frame),
|
||||
MOZ_TAG_BOOKMARK_FRAME);
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_frame_deinit(MozBookmarkFrame *frame)
|
||||
{
|
||||
printf("moz_bookmark_frame_deinit (empty)\n");
|
||||
}
|
||||
|
||||
/* our one bookmark frame. */
|
||||
static MozBookmarkFrame* singleton = NULL;
|
||||
|
||||
MozBookmarkFrame*
|
||||
moz_bookmark_frame_create()
|
||||
{
|
||||
if (!singleton)
|
||||
{
|
||||
MozBookmarkView *view;
|
||||
|
||||
singleton = XP_NEW_ZAP(MozBookmarkFrame);
|
||||
|
||||
moz_bookmark_frame_init(singleton);
|
||||
|
||||
MOZ_FRAME(singleton)->context->type = MWContextBookmarks;
|
||||
|
||||
gtk_widget_realize(MOZ_COMPONENT(singleton)->base_widget);
|
||||
|
||||
view = moz_bookmark_view_create(MOZ_FRAME(singleton), MOZ_FRAME(singleton)->context);
|
||||
|
||||
MOZ_FRAME(singleton)->top_view = MOZ_VIEW(view);
|
||||
|
||||
gtk_widget_show(MOZ_COMPONENT(view)->base_widget);
|
||||
|
||||
moz_frame_set_viewarea(MOZ_FRAME(singleton),
|
||||
MOZ_COMPONENT(view)->base_widget);
|
||||
|
||||
gtk_widget_set_usize(MOZ_COMPONENT(singleton)->base_widget,
|
||||
300, 400); /* XXX save off the default bookmark window size. */
|
||||
}
|
||||
|
||||
return singleton;
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-bookmark-frame.h -- bookmark windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_bookmark_frame_h
|
||||
#define _moz_bookmark_frame_h
|
||||
|
||||
#include "g-frame.h"
|
||||
#include "g-html-view.h"
|
||||
|
||||
struct _MozBookmarkFrame {
|
||||
/* our superclass */
|
||||
MozFrame _frame;
|
||||
|
||||
/* MozBookmarkFrame specific data members. */
|
||||
|
||||
};
|
||||
|
||||
extern void moz_bookmark_frame_init(MozBookmarkFrame *frame);
|
||||
extern void moz_bookmark_frame_deinit(MozBookmarkFrame *frame);
|
||||
|
||||
extern MozBookmarkFrame* moz_bookmark_frame_create();
|
||||
|
||||
#define MOZ_BOOKMARKFRAME(f) &((f)->_bookmark_frame)
|
||||
|
||||
#endif _moz_bookmark_frame_h
|
|
@ -1,93 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-bookmark-view.c -- bookmark views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "g-bookmark-view.h"
|
||||
|
||||
/* XXX I18N */
|
||||
static char *column_titles[] = {
|
||||
"Name",
|
||||
"Location",
|
||||
"Last Visited",
|
||||
"Created On"
|
||||
};
|
||||
static int num_column_titles = sizeof(column_titles) / sizeof(column_titles[0]);
|
||||
|
||||
void
|
||||
moz_bookmark_view_init(MozBookmarkView *view,
|
||||
MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_BOOKMARK_VIEW);
|
||||
|
||||
#if (GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION >= 1)
|
||||
view->ctree = gtk_ctree_new_with_titles(num_column_titles, 0, column_titles);
|
||||
#else
|
||||
view->ctree = gtk_clist_new_with_titles(num_column_titles, column_titles);
|
||||
#endif
|
||||
|
||||
moz_component_set_basewidget(MOZ_COMPONENT(view), view->ctree);
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_deinit(MozBookmarkView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_view_deinit(MOZ_VIEW(view));
|
||||
}
|
||||
|
||||
MozBookmarkView*
|
||||
moz_bookmark_view_create(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozBookmarkView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozBookmarkView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_bookmark_view_init(view, parent_frame, context);
|
||||
return view;
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_refresh_cells(MozBookmarkView *view,
|
||||
int32 first,
|
||||
int32 last,
|
||||
XP_Bool now)
|
||||
{
|
||||
printf("moz_bookmark_view_refresh_cells (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_scroll_into_view(MozBookmarkView *view,
|
||||
BM_Entry *entry)
|
||||
{
|
||||
printf("moz_bookmark_view_scroll_into_view (empty)\n");
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-bookmark-view.c -- bookmark views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "g-bookmark-view.h"
|
||||
|
||||
/* XXX I18N */
|
||||
static char *column_titles[] = {
|
||||
"Name",
|
||||
"Location",
|
||||
"Last Visited",
|
||||
"Created On"
|
||||
};
|
||||
static int num_column_titles = sizeof(column_titles) / sizeof(column_titles[0]);
|
||||
|
||||
void
|
||||
moz_bookmark_view_init(MozBookmarkView *view,
|
||||
MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_BOOKMARK_VIEW);
|
||||
|
||||
view->ctree = gtk_ctree_new_with_titles(num_column_titles, 0, column_titles);
|
||||
|
||||
moz_component_set_basewidget(MOZ_COMPONENT(view), view->ctree);
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_deinit(MozBookmarkView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_view_deinit(MOZ_VIEW(view));
|
||||
}
|
||||
|
||||
MozBookmarkView*
|
||||
moz_bookmark_view_create(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozBookmarkView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozBookmarkView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_bookmark_view_init(view, parent_frame, context);
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_refresh_cells(MozBookmarkView *view,
|
||||
int32 first,
|
||||
int32 last,
|
||||
XP_Bool now)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
moz_bookmark_view_scroll_into_view(MozBookmarkView *view,
|
||||
BM_Entry *entry)
|
||||
{
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-bookmark-view.h -- bookmark views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_bookmark_view_h
|
||||
#define _moz_bookmark_view_h
|
||||
|
||||
#include "g-view.h"
|
||||
|
||||
struct _MozBookmarkView {
|
||||
/* our superclass */
|
||||
MozView _view;
|
||||
|
||||
GtkWidget *ctree;
|
||||
};
|
||||
|
||||
extern void moz_bookmark_view_init(MozBookmarkView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_bookmark_view_deinit(MozBookmarkView *view);
|
||||
|
||||
extern MozBookmarkView* moz_bookmark_view_create(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
extern void moz_bookmark_view_refresh_cells(MozBookmarkView *view, int32 first, int32 last, XP_Bool now);
|
||||
extern void moz_bookmark_view_scroll_into_view(MozBookmarkView *view, BM_Entry *entry);
|
||||
|
||||
#endif _moz_bookmark_view_h
|
|
@ -1,426 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
browser-frame.c -- browser windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "net.h"
|
||||
|
||||
#include "g-util.h"
|
||||
#include "g-browser-frame.h"
|
||||
#include "g-commands.h"
|
||||
|
||||
#include "g-paned-view.h"
|
||||
#include "g-html-view.h"
|
||||
#include "g-navcenter-view.h"
|
||||
|
||||
static void
|
||||
callback(GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
/* blah */
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_navcenter(GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
MozBrowserFrame *browser_frame = MOZ_BROWSER_FRAME(client_data);
|
||||
MozView *view = MOZ_FRAME(browser_frame)->top_view;
|
||||
MozNavCenterView *ncview = (MozNavCenterView*)moz_get_view_of_type(view,
|
||||
MOZ_TAG_NAVCENTER_VIEW);
|
||||
|
||||
if (moz_component_is_shown(MOZ_COMPONENT(ncview)))
|
||||
moz_component_hide(MOZ_COMPONENT(ncview));
|
||||
else
|
||||
moz_component_show(MOZ_COMPONENT(ncview));
|
||||
}
|
||||
|
||||
|
||||
static GnomeUIInfo file_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "New Browser", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Open Location", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Save...", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Save As...", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Save Frame As...", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Send Page", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Send Link", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
#ifdef EDITOR
|
||||
{ GNOME_APP_UI_ITEM, "Edit Page", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Edit Frame", NULL, callback, NULL, NULL },
|
||||
#endif
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Upload File", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Print", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Close", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Exit", NULL, moz_exit, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo edit_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Undo", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Redo", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Cut", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Copy", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Paste", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Select All", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Find In Page", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Find Again", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Search", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Preferences...", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo view_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Toggle Navigation Toolbar", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Toggle Location Toolbar", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Toggle Personal Toolbar", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Toggle Navigation Center", NULL, toggle_navcenter, NULL, NULL },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Increase Font", NULL, callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Decreasea Font", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Reload", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Show Images", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Refresh", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Stop Loading", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "View Page Source", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "View Page Info", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "View Page Services", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo go_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Back", "Back to previous page", callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Forward", "Forward to next page", callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Home", "Load home page", callback, NULL, NULL },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo window_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Navigation Center", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Navigator", NULL, moz_open_browser, NULL, NULL },
|
||||
|
||||
#ifdef EDITOR
|
||||
{ GNOME_APP_UI_ITEM, "Composer", NULL, moz_open_editor, NULL, NULL },
|
||||
#endif
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Bookmarks", NULL, moz_open_bookmarks, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "History", NULL, moz_open_history, NULL, NULL },
|
||||
|
||||
#ifdef MOZ_SECURITY
|
||||
{ GNOME_APP_UI_ITEM, "View Security", NULL, callback, NULL, NULL },
|
||||
#endif
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo documents_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo help_submenu[] = {
|
||||
{ GNOME_APP_UI_HELP, "HelpStuff", NULL, "GnuZilla" },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo menubar_info[] = {
|
||||
{ GNOME_APP_UI_SUBTREE, "File", NULL, file_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Edit", NULL, edit_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "View", NULL, view_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Go", NULL, go_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Window", NULL, window_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Documents", NULL, documents_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Help", NULL, help_submenu },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo toolbar_info[] = {
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Back", "Back to previous page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Back.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Forward", "Forward to next page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Forward.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Reload", "Reload current page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Reload.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Home", "Load home page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Home.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Search", "Search the Web",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Search.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
#ifdef EDITOR
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Edit", "Edit this page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_EditPage.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
#endif
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Images", "Show Images",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_LoadImages.xpm" },
|
||||
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Print", "Print this page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Print.xpm" },
|
||||
|
||||
#ifdef MOZ_SECURITY
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Security", "View the Security Info for this page",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Secure.xpm" },
|
||||
#endif
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM,
|
||||
"Stop", "Stop Loading",
|
||||
callback, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_FILENAME,
|
||||
"images/TB_Stop.xpm" },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
void
|
||||
moz_browser_frame_init(MozBrowserFrame *frame)
|
||||
{
|
||||
/* call our superclass's init method first. */
|
||||
moz_frame_init(MOZ_FRAME(frame),
|
||||
menubar_info,
|
||||
toolbar_info);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(frame),
|
||||
MOZ_TAG_BROWSER_FRAME);
|
||||
}
|
||||
|
||||
extern void fe_url_exit (URL_Struct *url, int status, MWContext *context);
|
||||
|
||||
static void
|
||||
combo_activate(GtkWidget *entry,
|
||||
MozBrowserFrame *frame)
|
||||
{
|
||||
MWContext *context = MOZ_FRAME(frame)->context;
|
||||
gchar *value;
|
||||
URL_Struct *url;
|
||||
|
||||
value = gtk_entry_get_text(GTK_ENTRY(entry));
|
||||
|
||||
url = NET_CreateURLStruct(value, NET_NORMAL_RELOAD);
|
||||
|
||||
NET_GetURL(url, FO_CACHE_AND_PRESENT,
|
||||
context, fe_url_exit);
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
moz_browser_frame_create_bookmark_dropdown(MozBrowserFrame *frame)
|
||||
{
|
||||
GtkWidget *hbox, *pmap, *button, *label;
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 2);
|
||||
|
||||
pmap = gnome_pixmap_new_from_file("images/BM_QFile.xpm");
|
||||
gtk_widget_show(pmap);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), pmap, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new(_("Bookmarks"));
|
||||
gtk_widget_show(label);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
|
||||
|
||||
button = gtk_button_new();
|
||||
|
||||
gtk_widget_show(hbox);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(button), hbox);
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget*
|
||||
moz_browser_frame_create_browser_area(MozBrowserFrame *frame)
|
||||
{
|
||||
GtkWidget *combobox, *vbox, *label, *quickfile;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *hb;
|
||||
GtkWidget *statusbar;
|
||||
GtkWidget *proxy;
|
||||
|
||||
hb = gtk_handle_box_new();
|
||||
gtk_widget_show(hb);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
|
||||
gtk_widget_show(hbox);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
|
||||
quickfile = moz_browser_frame_create_bookmark_dropdown(frame);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), quickfile, FALSE, FALSE, 0);
|
||||
gtk_widget_show(quickfile);
|
||||
|
||||
proxy = gnome_pixmap_new_from_file("images/LocationProxy.xpm");
|
||||
gtk_box_pack_start(GTK_BOX(hbox), proxy, FALSE, FALSE, 0);
|
||||
gtk_widget_show(proxy);
|
||||
|
||||
label = gtk_label_new(_("Location:"));
|
||||
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
combobox = gtk_combo_new();
|
||||
gtk_combo_disable_activate(GTK_COMBO(combobox));
|
||||
gtk_box_pack_start(GTK_BOX(hbox), combobox, TRUE, TRUE, 0);
|
||||
gtk_widget_show(combobox);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(hb), hbox);
|
||||
gtk_widget_show(hb);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(GTK_COMBO(combobox)->entry),
|
||||
"activate",
|
||||
(GtkSignalFunc)combo_activate, frame);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hb, FALSE, FALSE, 0);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(vbox),
|
||||
MOZ_COMPONENT(MOZ_FRAME(frame)->top_view)->base_widget,
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(MOZ_FRAME(frame)->top_view));
|
||||
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
||||
MozBrowserFrame*
|
||||
moz_browser_frame_create()
|
||||
{
|
||||
MozBrowserFrame *frame = XP_NEW_ZAP(MozBrowserFrame);
|
||||
MozPanedView *paned_view;
|
||||
MozNavCenterView *navcenter_view;
|
||||
MozHTMLView *html_view;
|
||||
|
||||
moz_browser_frame_init(frame);
|
||||
|
||||
MOZ_FRAME(frame)->context->type = MWContextBrowser;
|
||||
|
||||
gtk_widget_realize(MOZ_COMPONENT(frame)->base_widget);
|
||||
|
||||
paned_view = moz_paned_view_create_horizontal(MOZ_FRAME(frame), MOZ_FRAME(frame)->context);
|
||||
html_view = moz_html_view_create(MOZ_FRAME(frame), MOZ_FRAME(frame)->context);
|
||||
#if NAVCENTER_VIEW
|
||||
navcenter_view = moz_navcenter_view_create(MOZ_FRAME(frame), MOZ_FRAME(frame)->context);
|
||||
#endif
|
||||
|
||||
MOZ_FRAME(frame)->top_view = MOZ_VIEW(paned_view);
|
||||
#if NAVCENTER_VIEW
|
||||
moz_paned_view_add_view1(paned_view, MOZ_VIEW(navcenter_view));
|
||||
#endif
|
||||
moz_paned_view_add_view2(paned_view, MOZ_VIEW(html_view));
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(html_view));
|
||||
moz_component_show(MOZ_COMPONENT(paned_view));
|
||||
|
||||
moz_frame_set_viewarea(MOZ_FRAME(frame),
|
||||
moz_browser_frame_create_browser_area(frame));
|
||||
|
||||
gtk_widget_set_usize(MOZ_COMPONENT(frame)->base_widget,
|
||||
500, 700); /* XXX save off the default browser size. */
|
||||
|
||||
return frame;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-browser-frame.h -- browser windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_browser_frame_h
|
||||
#define _moz_browser_frame_h
|
||||
|
||||
#include "g-frame.h"
|
||||
|
||||
struct _MozBrowserFrame {
|
||||
/* our superclass */
|
||||
MozFrame _frame;
|
||||
|
||||
/* MozBrowserFrame specific data members. */
|
||||
|
||||
};
|
||||
|
||||
extern void moz_browser_frame_init(MozBrowserFrame *frame);
|
||||
extern void moz_browser_frame_deinit(MozBrowserFrame *frame);
|
||||
|
||||
extern MozBrowserFrame* moz_browser_frame_create();
|
||||
|
||||
#define MOZ_BROWSERFRAME(f) &((f)->_browser_frame)
|
||||
|
||||
#endif /* _moz_browser_frame_h */
|
|
@ -1,65 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-commands.c -- toolbar callbacks.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 13-Apr-98.
|
||||
*/
|
||||
|
||||
#include "g-commands.h"
|
||||
|
||||
void
|
||||
moz_open_bookmarks(GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
MozFrame *frame = (MozFrame*)moz_bookmark_frame_create();
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(frame));
|
||||
|
||||
moz_frame_raise(frame);
|
||||
}
|
||||
|
||||
void
|
||||
moz_open_history(GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
MozFrame *frame = (MozFrame*)moz_history_frame_create();
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(frame));
|
||||
|
||||
moz_frame_raise(frame);
|
||||
}
|
||||
|
||||
void
|
||||
moz_open_browser(GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
MozFrame *frame = (MozFrame*)moz_browser_frame_create();
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(frame));
|
||||
}
|
||||
|
||||
void
|
||||
moz_open_editor(GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
MozFrame *frame = (MozFrame*)moz_editor_frame_create();
|
||||
|
||||
moz_component_show(MOZ_COMPONENT(frame));
|
||||
}
|
||||
|
||||
void
|
||||
moz_exit(GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
gtk_main_quit();
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-commands.c -- toolbar callbacks.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 13-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_commands_h
|
||||
#define _moz_commands_h
|
||||
|
||||
#include "g-types.h"
|
||||
#include "g-bookmark-frame.h"
|
||||
#include "g-editor-frame.h"
|
||||
#include "g-browser-frame.h"
|
||||
|
||||
extern void moz_open_bookmarks(GtkWidget *widget, gpointer client_data);
|
||||
extern void moz_open_history(GtkWidget *widget, gpointer client_data);
|
||||
extern void moz_open_browser(GtkWidget *widget, gpointer client_data);
|
||||
extern void moz_open_editor(GtkWidget *widget, gpointer client_data);
|
||||
extern void moz_exit(GtkWidget *widget, gpointer client_data);
|
||||
#endif /* _moz_commands_h */
|
|
@ -1,46 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-component.h -- components.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_component_h
|
||||
#define _moz_component_h
|
||||
|
||||
#include "gnome.h"
|
||||
#include "g-tagged.h"
|
||||
|
||||
struct _MozComponent {
|
||||
MozTagged _tagged;
|
||||
|
||||
GtkWidget *base_widget;
|
||||
|
||||
gboolean is_shown;
|
||||
};
|
||||
|
||||
extern void moz_component_init(MozComponent *component);
|
||||
extern void moz_component_deinit(MozComponent *component);
|
||||
|
||||
extern void moz_component_set_basewidget(MozComponent *component, GtkWidget *widget);
|
||||
extern GtkWidget* moz_component_get_basewidget(MozComponent *component);
|
||||
extern gboolean moz_component_is_shown(MozComponent *component);
|
||||
extern void moz_component_show(MozComponent *component);
|
||||
extern void moz_component_hide(MozComponent *component);
|
||||
|
||||
#endif /* _moz_component_h */
|
|
@ -1,65 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-editor-frame.c -- editor windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 13-Apr-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "g-editor-frame.h"
|
||||
|
||||
void
|
||||
moz_editor_frame_init(MozEditorFrame *frame)
|
||||
{
|
||||
printf("moz_editor_frame_init (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
moz_editor_frame_deinit(MozEditorFrame *frame)
|
||||
{
|
||||
printf("moz_editor_frame_deinit (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
MozEditorFrame*
|
||||
moz_editor_frame_create()
|
||||
{
|
||||
MozEditorFrame *frame = XP_NEW_ZAP(MozEditorFrame);
|
||||
MozHTMLView *view;
|
||||
|
||||
moz_editor_frame_init(frame);
|
||||
|
||||
MOZ_FRAME(frame)->context->type = MWContextEditor;
|
||||
|
||||
gtk_widget_realize(MOZ_COMPONENT(frame)->base_widget);
|
||||
|
||||
view = moz_html_view_create(MOZ_FRAME(frame), MOZ_FRAME(frame)->context);
|
||||
|
||||
MOZ_FRAME(frame)->top_view = MOZ_VIEW(view);
|
||||
|
||||
moz_frame_set_viewarea(MOZ_FRAME(frame),
|
||||
MOZ_COMPONENT(view)->base_widget);
|
||||
|
||||
gtk_widget_set_usize(MOZ_COMPONENT(frame)->base_widget,
|
||||
300, 400); /* XXX save off the default editor window size. */
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-editor-frame.h -- editor windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_editor_frame_h
|
||||
#define _moz_editor_frame_h
|
||||
|
||||
#include "g-frame.h"
|
||||
#include "g-html-view.h"
|
||||
|
||||
struct _MozEditorFrame {
|
||||
/* our superclass */
|
||||
MozFrame _frame;
|
||||
|
||||
/* MozEditorFrame specific data members. */
|
||||
|
||||
};
|
||||
|
||||
extern void moz_editor_frame_init(MozEditorFrame *frame);
|
||||
extern void moz_editor_frame_deinit(MozEditorFrame *frame);
|
||||
|
||||
extern MozEditorFrame* moz_editor_frame_create();
|
||||
|
||||
#define MOZ_EDITORFRAME(f) &((f)->_editor_frame)
|
||||
|
||||
#endif _moz_editor_frame_h
|
|
@ -1,68 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-editor-view.c -- editor views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 18-Jul-98.
|
||||
*/
|
||||
|
||||
#include "g-editor-view.h"
|
||||
|
||||
void
|
||||
moz_editor_view_init(MozEditorView *view, MozFrame *parent_frame, MWContext *context)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_html_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff. */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_EDITOR_VIEW);
|
||||
}
|
||||
|
||||
void
|
||||
moz_editor_view_deinit(MozEditorView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_html_view_deinit(MOZ_HTML_VIEW(view));
|
||||
}
|
||||
|
||||
MozEditorView*
|
||||
moz_editor_view_create(MozFrame *parent_frame, MWContext *context)
|
||||
{
|
||||
MozEditorView *view;
|
||||
|
||||
view = XP_NEW_ZAP(MozEditorView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
/* if context == NULL, then we should create a new context.
|
||||
this is used for grid cells. */
|
||||
moz_editor_view_init(view, parent_frame, context);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
void
|
||||
moz_editor_view_display_linefeed(MozEditorView *view,
|
||||
LO_LinefeedStruct *line_feed,
|
||||
XP_Bool need_bg)
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
printf("moz_editor_view_display_linefeed (empty)\n");
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-editor-view.h -- editor views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 18-Jul-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_editor_view_h
|
||||
#define _moz_editor_view_h
|
||||
|
||||
#include "g-html-view.h"
|
||||
|
||||
struct _MozEditorView {
|
||||
/* our superclass */
|
||||
MozHTMLView _html_view;
|
||||
};
|
||||
|
||||
extern void moz_editor_view_init(MozEditorView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_editor_view_deinit(MozEditorView *view);
|
||||
|
||||
extern MozEditorView* moz_editor_view_create(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
extern void moz_editor_view_display_linefeed(MozEditorView *view,
|
||||
LO_LinefeedStruct *line_feed,
|
||||
XP_Bool need_bg);
|
||||
|
||||
#endif /*_moz_html_view_h */
|
|
@ -1,63 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-frame.h -- components.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_frame_h
|
||||
#define _moz_frame_h
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
#include "g-component.h"
|
||||
|
||||
struct _MozFrame {
|
||||
MozComponent _component;
|
||||
|
||||
/* MozFrame specific stuff here. */
|
||||
|
||||
MWContext *context;
|
||||
|
||||
MozView *top_view;
|
||||
MozView *focus_view;
|
||||
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *viewarea;
|
||||
GtkWidget *statusbar;
|
||||
};
|
||||
|
||||
extern void moz_frame_init(MozFrame *frame, GnomeUIInfo *menubar_info, GnomeUIInfo *toolbar_info);
|
||||
extern void moz_frame_deinit(MozFrame *frame);
|
||||
|
||||
extern void moz_frame_show(MozFrame *frame);
|
||||
extern void moz_frame_raise(MozFrame *frame);
|
||||
|
||||
extern MozView* moz_frame_get_top_view(MozFrame *frame);
|
||||
extern MozView* moz_frame_get_focus_view(MozFrame *frame);
|
||||
|
||||
extern MWContext* moz_frame_get_context(MozFrame *frame);
|
||||
|
||||
extern void moz_frame_set_title(MozFrame *frame, char *title);
|
||||
extern void moz_frame_set_status(MozFrame *frame, char *status);
|
||||
extern void moz_frame_set_percent(MozFrame *frame, int32 percent);
|
||||
|
||||
extern void moz_frame_set_viewarea(MozFrame *frame, GtkWidget *viewarea);
|
||||
|
||||
#endif /* _moz_frame_h */
|
|
@ -1,136 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-history-frame.c -- history windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 13-Apr-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "g-commands.h"
|
||||
#include "g-history-frame.h"
|
||||
#include "g-history-view.h"
|
||||
|
||||
static void
|
||||
callback(GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
/* blah */
|
||||
}
|
||||
|
||||
static GnomeUIInfo file_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo edit_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo view_submenu[] = {
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo window_submenu[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Navigation Center", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Navigator", NULL, moz_open_browser, NULL, NULL },
|
||||
|
||||
#ifdef EDITOR
|
||||
{ GNOME_APP_UI_ITEM, "Composer", NULL, callback, NULL, NULL },
|
||||
#endif
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "Bookmarks", NULL, moz_open_bookmarks, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "History", NULL, moz_open_history, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_ITEM, "View Security", NULL, callback, NULL, NULL },
|
||||
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo help_submenu[] = {
|
||||
{ GNOME_APP_UI_HELP, "HelpStuff", NULL, "GnuZilla" },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo menubar_info[] = {
|
||||
{ GNOME_APP_UI_SUBTREE, "File", NULL, file_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Edit", NULL, edit_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "View", NULL, view_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Window", NULL, window_submenu },
|
||||
{ GNOME_APP_UI_SUBTREE, "Help", NULL, help_submenu },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
void
|
||||
moz_history_frame_init(MozHistoryFrame *frame)
|
||||
{
|
||||
/* call our superclass's init method first. */
|
||||
moz_frame_init(MOZ_FRAME(frame),
|
||||
menubar_info,
|
||||
NULL);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(frame),
|
||||
MOZ_TAG_HISTORY_FRAME);
|
||||
}
|
||||
|
||||
void
|
||||
moz_history_frame_deinit(MozHistoryFrame *frame)
|
||||
{
|
||||
printf("moz_history_frame_deinit (empty)\n");
|
||||
}
|
||||
|
||||
/* our one history frame. */
|
||||
static MozHistoryFrame* singleton = NULL;
|
||||
|
||||
MozHistoryFrame*
|
||||
moz_history_frame_create()
|
||||
{
|
||||
if (!singleton)
|
||||
{
|
||||
MozHistoryView *view;
|
||||
|
||||
singleton = XP_NEW_ZAP(MozHistoryFrame);
|
||||
|
||||
moz_history_frame_init(singleton);
|
||||
|
||||
MOZ_FRAME(singleton)->context->type = MWContextHistory;
|
||||
|
||||
gtk_widget_realize(MOZ_COMPONENT(singleton)->base_widget);
|
||||
|
||||
view = moz_history_view_create(MOZ_FRAME(singleton), MOZ_FRAME(singleton)->context);
|
||||
|
||||
MOZ_FRAME(singleton)->top_view = MOZ_VIEW(view);
|
||||
|
||||
gtk_widget_show(MOZ_COMPONENT(view)->base_widget);
|
||||
|
||||
moz_frame_set_viewarea(MOZ_FRAME(singleton),
|
||||
MOZ_COMPONENT(view)->base_widget);
|
||||
|
||||
gtk_widget_set_usize(MOZ_COMPONENT(singleton)->base_widget,
|
||||
300, 400); /* XXX save off the default history window size. */
|
||||
}
|
||||
|
||||
return singleton;
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-history-frame.h -- history windows.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_history_frame_h
|
||||
#define _moz_history_frame_h
|
||||
|
||||
#include "g-frame.h"
|
||||
#include "g-html-view.h"
|
||||
|
||||
struct _MozHistoryFrame {
|
||||
/* our superclass */
|
||||
MozFrame _frame;
|
||||
|
||||
/* MozHistoryFrame specific data members. */
|
||||
|
||||
};
|
||||
|
||||
extern void moz_history_frame_init(MozHistoryFrame *frame);
|
||||
extern void moz_history_frame_deinit(MozHistoryFrame *frame);
|
||||
|
||||
extern MozHistoryFrame* moz_history_frame_create();
|
||||
|
||||
#define MOZ_HISTORYFRAME(f) &((f)->_history_frame)
|
||||
|
||||
#endif _moz_history_frame_h
|
|
@ -1,74 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-history-view.c -- history views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "g-history-view.h"
|
||||
|
||||
/* XXX I18N */
|
||||
static char *column_titles[] = {
|
||||
"Title",
|
||||
"Location",
|
||||
"Last Visited",
|
||||
"Expires",
|
||||
"Visit Count"
|
||||
};
|
||||
static int num_column_titles = sizeof(column_titles) / sizeof(column_titles[0]);
|
||||
|
||||
void
|
||||
moz_history_view_init(MozHistoryView *view,
|
||||
MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_HISTORY_VIEW);
|
||||
|
||||
view->clist = gtk_clist_new_with_titles(num_column_titles, column_titles);
|
||||
|
||||
moz_component_set_basewidget(MOZ_COMPONENT(view), view->clist);
|
||||
}
|
||||
|
||||
void
|
||||
moz_history_view_deinit(MozHistoryView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_view_deinit(MOZ_VIEW(view));
|
||||
}
|
||||
|
||||
MozHistoryView*
|
||||
moz_history_view_create(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozHistoryView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozHistoryView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_history_view_init(view, parent_frame, context);
|
||||
return view;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-history-view.h -- history views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_history_view_h
|
||||
#define _moz_history_view_h
|
||||
|
||||
#include "g-view.h"
|
||||
|
||||
struct _MozHistoryView {
|
||||
/* our superclass */
|
||||
MozView _view;
|
||||
|
||||
GtkWidget *clist;
|
||||
};
|
||||
|
||||
extern void moz_history_view_init(MozHistoryView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_history_view_deinit(MozHistoryView *view);
|
||||
|
||||
extern MozHistoryView* moz_history_view_create(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
#endif _moz_history_view_h
|
|
@ -1,819 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
g-html-forms.c --- form elements for html views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 12-Apr-98.
|
||||
*/
|
||||
|
||||
#include "g-html-view.h"
|
||||
#include "lo_ele.h"
|
||||
#include "xpform.h"
|
||||
#include "libmocha.h"
|
||||
#include "libevent.h"
|
||||
|
||||
typedef struct fe_form_vtable FEFormVtable;
|
||||
typedef struct fe_form_data FEFormData;
|
||||
|
||||
struct fe_form_vtable
|
||||
{
|
||||
void (*create_widget_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*get_size_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*element_is_submit_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*display_element_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*get_element_value)(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
void (*free_element_func)(FEFormData *, LO_FormElementData *);
|
||||
void (*reset_element)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*select_element_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*change_element_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*focus_element_func)(FEFormData *, LO_FormElementStruct *);
|
||||
void (*lost_focus_func)(FEFormData *);
|
||||
};
|
||||
|
||||
struct fe_form_data {
|
||||
FEFormVtable vtbl;
|
||||
LO_FormElementStruct *form;
|
||||
GtkWidget *widget;
|
||||
MozHTMLView *view;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
FEFormData form_data;
|
||||
|
||||
GtkWidget *rowcolumn;
|
||||
GtkWidget *browse_button;
|
||||
GtkWidget *file_widget;
|
||||
} FEFileFormData;
|
||||
|
||||
typedef struct {
|
||||
FEFormData form_data;
|
||||
|
||||
GtkWidget *text_widget; /* form_data.widget is the scrolled window. */
|
||||
} FETextAreaFormData;
|
||||
|
||||
typedef struct {
|
||||
FEFormData form_data;
|
||||
|
||||
GtkWidget *list_widget; /* form_data.widget is the scrolled window. */
|
||||
int nkids;
|
||||
char *selected_p;
|
||||
} FESelectMultFormData;
|
||||
|
||||
typedef FESelectMultFormData FESelectOneFormData;
|
||||
|
||||
static FEFormData* alloc_form_data(int32 type);
|
||||
|
||||
static void text_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
static void text_display(FEFormData *, LO_FormElementStruct *);
|
||||
static void text_get_value(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
static void text_reset(FEFormData *, LO_FormElementStruct *);
|
||||
static void text_change(FEFormData *, LO_FormElementStruct *);
|
||||
static void text_focus(FEFormData *, LO_FormElementStruct *);
|
||||
static void text_lost_focus(FEFormData *);
|
||||
static void text_select(FEFormData *, LO_FormElementStruct *);
|
||||
|
||||
static void file_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
static void file_get_value(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
static void file_free(FEFormData *, LO_FormElementData *);
|
||||
|
||||
static void button_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
|
||||
static void checkbox_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
static void checkbox_get_value(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
static void checkbox_change(FEFormData *, LO_FormElementStruct *);
|
||||
|
||||
static void select_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
static void select_get_value(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
static void select_free(FEFormData *, LO_FormElementData *);
|
||||
static void select_reset(FEFormData *, LO_FormElementStruct *);
|
||||
static void select_change(FEFormData *, LO_FormElementStruct *);
|
||||
|
||||
static void textarea_create_widget(FEFormData *, LO_FormElementStruct *);
|
||||
static void textarea_display(FEFormData *, LO_FormElementStruct *);
|
||||
static void textarea_get_value(FEFormData *, LO_FormElementStruct *, XP_Bool);
|
||||
static void textarea_reset(FEFormData *, LO_FormElementStruct *);
|
||||
static void textarea_lost_focus(FEFormData *);
|
||||
|
||||
static void form_element_display(FEFormData *, LO_FormElementStruct *);
|
||||
static void form_element_get_size(FEFormData *, LO_FormElementStruct *);
|
||||
static void form_element_is_submit(FEFormData *, LO_FormElementStruct *);
|
||||
static void form_element_get_value(FEFormData *, LO_FormElementStruct *,
|
||||
XP_Bool);
|
||||
static void form_element_free(FEFormData *, LO_FormElementData *);
|
||||
|
||||
|
||||
/* doubles as both the text and password vtable */
|
||||
static FEFormVtable text_form_vtable = {
|
||||
text_create_widget,
|
||||
form_element_get_size,
|
||||
form_element_is_submit,
|
||||
text_display,
|
||||
text_get_value,
|
||||
form_element_free,
|
||||
text_reset,
|
||||
text_select,
|
||||
text_change,
|
||||
text_focus,
|
||||
text_lost_focus
|
||||
};
|
||||
|
||||
static FEFormVtable file_form_vtable = {
|
||||
file_create_widget,
|
||||
form_element_get_size,
|
||||
form_element_is_submit,
|
||||
text_display,
|
||||
file_get_value,
|
||||
file_free,
|
||||
text_reset,
|
||||
text_select,
|
||||
text_change,
|
||||
text_focus,
|
||||
text_lost_focus
|
||||
};
|
||||
|
||||
static FEFormVtable button_form_vtable = {
|
||||
button_create_widget,
|
||||
form_element_get_size,
|
||||
NULL,
|
||||
form_element_display,
|
||||
form_element_get_value,
|
||||
form_element_free,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static FEFormVtable checkbox_form_vtable = {
|
||||
checkbox_create_widget,
|
||||
form_element_get_size,
|
||||
NULL,
|
||||
form_element_display,
|
||||
checkbox_get_value,
|
||||
form_element_free,
|
||||
NULL,
|
||||
NULL,
|
||||
checkbox_change,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static FEFormVtable selectone_form_vtable = {
|
||||
select_create_widget,
|
||||
form_element_get_size,
|
||||
NULL,
|
||||
form_element_display,
|
||||
select_get_value,
|
||||
select_free,
|
||||
select_reset,
|
||||
NULL,
|
||||
select_change,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static FEFormVtable selectmult_form_vtable = {
|
||||
select_create_widget,
|
||||
form_element_get_size,
|
||||
NULL,
|
||||
form_element_display,
|
||||
select_get_value,
|
||||
select_free,
|
||||
select_reset,
|
||||
NULL,
|
||||
select_change,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static FEFormVtable textarea_form_vtable = {
|
||||
textarea_create_widget,
|
||||
form_element_get_size,
|
||||
NULL,
|
||||
textarea_display,
|
||||
textarea_get_value,
|
||||
form_element_free,
|
||||
textarea_reset,
|
||||
text_select,
|
||||
text_change,
|
||||
text_focus,
|
||||
textarea_lost_focus
|
||||
};
|
||||
|
||||
static void
|
||||
text_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
|
||||
MWContext *context = MOZ_VIEW(fed->view)->context;
|
||||
LO_FormElementData *form_data;
|
||||
int32 form_type;
|
||||
int32 text_size;
|
||||
int32 max_size;
|
||||
LO_TextAttr *text_attr;
|
||||
int16 charset;
|
||||
char *text;
|
||||
|
||||
form_data = XP_GetFormElementData(form);
|
||||
form_type = XP_FormGetType(form_data);
|
||||
text_size = XP_FormTextGetSize(form_data);
|
||||
max_size = XP_FormTextGetMaxSize(form_data);
|
||||
text_attr = XP_GetFormTextAttr(form);
|
||||
text = (char*)XP_FormGetDefaultText(form_data);
|
||||
charset = text_attr->charset;
|
||||
|
||||
fed->widget = gtk_entry_new();
|
||||
|
||||
gtk_entry_set_text(GTK_ENTRY(fed->widget), text);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_display(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
int32 form_x, form_y;
|
||||
|
||||
printf ("displaying text form element\n");
|
||||
|
||||
form_x = form->x + form->x_offset - fed->view->doc_x + fed->view->drawable->x_origin;
|
||||
form_y = form->y + form->y_offset - fed->view->doc_y + fed->view->drawable->y_origin;
|
||||
|
||||
printf (" moving form element to %d,%d\n", form_x, form_y);
|
||||
|
||||
if (fed->widget->parent == NULL)
|
||||
gtk_fixed_put(GTK_FIXED(MOZ_VIEW(fed->view)->subview_parent),
|
||||
fed->widget,
|
||||
form_x,
|
||||
form_y);
|
||||
else
|
||||
gtk_widget_set_uposition(fed->widget,
|
||||
form_x,
|
||||
form_y);
|
||||
|
||||
gtk_widget_show(fed->widget);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
MWContext *context = MOZ_VIEW(fed->view)->context;
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
char *text = 0;
|
||||
int32 form_type;
|
||||
PA_Block cur_current;
|
||||
PA_Block default_txt;
|
||||
|
||||
form_type = XP_FormGetType(form_data);
|
||||
|
||||
if (form_type == FORM_TYPE_TEXT)
|
||||
text = gtk_entry_get_text(GTK_ENTRY(fed->widget));
|
||||
else if (form_type == FORM_TYPE_PASSWORD)
|
||||
abort(); /* XXXX */
|
||||
|
||||
cur_current = XP_FormGetCurrentText(form_data);
|
||||
default_txt = XP_FormGetDefaultText(form_data);
|
||||
|
||||
if (cur_current && cur_current != default_txt)
|
||||
free ((char*)cur_current);
|
||||
|
||||
XP_FormSetCurrentText(form_data, (PA_Block)text);
|
||||
|
||||
form_element_get_value(fed, form, delete_p);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_reset(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
char *default_text = (char*)XP_FormGetDefaultText(form_data);
|
||||
LO_TextAttr *text_attr = XP_GetFormTextAttr(form);
|
||||
char *tmp_text = 0;
|
||||
GtkEntry *entry = GTK_ENTRY(fed->widget);
|
||||
int32 max_size = XP_FormTextGetMaxSize(form_data);
|
||||
int32 form_type;
|
||||
|
||||
form_type = XP_FormGetType(form_data);
|
||||
|
||||
if (!default_text) default_text = "";
|
||||
|
||||
if (max_size > 0 && (int) XP_STRLEN (default_text) >= max_size)
|
||||
{
|
||||
tmp_text = XP_STRDUP (default_text);
|
||||
tmp_text [max_size] = '\0';
|
||||
default_text = tmp_text;
|
||||
}
|
||||
|
||||
gtk_entry_set_position(entry, 0);
|
||||
|
||||
gtk_entry_set_text(entry, default_text);
|
||||
|
||||
if (tmp_text) XP_FREE (tmp_text);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_change(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
int32 form_type = XP_FormGetType(form_data);
|
||||
char *text = (char*)XP_FormGetCurrentText(form_data);
|
||||
LO_TextAttr *text_attr = XP_GetFormTextAttr(form);
|
||||
|
||||
if (!text) text = (char*)XP_FormGetDefaultText(form_data);
|
||||
|
||||
if (form_type == FORM_TYPE_TEXTAREA)
|
||||
abort(); /* XXX */
|
||||
else
|
||||
gtk_entry_set_text(GTK_ENTRY(fed->widget), text);
|
||||
}
|
||||
|
||||
static void
|
||||
text_focus(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
gtk_widget_grab_focus(fed->widget);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_lost_focus(FEFormData *fed)
|
||||
{
|
||||
FETextAreaFormData *ta_fed = (FETextAreaFormData*)fed;
|
||||
LO_FormElementData *form_data;
|
||||
char *text;
|
||||
XP_Bool text_changed = FALSE;
|
||||
PA_Block current_text;
|
||||
JSEvent *event;
|
||||
|
||||
form_data = XP_GetFormElementData(fed->form);
|
||||
|
||||
current_text = XP_FormGetCurrentText(form_data);
|
||||
|
||||
text = gtk_entry_get_text(GTK_ENTRY(fed->widget));
|
||||
|
||||
if (!current_text || XP_STRCMP((char*)current_text, text))
|
||||
text_changed = FALSE;
|
||||
|
||||
if (((char*) current_text) != text) {
|
||||
free (text);
|
||||
}
|
||||
|
||||
/* if the text has changed, call get_element_value to copy it into the form
|
||||
element, and send a CHANGE event to the javascript thread. */
|
||||
if (text_changed)
|
||||
{
|
||||
(*fed->vtbl.get_element_value)(fed, fed->form, FALSE);
|
||||
|
||||
event = XP_NEW_ZAP(JSEvent);
|
||||
|
||||
event->type = EVENT_CHANGE;
|
||||
|
||||
ET_SendEvent (MOZ_VIEW(fed->view)->context, (LO_Element *) fed->form, event,
|
||||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
text_select(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("text_select (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
file_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("file_create_widget: (not done! will crash)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
file_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
printf("file_get_value (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
file_free(FEFormData *fed,
|
||||
LO_FormElementData *form_data)
|
||||
{
|
||||
printf("file_free (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
button_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
LO_FormElementData *form_data;
|
||||
|
||||
form_data = XP_GetFormElementData(form);
|
||||
fed->widget = gtk_button_new_with_label((unsigned char*)XP_FormGetValue(form_data));
|
||||
}
|
||||
|
||||
void
|
||||
checkbox_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("checkbox_create_widget: (not done! will crash)\n");
|
||||
}
|
||||
|
||||
void
|
||||
checkbox_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool hide)
|
||||
{
|
||||
printf("checkbox_get_value (empty)\n");
|
||||
}
|
||||
|
||||
void
|
||||
checkbox_change(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("checkbox_change (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
select_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("select_create_widget (not done! will crash!)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
select_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
printf("select_get_value (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
select_free(FEFormData *fed,
|
||||
LO_FormElementData *form)
|
||||
{
|
||||
printf("select_free (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
select_reset(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("select_reset (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
select_change(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("select_change (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
textarea_create_widget(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("textarea_create_widget (not done! will crash!)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
textarea_display(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("textarea_display (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
textarea_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
printf("textarea_get_value (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
textarea_reset(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("textarea_reset (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
textarea_lost_focus(FEFormData *fed)
|
||||
{
|
||||
printf("textarea_lost_focus (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
form_element_display(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
int32 form_x, form_y;
|
||||
|
||||
form_x = form->x + form->x_offset - fed->view->doc_x + fed->view->drawable->x_origin;
|
||||
form_y = form->y + form->y_offset - fed->view->doc_y + fed->view->drawable->y_origin;
|
||||
|
||||
if (fed->widget->parent == NULL)
|
||||
gtk_fixed_put(GTK_FIXED(MOZ_VIEW(fed->view)->subview_parent),
|
||||
fed->widget,
|
||||
form_x,
|
||||
form_y);
|
||||
else
|
||||
gtk_widget_set_uposition(fed->widget,
|
||||
form_x,
|
||||
form_y);
|
||||
|
||||
gtk_widget_show(fed->widget);
|
||||
}
|
||||
|
||||
static void
|
||||
form_element_get_size(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
form->width = fed->widget->allocation.width;
|
||||
form->height = fed->widget->allocation.height;
|
||||
}
|
||||
|
||||
static void
|
||||
form_element_is_submit(FEFormData *fed,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
printf("form_element_is_submit (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
form_element_get_value(FEFormData *fed,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
if (delete_p)
|
||||
{
|
||||
gtk_widget_destroy(fed->widget);
|
||||
fed->widget = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
form_element_free(FEFormData *fed,
|
||||
LO_FormElementData *form)
|
||||
{
|
||||
if (fed->widget)
|
||||
gtk_widget_destroy(fed->widget);
|
||||
|
||||
fed->widget = 0;
|
||||
|
||||
XP_FREE(fed);
|
||||
}
|
||||
|
||||
static FEFormData *
|
||||
alloc_form_data(int32 form_type)
|
||||
{
|
||||
FEFormData *data;
|
||||
|
||||
switch (form_type)
|
||||
{
|
||||
case FORM_TYPE_TEXT:
|
||||
case FORM_TYPE_PASSWORD:
|
||||
case FORM_TYPE_READONLY:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FEFormData);
|
||||
data->vtbl = text_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_FILE:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FEFileFormData);
|
||||
data->vtbl = file_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_SUBMIT:
|
||||
case FORM_TYPE_RESET:
|
||||
case FORM_TYPE_BUTTON:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FEFormData);
|
||||
data->vtbl = button_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_RADIO:
|
||||
case FORM_TYPE_CHECKBOX:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FEFormData);
|
||||
data->vtbl = checkbox_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_SELECT_ONE:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FESelectOneFormData);
|
||||
data->vtbl = selectone_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_TEXTAREA:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FETextAreaFormData);
|
||||
data->vtbl = textarea_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_SELECT_MULT:
|
||||
data = (FEFormData*)XP_NEW_ZAP(FESelectMultFormData);
|
||||
data->vtbl = selectmult_form_vtable;
|
||||
return data;
|
||||
|
||||
case FORM_TYPE_HIDDEN:
|
||||
case FORM_TYPE_JOT:
|
||||
case FORM_TYPE_ISINDEX:
|
||||
case FORM_TYPE_IMAGE:
|
||||
case FORM_TYPE_KEYGEN:
|
||||
case FORM_TYPE_OBJECT:
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
moz_html_view_get_form_element_info(MozHTMLView *view,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
MWContext *context = MOZ_VIEW(view)->context;
|
||||
FEFormData *fed;
|
||||
|
||||
if (!form_data)
|
||||
return;
|
||||
|
||||
fed = (FEFormData*)XP_FormGetFEData(form_data);
|
||||
if (!fed)
|
||||
{
|
||||
int32 form_type = XP_FormGetType(form_data);
|
||||
|
||||
fed = alloc_form_data(form_type);
|
||||
|
||||
XP_ASSERT(fed);
|
||||
if (!fed) return;
|
||||
|
||||
XP_FormSetFEData(form_data, fed);
|
||||
}
|
||||
|
||||
fed->form = form;
|
||||
fed->view = view;
|
||||
|
||||
if (!fed->widget)
|
||||
{
|
||||
XP_ASSERT(fed->vtbl.create_widget_func);
|
||||
|
||||
(*fed->vtbl.create_widget_func)(fed, form);
|
||||
}
|
||||
|
||||
XP_ASSERT(fed->vtbl.get_size_func);
|
||||
|
||||
(*fed->vtbl.get_size_func)(fed, form);
|
||||
}
|
||||
|
||||
void
|
||||
moz_html_view_display_form_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form)
|
||||
{
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
FEFormData *fed;
|
||||
|
||||
printf ("MOZ_HTML_VIEW_DISPLAY_FORM_ELEMENT\n");
|
||||
|
||||
if (!form_data)
|
||||
return;
|
||||
|
||||
fed = (FEFormData*)XP_FormGetFEData(form_data);
|
||||
|
||||
XP_ASSERT(fed);
|
||||
if (!fed) return;
|
||||
|
||||
if (fed->vtbl.display_element_func)
|
||||
(*fed->vtbl.display_element_func)(fed, form);
|
||||
}
|
||||
|
||||
void
|
||||
moz_html_view_get_form_element_value(MozHTMLView *view,
|
||||
LO_FormElementStruct *form,
|
||||
XP_Bool delete_p)
|
||||
{
|
||||
LO_FormElementData *form_data = XP_GetFormElementData(form);
|
||||
FEFormData *fed;
|
||||
|
||||
if (!form_data)
|
||||
return;
|
||||
|
||||
fed = (FEFormData*)XP_FormGetFEData(form_data);
|
||||
|
||||
XP_ASSERT(fed);
|
||||
if (!fed) return;
|
||||
|
||||
if (fed->vtbl.get_element_value)
|
||||
(*fed->vtbl.get_element_value)(fed, form, delete_p);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_reset_form_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_reset_form_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_set_form_element_toggle(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element,
|
||||
XP_Bool toggle)
|
||||
{
|
||||
printf("moz_html_view_set_form_element_toggle (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_free_form_element(MozHTMLView *view,
|
||||
LO_FormElementData *form_data)
|
||||
{
|
||||
FEFormData *fed;
|
||||
|
||||
if (!form_data)
|
||||
return;
|
||||
|
||||
fed = (FEFormData*)XP_FormGetFEData(form_data);
|
||||
|
||||
/* this assert gets tripped by HIDDEN form elements, since we have no
|
||||
FE data associated with them. */
|
||||
/*XP_ASSERT(fed);*/
|
||||
if (!fed) return;
|
||||
|
||||
if (fed->vtbl.free_element_func)
|
||||
(*fed->vtbl.free_element_func)(fed, form_data);
|
||||
|
||||
/* clear out the FE data, so we don't try anything funny from now on. */
|
||||
XP_FormSetFEData(form_data, NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_blur_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_blur_input_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_focus_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_focus_input_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_select_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_select_input_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_click_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_click_input_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_change_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_change_input_element (empty)\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moz_html_view_submit_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element)
|
||||
{
|
||||
printf("moz_html_view_submit_input_element (empty)\n");
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,141 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-html-view.h -- html views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_html_view_h
|
||||
#define _moz_html_view_h
|
||||
|
||||
#include "g-view.h"
|
||||
|
||||
/* Platform-specific part of a compositor drawable, which consists of
|
||||
a drawing target, an XY offset and a clipping region. */
|
||||
typedef struct fe_Drawable
|
||||
{
|
||||
GdkDrawable *drawable; /* gdk drawable */
|
||||
int drawable_serial_num; /* Serial number for offscreen pixmap */
|
||||
int32 x_origin;
|
||||
int32 y_origin;
|
||||
FE_Region clip_region;
|
||||
} fe_Drawable;
|
||||
|
||||
struct _MozHTMLView {
|
||||
/* our superclass */
|
||||
MozView _view;
|
||||
|
||||
GdkGC *gc;
|
||||
fe_Drawable *drawable;
|
||||
|
||||
GtkObject *vadj, *hadj;
|
||||
|
||||
int32 doc_width, doc_height;
|
||||
int32 doc_x, doc_y;
|
||||
int32 sw_width, sw_height;
|
||||
|
||||
GtkWidget *scrolled_window;
|
||||
int s_width, s_height, s_depth;
|
||||
};
|
||||
|
||||
extern void moz_html_view_init(MozHTMLView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_html_view_deinit(MozHTMLView *view);
|
||||
|
||||
extern MozHTMLView* moz_html_view_create(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
extern void moz_html_view_finished_layout(MozHTMLView *view);
|
||||
extern void moz_html_view_layout_new_document(MozHTMLView *view,
|
||||
URL_Struct *url,
|
||||
int32 *iWidth,
|
||||
int32 *iHeight,
|
||||
int32 *mWidth,
|
||||
int32 *mHeight);
|
||||
|
||||
extern void moz_html_view_erase_background(MozHTMLView *view,
|
||||
int32 x, int32 y,
|
||||
uint32 width, uint32 height,
|
||||
LO_Color *bg);
|
||||
|
||||
extern int moz_html_view_get_text_info(MozHTMLView *view,
|
||||
LO_TextStruct *text,
|
||||
LO_TextInfo *info);
|
||||
|
||||
extern void moz_html_view_set_doc_dimension(MozHTMLView *view,
|
||||
int32 iWidth,
|
||||
int32 iHeight);
|
||||
|
||||
extern void moz_html_view_set_doc_position(MozHTMLView *view,
|
||||
int32 iX,
|
||||
int32 iY);
|
||||
|
||||
extern void moz_html_view_display_text(MozHTMLView *view,
|
||||
LO_TextStruct *text,
|
||||
XP_Bool need_bg);
|
||||
extern void moz_html_view_display_hr(MozHTMLView *view,
|
||||
LO_HorizRuleStruct *hr);
|
||||
extern void moz_html_view_display_bullet(MozHTMLView *view,
|
||||
LO_BulletStruct *bullet);
|
||||
extern void moz_html_view_display_cell(MozHTMLView *view,
|
||||
LO_CellStruct *cell);
|
||||
extern void moz_html_view_display_table(MozHTMLView *view,
|
||||
LO_TableStruct *table);
|
||||
|
||||
extern void moz_html_view_refresh_rect(MozHTMLView *view,
|
||||
int32 x,
|
||||
int32 y,
|
||||
int32 width,
|
||||
int32 height);
|
||||
|
||||
extern XP_Bool moz_html_view_add_image_callbacks(MozHTMLView *view);
|
||||
|
||||
extern CL_Compositor *moz_html_view_create_compositor(MozHTMLView* view);
|
||||
|
||||
extern void moz_html_set_drawable(MozHTMLView *view,
|
||||
CL_Drawable *drawable);
|
||||
|
||||
extern void moz_html_view_set_background_color(MozHTMLView *view,
|
||||
uint8 red, uint8 green, uint8 blue);
|
||||
|
||||
extern void moz_html_view_get_form_element_info(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_get_form_element_value(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element,
|
||||
XP_Bool hide);
|
||||
extern void moz_html_view_reset_form_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_set_form_element_toggle(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element,
|
||||
XP_Bool toggle);
|
||||
extern void moz_html_view_free_form_element(MozHTMLView *view,
|
||||
LO_FormElementData *form_data);
|
||||
extern void moz_html_view_blur_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_focus_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_select_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_click_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_change_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_submit_input_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
extern void moz_html_view_display_form_element(MozHTMLView *view,
|
||||
LO_FormElementStruct *form_element);
|
||||
|
||||
#endif /*_moz_html_view_h */
|
|
@ -1,220 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-navcenter-view.c -- navcenter views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "g-navcenter-view.h"
|
||||
|
||||
static void
|
||||
ctree_expand(GtkWidget *ctree,
|
||||
GList *node,
|
||||
MozNavCenterView *view)
|
||||
{
|
||||
printf ("Expanding node %p\n", node);
|
||||
}
|
||||
|
||||
static void
|
||||
ctree_collapse(GtkWidget *ctree,
|
||||
GList *node,
|
||||
MozNavCenterView *view)
|
||||
{
|
||||
printf ("Collapsing node %p\n", node);
|
||||
}
|
||||
|
||||
static void
|
||||
ctree_select(GtkWidget *ctree,
|
||||
gint node_index,
|
||||
MozNavCenterView *view)
|
||||
{
|
||||
printf ("selecting node %d\n", node_index);
|
||||
}
|
||||
|
||||
static void
|
||||
ctree_deselect(GtkWidget *ctree,
|
||||
gint node_index,
|
||||
MozNavCenterView *view)
|
||||
{
|
||||
printf ("deselecting node %d\n", node_index);
|
||||
}
|
||||
|
||||
static void
|
||||
get_column_titles(MozNavCenterView *view,
|
||||
int *num,
|
||||
char ***titles)
|
||||
{
|
||||
HT_Cursor column_cursor;
|
||||
char *column_name;
|
||||
uint32 column_width;
|
||||
void *token;
|
||||
uint32 token_type;
|
||||
int cur_title;
|
||||
|
||||
/* first we count them. */
|
||||
column_cursor = HT_NewColumnCursor(view->ht_view);
|
||||
*num = 0;
|
||||
while (HT_GetNextColumn(column_cursor, &column_name, &column_width,
|
||||
&token, &token_type))
|
||||
{
|
||||
*num++;
|
||||
}
|
||||
HT_DeleteColumnCursor(column_cursor);
|
||||
|
||||
/* then we fill in the array */
|
||||
column_cursor = HT_NewColumnCursor(view->ht_view);
|
||||
*titles = (char**)XP_CALLOC(*num, sizeof(char*));
|
||||
cur_title = 0;
|
||||
while (HT_GetNextColumn(column_cursor, &column_name, &column_width,
|
||||
&token, &token_type))
|
||||
{
|
||||
*titles[cur_title++] = XP_STRDUP(column_name);
|
||||
}
|
||||
HT_DeleteColumnCursor(column_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
release_column_titles(MozNavCenterView *view,
|
||||
int num,
|
||||
char **titles)
|
||||
{
|
||||
printf("release_column_titles (empty)\n");
|
||||
}
|
||||
|
||||
static void
|
||||
fill_tree(MozNavCenterView *view)
|
||||
{
|
||||
char **column_titles;
|
||||
int num_column_titles;
|
||||
int i;
|
||||
|
||||
get_column_titles(view, &num_column_titles, &column_titles);
|
||||
printf("There are %d titles.\n", num_column_titles);
|
||||
for (i = 0; i < num_column_titles; i++)
|
||||
printf ("Column[%d]: %s\n", i, column_titles[i]);
|
||||
release_column_titles(view, num_column_titles, column_titles);
|
||||
}
|
||||
|
||||
static void
|
||||
navcenter_ht_notify(HT_Notification ns, HT_Resource n,
|
||||
HT_Event whatHappened)
|
||||
{
|
||||
MozNavCenterView *view = (MozNavCenterView*)ns->data;
|
||||
|
||||
switch (whatHappened)
|
||||
{
|
||||
case HT_EVENT_VIEW_CLOSED:
|
||||
break;
|
||||
case HT_EVENT_VIEW_SELECTED:
|
||||
{
|
||||
HT_View ht_view = HT_GetView(n);
|
||||
|
||||
if (view->ht_view != ht_view)
|
||||
view->ht_view = ht_view;
|
||||
|
||||
fill_tree(view);
|
||||
|
||||
break;
|
||||
}
|
||||
case HT_EVENT_VIEW_ADDED:
|
||||
break;
|
||||
case HT_EVENT_NODE_ADDED:
|
||||
case HT_EVENT_NODE_DELETED_DATA:
|
||||
case HT_EVENT_NODE_DELETED_NODATA:
|
||||
case HT_EVENT_NODE_VPROP_CHANGED:
|
||||
case HT_EVENT_NODE_SELECTION_CHANGED:
|
||||
case HT_EVENT_NODE_OPENCLOSE_CHANGED:
|
||||
case HT_EVENT_NODE_OPENCLOSE_CHANGING:
|
||||
break;
|
||||
default:
|
||||
printf("HT_Event(%d): Unknown type on %s\n",whatHappened,HT_GetNodeName(n));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
createHTPane(MozNavCenterView *view)
|
||||
{
|
||||
HT_Notification ns = XP_NEW_ZAP(HT_NotificationStruct);
|
||||
ns->notifyProc = navcenter_ht_notify;
|
||||
ns->data = view;
|
||||
|
||||
view->ht_pane = HT_NewPane(ns);
|
||||
HT_SetPaneFEData(view->ht_pane, view);
|
||||
}
|
||||
|
||||
void
|
||||
moz_navcenter_view_init(MozNavCenterView *view,
|
||||
MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_NAVCENTER_VIEW);
|
||||
|
||||
/* create the HTPane stuff */
|
||||
createHTPane(view);
|
||||
|
||||
#if 0
|
||||
view->ctree = gtk_ctree_new_with_titles(num_column_titles, 0, column_titles);
|
||||
#else
|
||||
view->ctree = gtk_ctree_new_with_titles(0, 0, 0);
|
||||
#endif
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(view->ctree),
|
||||
"tree_collapse",
|
||||
(GtkSignalFunc)ctree_collapse, view);
|
||||
gtk_signal_connect(GTK_OBJECT(view->ctree),
|
||||
"tree_expand",
|
||||
(GtkSignalFunc)ctree_expand, view);
|
||||
gtk_signal_connect(GTK_OBJECT(view->ctree),
|
||||
"tree_select",
|
||||
(GtkSignalFunc)ctree_select, view);
|
||||
gtk_signal_connect(GTK_OBJECT(view->ctree),
|
||||
"tree_deselect",
|
||||
(GtkSignalFunc)ctree_select, view);
|
||||
|
||||
moz_component_set_basewidget(MOZ_COMPONENT(view), view->ctree);
|
||||
}
|
||||
|
||||
void
|
||||
moz_navcenter_view_deinit(MozNavCenterView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_view_deinit(MOZ_VIEW(view));
|
||||
}
|
||||
|
||||
MozNavCenterView*
|
||||
moz_navcenter_view_create(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozNavCenterView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozNavCenterView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_navcenter_view_init(view, parent_frame, context);
|
||||
return view;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-navcenter-view.h -- navcenter views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_navcenter_view_h
|
||||
#define _moz_navcenter_view_h
|
||||
|
||||
#include "g-view.h"
|
||||
#include "htrdf.h"
|
||||
|
||||
struct _MozNavCenterView {
|
||||
/* our superclass */
|
||||
MozView _view;
|
||||
|
||||
GtkWidget *ctree;
|
||||
HT_View ht_view;
|
||||
HT_Pane ht_pane;
|
||||
};
|
||||
|
||||
extern void moz_navcenter_view_init(MozNavCenterView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_navcenter_view_deinit(MozNavCenterView *view);
|
||||
|
||||
extern MozNavCenterView* moz_navcenter_view_create(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
#endif _moz_bookmark_view_h
|
|
@ -1,105 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-paned-view.c -- paned views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#include "xp_mem.h"
|
||||
#include "g-paned-view.h"
|
||||
|
||||
void
|
||||
moz_paned_view_init(MozPanedView *view,
|
||||
MozFrame *parent_frame,
|
||||
MWContext *context,
|
||||
XP_Bool horizontal)
|
||||
{
|
||||
/* call our superclass's init */
|
||||
moz_view_init(MOZ_VIEW(view), parent_frame, context);
|
||||
|
||||
/* then do our stuff */
|
||||
moz_tagged_set_type(MOZ_TAGGED(view),
|
||||
MOZ_TAG_PANED_VIEW);
|
||||
|
||||
view->paned = horizontal ? gtk_hpaned_new() : gtk_vpaned_new();
|
||||
|
||||
view->horizontal = horizontal;
|
||||
|
||||
moz_component_set_basewidget(MOZ_COMPONENT(view), view->paned);
|
||||
}
|
||||
|
||||
void
|
||||
moz_paned_view_deinit(MozPanedView *view)
|
||||
{
|
||||
/* do our stuff. */
|
||||
|
||||
/* then call our superclass's deinit */
|
||||
moz_view_deinit(MOZ_VIEW(view));
|
||||
}
|
||||
|
||||
MozPanedView*
|
||||
moz_paned_view_create_horizontal(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozPanedView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozPanedView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_paned_view_init(view, parent_frame, context, TRUE);
|
||||
return view;
|
||||
}
|
||||
|
||||
MozPanedView*
|
||||
moz_paned_view_create_vertical(MozFrame *parent_frame,
|
||||
MWContext *context)
|
||||
{
|
||||
MozPanedView* view;
|
||||
|
||||
view = XP_NEW_ZAP(MozPanedView);
|
||||
XP_ASSERT(view);
|
||||
if (view == NULL) return NULL;
|
||||
|
||||
moz_paned_view_init(view, parent_frame, context, FALSE);
|
||||
return view;
|
||||
}
|
||||
|
||||
void
|
||||
moz_paned_view_add_view1(MozPanedView *parent_view,
|
||||
MozView *child_view)
|
||||
{
|
||||
gtk_paned_add1(GTK_PANED(parent_view->paned),
|
||||
MOZ_COMPONENT(child_view)->base_widget);
|
||||
|
||||
/* XXX mostly copied from moz_view_add_view */
|
||||
child_view->parent_view = MOZ_VIEW(parent_view);
|
||||
MOZ_VIEW(parent_view)->subviews = g_list_prepend(MOZ_VIEW(parent_view)->subviews, child_view);
|
||||
}
|
||||
|
||||
void
|
||||
moz_paned_view_add_view2(MozPanedView *parent_view,
|
||||
MozView *child_view)
|
||||
{
|
||||
gtk_paned_add2(GTK_PANED(parent_view->paned),
|
||||
MOZ_COMPONENT(child_view)->base_widget);
|
||||
|
||||
/* XXX mostly copied from moz_view_add_view */
|
||||
child_view->parent_view = MOZ_VIEW(parent_view);
|
||||
MOZ_VIEW(parent_view)->subviews = g_list_prepend(MOZ_VIEW(parent_view)->subviews, child_view);
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-paned-view.h -- paned views.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 1-Jul-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_paned_view_h
|
||||
#define _moz_paned_view_h
|
||||
|
||||
#include "g-view.h"
|
||||
|
||||
struct _MozPanedView {
|
||||
/* our superclass */
|
||||
MozView _view;
|
||||
|
||||
GtkWidget* paned;
|
||||
XP_Bool horizontal;
|
||||
};
|
||||
|
||||
extern void moz_paned_view_init(MozPanedView *view, MozFrame *parent_frame, MWContext *context, XP_Bool horizontal);
|
||||
extern void moz_paned_view_deinit(MozPanedView *view);
|
||||
|
||||
extern MozPanedView* moz_paned_view_create_horizontal(MozFrame *parent_frame, MWContext *context);
|
||||
extern MozPanedView* moz_paned_view_create_vertical(MozFrame *parent_frame, MWContext *context);
|
||||
|
||||
extern void moz_paned_view_add_view1(MozPanedView *parent_view, MozView *child_view);
|
||||
extern void moz_paned_view_add_view2(MozPanedView *parent_view, MozView *child_view);
|
||||
|
||||
extern MozView* moz_paned_view_get_view1(MozPanedView *paned_view);
|
||||
extern MozView* moz_paned_view_get_view2(MozPanedView *paned_view);
|
||||
|
||||
#endif _moz_bookmark_view_h
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-tagged.c -- tagged c objects with subclassing.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#include "g-tagged.h"
|
||||
|
||||
void
|
||||
moz_tagged_init(MozTagged *tagged)
|
||||
{
|
||||
/* nothing to do here... */
|
||||
}
|
||||
|
||||
void
|
||||
moz_tagged_deinit(MozTagged *tagged)
|
||||
{
|
||||
/* nothing to do here... */
|
||||
}
|
||||
|
||||
void
|
||||
moz_tagged_set_type(MozTagged *tagged,
|
||||
PRUint32 tag)
|
||||
{
|
||||
tagged->tag |= tag;
|
||||
}
|
||||
|
||||
PRUint32
|
||||
moz_tagged_get_type(MozTagged *tagged)
|
||||
{
|
||||
return tagged->tag;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-tagged.h -- tagged c objects with subclassing.
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_tagged_h
|
||||
#define _moz_tagged_h
|
||||
|
||||
#include "g-types.h"
|
||||
#include "prtypes.h"
|
||||
|
||||
struct _MozTagged {
|
||||
PRUint32 tag;
|
||||
};
|
||||
|
||||
extern void moz_tagged_init(MozTagged *tagged);
|
||||
extern void moz_tagged_deinit(MozTagged *tagged);
|
||||
|
||||
extern void moz_tagged_set_type(MozTagged *tagged, PRUint32 tag);
|
||||
extern PRUint32 moz_tagged_get_type(MozTagged *tagged);
|
||||
|
||||
#endif
|
|
@ -1,52 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*
|
||||
g-view.h -- views.h
|
||||
Created: Chris Toshok <toshok@hungry.com>, 9-Apr-98.
|
||||
*/
|
||||
|
||||
#ifndef _moz_view_h
|
||||
#define _moz_view_h
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
|
||||
#include "g-frame.h"
|
||||
#include "g-component.h"
|
||||
|
||||
struct _MozView {
|
||||
MozComponent _component;
|
||||
|
||||
MWContext *context;
|
||||
|
||||
MozFrame *parent_frame;
|
||||
MozView *parent_view;
|
||||
|
||||
GtkWidget *subview_parent;
|
||||
GList *subviews;
|
||||
};
|
||||
|
||||
extern void moz_view_init(MozView *view, MozFrame *parent_frame, MWContext *context);
|
||||
extern void moz_view_deinit(MozView *view);
|
||||
|
||||
extern void moz_view_add_view(MozView *parent_view, MozView *child);
|
||||
|
||||
extern void moz_view_set_context(MozView *view, MWContext *context);
|
||||
extern MWContext* moz_view_get_context(MozView *view);
|
||||
|
||||
#endif /* _moz_view_h */
|
|
@ -1,39 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* gnomestr.c --- gnome fe handling of string id's */
|
||||
|
||||
#define RESOURCE_STR
|
||||
#include "gnomefe-strings.h"
|
||||
|
||||
#include "ntypes.h"
|
||||
|
||||
extern char *XP_GetBuiltinString(int16 i);
|
||||
|
||||
char *
|
||||
XP_GetString(int16 i)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if ((ret = mcom_cmd_gnome_gnome_err_h_strings (i + RES_OFFSET)))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
return XP_GetBuiltinString(i);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "gnomefe-strings.h"
|
|
@ -1,92 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* gnometime.c --- gnome functions dealing with front-end
|
||||
timers and timeouts.
|
||||
*/
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "fe_proto.h"
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
struct foo {
|
||||
void *real_closure;
|
||||
TimeoutCallbackFunction func;
|
||||
guint timer_id;
|
||||
};
|
||||
|
||||
gint
|
||||
timeout_trampoline(gpointer data)
|
||||
{
|
||||
struct foo *blah = (struct foo*)data;
|
||||
|
||||
(*blah->func)(blah->real_closure);
|
||||
|
||||
free(blah);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_SetTimeout - Do whatever needs to be done to register a timeout to happen
|
||||
** after msecs milliseconds.
|
||||
**
|
||||
** This function should return some unique ID for the timeout, or NULL
|
||||
** if some operation fails.
|
||||
**
|
||||
** once the timeout has fired, it should not be fired again until
|
||||
** re-registered. That is, if the FE maintains a list of timeouts, it
|
||||
** should remove the timeout after it's fired.
|
||||
*/
|
||||
void*
|
||||
FE_SetTimeout(TimeoutCallbackFunction func,
|
||||
void *closure,
|
||||
uint32 msecs)
|
||||
{
|
||||
struct foo *blah = XP_NEW(struct foo);
|
||||
|
||||
if (msecs == 0)
|
||||
{
|
||||
printf ("hmm. FE_SetTimeout == 0\n");
|
||||
msecs = 1;
|
||||
}
|
||||
|
||||
blah->func = func;
|
||||
blah->real_closure = closure;
|
||||
blah->timer_id = gtk_timeout_add(msecs,
|
||||
timeout_trampoline,
|
||||
blah);
|
||||
|
||||
return blah;
|
||||
}
|
||||
|
||||
/*
|
||||
** FE_ClearTimeout - Do whatever needs to happen to unregister a
|
||||
** timeout, given it's ID.
|
||||
*/
|
||||
void
|
||||
FE_ClearTimeout(void *timer_id)
|
||||
{
|
||||
struct foo *blah = (struct foo*)timer_id;
|
||||
|
||||
gtk_timeout_remove(blah->timer_id);
|
||||
|
||||
free(blah);
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
include $(DEPTH)/config/config.mk
|
||||
|
||||
MODULE = gnuzilla-widgets
|
||||
|
||||
LIBRARY_NAME = gnuzilla-widgets
|
||||
|
||||
CSRCS = moz-statusbar.c
|
||||
|
||||
EXPORTS = moz-statusbar.h
|
||||
|
||||
GNOME_CFLAGS := $(shell gnome-config --cflags gnomeui)
|
||||
|
||||
INCLUDES += -I$(OBJDIR) -I.. -I. $(GNOME_CFLAGS)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
|
@ -1,40 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
MODULE = gnuzilla-widgets
|
||||
|
||||
LIBRARY_NAME = gnuzilla-widgets
|
||||
|
||||
CSRCS = moz-statusbar.c
|
||||
|
||||
EXPORTS = moz-statusbar.h
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
GNOME_CFLAGS := $(FE_GNOME_CFLAGS)
|
||||
|
||||
INCLUDES += -I$(OBJDIR) -I$(srcdir)/.. -I$(srcdir)/. $(GNOME_CFLAGS)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,216 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include "structs.h"
|
||||
#include "ntypes.h"
|
||||
#include "proto.h"
|
||||
#include "net.h"
|
||||
#include "plevent.h"
|
||||
#include "xp.h"
|
||||
#include "rdf.h"
|
||||
|
||||
#include "g-browser-frame.h"
|
||||
|
||||
extern char *fe_home_dir;
|
||||
extern char *fe_config_dir;
|
||||
|
||||
gint gnomefe_depth;
|
||||
GdkVisual *gnomefe_visual;
|
||||
|
||||
PRThread *mozilla_thread;
|
||||
PREventQueue* mozilla_event_queue;
|
||||
|
||||
extern const char *XP_AppCodeName;
|
||||
extern const char *XP_AppVersion;
|
||||
extern const char *XP_AppPlatform;
|
||||
const char *XP_Language;
|
||||
|
||||
void
|
||||
fe_url_exit (URL_Struct *url, int status, MWContext *context)
|
||||
{
|
||||
printf ("in fe_url_exit()\n");
|
||||
|
||||
if (status != MK_CHANGING_CONTEXT)
|
||||
{
|
||||
NET_FreeURLStruct (url);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
net_idle_function(gpointer data)
|
||||
{
|
||||
NET_ProcessNet (NULL, NET_EVERYTIME_TYPE);
|
||||
PR_ProcessPendingEvents(mozilla_event_queue);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,
|
||||
char **argv)
|
||||
{
|
||||
URL_Struct *url;
|
||||
|
||||
MozBrowserFrame *initial_frame;
|
||||
|
||||
XP_AppName = "gnuzilla";
|
||||
XP_AppCodeName = "Gnuzilla";
|
||||
XP_AppVersion = "0.1";
|
||||
XP_Language = "";
|
||||
XP_AppPlatform = "";
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
XP_StatStruct stat_struct;
|
||||
|
||||
if(stat(".WWWtraceon", &stat_struct) != -1)
|
||||
MKLib_trace_flag = 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
/* initialize NSPR stuff */
|
||||
#ifdef DEBUG
|
||||
extern PRLogModuleInfo* NETLIB;
|
||||
NETLIB = PR_NewLogModule("netlib");
|
||||
#endif
|
||||
|
||||
PR_SetThreadGCAble();
|
||||
PR_SetThreadPriority(PR_GetCurrentThread(), PR_PRIORITY_LAST);
|
||||
PR_BlockClockInterrupts();
|
||||
|
||||
LJ_SetProgramName(argv[0]);
|
||||
#if 0
|
||||
PR_XLock();
|
||||
#endif
|
||||
mozilla_thread = PR_CurrentThread();
|
||||
#if 0
|
||||
fdset_lock = PR_NewNamedMonitor("mozilla-fdset-lock");
|
||||
#endif
|
||||
/*
|
||||
** Create a pipe used to wakeup mozilla from select. A problem we had
|
||||
** to solve is the case where a non-mozilla thread uses the netlib to
|
||||
** fetch a file. Because the netlib operates by updating mozilla's
|
||||
** select set, and because mozilla might be in the middle of select
|
||||
** when the update occurs, sometimes mozilla never wakes up (i.e. it
|
||||
** looks hung). Because of this problem we create a pipe and when a
|
||||
** non-mozilla thread wants to wakeup mozilla we write a byte to the
|
||||
** pipe.
|
||||
*/
|
||||
mozilla_event_queue = PR_CreateEventQueue("mozilla-event-queue", mozilla_thread);
|
||||
|
||||
}
|
||||
|
||||
/* Must do this early now so that mail can load directories */
|
||||
/* Setting fe_home_dir likewise must happen early. */
|
||||
fe_home_dir = getenv ("HOME");
|
||||
if (!fe_home_dir || !*fe_home_dir)
|
||||
{
|
||||
/* Default to "/" in case a root shell is running in dire straits. */
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
|
||||
fe_home_dir = pw ? pw->pw_dir : "/";
|
||||
}
|
||||
else
|
||||
{
|
||||
char *slash;
|
||||
|
||||
/* Trim trailing slashes just to be fussy. */
|
||||
while ((slash = strrchr(fe_home_dir, '/')) && slash[1] == '\0')
|
||||
*slash = '\0';
|
||||
}
|
||||
|
||||
/* Hmm. XFE claims InitNetLib needs to happen before pref init */
|
||||
/* The unit for tcp buffer size is changed from kbytes to bytes */
|
||||
NET_InitNetLib (8192, 50);
|
||||
|
||||
{
|
||||
char buf [1024];
|
||||
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir,
|
||||
#ifdef OLD_UNIX_FILES
|
||||
".netscape-preferences"
|
||||
#else
|
||||
MOZ_USER_DIR "/preferences.js"
|
||||
#endif
|
||||
);
|
||||
|
||||
PREF_Init(buf);
|
||||
}
|
||||
|
||||
gnome_init("gnuzilla", NULL, /* argc */ 1, argv, 0, NULL);
|
||||
|
||||
gnomefe_depth = gdk_visual_get_best_depth();
|
||||
gnomefe_visual = gdk_visual_get_best_with_depth(gnomefe_depth);
|
||||
|
||||
gtk_widget_set_default_visual(gnomefe_visual);
|
||||
|
||||
PR_UnblockClockInterrupts();
|
||||
|
||||
check_for_lock_file();
|
||||
|
||||
NR_StartupRegistry();
|
||||
fe_RegisterConverters ();
|
||||
|
||||
GH_InitGlobalHistory();
|
||||
|
||||
IL_Init();
|
||||
LM_InitMocha ();
|
||||
|
||||
initial_frame = moz_browser_frame_create();
|
||||
|
||||
moz_frame_show(MOZ_FRAME(initial_frame));
|
||||
|
||||
/* Initialize RDF */
|
||||
{
|
||||
RDF_InitParamsStruct rdf_params = {0, };
|
||||
|
||||
rdf_params.profileURL =
|
||||
XP_PlatformFileToURL(fe_config_dir);
|
||||
rdf_params.bookmarksURL =
|
||||
XP_PlatformFileToURL(fe_GetConfigDirFilename("bookmarks.html"));
|
||||
rdf_params.globalHistoryURL =
|
||||
XP_PlatformFileToURL(fe_GetConfigDirFilename("history.db"));
|
||||
|
||||
RDF_Init(&rdf_params);
|
||||
|
||||
XP_FREEIF(rdf_params.profileURL);
|
||||
XP_FREEIF(rdf_params.bookmarksURL);
|
||||
XP_FREEIF(rdf_params.globalHistoryURL);
|
||||
}
|
||||
NPL_Init();
|
||||
|
||||
if(argc > 1)
|
||||
url = NET_CreateURLStruct(argv[1], NET_NORMAL_RELOAD);
|
||||
else
|
||||
url = NET_CreateURLStruct("about:blank", NET_NORMAL_RELOAD);
|
||||
|
||||
|
||||
NET_GetURL(url, FO_CACHE_AND_PRESENT,
|
||||
moz_frame_get_context(MOZ_FRAME(initial_frame)),
|
||||
fe_url_exit);
|
||||
|
||||
/* XXX is this enough time? */
|
||||
gtk_timeout_add(250, net_idle_function, NULL);
|
||||
|
||||
gtk_main();
|
||||
|
||||
/* keep gcc happy */
|
||||
return 0;
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NPPRIV_H_
|
||||
#define _NPPRIV_H_
|
||||
|
||||
#include "xp_core.h"
|
||||
#include "xp_mem.h"
|
||||
#include "xp_trace.h"
|
||||
#include "xp_mcom.h"
|
||||
#include "lo_ele.h"
|
||||
#include "npupp.h"
|
||||
#include "npassoc.h"
|
||||
#include "npapi.h"
|
||||
|
||||
#define ISFUNCPTR(x) (x != NULL)
|
||||
|
||||
#define PLUGIN_TIMER_EVENT
|
||||
|
||||
typedef struct _np_handle np_handle;
|
||||
typedef struct _np_mimetype np_mimetype;
|
||||
typedef struct _np_instance np_instance;
|
||||
typedef struct _np_stream np_stream;
|
||||
typedef struct _np_data np_data;
|
||||
typedef struct _np_urlsnode np_urlsnode;
|
||||
typedef struct _np_reconnect np_reconnect;
|
||||
struct nsIPlugin;
|
||||
|
||||
typedef enum {
|
||||
NPDataNormal = 0, /* URL_Struct.fe_data -> NPEmbeddedApp.np_data -> np_data */
|
||||
NPDataCache = 1, /* LO_EmbedStruct.session_data -> np_data */
|
||||
NPDataCached = 2, /* LO_EmbedStruct.session_data -> np_data */
|
||||
NPDataSaved = 3 /* LO_EmbedStruct.session_data -> np_data */
|
||||
} NPDataState;
|
||||
|
||||
struct _np_data {
|
||||
NPDataState state;
|
||||
np_handle *handle;
|
||||
NPEmbeddedApp *app;
|
||||
NPSavedData *sdata;
|
||||
/* Not valid in state NPDataSaved! */
|
||||
np_instance *instance;
|
||||
LO_EmbedStruct *lo_struct;
|
||||
int32 refs;
|
||||
XP_Bool streamStarted;
|
||||
};
|
||||
|
||||
struct _np_handle {
|
||||
np_handle *next;
|
||||
NPPluginFuncs *f;
|
||||
void *pdesc; /* pd glue description */
|
||||
int32 refs;
|
||||
np_instance *instances;
|
||||
np_mimetype *mimetypes;
|
||||
char *name;
|
||||
char *filename;
|
||||
char *description;
|
||||
struct nsIPlugin* userPlugin;
|
||||
};
|
||||
|
||||
struct _np_mimetype {
|
||||
np_mimetype* next;
|
||||
NPMIMEType type;
|
||||
NPFileTypeAssoc *fassoc;
|
||||
np_handle* handle;
|
||||
XP_Bool enabled;
|
||||
};
|
||||
|
||||
struct _np_instance {
|
||||
np_handle *handle;
|
||||
np_mimetype *mimetype;
|
||||
char *typeString;
|
||||
np_instance *next;
|
||||
NPEmbeddedApp *app;
|
||||
NPP npp;
|
||||
MWContext *cx;
|
||||
np_stream *streams;
|
||||
uint16 type;
|
||||
int reentrant;
|
||||
URL_Struct *delayedload;
|
||||
XP_List *url_list;
|
||||
JRIEnv* javaEnv;
|
||||
#ifdef OJI
|
||||
jobject javaInstance;
|
||||
#else
|
||||
JRIGlobalRef javaInstance;
|
||||
#endif /* OJI */
|
||||
XP_Bool windowed; /* TRUE = has its own window, FALSE = windowless */
|
||||
XP_Bool transparent; /* TRUE = transparent, FALSE = opaque */
|
||||
XP_Bool calling_netlib_all_the_time;
|
||||
JRIGlobalRef mochaWindow;
|
||||
|
||||
#ifdef PLUGIN_TIMER_EVENT
|
||||
void* timeout;
|
||||
uint32 interval;
|
||||
#endif
|
||||
|
||||
#ifdef LAYERS
|
||||
CL_Layer *layer;
|
||||
#endif /* LAYERS */
|
||||
};
|
||||
|
||||
struct _np_stream {
|
||||
np_instance *instance;
|
||||
np_handle *handle;
|
||||
np_stream *next;
|
||||
NPStream *pstream;
|
||||
char *url; /* convenience */
|
||||
URL_Struct *initial_urls;
|
||||
NET_StreamClass *nstream;
|
||||
int32 len;
|
||||
int init;
|
||||
int seek; /* 0 normal, -1 turn, 1 seek, 2 discard */
|
||||
int seekable;
|
||||
int dontclose;
|
||||
int asfile;
|
||||
int islocked;
|
||||
int32 offset;
|
||||
NPByteRange *deferred;
|
||||
NET_StreamClass *prev_stream;
|
||||
};
|
||||
|
||||
struct _np_urlsnode {
|
||||
URL_Struct *urls;
|
||||
void* notifyData;
|
||||
XP_Bool cached;
|
||||
XP_Bool notify;
|
||||
};
|
||||
|
||||
/* MWContext.pluginReconnect -> np_reconnect */
|
||||
struct _np_reconnect {
|
||||
np_mimetype* mimetype;
|
||||
char* requestedtype;
|
||||
NPEmbeddedApp* app;
|
||||
};
|
||||
|
||||
#endif /* _NPPRIV_H_ */
|
|
@ -1,40 +0,0 @@
|
|||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH=..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
|
||||
#// (these must come before the common makefiles are included)
|
||||
#//
|
||||
#// DIRS - There are subdirectories to process
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DIRS=wincom winfe
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -1,71 +0,0 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# Name: motif.mk
|
||||
#
|
||||
# Description: Motif Makefile hackery shared across unix and unik-like
|
||||
# Mozilla front ends.
|
||||
#
|
||||
# Currently this file is only used for linux, but eventually
|
||||
# it should be used for other platforms as well.
|
||||
#
|
||||
# Author: Ramiro Estrugo <ramiro@netscape.com>
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# MOZILLA_XFE_MOTIF_FLAGS
|
||||
#
|
||||
# This macro will contain the default flags needed to link 'mozilla-export'
|
||||
#
|
||||
# The actual value will depend on whether static and/or dynamic motif
|
||||
# libraries are found in the system.
|
||||
#
|
||||
# The following two macros are used to determine the above value:
|
||||
#
|
||||
# MOZILLA_XFE_MOTIF_HAVE_STATIC_LIB
|
||||
# MOZILLA_XFE_MOTIF_HAVE_DYNAMIC_LIB
|
||||
#
|
||||
# These are defined in the system specific generated detect makefile.
|
||||
# See mozilla/config/mkdetect for details.
|
||||
#
|
||||
##########################################################################
|
||||
ifdef MOZILLA_XFE_MOTIF_HAVE_STATIC_LIB
|
||||
|
||||
MOZILLA_XFE_MOTIF_FLAGS = $(MOZILLA_XFE_MOTIF_STATIC_FLAGS)
|
||||
|
||||
else
|
||||
|
||||
ifdef MOZILLA_XFE_MOTIF_HAVE_DYNAMIC_LIB
|
||||
|
||||
MOZILLA_XFE_MOTIF_FLAGS = $(MOZILLA_XFE_MOTIF_DYNAMIC_FLAGS)
|
||||
|
||||
else
|
||||
|
||||
error "Motif library (static or dynamic) required"
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
##########################################################################
|
||||
|
||||
endif # OS_ARCH == Linux
|
|
@ -1,209 +0,0 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# STOP THE INSANITY #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# Name: unixfe.mk
|
||||
#
|
||||
# Description: Makefile hackery shared across unix and unik-like
|
||||
# Mozilla front ends.
|
||||
#
|
||||
# The purpose of this file is to STOP THE INSANITY that
|
||||
# has become the XFE Makefile and that will soon be the
|
||||
# gnomefe, qtfe, ybfe and foofe Makfiles.
|
||||
#
|
||||
# Anything that can be shared between the unix fes, should
|
||||
# be shared. Always look here first before adding anything
|
||||
# to the toolkit specific Makefiles, or you will suffer
|
||||
# dearly.
|
||||
#
|
||||
# Author: Ramiro Estrugo <ramiro@netscape.com>
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# MOZ_NATIVE_JPEG
|
||||
#
|
||||
# The default usage for libjpeg is that its built as part of Mozilla.
|
||||
#
|
||||
# MOZ_NATIVE_JPEG can be set to make Mozilla build using a 'native' libjpeg
|
||||
# as found in platforms such as Linux and IRIX.
|
||||
#
|
||||
# Only one of the following gets set for linking the xfe:
|
||||
#
|
||||
# XFE_JPEG_LIB
|
||||
# XFE_JPEG_DSO
|
||||
#
|
||||
# Only one of the following gets set for linking mkicons.
|
||||
#
|
||||
# XFE_MKICONS_JPEG_LIB
|
||||
# XFE_MKICONS_JPEG_DSO
|
||||
#
|
||||
# We dont want to link mkicons dynamically against jpeg if we dont have to.
|
||||
# It breaks on many platforms.
|
||||
#
|
||||
##########################################################################
|
||||
ifdef MOZ_NATIVE_JPEG
|
||||
|
||||
XFE_JPEG_LIB =
|
||||
XFE_JPEG_DSO = -ljpeg
|
||||
XFE_JPEG_REQUIRES =
|
||||
XFE_MKICONS_JPEG_LIB =
|
||||
XFE_MKICONS_JPEG_DSO = -ljpeg
|
||||
|
||||
ifdef USE_AUTOCONF
|
||||
XFE_JPEG_DSO = $(JPEG_LIBS)
|
||||
XFE_MKICONS_JPEG_DSO = $(JPEG_LIBS)
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
XFE_JPEG_LIB = $(DIST)/lib/libjpeg.a
|
||||
XFE_JPEG_DSO =
|
||||
XFE_JPEG_REQUIRES = jpeg
|
||||
XFE_MKICONS_JPEG_LIB = $(DIST)/lib/libjpeg.a
|
||||
XFE_MKICONS_JPEG_DSO =
|
||||
|
||||
endif
|
||||
##########################################################################
|
||||
|
||||
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# MOZ_NATIVE_PNG
|
||||
#
|
||||
# The default usage for libpng is that its built as part of Mozilla.
|
||||
#
|
||||
# MOZ_NATIVE_PNG can be set to make Mozilla build using a 'native' libpng
|
||||
# as found in platforms such as Linux and IRIX.
|
||||
#
|
||||
# Only one of the following gets set for linking the xfe:
|
||||
#
|
||||
# XFE_PNG_LIB
|
||||
# XFE_PNG_DSO
|
||||
#
|
||||
# Only one of the following gets set for linking mkicons.
|
||||
#
|
||||
# XFE_MKICONS_PNG_LIB
|
||||
# XFE_MKICONS_PNG_DSO
|
||||
#
|
||||
# We dont want to link mkicons dynamically against png if we dont have to.
|
||||
# It breaks on many platforms.
|
||||
#
|
||||
##########################################################################
|
||||
ifdef MOZ_NATIVE_PNG
|
||||
|
||||
XFE_PNG_LIB =
|
||||
XFE_PNG_DSO = -lpng
|
||||
XFE_PNG_REQUIRES =
|
||||
XFE_MKICONS_PNG_LIB =
|
||||
XFE_MKICONS_PNG_DSO = -lpng
|
||||
|
||||
ifdef USE_AUTOCONF
|
||||
XFE_PNG_DSO = $(PNG_LIBS)
|
||||
XFE_MKICONS_PNG_DSO = $(PNG_LIBS)
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
XFE_PNG_LIB = $(DIST)/lib/libpng.a
|
||||
XFE_PNG_DSO =
|
||||
XFE_PNG_REQUIRES = png
|
||||
XFE_MKICONS_PNG_LIB = $(DIST)/lib/libpng.a
|
||||
XFE_MKICONS_PNG_DSO =
|
||||
|
||||
endif
|
||||
##########################################################################
|
||||
|
||||
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# MOZ_NATIVE_ZLIB
|
||||
#
|
||||
# The default usage for libzlib is that its built as part of Mozilla.
|
||||
#
|
||||
# MOZ_NATIVE_ZLIB can be set to make Mozilla build using a 'native' libzlib
|
||||
# as found in platforms such as Linux and IRIX.
|
||||
#
|
||||
# When built as part of Mozilla, it takes the name 'libzlib'
|
||||
#
|
||||
# The native zlib libs seem to be named 'libz' - at least on Linux.
|
||||
#
|
||||
# The FULL_STATIC_BUILD force the final Mozilla binary to be as fully
|
||||
# staitc as possible - which includes zlib.
|
||||
#
|
||||
# Only one of the following gets set for linking the xfe:
|
||||
#
|
||||
# XFE_ZLIB_LIB
|
||||
# XFE_ZLIB_DSO
|
||||
#
|
||||
# Only one of the following gets set for linking mkicons.
|
||||
#
|
||||
# XFE_MKICONS_ZLIB_LIB
|
||||
# XFE_MKICONS_ZLIB_DSO
|
||||
#
|
||||
# We dont want to link mkicons dynamically against zlib if we dont have to.
|
||||
# It breaks on many platforms.
|
||||
#
|
||||
#
|
||||
##########################################################################
|
||||
ifdef MOZ_NATIVE_ZLIB
|
||||
|
||||
XFE_ZLIB_LIB =
|
||||
XFE_ZLIB_DSO = -lz
|
||||
XFE_ZLIB_REQUIRES =
|
||||
XFE_MKICONS_ZLIB_LIB =
|
||||
XFE_MKICONS_ZLIB_DSO = -lz
|
||||
|
||||
ifdef USE_AUTOCONF
|
||||
XFE_ZLIB_DSO = $(ZLIB_LIBS)
|
||||
XFE_MKICONS_ZLIB_DSO = $(ZLIB_LIBS)
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
ifdef FULL_STATIC_BUILD
|
||||
|
||||
XFE_ZLIB_LIB = $(DIST)/lib/libzlib.a
|
||||
XFE_ZLIB_DSO =
|
||||
XFE_ZLIB_REQUIRES = zlib
|
||||
|
||||
else
|
||||
|
||||
XFE_ZLIB_LIB =
|
||||
XFE_ZLIB_DSO = -lzlib
|
||||
XFE_ZLIB_REQUIRES = zlib
|
||||
|
||||
endif
|
||||
|
||||
XFE_MKICONS_ZLIB_LIB = $(DIST)/lib/libzlib.a
|
||||
XFE_MKICONS_ZLIB_DSO =
|
||||
|
||||
endif
|
||||
##########################################################################
|
||||
|
||||
# eof
|
|
@ -1,20 +0,0 @@
|
|||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ..\..\..
|
||||
DIRS = public src
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllCommon_H
|
||||
#define __DllCommon_H
|
||||
|
||||
// Common dll code to be compiled to library form, and then
|
||||
// used as a framework by other windows dlls which support
|
||||
// both 16 and 32 bits through a COM interface.
|
||||
|
||||
#include "dlltypes.h"
|
||||
#include "dlldbg.h"
|
||||
#include "dlliface.h"
|
||||
#include "dllmem.h"
|
||||
#include "dlltask.h"
|
||||
#include "dllref.h"
|
||||
#include "dllobj.h"
|
||||
#include "dllutil.h"
|
||||
|
||||
// End consumer must derive from this class and implement the
|
||||
// abstract/virtual interfaces.
|
||||
// Please note that a CComDll derived class will self destruct
|
||||
// once it detects that no more instance data is at hand (no
|
||||
// CComClass instances for this CComDll are in existence).
|
||||
class CComDll : public IUnknown {
|
||||
private:
|
||||
CProcessEntry *m_pEntry;
|
||||
public:
|
||||
CComDll();
|
||||
virtual ~CComDll();
|
||||
|
||||
// Had to break down and track the module for resources and
|
||||
// path resolution situations.
|
||||
// Static is OK, as on 16 bits, the DLL will continue to
|
||||
// have the same module handle no matter how many
|
||||
// different EXEs are looking at it.
|
||||
public:
|
||||
static HINSTANCE m_hInstance;
|
||||
static HINSTANCE GetInstanceHandle();
|
||||
|
||||
// Reference counting is done on a per COM object basis in
|
||||
// the instance data.
|
||||
// You must derive your COM related classes from
|
||||
// CComClass as they know how to properly utilize
|
||||
// the following functions of the CComDll instance.
|
||||
private:
|
||||
DWORD m_ulCount;
|
||||
public:
|
||||
STDMETHODIMP QueryInterface(REFIID iid, void **ppObj);
|
||||
STDMETHODIMP_(DWORD) AddRef();
|
||||
STDMETHODIMP_(DWORD) Release();
|
||||
|
||||
public:
|
||||
// Provide way to get the module name.
|
||||
DWORD GetModuleFileName(char *pOutName, size_t stOutSize, BOOL bFullPath = FALSE);
|
||||
|
||||
public:
|
||||
// Consumer implementation of DllGetClassObject per DLL
|
||||
// task instance.
|
||||
virtual HRESULT GetClassObject(REFCLSID rClsid, REFIID rIid, LPVOID *ppObj) = 0;
|
||||
// Consumer implemenation of Dll[Un]RegisterServer to
|
||||
// write / delete CLSIDs for objects it implements.
|
||||
// No need to override unless you need to do more than
|
||||
// base implementation.
|
||||
virtual HRESULT RegisterServer();
|
||||
virtual HRESULT UnregisterServer();
|
||||
// Needed by RegisterServer and UnregisterServer.
|
||||
// Simply return an array of CLSIDs, terminated by a
|
||||
// null.
|
||||
// Must return an allocated buffer which must be freed by the
|
||||
// caller.
|
||||
virtual const CLSID **GetCLSIDs() = 0;
|
||||
|
||||
#ifdef DLL_DEBUG
|
||||
public:
|
||||
// Mainly needed to distinguish trace output.
|
||||
// Set to your own string when you need to.
|
||||
static const char *m_pTraceID;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // __DllCommon_H
|
|
@ -1,50 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllDebug_H
|
||||
#define __DllDebug_H
|
||||
|
||||
#ifdef DLL_RELEASE
|
||||
#define DLL_ASSERT(a) ((void)0)
|
||||
#endif
|
||||
#ifdef DLL_DEBUG
|
||||
#define DLL_ASSERT(a) ((a) ? ((void)0) : DebugBreak())
|
||||
#endif
|
||||
|
||||
#ifdef DLL_RELEASE
|
||||
#define DLL_VERIFY(a) ((void)(a))
|
||||
#endif
|
||||
#ifdef DLL_DEBUG
|
||||
#define DLL_VERIFY(a) DLL_ASSERT(a)
|
||||
#endif
|
||||
|
||||
#ifdef DLL_RELEASE
|
||||
#define DLL_TRACE 1 ? ((void)0) : DLL_Trace
|
||||
#endif
|
||||
#ifdef DLL_DEBUG
|
||||
#define DLL_TRACE DLL_Trace
|
||||
#endif
|
||||
|
||||
#ifdef DLL_RELEASE
|
||||
inline void DLL_Trace(const char *, ...) { }
|
||||
#endif
|
||||
#ifdef DLL_DEBUG
|
||||
void DLL_Trace(const char *pFormat, ...);
|
||||
#endif
|
||||
|
||||
#endif // __DllDebug_H
|
|
@ -1,37 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllInterfaces_H
|
||||
#define __DllInterfaces_H
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef DLL_WIN16
|
||||
#include <compobj.h>
|
||||
#include <variant.h>
|
||||
#include <dispatch.h>
|
||||
#include <ole2.h>
|
||||
#else
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
#include <olectl.h>
|
||||
#if (_MSC_VER < 1200)
|
||||
#include <olectlid.h>
|
||||
#endif
|
||||
|
||||
#endif // __DllInterfaces_H
|
|
@ -1,36 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* Simply include this file into a source file
|
||||
* in order to cause linkage of the DLL entry point.
|
||||
*
|
||||
* This file exists simply because the DLL entry point can not be
|
||||
* added to the wincom library and still successfully link
|
||||
* due to conflicts with other run time libraries containing
|
||||
* the same routine and is provided solely for your convenience.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
BOOL WINAPI DllMain(HANDLE hDLL, DWORD, LPVOID)
|
||||
#else
|
||||
extern "C" int CALLBACK LibMain(HINSTANCE hDLL, WORD, WORD, LPSTR)
|
||||
#endif
|
||||
{
|
||||
CComDll::m_hInstance = (HINSTANCE)hDLL;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllMemory_H
|
||||
#define __DllMemory_H
|
||||
|
||||
#ifndef _WIN32
|
||||
// CoTaskMemAlloc uses the default OLE allocator to allocate a memory
|
||||
// block in the same way that IMalloc::Alloc does
|
||||
LPVOID CoTaskMemAlloc(ULONG cb);
|
||||
|
||||
// CoTaskMemRealloc changes the size of a previously allocated memory
|
||||
// block in the same way that IMalloc::Realloc does
|
||||
LPVOID CoTaskMemRealloc(LPVOID lpv, ULONG cb);
|
||||
|
||||
// CoTaskMemFree uses the default OLE allocator to free a block of
|
||||
// memory previously allocated through a call to CoTaskMemAlloc
|
||||
void CoTaskMemFree(LPVOID lpv);
|
||||
#endif
|
||||
|
||||
#endif // __DllMemory_H
|
|
@ -1,59 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllComClassObject_H
|
||||
#define __DllComClassObject_H
|
||||
|
||||
// ALL COM IMPLEMENTED OBJECTS MUST DERIVE FROM THIS
|
||||
// CLASS (or do what it does).
|
||||
|
||||
// All your COM interface exposing classes which you implement
|
||||
// in your consumer DLL must derive from this class
|
||||
// such that it can perform some minimal DLL maintenence
|
||||
// and ensure that you do not forget to do so.
|
||||
class CComClass {
|
||||
private:
|
||||
CRefDll m_Ref; // Ref count dll instance.
|
||||
public:
|
||||
CComClass(IUnknown *pAggregate = NULL);
|
||||
virtual ~CComClass();
|
||||
|
||||
// external IUnknown implementation inside of the class.
|
||||
private:
|
||||
DWORD m_ulCount;
|
||||
IUnknown *m_pAggregate;
|
||||
public:
|
||||
HRESULT ObjectQueryInterface(REFIID iid, void **ppObj, BOOL bIUnknown = FALSE);
|
||||
virtual HRESULT CustomQueryInterface(REFIID iid, void **ppObj);
|
||||
DWORD ObjectAddRef(BOOL bIUnknown = FALSE);
|
||||
virtual DWORD CustomAddRef();
|
||||
DWORD ObjectRelease(BOOL bIUnknown = FALSE);
|
||||
virtual DWORD CustomRelease();
|
||||
|
||||
// Nested class interface implementation.
|
||||
private:
|
||||
class CImplUnknown : public IUnknown {
|
||||
public:
|
||||
CComClass *m_pObject;
|
||||
STDMETHODIMP QueryInterface(REFIID iid, void **ppObj);
|
||||
STDMETHODIMP_(DWORD) AddRef();
|
||||
STDMETHODIMP_(DWORD) Release();
|
||||
} m_IUnknown;
|
||||
};
|
||||
|
||||
#endif // __DllComClassObject_H
|
|
@ -1,41 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllRefCounterHelper_H
|
||||
#define __DllRefCounterHelper_H
|
||||
|
||||
// Here's a helper to keep DLL ref counting straight.
|
||||
// Just use it as a member to your classes which control the lifetime
|
||||
// of the DLL instance.
|
||||
class CRefDll {
|
||||
private:
|
||||
IUnknown *m_pDllRef;
|
||||
public:
|
||||
CRefDll() {
|
||||
m_pDllRef = (IUnknown *)CProcess::GetProcessDll();
|
||||
}
|
||||
~CRefDll() {
|
||||
if(m_pDllRef) {
|
||||
m_pDllRef->Release();
|
||||
m_pDllRef = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __DllRefCounterHelper_H
|
|
@ -1,68 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllProcessData_H
|
||||
#define __DllProcessData_H
|
||||
|
||||
// THIS HEADER IS NOT PUBLIC TO OTHER CODE EXCEPT THE
|
||||
// CORE DLL IMPLEMENTATION.
|
||||
|
||||
// Classes used to maintain a seperate instace list of
|
||||
// Dll data for each different task utilizing the
|
||||
// Dll. The goal here is to transparently make
|
||||
// win16 Dlls which share data, to act like win32
|
||||
// Dlls, which do not share data.
|
||||
|
||||
// This class is solely contained by the CComDll class
|
||||
// constructor and destructor, but this class
|
||||
// registers itself into a list such that a per
|
||||
// process lookup can find a CComDll instance.
|
||||
class CProcessEntry {
|
||||
friend class CComDll;
|
||||
friend class CProcess;
|
||||
private:
|
||||
// Used in conjunction with the CProcess list
|
||||
// to automatically manage it.
|
||||
CProcessEntry(CComDll *pDll);
|
||||
~CProcessEntry();
|
||||
|
||||
private:
|
||||
// All needed state data to seperate out and
|
||||
// combine a single process with a single
|
||||
// set of instance data.
|
||||
DWORD m_dwProcessID;
|
||||
CComDll *m_pDllInstance;
|
||||
CProcessEntry *m_pNext;
|
||||
};
|
||||
|
||||
// This class is never actually allocated, but is used
|
||||
// to logically seperate out the members and their
|
||||
// purpose.
|
||||
class CProcess {
|
||||
friend class CProcessEntry;
|
||||
private:
|
||||
// A list of process IDs and Dll instance data.
|
||||
static CProcessEntry *m_pProcessList;
|
||||
|
||||
public:
|
||||
static CComDll *GetProcessDll();
|
||||
static BOOL CanUnloadNow();
|
||||
static DWORD GetProcessID();
|
||||
};
|
||||
|
||||
#endif // __DllProcessData_H
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DllTypes_H
|
||||
#define __DllTypes_H
|
||||
|
||||
// Common windows header file.
|
||||
#include <windows.h>
|
||||
|
||||
// Do not depend on normal netscape mechanisms to
|
||||
// control code compilation, compilation
|
||||
// options, macro expansion, etc....
|
||||
// These DLLs may exist entirely outside of that
|
||||
// build system and use DLL custom macros
|
||||
// to do things the right way under the
|
||||
// restrictive conditions that a DLL runs.
|
||||
// Failure to comply will undoubtedly result
|
||||
// in many long nights working with a 16
|
||||
// bit debugger.
|
||||
|
||||
#if defined(_WINDOWS) && !defined(WIN32)
|
||||
#define DLL_WIN16
|
||||
#else
|
||||
#define DLL_WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_DEBUG)
|
||||
#define DLL_DEBUG
|
||||
#else
|
||||
#define DLL_RELEASE
|
||||
#endif
|
||||
|
||||
#endif // __DllTypes_H
|
|
@ -1,49 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __ComDllUtility_H
|
||||
#define __ComDllUtility_H
|
||||
|
||||
// Useful utility functions. DLL_StringFromGUID returns
|
||||
// an ANSI string that the caller must use CoTaskMemFree
|
||||
// to free the memory
|
||||
#define DLL_StringFromCLSID DLL_StringFromGUID
|
||||
#define DLL_StringFromIID DLL_StringFromGUID
|
||||
LPSTR DLL_StringFromGUID(REFGUID rGuid);
|
||||
|
||||
// Converts an OLE string (UNICODE) to an ANSI string. The caller
|
||||
// must use CoTaskMemFree to free the memory
|
||||
LPSTR AllocTaskAnsiString(LPOLESTR lpszString);
|
||||
|
||||
// Required function, not implemented anywhere in the library,
|
||||
// and is your responsiblilty as the end consumer to
|
||||
// implement.
|
||||
// Create a CComDll derived class, and return the base pointer.
|
||||
// Manage all state data in the derived class that is needed to
|
||||
// track an instance of a DLL being used by a specific TASK.
|
||||
CComDll *DLL_ConsumerCreateInstance(void);
|
||||
|
||||
#ifdef DLL_WIN16
|
||||
// The following are WIN32 COM Dll optional, but the functionality
|
||||
// is badly needed on WIN16, so support it for installation
|
||||
// consistancy and ease.
|
||||
STDAPI DllRegisterServer(void);
|
||||
STDAPI DllUnregisterServer(void);
|
||||
#endif
|
||||
|
||||
#endif // __ComDllUtility_H
|
|
@ -1,23 +0,0 @@
|
|||
IGNORE_MANIFEST=1
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
MODULE=dllcom
|
||||
DEPTH=..\..\..\..
|
||||
EXPORTS=dllcom.h dlldbg.h dllmem.h dllobj.h dllref.h dlltask.h \
|
||||
dlltypes.h dllutil.h dlliface.h
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
|
@ -1,369 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "dllcom.h"
|
||||
#include <shellapi.h>
|
||||
|
||||
HINSTANCE CComDll::m_hInstance = NULL;
|
||||
|
||||
#ifdef DLL_DEBUG
|
||||
// Set this to your module name if you need something
|
||||
// more specific in your derived constructor.
|
||||
const char *CComDll::m_pTraceID = "CComDll";
|
||||
#endif
|
||||
|
||||
HINSTANCE CComDll::GetInstanceHandle()
|
||||
{
|
||||
// Should be non null by the time this
|
||||
// gets called.
|
||||
DLL_ASSERT(m_hInstance);
|
||||
return(m_hInstance);
|
||||
}
|
||||
|
||||
CComDll::CComDll()
|
||||
{
|
||||
// No COM objects created yet.
|
||||
m_ulCount = 0;
|
||||
|
||||
// Be sure to register this instance with the
|
||||
// process ID map.
|
||||
m_pEntry = new CProcessEntry(this);
|
||||
DLL_ASSERT(m_pEntry);
|
||||
|
||||
// Add a reference upon creation.
|
||||
AddRef();
|
||||
}
|
||||
|
||||
CComDll::~CComDll()
|
||||
{
|
||||
DLL_ASSERT(m_ulCount == 0);
|
||||
|
||||
// Unregister us from this particular process.
|
||||
if(m_pEntry) {
|
||||
delete m_pEntry;
|
||||
m_pEntry = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CComDll::QueryInterface(REFIID rIid, void **ppObj) {
|
||||
HRESULT hRetval = ResultFromScode(E_NOINTERFACE);
|
||||
*ppObj = NULL;
|
||||
|
||||
// Just check to see if we should return our IUnknown
|
||||
// implementation.
|
||||
if(IsEqualIID(rIid, IID_IUnknown)) {
|
||||
AddRef();
|
||||
*ppObj = (void *)((IUnknown *)this);
|
||||
hRetval = ResultFromScode(S_OK);
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
DWORD CComDll::AddRef()
|
||||
{
|
||||
m_ulCount++;
|
||||
|
||||
return(m_ulCount);
|
||||
}
|
||||
|
||||
DWORD CComDll::Release()
|
||||
{
|
||||
m_ulCount--;
|
||||
|
||||
DWORD ulRetval = m_ulCount;
|
||||
|
||||
if(!m_ulCount) {
|
||||
delete this;
|
||||
}
|
||||
|
||||
// DO NOTHING BETWEEN THE DELETE AND RETURN
|
||||
// EXCEPT RETURN STACK DATA.
|
||||
|
||||
return(ulRetval);
|
||||
}
|
||||
|
||||
// Given a CLSID, copies the string for registering the CLSID as an in-proc server
|
||||
// into the specified buffer
|
||||
static HRESULT
|
||||
BuildRegistryCLSIDKey(REFGUID rGuid, LPSTR szStringKey)
|
||||
{
|
||||
// Convert the CLSID to a string.
|
||||
LPSTR lpszGuid = DLL_StringFromCLSID(rGuid);
|
||||
|
||||
if (!lpszGuid)
|
||||
return ResultFromScode(E_OUTOFMEMORY);
|
||||
|
||||
// Get the information into key format.
|
||||
#ifdef _WIN32
|
||||
wsprintf(szStringKey, "CLSID\\%s\\InprocServer32", lpszGuid);
|
||||
#else
|
||||
wsprintf(szStringKey, "CLSID\\%s\\InprocServer", lpszGuid);
|
||||
#endif
|
||||
|
||||
// Free off the string
|
||||
CoTaskMemFree(lpszGuid);
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
// Make registry entries for implemented CLSIDs.
|
||||
// As DllRegisterServer.
|
||||
HRESULT CComDll::RegisterServer()
|
||||
{
|
||||
HRESULT hres = ResultFromScode(E_UNEXPECTED);
|
||||
|
||||
// Determine our module (dll) path and name.
|
||||
char szModuleName[_MAX_PATH];
|
||||
DWORD dwModuleNameLen;
|
||||
|
||||
dwModuleNameLen = GetModuleFileName(szModuleName, sizeof(szModuleName));
|
||||
if (dwModuleNameLen == 0)
|
||||
return hres;
|
||||
|
||||
// Get the list of CLSIDs
|
||||
const CLSID **ppCLSIDs = GetCLSIDs();
|
||||
|
||||
if (ppCLSIDs) {
|
||||
const CLSID **ppTraverse = ppCLSIDs;
|
||||
char szStringKey[80];
|
||||
|
||||
while (*ppTraverse) {
|
||||
// Get the information into registry key format.
|
||||
hres = BuildRegistryCLSIDKey(**ppTraverse, szStringKey);
|
||||
if (FAILED(hres))
|
||||
break;
|
||||
|
||||
// Set the registry key.
|
||||
if (RegSetValue(HKEY_CLASSES_ROOT, szStringKey, REG_SZ, szModuleName, dwModuleNameLen) != ERROR_SUCCESS) {
|
||||
hres = ResultFromScode(/*SELFREG_E_CLASS*/ E_UNEXPECTED);
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the next CLSID
|
||||
ppTraverse++;
|
||||
}
|
||||
|
||||
// Only if we made it all the way through the loop do we consider this a success
|
||||
if (*ppTraverse == NULL)
|
||||
hres = NOERROR;
|
||||
|
||||
// Free off the list of CLSIDs
|
||||
CoTaskMemFree((LPVOID)ppCLSIDs);
|
||||
}
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
// Return name of module.
|
||||
DWORD CComDll::GetModuleFileName(char *pOutName, size_t stOutSize, BOOL bFullPath)
|
||||
{
|
||||
DWORD dwRetval = 0;
|
||||
|
||||
dwRetval = ::GetModuleFileName(GetInstanceHandle(), pOutName, stOutSize);
|
||||
if(dwRetval && FALSE == bFullPath) {
|
||||
// Don't return the full path, split it up to the filename only.
|
||||
char aName[_MAX_FNAME];
|
||||
char aExt[_MAX_EXT];
|
||||
_splitpath(pOutName, NULL, NULL, aName, aExt);
|
||||
strcpy(pOutName, aName);
|
||||
strcat(pOutName, aExt);
|
||||
dwRetval = strlen(pOutName);
|
||||
}
|
||||
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
// Remove registry entries for implemented CLSIDs.
|
||||
// As DllUnregisterServer.
|
||||
HRESULT CComDll::UnregisterServer()
|
||||
{
|
||||
HRESULT hres = ResultFromScode(E_UNEXPECTED);
|
||||
|
||||
// Determine our module (dll) path and name.
|
||||
char szModuleName[_MAX_PATH];
|
||||
DWORD dwModuleNameLen;
|
||||
|
||||
dwModuleNameLen = GetModuleFileName(szModuleName, sizeof(szModuleName));
|
||||
if (dwModuleNameLen == 0)
|
||||
return hres;
|
||||
|
||||
// Get the list of CLSIDs
|
||||
const CLSID **ppCLSIDs = GetCLSIDs();
|
||||
|
||||
if (ppCLSIDs) {
|
||||
const CLSID **ppTraverse = ppCLSIDs;
|
||||
char szStringKey[80];
|
||||
|
||||
while (*ppTraverse) {
|
||||
LONG lSize;
|
||||
|
||||
// Get the information into registry key format.
|
||||
hres = BuildRegistryCLSIDKey(**ppTraverse, szStringKey);
|
||||
if (FAILED(hres))
|
||||
break;
|
||||
|
||||
// Figure out if it points to us.
|
||||
// Continue if err, as it simply may not exist.
|
||||
if (RegQueryValue(HKEY_CLASSES_ROOT, szStringKey, NULL, &lSize) == ERROR_SUCCESS && lSize != 0) {
|
||||
LPSTR lpszValue = NULL;
|
||||
|
||||
// Allocate a buffer large enough for it.
|
||||
lpszValue = (LPSTR)CoTaskMemAlloc(lSize);
|
||||
if (!lpszValue) {
|
||||
hres = ResultFromScode(E_OUTOFMEMORY);
|
||||
break;
|
||||
}
|
||||
|
||||
// We do err on not being able to query the value if we got the size
|
||||
if (RegQueryValue(HKEY_CLASSES_ROOT, szStringKey, lpszValue, &lSize) != ERROR_SUCCESS) {
|
||||
hres = ResultFromScode(E_UNEXPECTED);
|
||||
CoTaskMemFree(lpszValue);
|
||||
break;
|
||||
}
|
||||
|
||||
// Only delete if the same; ignore the case
|
||||
if (lstrcmpi(lpszValue, szModuleName) == 0) {
|
||||
// Delete the registry key.
|
||||
if (RegDeleteKey(HKEY_CLASSES_ROOT, szStringKey) != ERROR_SUCCESS) {
|
||||
hres = ResultFromScode(/*SELFREG_E_CLASS*/ E_UNEXPECTED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Free the buffer
|
||||
CoTaskMemFree(lpszValue);
|
||||
}
|
||||
|
||||
// Get the next CLSID
|
||||
ppTraverse++;
|
||||
}
|
||||
|
||||
// Only if we made it through the loop do we consider this a success
|
||||
if (*ppTraverse == NULL)
|
||||
hres = NOERROR;
|
||||
|
||||
// Free off the list of CLSIDs
|
||||
CoTaskMemFree((LPVOID)ppCLSIDs);
|
||||
}
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
// These routines contain the only entry points into your
|
||||
// end consumer DLL.
|
||||
// You must implement the functions which it calls to
|
||||
// your own satisfaction.
|
||||
|
||||
// Standard COM callback to usually obtain an IClassFactory.
|
||||
STDAPI DllGetClassObject(REFCLSID rClsid, REFIID rIid, LPVOID *ppObj)
|
||||
{
|
||||
HRESULT hRetval;
|
||||
*ppObj = NULL;
|
||||
|
||||
// Under 16 bits, it is imperative to seperate out each task
|
||||
// which uses this DLL so that they don't all use
|
||||
// the same memory heap, but instead use task specific
|
||||
// memory.
|
||||
// Find the abstract Dll instance for the current task.
|
||||
CComDll *pDll = CProcess::GetProcessDll();
|
||||
if(pDll) {
|
||||
// Do it.
|
||||
hRetval = pDll->GetClassObject(rClsid, rIid, ppObj);
|
||||
|
||||
// Take off a reference here.
|
||||
// This may also cause the instance data to self
|
||||
// self destruct if no objects were created
|
||||
// in the GetClassObject call.
|
||||
pDll->Release();
|
||||
pDll = NULL;
|
||||
}
|
||||
else {
|
||||
hRetval = ResultFromScode(E_OUTOFMEMORY);
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
// Standard COM callback to see if the DLL can now be unloaded.
|
||||
// This is actually never called on 16 bits (via the
|
||||
// CoFreeUnusedLibraries call), but would work if that
|
||||
// mechanism is ever fixed.
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
HRESULT hRetval = ResultFromScode(S_FALSE);
|
||||
|
||||
// We tell if we can unload by simply checking if
|
||||
// our process list of instance DLL objects is
|
||||
// empty. If not empty, we can not unload.
|
||||
if(CProcess::CanUnloadNow()) {
|
||||
hRetval = ResultFromScode(S_OK);
|
||||
DLL_TRACE("DllCanUnloadNow is TRUE\n");
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
STDAPI DllRegisterServer(void)
|
||||
{
|
||||
HRESULT hRetval;
|
||||
|
||||
// Find the abstract Dll instance for the current task.
|
||||
CComDll *pDll = CProcess::GetProcessDll();
|
||||
if(pDll) {
|
||||
// Do it.
|
||||
hRetval = pDll->RegisterServer();
|
||||
|
||||
// Take off a reference here.
|
||||
// This should cause the instance data to self
|
||||
// self destruct if no objects were created
|
||||
// in the GetClassObject call.
|
||||
pDll->Release();
|
||||
pDll = NULL;
|
||||
}
|
||||
else {
|
||||
hRetval = ResultFromScode(E_OUTOFMEMORY);
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
STDAPI DllUnregisterServer(void)
|
||||
{
|
||||
HRESULT hRetval;
|
||||
|
||||
// Find the abstract Dll instance for the current task.
|
||||
CComDll *pDll = CProcess::GetProcessDll();
|
||||
if(pDll) {
|
||||
// Do it.
|
||||
hRetval = pDll->UnregisterServer();
|
||||
|
||||
// Take off a reference here.
|
||||
// This should cause the instance data to self
|
||||
// self destruct if no objects were created
|
||||
// in the GetClassObject call.
|
||||
pDll->Release();
|
||||
pDll = NULL;
|
||||
}
|
||||
else {
|
||||
hRetval = ResultFromScode(E_OUTOFMEMORY);
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "dllcom.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef DLL_DEBUG
|
||||
|
||||
#define TRACE_BUFFERSIZE 256
|
||||
|
||||
void DLL_Trace(const char *pFormat, ...)
|
||||
{
|
||||
LPSTR pBuffer = (char *)CoTaskMemAlloc(TRACE_BUFFERSIZE);
|
||||
|
||||
if(pBuffer) {
|
||||
// Output module name.
|
||||
strcpy(pBuffer, CComDll::m_pTraceID);
|
||||
strcat(pBuffer, ":");
|
||||
|
||||
// Output module instance.
|
||||
_ltoa(CProcess::GetProcessID(), pBuffer + lstrlen(pBuffer), 10);
|
||||
strcat(pBuffer, ": ");
|
||||
|
||||
// Output what programmer wanted now.
|
||||
va_list args;
|
||||
va_start(args, pFormat);
|
||||
|
||||
vsprintf(pBuffer + lstrlen(pBuffer), pFormat, args);
|
||||
|
||||
// Offending trace statement.
|
||||
// Reduce output, or increase trace size.
|
||||
DLL_ASSERT(lstrlen(pBuffer) < TRACE_BUFFERSIZE);
|
||||
|
||||
OutputDebugString(pBuffer);
|
||||
|
||||
va_end(args);
|
||||
|
||||
CoTaskMemFree((LPVOID)pBuffer);
|
||||
pBuffer = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,69 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "dllcom.h"
|
||||
#include <assert.h>
|
||||
|
||||
// CoTaskMemAlloc uses the default OLE allocator to allocate a memory
|
||||
// block in the same way that IMalloc::Alloc does
|
||||
LPVOID
|
||||
CoTaskMemAlloc(ULONG cb)
|
||||
{
|
||||
LPMALLOC pMalloc;
|
||||
|
||||
if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pMalloc))) {
|
||||
LPVOID lpv = pMalloc->Alloc(cb);
|
||||
|
||||
pMalloc->Release();
|
||||
return lpv;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// CoTaskMemRealloc changes the size of a previously allocated memory
|
||||
// block in the same way that IMalloc::Realloc does
|
||||
LPVOID
|
||||
CoTaskMemRealloc(LPVOID lpv, ULONG cb)
|
||||
{
|
||||
LPMALLOC pMalloc;
|
||||
|
||||
if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pMalloc))) {
|
||||
lpv = pMalloc->Realloc(lpv, cb);
|
||||
pMalloc->Release();
|
||||
return lpv;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// CoTaskMemFree uses the default OLE allocator to free a block of
|
||||
// memory previously allocated through a call to CoTaskMemAlloc
|
||||
void
|
||||
CoTaskMemFree(LPVOID lpv)
|
||||
{
|
||||
if (lpv) {
|
||||
LPMALLOC pMalloc;
|
||||
|
||||
if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pMalloc))) {
|
||||
pMalloc->Free(lpv);
|
||||
pMalloc->Release();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "dllcom.h"
|
||||
|
||||
// ALL COM IMPLEMENTED OBJECTS MUST DERIVE FROM THIS
|
||||
// CLASS (or do what it does).
|
||||
|
||||
// Perform simple minimal maintenance such that
|
||||
// the remainder of the library can perform
|
||||
// more powerful house keeping.
|
||||
// All we do here is inform the instance data
|
||||
// (CComDll) that there is yet another
|
||||
// object (more instance data) alive and
|
||||
// well. This way, the CComDll class won't
|
||||
// remove itself from memory until there are
|
||||
// no more objects hanging around.
|
||||
|
||||
CComClass::CComClass(IUnknown *pAggregate)
|
||||
{
|
||||
m_ulCount = 0;
|
||||
m_IUnknown.m_pObject = this;
|
||||
m_pAggregate = NULL;
|
||||
m_pAggregate = pAggregate;
|
||||
|
||||
// Need to add a reference to ourselves.
|
||||
// Use IUnknown to avoid aggregate.
|
||||
m_IUnknown.AddRef();
|
||||
}
|
||||
|
||||
CComClass::~CComClass()
|
||||
{
|
||||
DLL_ASSERT(m_ulCount == 0);
|
||||
m_IUnknown.m_pObject = NULL;
|
||||
m_pAggregate = NULL;
|
||||
}
|
||||
|
||||
HRESULT CComClass::ObjectQueryInterface(REFIID iid, void **ppObj, BOOL bIUnknown)
|
||||
{
|
||||
// Determine if we should aggregate the call.
|
||||
if(m_pAggregate && !bIUnknown) {
|
||||
return(m_pAggregate->QueryInterface(iid, ppObj));
|
||||
}
|
||||
else {
|
||||
return(CustomQueryInterface(iid, ppObj));
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CComClass::CustomQueryInterface(REFIID iid, void **ppObj)
|
||||
{
|
||||
HRESULT hRetval = ResultFromScode(E_NOINTERFACE);
|
||||
*ppObj = NULL;
|
||||
|
||||
// This is virtual.
|
||||
// Just check to see if we should return our IUnknown
|
||||
// implementation.
|
||||
if(IsEqualIID(iid, IID_IUnknown)) {
|
||||
m_IUnknown.AddRef();
|
||||
*ppObj = (void *)&m_IUnknown;
|
||||
hRetval = ResultFromScode(S_OK);
|
||||
}
|
||||
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
DWORD CComClass::ObjectAddRef(BOOL bIUnknown)
|
||||
{
|
||||
DWORD dwRetval;
|
||||
|
||||
if(m_pAggregate && !bIUnknown) {
|
||||
dwRetval = m_pAggregate->AddRef();
|
||||
}
|
||||
else {
|
||||
dwRetval = CustomAddRef();
|
||||
}
|
||||
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
DWORD CComClass::CustomAddRef()
|
||||
{
|
||||
m_ulCount++;
|
||||
return(m_ulCount);
|
||||
}
|
||||
|
||||
DWORD CComClass::ObjectRelease(BOOL bIUnknown)
|
||||
{
|
||||
DWORD dwRetval;
|
||||
|
||||
if(m_pAggregate && !bIUnknown) {
|
||||
dwRetval = m_pAggregate->Release();
|
||||
}
|
||||
else {
|
||||
dwRetval = CustomRelease();
|
||||
}
|
||||
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
DWORD CComClass::CustomRelease()
|
||||
{
|
||||
DWORD dwRetval;
|
||||
|
||||
m_ulCount--;
|
||||
dwRetval = m_ulCount;
|
||||
|
||||
if(!dwRetval) {
|
||||
delete this;
|
||||
}
|
||||
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
STDMETHODIMP CComClass::CImplUnknown::QueryInterface(REFIID iid, void **ppObj)
|
||||
{
|
||||
// Avoid aggregation in actual IUnknown implementation.
|
||||
HRESULT hRetval = m_pObject->ObjectQueryInterface(iid, ppObj, TRUE);
|
||||
return(hRetval);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(DWORD) CComClass::CImplUnknown::AddRef()
|
||||
{
|
||||
// Avoid aggregation in actual IUnknown implementation.
|
||||
DWORD dwRetval = m_pObject->ObjectAddRef(TRUE);
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(DWORD) CComClass::CImplUnknown::Release()
|
||||
{
|
||||
// Avoid aggregation in actual IUnknown implementation.
|
||||
DWORD dwRetval = m_pObject->ObjectRelease(TRUE);
|
||||
return(dwRetval);
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "dllcom.h"
|
||||
|
||||
CProcessEntry *CProcess::m_pProcessList = NULL;
|
||||
|
||||
CProcessEntry::CProcessEntry(CComDll *pDll)
|
||||
{
|
||||
DLL_ASSERT(pDll);
|
||||
|
||||
m_dwProcessID = CProcess::GetProcessID();
|
||||
m_pDllInstance = pDll;
|
||||
|
||||
m_pNext = CProcess::m_pProcessList;
|
||||
CProcess::m_pProcessList = this;
|
||||
}
|
||||
|
||||
CProcessEntry::~CProcessEntry()
|
||||
{
|
||||
// find ourselves in the list and remove us.
|
||||
CProcessEntry **ppChange = &CProcess::m_pProcessList;
|
||||
|
||||
while(*ppChange != this) {
|
||||
ppChange = &((*ppChange)->m_pNext);
|
||||
}
|
||||
|
||||
*ppChange = m_pNext;
|
||||
|
||||
m_dwProcessID = 0;
|
||||
m_pDllInstance = NULL;
|
||||
m_pNext = NULL;
|
||||
}
|
||||
|
||||
DWORD CProcess::GetProcessID()
|
||||
{
|
||||
DWORD dwRetval = 0;
|
||||
|
||||
// This is only needed to multiplex instance data on win16.
|
||||
#ifdef DLL_WIN16
|
||||
dwRetval = CoGetCurrentProcess();
|
||||
#else
|
||||
// Just use the HINSTANCE unless we need to do this on a per
|
||||
// thread bases (then as above like WIN16).
|
||||
dwRetval = (DWORD)CComDll::GetInstanceHandle();
|
||||
#endif
|
||||
|
||||
return(dwRetval);
|
||||
}
|
||||
|
||||
CComDll *CProcess::GetProcessDll()
|
||||
{
|
||||
CComDll *pRetval = NULL;
|
||||
|
||||
// Before we can find the Dll instance data, we need to
|
||||
// get the ID of the current process calling us.
|
||||
DWORD dwCurrent = GetProcessID();
|
||||
|
||||
// See if the object already exists.
|
||||
CProcessEntry *pTraverse = m_pProcessList;
|
||||
while(pTraverse && pTraverse->m_dwProcessID != dwCurrent) {
|
||||
pTraverse = pTraverse->m_pNext;
|
||||
}
|
||||
|
||||
if(pTraverse) {
|
||||
// Have it already.
|
||||
// Return it.
|
||||
pRetval = pTraverse->m_pDllInstance;
|
||||
|
||||
// We must be sure to properly reference count the returned
|
||||
// object.
|
||||
pRetval->AddRef();
|
||||
}
|
||||
else {
|
||||
// Do not have it.
|
||||
// Ask the end consumer to create it.
|
||||
pRetval = DLL_ConsumerCreateInstance();
|
||||
}
|
||||
|
||||
return(pRetval);
|
||||
}
|
||||
|
||||
BOOL CProcess::CanUnloadNow()
|
||||
{
|
||||
// We can unload if we have no more process entries;
|
||||
// all objects are freed off.
|
||||
return(m_pProcessList == NULL);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "dllcom.h"
|
||||
#include <assert.h>
|
||||
|
||||
// Converts an OLE string (UNICODE) to an ANSI string. The caller
|
||||
// must use CoTaskMemFree to free the memory
|
||||
LPSTR
|
||||
AllocTaskAnsiString(LPOLESTR lpszString)
|
||||
{
|
||||
LPSTR lpszResult;
|
||||
UINT nBytes;
|
||||
|
||||
if (lpszString == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
nBytes = (wcslen(lpszString) + 1) * 2;
|
||||
#else
|
||||
nBytes = lstrlen(lpszString) + 1; // Win 16 doesn't use any UNICODE
|
||||
#endif
|
||||
lpszResult = (LPSTR)CoTaskMemAlloc(nBytes);
|
||||
|
||||
if (lpszResult) {
|
||||
#ifdef _WIN32
|
||||
WideCharToMultiByte(CP_ACP, 0, lpszString, -1, lpszResult, nBytes, NULL, NULL);
|
||||
#else
|
||||
lstrcpy(lpszResult, lpszString);
|
||||
#endif
|
||||
}
|
||||
|
||||
return lpszResult;
|
||||
}
|
||||
|
||||
// The caller must free the returned string using CoTaskMemFree. The
|
||||
// returned string is an ANSI string
|
||||
LPSTR
|
||||
DLL_StringFromGUID(REFGUID rGuid)
|
||||
{
|
||||
#ifdef DLL_WIN32
|
||||
OLECHAR szGuidID[80];
|
||||
int iConvert = StringFromGUID2(rGuid, szGuidID, 80);
|
||||
|
||||
assert(iConvert > 0);
|
||||
return iConvert > 0 ? AllocTaskAnsiString(szGuidID) : NULL;
|
||||
#else
|
||||
LPSTR lpszGuidID;
|
||||
|
||||
if (!SUCCEEDED(StringFromCLSID(rGuid, &lpszGuidID)))
|
||||
return NULL;
|
||||
|
||||
return lpszGuidID;
|
||||
#endif
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
IGNORE_MANIFEST=1
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
LIBNAME = dllcom
|
||||
PDBFILE = $(LIBNAME).pdb
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBNAME).lib
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
OBJS = $(OBJS) .\$(OBJDIR)\dllmem.obj
|
||||
!endif
|
||||
|
||||
|
||||
MODULE=dllcom
|
||||
DEPTH=..\..\..\..
|
||||
REQUIRES=dllcom
|
||||
CPPSRCS=dlldbg.cpp dllobj.cpp dlltask.cpp dllutil.cpp dllcom.cpp
|
||||
CPP_OBJS=.\$(OBJDIR)\dlldbg.obj .\$(OBJDIR)\dllobj.obj \
|
||||
.\$(OBJDIR)\dlltask.obj .\$(OBJDIR)\dllutil.obj \
|
||||
.\$(OBJDIR)\dllcom.obj
|
||||
!if "$(MOZ_BITS)" != "16"
|
||||
LINCS=-I$(XPDIST)\public\dllcom
|
||||
!endif
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
||||
|
||||
libs:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(LIBNAME).lib $(DIST)\lib
|
|
@ -1,176 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <compobj.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* This is mainly sample source to show how to auto[un]register a DLL.
|
||||
* This is equivalent to REGSVR32.EXE for 32 bits (VC4), and
|
||||
* REGSVR.EXE for 16 bits (MSVC CDK16 only).
|
||||
*
|
||||
* Also, we can ship this, I am not sure if we can redistribute those
|
||||
* utilities.
|
||||
*/
|
||||
|
||||
typedef HRESULT (*DllServerFunction)(void);
|
||||
|
||||
#ifdef WIN32
|
||||
int main(int iArgc, char *paArgv[])
|
||||
#else
|
||||
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
#endif
|
||||
{
|
||||
BOOL bRegister = TRUE;
|
||||
BOOL bRetval = FALSE;
|
||||
char szPath[_MAX_PATH];
|
||||
LPSTR pLib = NULL;
|
||||
LPSTR pOldLib = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
if(iArgc >= 2) {
|
||||
int iTraverse = 1;
|
||||
while(iTraverse < iArgc) {
|
||||
if(!stricmp(paArgv[iTraverse], "/u")) {
|
||||
bRegister = FALSE;
|
||||
}
|
||||
else {
|
||||
pLib = paArgv[iTraverse];
|
||||
}
|
||||
|
||||
iTraverse++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(lpCmdLine && *lpCmdLine) {
|
||||
char *pTraverse = lpCmdLine;
|
||||
while(*pTraverse) {
|
||||
if(!strnicmp(pTraverse, "/u", 2)) {
|
||||
bRegister = FALSE;
|
||||
|
||||
*pTraverse = ' ';
|
||||
pTraverse++;
|
||||
*pTraverse = ' ';
|
||||
}
|
||||
|
||||
pTraverse++;
|
||||
}
|
||||
|
||||
pTraverse = lpCmdLine;
|
||||
while(*pTraverse && isspace(*pTraverse)) {
|
||||
pTraverse++;
|
||||
}
|
||||
|
||||
pLib = pTraverse;
|
||||
}
|
||||
#endif
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
if(pLib) {
|
||||
/* Expand to the full path or LoadLibrary likes to fail
|
||||
* if it is too convoluted/long/relative.
|
||||
*/
|
||||
pOldLib = pLib;
|
||||
pLib = _fullpath(szPath, pLib, sizeof(szPath));
|
||||
}
|
||||
|
||||
if(pLib) {
|
||||
HINSTANCE hLibInstance = hLibInstance = LoadLibrary(pLib);
|
||||
|
||||
#ifdef WIN32
|
||||
if(hLibInstance)
|
||||
#else
|
||||
if(hLibInstance > (HINSTANCE)HINSTANCE_ERROR)
|
||||
#endif
|
||||
{
|
||||
DllServerFunction RegistryFunc = NULL;
|
||||
|
||||
if(bRegister) {
|
||||
(FARPROC)RegistryFunc = GetProcAddress(hLibInstance, "DllRegisterServer");
|
||||
}
|
||||
else {
|
||||
(FARPROC)RegistryFunc = GetProcAddress(hLibInstance, "DllUnregisterServer");
|
||||
}
|
||||
|
||||
if(RegistryFunc) {
|
||||
HRESULT hResult = (RegistryFunc)();
|
||||
|
||||
if(GetScode(hResult) == S_OK) {
|
||||
bRetval = TRUE;
|
||||
}
|
||||
|
||||
RegistryFunc = NULL;
|
||||
}
|
||||
else {
|
||||
/* If the DLL doesn't have those functions then it just doesn't support
|
||||
* self-registration. We don't consider that to be an error
|
||||
*
|
||||
* We should consider checking for the "OleSelfRegister" string in the
|
||||
* StringFileInfo section of the version information resource. If the DLL
|
||||
* has "OleSelfRegister" but doesn't have the self-registration functions
|
||||
* then that would be an error
|
||||
*/
|
||||
bRetval = TRUE;
|
||||
}
|
||||
|
||||
FreeLibrary(hLibInstance);
|
||||
hLibInstance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
if(bRetval == FALSE) {
|
||||
char *pMessage;
|
||||
|
||||
if(bRegister == TRUE) {
|
||||
pMessage = "Registration did not succeed.";
|
||||
}
|
||||
else {
|
||||
pMessage = "Unregistration did not succeed.";
|
||||
}
|
||||
|
||||
if(pLib == NULL) {
|
||||
pLib = "Usage";
|
||||
pMessage = "dllreg [/u] filename.dll";
|
||||
}
|
||||
|
||||
#ifndef DEBUG_blythe
|
||||
#ifdef WIN32
|
||||
printf("%s:\t%s\n", pLib, pMessage);
|
||||
#else
|
||||
MessageBox(NULL, pMessage, pLib, MB_OK);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if(pLib) {
|
||||
pLib = pOldLib;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
return(bRetval == FALSE);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
IGNORE_MANIFEST=1
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
EXENAME = dllreg
|
||||
PROGRAM =.\$(OBJDIR)\$(EXENAME).exe
|
||||
MAPFILE =$(EXENAME).map
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
|
||||
!if "$(MOZ_BITS)" == "32"
|
||||
!if defined(MOZ_DEBUG) && defined(GLOWCODE)
|
||||
LLIBS=ole32.lib $(GLOWDIR)\glowcode.lib
|
||||
!else
|
||||
LLIBS=ole32.lib
|
||||
!endif
|
||||
!else
|
||||
LLIBS=ole2.lib
|
||||
!endif
|
||||
|
||||
DEPTH=..\..\..
|
||||
CSRCS=dllreg.c
|
||||
C_OBJS=.\$(OBJDIR)\dllreg.obj
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
||||
|
||||
libs:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(EXENAME).exe $(DIST)\bin
|
|
@ -1,22 +0,0 @@
|
|||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
DEPTH=..\..
|
||||
|
||||
DIRS=\
|
||||
dllreg dllcom
|
||||
|
||||
!include "$(DEPTH)\config\rules.mak"
|
|
@ -1,25 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
MODULE = DtWidgets
|
||||
LIBRARY_NAME = DtWidgets
|
||||
|
||||
CSRCS = ComboBox.c
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
|
@ -1,32 +0,0 @@
|
|||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = DtWidgets
|
||||
LIBRARY_NAME = DtWidgets
|
||||
|
||||
CSRCS = ComboBox.c
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CFLAGS += $(FE_X_CFLAGS)
|
1328
cmd/xfe/Makefile
1328
cmd/xfe/Makefile
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
1349
cmd/xfe/Makefile.in
1349
cmd/xfe/Makefile.in
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,31 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
DIRS = XmL
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
|
@ -1,36 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = XmL
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,57 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLFolderH
|
||||
#define XmLFolderH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlFolderWidgetClass;
|
||||
typedef struct _XmLFolderClassRec *XmLFolderWidgetClass;
|
||||
typedef struct _XmLFolderRec *XmLFolderWidget;
|
||||
|
||||
#define XmLIsFolder(w) XtIsSubclass((w), xmlFolderWidgetClass)
|
||||
|
||||
Widget XmLCreateFolder(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
Widget XmLFolderAddBitmapTab(Widget w, XmString string,
|
||||
char *bitmapBits, int bitmapWidth, int bitmapHeight);
|
||||
Widget XmLFolderAddBitmapTabForm(Widget w, XmString string,
|
||||
char *bitmapBits, int bitmapWidth, int bitmapHeight);
|
||||
Widget XmLFolderAddTab(Widget w, XmString string);
|
||||
Widget XmLFolderAddTabFromClass(Widget w, XmString string);
|
||||
Widget XmLFolderAddTabForm(Widget w, XmString string);
|
||||
void XmLFolderSetActiveTab(Widget w, int position, Boolean notify);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,113 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLFolderPH
|
||||
#define XmLFolderPH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
|
||||
#ifdef MOTIF11
|
||||
#else
|
||||
#include <Xm/ManagerP.h>
|
||||
#endif
|
||||
|
||||
#include "Folder.h"
|
||||
|
||||
typedef struct _XmLFolderPart
|
||||
{
|
||||
int debugLevel;
|
||||
Boolean serverDrawsArcsLarge;
|
||||
unsigned char cornerStyle, tabPlacement, resizePolicy;
|
||||
Boolean allowRotate, autoSelect;
|
||||
GC gc;
|
||||
Pixel inactiveBg, inactiveFg, blankBg;
|
||||
Pixmap blankPix;
|
||||
WidgetList tabs;
|
||||
int tabCount, tabAllocCount;
|
||||
Dimension marginWidth, marginHeight, spacing;
|
||||
Dimension cornerDimension, highlightThickness;
|
||||
Dimension pixmapMargin;
|
||||
Dimension tabHeight, tabWidth, tabBarHeight;
|
||||
int tabsPerRow, activeRow;
|
||||
XtTranslations primTrans;
|
||||
Widget focusW, activeW;
|
||||
int activeTab;
|
||||
char allowLayout;
|
||||
XtCallbackList activateCallback;
|
||||
XmFontList fontList;
|
||||
|
||||
WidgetClass tabWidgetClass;
|
||||
|
||||
} XmLFolderPart;
|
||||
|
||||
typedef struct _XmLFolderRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmLFolderPart folder;
|
||||
} XmLFolderRec;
|
||||
|
||||
typedef struct _XmLFolderClassPart
|
||||
{
|
||||
int unused;
|
||||
} XmLFolderClassPart;
|
||||
|
||||
typedef struct _XmLFolderClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmLFolderClassPart folder_class;
|
||||
} XmLFolderClassRec;
|
||||
|
||||
extern XmLFolderClassRec xmlFolderClassRec;
|
||||
|
||||
typedef struct _XmLFolderConstraintPart
|
||||
{
|
||||
Position x, y;
|
||||
Dimension width, height;
|
||||
Dimension maxPixWidth, maxPixHeight;
|
||||
Dimension pixWidth, pixHeight;
|
||||
Dimension inactPixWidth, inactPixHeight;
|
||||
int row;
|
||||
Boolean firstInRow;
|
||||
Boolean freePix;
|
||||
Pixmap pix, inactPix;
|
||||
char *managedName;
|
||||
Widget managedW;
|
||||
} XmLFolderConstraintPart;
|
||||
|
||||
typedef struct _XmLFolderConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager;
|
||||
XmLFolderConstraintPart folder;
|
||||
} XmLFolderConstraintRec, *XmLFolderConstraintPtr;
|
||||
|
||||
#endif
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,147 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLGridH
|
||||
#define XmLGridH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlGridWidgetClass;
|
||||
typedef struct _XmLGridClassRec *XmLGridWidgetClass;
|
||||
typedef struct _XmLGridRec *XmLGridWidget;
|
||||
typedef struct _XmLGridRowRec *XmLGridRow;
|
||||
typedef struct _XmLGridColumnRec *XmLGridColumn;
|
||||
typedef struct _XmLGridCellRec *XmLGridCell;
|
||||
|
||||
#define XmLIsGrid(w) XtIsSubclass((w), xmlGridWidgetClass)
|
||||
|
||||
Widget XmLCreateGrid(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
void XmLGridAddColumns(Widget w, unsigned char type, int position, int count);
|
||||
void XmLGridAddRows(Widget w, unsigned char type, int position, int count);
|
||||
Boolean XmLGridColumnIsVisible(Widget w, int column);
|
||||
Boolean XmLGridCopyPos(Widget w, Time time, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, int nrow, int ncolumn);
|
||||
Boolean XmLGridCopySelected(Widget w, Time time);
|
||||
void XmLGridDeleteAllColumns(Widget w, unsigned char type);
|
||||
void XmLGridDeleteAllRows(Widget w, unsigned char type);
|
||||
void XmLGridDeleteColumns(Widget w, unsigned char type, int position,
|
||||
int count);
|
||||
void XmLGridDeleteRows(Widget w, unsigned char type, int position, int count);
|
||||
void XmLGridDeselectAllCells(Widget w, Boolean notify);
|
||||
void XmLGridDeselectAllColumns(Widget w, Boolean notify);
|
||||
void XmLGridDeselectAllRows(Widget w, Boolean notify);
|
||||
void XmLGridDeselectCell(Widget w, int row, int column, Boolean notify);
|
||||
void XmLGridDeselectColumn(Widget w, int column, Boolean notify);
|
||||
void XmLGridDeselectRow(Widget w, int row, Boolean notify);
|
||||
int XmLGridEditBegin(Widget w, Boolean insert, int row, int column);
|
||||
void XmLGridEditCancel(Widget w);
|
||||
void XmLGridEditComplete(Widget w);
|
||||
XmLGridColumn XmLGridGetColumn(Widget w, unsigned char columnType, int column);
|
||||
void XmLGridGetFocus(Widget w, int *row, int *column, Boolean *focusIn);
|
||||
XmLGridRow XmLGridGetRow(Widget w, unsigned char rowType, int row);
|
||||
int XmLGridGetSelectedCellCount(Widget w);
|
||||
int XmLGridGetSelectedCells(Widget w, int *rowPositions,
|
||||
int *columnPositions, int count);
|
||||
int XmLGridGetSelectedColumnCount(Widget w);
|
||||
int XmLGridGetSelectedColumns(Widget w, int *positions, int count);
|
||||
int XmLGridGetSelectedRow(Widget w);
|
||||
int XmLGridGetSelectedRowCount(Widget w);
|
||||
int XmLGridGetSelectedRows(Widget w, int *positions, int count);
|
||||
void XmLGridMoveColumns(Widget w, int newPosition, int position, int count);
|
||||
void XmLGridMoveRows(Widget w, int newPosition, int position, int count);
|
||||
Boolean XmLGridPaste(Widget w);
|
||||
Boolean XmLGridPastePos(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column);
|
||||
int XmLGridRead(Widget w, FILE *file, int format, char delimiter);
|
||||
int XmLGridReadPos(Widget w, FILE *file, int format, char delimiter,
|
||||
unsigned char rowType, int row, unsigned char columnType, int column);
|
||||
void XmLGridRedrawAll(Widget w);
|
||||
void XmLGridRedrawCell(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column);
|
||||
void XmLGridRedrawColumn(Widget w, unsigned char type, int column);
|
||||
void XmLGridRedrawRow(Widget w, unsigned char type, int row);
|
||||
void XmLGridReorderColumns(Widget w, int *newPositions,
|
||||
int position, int count);
|
||||
void XmLGridReorderRows(Widget w, int *newPositions,
|
||||
int position, int count);
|
||||
int XmLGridRowColumnToXY(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, Boolean clipped, XRectangle *rect);
|
||||
Boolean XmLGridRowIsVisible(Widget w, int row);
|
||||
void XmLGridSelectAllCells(Widget w, Boolean notify);
|
||||
void XmLGridSelectAllColumns(Widget w, Boolean notify);
|
||||
void XmLGridSelectAllRows(Widget w, Boolean notify);
|
||||
void XmLGridSelectCell(Widget w, int row, int column, Boolean notify);
|
||||
void XmLGridSelectColumn(Widget w, int column, Boolean notify);
|
||||
void XmLGridSelectRow(Widget w, int row, Boolean notify);
|
||||
int XmLGridSetFocus(Widget w, int row, int column);
|
||||
int XmLGridSetStrings(Widget w, char *data);
|
||||
int XmLGridSetStringsPos(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, char *data);
|
||||
int XmLGridWrite(Widget w, FILE *file, int format, char delimiter,
|
||||
Boolean skipHidden);
|
||||
int XmLGridWritePos(Widget w, FILE *file, int format, char delimiter,
|
||||
Boolean skipHidden, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, int nrow, int ncolumn);
|
||||
int XmLGridXYToRowColumn(Widget w, int x, int y, unsigned char *rowType,
|
||||
int *row, unsigned char *columnType, int *column);
|
||||
|
||||
int XmLGridPosIsResize(Widget g, int x, int y);
|
||||
|
||||
void XmLGridSetVisibleColumnCount(Widget w, int num_visible);
|
||||
void XmLGridHideRightColumn(Widget w);
|
||||
void XmLGridUnhideRightColumn(Widget w);
|
||||
|
||||
int XmLGridGetRowCount(Widget w);
|
||||
int XmLGridGetColumnCount(Widget w);
|
||||
|
||||
/* extern */ void
|
||||
XmLGridXYToCellTracking(Widget widget,
|
||||
int x, /* input only args. */
|
||||
int y, /* input only args. */
|
||||
Boolean * m_inGrid, /* input/output args. */
|
||||
int * m_lastRow, /* input/output args. */
|
||||
int * m_lastCol, /* input/output args. */
|
||||
unsigned char * m_lastRowtype,/* input/output args. */
|
||||
unsigned char * m_lastColtype,/* input/output args. */
|
||||
int * outRow, /* output only args. */
|
||||
int * outCol, /* output only args. */
|
||||
Boolean * enter, /* output only args. */
|
||||
Boolean * leave); /* output only args. */
|
||||
|
||||
void XmLGridGetSort(Widget w, int *column, unsigned char *sortType);
|
||||
void XmLGridSetSort(Widget w, int column, unsigned char sortType);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,475 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLGridPH
|
||||
#define XmLGridPH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef MOTIF11
|
||||
#include <Xm/ManagerP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
#include <Xm/DragC.h>
|
||||
#include <Xm/DropTrans.h>
|
||||
#endif
|
||||
|
||||
#include "Grid.h"
|
||||
|
||||
#ifdef XmL_ANSIC
|
||||
|
||||
void _XmLGridLayout(XmLGridWidget g);
|
||||
|
||||
void _XmLGridCellDrawBackground(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
void _XmLGridCellDrawBorders(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
void _XmLGridCellDrawValue(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
typedef int (*XmLGridPreLayoutProc)(XmLGridWidget g, int isVert);
|
||||
|
||||
typedef XmLGridRow (*XmLGridRowNewProc)(Widget grid);
|
||||
typedef void (*XmLGridRowFreeProc)(XmLGridRow);
|
||||
typedef void (*XmLGridGetRowValueMaskProc)(XmLGridWidget g,
|
||||
char *s, long *mask);
|
||||
typedef void (*XmLGridGetRowValueProc)(XmLGridWidget g, XmLGridRow row,
|
||||
XtArgVal value, long mask);
|
||||
typedef int (*XmLGridSetRowValuesProc)(XmLGridWidget g,
|
||||
XmLGridRow row, long mask);
|
||||
|
||||
typedef XmLGridColumn (*XmLGridColumnNewProc)(Widget grid);
|
||||
typedef void (*XmLGridColumnFreeProc)(XmLGridColumn);
|
||||
typedef void (*XmLGridGetColumnValueMaskProc)(XmLGridWidget g,
|
||||
char *s, long *mask);
|
||||
typedef void (*XmLGridGetColumnValueProc)(XmLGridWidget g, XmLGridColumn col,
|
||||
XtArgVal value, long mask);
|
||||
typedef int (*XmLGridSetColumnValuesProc)(XmLGridWidget g,
|
||||
XmLGridColumn col, long mask);
|
||||
|
||||
typedef int (*XmLGridSetCellValuesResizeProc)(XmLGridWidget g,
|
||||
XmLGridRow row, XmLGridColumn col, XmLGridCell cell, long mask);
|
||||
typedef int (*XmLGridCellActionProc)(XmLGridCell, Widget,
|
||||
XmLGridCallbackStruct *);
|
||||
|
||||
#else
|
||||
|
||||
void _XmLGridLayout();
|
||||
|
||||
void _XmLGridCellDrawBackground();
|
||||
void _XmLGridCellDrawBorders();
|
||||
void _XmLGridCellDrawValue();
|
||||
typedef int (*XmLGridPreLayoutProc)();
|
||||
|
||||
typedef XmLGridRow (*XmLGridRowNewProc)();
|
||||
typedef void (*XmLGridRowFreeProc)() ;
|
||||
typedef void (*XmLGridGetRowValueMaskProc)();
|
||||
typedef void (*XmLGridGetRowValueProc)();
|
||||
typedef int (*XmLGridSetRowValuesProc)();
|
||||
|
||||
typedef XmLGridColumn (*XmLGridColumnNewProc)() ;
|
||||
typedef void (*XmLGridColumnFreeProc)() ;
|
||||
typedef void (*XmLGridGetColumnValueMaskProc)();
|
||||
typedef void (*XmLGridGetColumnValueProc)();
|
||||
typedef int (*XmLGridSetColumnValuesProc)();
|
||||
|
||||
typedef int (*XmLGridSetCellValuesResizeProc)();
|
||||
typedef int (*XmLGridCellActionProc)();
|
||||
|
||||
#endif
|
||||
|
||||
#define XmLGridClassPartOfWidget(w) \
|
||||
((XmLGridWidgetClass)XtClass(w))->grid_class
|
||||
|
||||
#define XmInheritGridPreLayout ((XmLGridPreLayoutProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridRowNew ((XmLGridRowNewProc)_XtInherit)
|
||||
#define XmInheritGridRowFree ((XmLGridRowFreeProc)_XtInherit)
|
||||
#define XmInheritGridGetRowValueMask ((XmLGridGetRowValueMaskProc)_XtInherit)
|
||||
#define XmInheritGridGetRowValue ((XmLGridGetRowValueProc)_XtInherit)
|
||||
#define XmInheritGridSetRowValues ((XmLGridSetRowValuesProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridColumnNew ((XmLGridColumnNewProc)_XtInherit)
|
||||
#define XmInheritGridColumnFree ((XmLGridColumnFreeProc)_XtInherit)
|
||||
#define XmInheritGridGetColumnValueMask \
|
||||
((XmLGridGetColumnValueMaskProc)_XtInherit)
|
||||
#define XmInheritGridGetColumnValue ((XmLGridGetColumnValueProc)_XtInherit)
|
||||
#define XmInheritGridSetColumnValues ((XmLGridSetColumnValuesProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridSetCellValuesResize \
|
||||
((XmLGridSetCellValuesResizeProc)_XtInherit)
|
||||
#define XmInheritGridCellAction ((XmLGridCellActionProc)_XtInherit)
|
||||
|
||||
/* row value mask for get/set values */
|
||||
#define XmLGridRowHeight (1L<<0)
|
||||
#define XmLGridRowSizePolicy (1L<<1)
|
||||
#define XmLGridRowUserData (1L<<2)
|
||||
#define XmLGridRowValueMaskLen 3
|
||||
|
||||
/* column value mask for get/set values */
|
||||
#define XmLGridColumnWidth (1L<<0)
|
||||
#define XmLGridColumnSizePolicy (1L<<1)
|
||||
#define XmLGridColumnUserData (1L<<2)
|
||||
#define XmLGridColumnResizable (1L<<3)
|
||||
#define XmLGridColumnHidden (1L<<4)
|
||||
#define XmLGridColumnSortType (1L<<5)
|
||||
#define XmLGridColumnValueMaskLen 6
|
||||
|
||||
/* flags for XmLGridCell flags member */
|
||||
#define XmLGridCellSelectedFlag (1 << 0)
|
||||
#define XmLGridCellValueSetFlag (1 << 1)
|
||||
#define XmLGridCellInRowSpanFlag (1 << 2)
|
||||
#define XmLGridCellInColumnSpanFlag (1 << 3)
|
||||
#define XmLGridCellDrawSortFlag (1 << 4)
|
||||
#define XmLGridCellSortAscendingFlag (1 << 5)
|
||||
|
||||
/* cell value mask for get/set values */
|
||||
#define XmLGridCellAlignment (1L<<0)
|
||||
#define XmLGridCellBackground (1L<<1)
|
||||
#define XmLGridCellBottomBorderColor (1L<<2)
|
||||
#define XmLGridCellBottomBorderType (1L<<3)
|
||||
#define XmLGridCellColumnSpan (1L<<4)
|
||||
#define XmLGridCellEditable (1L<<5)
|
||||
#define XmLGridCellFontList (1L<<6)
|
||||
#define XmLGridCellForeground (1L<<7)
|
||||
#define XmLGridCellLeftBorderColor (1L<<8)
|
||||
#define XmLGridCellLeftBorderType (1L<<9)
|
||||
#define XmLGridCellMarginBottom (1L<<10)
|
||||
#define XmLGridCellMarginLeft (1L<<11)
|
||||
#define XmLGridCellMarginRight (1L<<12)
|
||||
#define XmLGridCellMarginTop (1L<<13)
|
||||
#define XmLGridCellPixmapF (1L<<14)
|
||||
#define XmLGridCellPixmapMask (1L<<15)
|
||||
#define XmLGridCellRightBorderColor (1L<<16)
|
||||
#define XmLGridCellRightBorderType (1L<<17)
|
||||
#define XmLGridCellRowSpan (1L<<18)
|
||||
#define XmLGridCellString (1L<<19)
|
||||
#define XmLGridCellToggleSet (1L<<20)
|
||||
#define XmLGridCellTopBorderColor (1L<<21)
|
||||
#define XmLGridCellTopBorderType (1L<<22)
|
||||
#define XmLGridCellType (1L<<23)
|
||||
#define XmLGridCellUserData (1L<<24)
|
||||
|
||||
/* This is now a resource */
|
||||
/* #define XmLICON_SPACING 4 */
|
||||
|
||||
enum { DrawAll, DrawHScroll, DrawVScroll, DrawRow, DrawCol, DrawCell };
|
||||
enum { SelectRow, SelectCol, SelectCell };
|
||||
enum { CursorNormal, CursorHResize, CursorVResize };
|
||||
enum { InNormal, InSelect, InResize, InMove };
|
||||
enum { DragLeft = 1, DragRight = 2, DragUp = 4, DragDown = 8 };
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x, y, width, height;
|
||||
int row, col, nrow, ncol;
|
||||
} GridReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int row, col;
|
||||
} GridDropLoc;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char alignment;
|
||||
Pixel background;
|
||||
Pixel bottomBorderColor;
|
||||
char bottomBorderType;
|
||||
Dimension bottomMargin;
|
||||
int columnSpan;
|
||||
Boolean editable;
|
||||
short fontHeight;
|
||||
XmFontList fontList;
|
||||
short fontWidth;
|
||||
Pixel foreground;
|
||||
Pixel leftBorderColor;
|
||||
char leftBorderType;
|
||||
Dimension leftMargin;
|
||||
int refCount;
|
||||
Pixel rightBorderColor;
|
||||
char rightBorderType;
|
||||
Dimension rightMargin;
|
||||
int rowSpan;
|
||||
Pixel topBorderColor;
|
||||
char topBorderType;
|
||||
Dimension topMargin;
|
||||
unsigned char type;
|
||||
void *userData;
|
||||
} XmLGridCellRefValues;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Pixmap pixmap, pixmask;
|
||||
Dimension width, height;
|
||||
} XmLGridCellPixmap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
XmString string;
|
||||
XmLGridCellPixmap pix;
|
||||
} XmLGridCellIcon;
|
||||
|
||||
typedef struct _XmLGridCellPart
|
||||
{
|
||||
XmLGridCellRefValues *refValues;
|
||||
unsigned char flags;
|
||||
void *value;
|
||||
} XmLGridCellPart;
|
||||
|
||||
struct _XmLGridCellRec
|
||||
{
|
||||
XmLGridCellPart cell;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridRowPart
|
||||
{
|
||||
int pos; /* required first for Array autonumber */
|
||||
Dimension height;
|
||||
unsigned char sizePolicy;
|
||||
Boolean selected;
|
||||
XtPointer userData;
|
||||
Dimension heightInPixels;
|
||||
unsigned int heightInPixelsValid:1;
|
||||
Widget grid;
|
||||
int visPos;
|
||||
XmLArray cellArray;
|
||||
} XmLGridRowPart;
|
||||
|
||||
struct _XmLGridRowRec
|
||||
{
|
||||
XmLGridRowPart grid;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridColumnPart
|
||||
{
|
||||
int pos; /* required first for Array autonumber */
|
||||
Dimension width;
|
||||
unsigned char sizePolicy;
|
||||
Boolean selected;
|
||||
XtPointer userData;
|
||||
XmLGridCellRefValues *defCellValues;
|
||||
Widget grid;
|
||||
Dimension widthInPixels;
|
||||
unsigned int widthInPixelsValid:1;
|
||||
Boolean resizable;
|
||||
int visPos;
|
||||
|
||||
/* xfe additions */
|
||||
Boolean hidden;
|
||||
unsigned char sort;
|
||||
} XmLGridColumnPart;
|
||||
|
||||
struct _XmLGridColumnRec
|
||||
{
|
||||
XmLGridColumnPart grid;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridPart
|
||||
{
|
||||
/* resource values */
|
||||
int leftFixedCount, rightFixedCount;
|
||||
int headingRowCount, footerRowCount;
|
||||
int topFixedCount, bottomFixedCount;
|
||||
int headingColCount, footerColCount;
|
||||
Dimension leftFixedMargin, rightFixedMargin;
|
||||
Dimension topFixedMargin, bottomFixedMargin;
|
||||
Dimension scrollBarMargin;
|
||||
Dimension highlightThickness;
|
||||
Dimension toggleSize;
|
||||
Dimension globalPixmapWidth, globalPixmapHeight;
|
||||
unsigned char selectionPolicy;
|
||||
Boolean layoutFrozen, immediateDraw;
|
||||
int debugLevel;
|
||||
unsigned char vsPolicy, hsPolicy;
|
||||
unsigned char hsbDisplayPolicy, vsbDisplayPolicy;
|
||||
int rowCount, colCount;
|
||||
int hiddenRowCount, hiddenColCount;
|
||||
int shadowRegions;
|
||||
unsigned char shadowType;
|
||||
Widget hsb, vsb, text;
|
||||
XmFontList fontList;
|
||||
Pixel blankBg, selectBg, selectFg;
|
||||
Pixel defaultCellBg, defaultCellFg;
|
||||
Pixel toggleTopColor, toggleBotColor;
|
||||
int visibleCols, visibleRows;
|
||||
char *simpleHeadings, *simpleWidths;
|
||||
XtTranslations editTrans, traverseTrans;
|
||||
Boolean allowRowHide, allowColHide;
|
||||
Boolean allowRowResize, allowColResize;
|
||||
Boolean allowDrag, allowDrop;
|
||||
Boolean autoSelect;
|
||||
Boolean highlightRowMode;
|
||||
Boolean useAvgWidth;
|
||||
int scrollRow, scrollCol, cScrollRow, cScrollCol;
|
||||
XtCallbackList addCallback, deleteCallback;
|
||||
XtCallbackList cellDrawCallback, cellFocusCallback;
|
||||
XtCallbackList cellDropCallback, cellPasteCallback;
|
||||
XtCallbackList activateCallback, editCallback;
|
||||
XtCallbackList selectCallback, deselectCallback;
|
||||
XtCallbackList resizeCallback, scrollCallback;
|
||||
|
||||
XtCallbackList enterCellCallback;
|
||||
XtCallbackList leaveCellCallback;
|
||||
XtCallbackList enterGridCallback;
|
||||
XtCallbackList leaveGridCallback;
|
||||
|
||||
/* XFE Additions */
|
||||
XtCallbackList popupCallback;
|
||||
Boolean hideUnhideButtons;
|
||||
Boolean singleClickActivation;
|
||||
Widget hideButton;
|
||||
Widget unhideButton;
|
||||
XtTranslations hideButtonTrans;
|
||||
XtTranslations unhideButtonTrans;
|
||||
|
||||
Boolean inResize;
|
||||
|
||||
Boolean useTextWidget;
|
||||
|
||||
Dimension iconSpacing;
|
||||
|
||||
Dimension minColWidth;
|
||||
|
||||
int lastCursorMotionRow;
|
||||
int lastCursorMotionCol;
|
||||
|
||||
unsigned char colSortType;
|
||||
|
||||
/* private data */
|
||||
GC gc;
|
||||
Cursor hResizeCursor, vResizeCursor;
|
||||
XFontStruct *fallbackFont;
|
||||
char ignoreModifyVerify;
|
||||
char focusIn, inEdit, inMode;
|
||||
char singleColScrollMode;
|
||||
int singleColScrollPos;
|
||||
char cursorDefined, textHidden, resizeIsVert;
|
||||
char mayHaveRowSpans;
|
||||
int layoutStack;
|
||||
char needsHorizLayout, needsVertLayout;
|
||||
char recalcHorizVisPos, recalcVertVisPos;
|
||||
char vertVisChangedHint;
|
||||
char dragTimerSet;
|
||||
XtIntervalId dragTimerId;
|
||||
int resizeRow, resizeCol, resizeLineXY;
|
||||
int extendRow, extendCol, extendToRow, extendToCol;
|
||||
Boolean extendSelect;
|
||||
int lastSelectRow, lastSelectCol;
|
||||
Time lastSelectTime;
|
||||
int focusRow, focusCol;
|
||||
XmLArray rowArray;
|
||||
XmLArray colArray;
|
||||
GridReg reg[9];
|
||||
GridDropLoc dropLoc;
|
||||
|
||||
/* resources use by SetSubValues and GetSubValues */
|
||||
Boolean cellDefaults;
|
||||
int cellRow, cellCol;
|
||||
int cellColRangeStart, cellColRangeEnd;
|
||||
int cellRowRangeStart, cellRowRangeEnd;
|
||||
int rowStep, colStep;
|
||||
unsigned char rowType, colType;
|
||||
Boolean colHidden;
|
||||
|
||||
/* cell resources */
|
||||
XmString cellString;
|
||||
Boolean cellToggleSet;
|
||||
Pixmap cellPixmap, cellPixmapMask;
|
||||
Dimension cellPixmapWidth, cellPixmapHeight;
|
||||
XmLGridCellRefValues cellValues, *defCellValues;
|
||||
|
||||
/* row resources */
|
||||
Dimension rowHeight;
|
||||
unsigned char rowSizePolicy;
|
||||
Boolean rowSelected;
|
||||
XtPointer rowUserData;
|
||||
|
||||
/* column resources */
|
||||
Dimension colWidth;
|
||||
unsigned char colSizePolicy;
|
||||
Boolean colSelected;
|
||||
XtPointer colUserData;
|
||||
Boolean colResizable;
|
||||
|
||||
/* xfe additions */
|
||||
/* Edit timer is used for inplace editing */
|
||||
char editTimerSet;
|
||||
XtIntervalId editTimerId;
|
||||
} XmLGridPart;
|
||||
|
||||
typedef struct _XmLGridRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmLGridPart grid;
|
||||
} XmLGridRec;
|
||||
|
||||
typedef struct _XmLGridClassPart
|
||||
{
|
||||
int initialRows;
|
||||
int initialCols;
|
||||
XmLGridPreLayoutProc preLayoutProc;
|
||||
int rowRecSize;
|
||||
XmLGridRowNewProc rowNewProc;
|
||||
XmLGridRowFreeProc rowFreeProc;
|
||||
XmLGridGetRowValueMaskProc getRowValueMaskProc;
|
||||
XmLGridGetRowValueProc getRowValueProc;
|
||||
XmLGridSetRowValuesProc setRowValuesProc;
|
||||
int columnRecSize;
|
||||
XmLGridColumnNewProc columnNewProc;
|
||||
XmLGridColumnFreeProc columnFreeProc;
|
||||
XmLGridGetColumnValueMaskProc getColumnValueMaskProc;
|
||||
XmLGridGetColumnValueProc getColumnValueProc;
|
||||
XmLGridSetColumnValuesProc setColumnValuesProc;
|
||||
XmLGridSetCellValuesResizeProc setCellValuesResizeProc;
|
||||
XmLGridCellActionProc cellActionProc;
|
||||
} XmLGridClassPart;
|
||||
|
||||
typedef struct _XmLGridClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmLGridClassPart grid_class;
|
||||
} XmLGridClassRec;
|
||||
|
||||
extern XmLGridClassRec xmlGridClassRec;
|
||||
|
||||
typedef struct _XmLGridConstraintPart
|
||||
{
|
||||
int unused;
|
||||
} XmLGridConstraintPart;
|
||||
|
||||
typedef struct _XmLGridConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager;
|
||||
XmLGridConstraintPart grid;
|
||||
} XmLGridConstraintRec, *XmLGridConstraintPtr;
|
||||
|
||||
#endif
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче