/* Copyright 1998 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Toolbox */
#include "event.h"
#include "toolbox.h"
#include "wimplib.h"
/* Common */
#include "misc.h"
/* local headers */
#include "Main.h"
#include "WimpM.h"  /* includes prototypes for this file */

static int wimpm_quit (WimpMessage *message, void *handle);
static int wimpm_openconfigwindow (WimpMessage *message, void *handle);

int wimpm_messages [2] =      { Wimp_MOpenConfigWindow,
				0 };

void wimpm_register (void)
{
  throw (event_register_message_handler (Wimp_MQuit, wimpm_quit, NULL));
  throw (event_register_message_handler (Wimp_MOpenConfigWindow, wimpm_openconfigwindow, NULL));
}

static int wimpm_quit (WimpMessage *message, void *handle)
{
  quit = TRUE;
  return 1;
}

static int wimpm_openconfigwindow (WimpMessage *message, void *handle)
{
  misc_openwindow (mainwindow_id, FALSE);
  return 1;
}
