home *** CD-ROM | disk | FTP | other *** search
- // Zinc Interface Library
- // COPYRIGHT (C) 1990. All Rights Reserved.
- // Zinc Software Incorporated. Pleasant Grove, Utah USA
-
- #include "ui_win.hpp"
- #include <string.h>
-
- #ifdef ZIL_LOAD
-
- UI_JUMP_LIST UI_JUMP_LIST::_jumpList;
-
- UI_JUMP_ELEMENT::UI_JUMP_ELEMENT(char *_name, char *_codeName, int _type,
- UI_WINDOW_OBJECT *(*_newFunction)(const char *name, UI_STORAGE *file, USHORT loadFlags)) :
- type(_type), newFunction(_newFunction)
- {
- strcpy(name, _name ? _name : "");
- strcpy(codeName, _codeName ? _codeName : "");
- }
-
- UI_JUMP_ELEMENT::UI_JUMP_ELEMENT(int _type,
- UI_WINDOW_OBJECT *(*_newFunction)(const char *name, UI_STORAGE *file, USHORT loadFlags)) :
- type(_type), newFunction(_newFunction)
- {
- name[0] = codeName[0] = '\0';
- }
-
- int UI_JUMP_ELEMENT::FindName(void *object, void *matchName)
- {
- return (strcmpi(((UI_JUMP_ELEMENT *)object)->name, (char *)matchName));
- }
-
- int UI_JUMP_ELEMENT::FindType(void *object, void *matchType)
- {
- return ((((UI_JUMP_ELEMENT *)object)->type == *(int *)matchType) ? 0 : -1);
- }
-
- void UI_JUMP_LIST::GetFunction(const char *name,
- UI_WINDOW_OBJECT *(**newFunction)(const char *name, UI_STORAGE *file, USHORT loadFlags))
- {
- UI_JUMP_ELEMENT *element = (UI_JUMP_ELEMENT *)UI_LIST::Get(UI_JUMP_ELEMENT::FindName, name);
- if (element)
- {
- *newFunction = element->newFunction;
- element->used = TRUE;
- }
- else
- *newFunction = NULL;
- }
-
- void UI_JUMP_LIST::GetFunction(int type,
- UI_WINDOW_OBJECT *(**newFunction)(const char *name, UI_STORAGE *file, USHORT loadFlags))
- {
- UI_JUMP_ELEMENT *element = (UI_JUMP_ELEMENT *)UI_LIST::Get(UI_JUMP_ELEMENT::FindType, &type);
- if (element)
- {
- *newFunction = element->newFunction;
- element->used = TRUE;
- }
- else
- *newFunction = NULL;
- }
-
- #endif
-