Commit c0e9480d authored by Asbjørn Pettersen's avatar Asbjørn Pettersen

new OS2 module functions

parent d70a75c4
Sat Nov 13 19:43:11 1999 ape@spacetec.no (Asbjorn Pettersen)
* modules/modregister.h:
* modules/modregister.c: Place all OS/2 functions here.
mod_color_selector_register()
mod_color_selector_unregister() new OS/2 functions for register
and unregister. Shall replace OS/2 code in modules.
Sat Nov 13 01:58:31 MET 1999 Sven Neumann <sven@gimp.org>
* app/airbrush.c
......
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*/
#ifdef __EMX__
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <libgimp/color_selector.h>
#include <libgimp/gimpmodule.h>
#include <math.h>
#include "modregister.h"
struct main_funcs_struc *gimp_main_funcs = NULL;
gpointer get_main_func(gchar *name)
{
struct main_funcs_struc *x;
if (gimp_main_funcs == NULL)
return NULL;
for (x = gimp_main_funcs; x->name; x++)
{
if (!strcmp(x->name, name))
return (gpointer) x->func;
}
}
GimpColorSelectorID
mod_color_selector_register (const char *name,
const char *help_page,
GimpColorSelectorMethods *methods)
{
GimpColorSelectorID id;
color_reg_func reg_func;
reg_func = (color_reg_func) get_main_func("gimp_color_selector_register");
if (!reg_func)
return 0;
id = (*reg_func) (name, help_page, methods);
return (id);
}
gboolean
mod_color_selector_unregister (GimpColorSelectorID id,
void (*callback)(void *data),
void *data)
{
color_unreg_func unreg_func;
gboolean status;
unreg_func = (color_unreg_func) get_main_func("gimp_color_selector_unregiste");
if (unreg_func)
{
status = (*unreg_func) (id, callback, data);
}
else
status = FALSE;
return (status);
}
#endif
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __MODREGISTER_H__
#define __MODREGISTER_H__
#ifdef __EMX__
struct main_funcs_struc {
gchar *name;
void (*func)();
};
typedef GimpColorSelectorID (*color_reg_func)(const char *,
const char *,
GimpColorSelectorMethods *);
typedef gboolean (*color_unreg_func) (GimpColorSelectorID,
void (*)(void *),
void *);
GimpColorSelectorID
mod_color_selector_register (const char *name,
const char *help_page,
GimpColorSelectorMethods *methods);
gboolean
mod_color_selector_unregister (GimpColorSelectorID id,
void (*callback)(void *data),
void *data);
#endif
#endif /* __MODREGISTER_H__ */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*/
#ifdef __EMX__
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <libgimp/color_selector.h>
#include <libgimp/gimpmodule.h>
#include <math.h>
#include "modregister.h"
struct main_funcs_struc *gimp_main_funcs = NULL;
gpointer get_main_func(gchar *name)
{
struct main_funcs_struc *x;
if (gimp_main_funcs == NULL)
return NULL;
for (x = gimp_main_funcs; x->name; x++)
{
if (!strcmp(x->name, name))
return (gpointer) x->func;
}
}
GimpColorSelectorID
mod_color_selector_register (const char *name,
const char *help_page,
GimpColorSelectorMethods *methods)
{
GimpColorSelectorID id;
color_reg_func reg_func;
reg_func = (color_reg_func) get_main_func("gimp_color_selector_register");
if (!reg_func)
return 0;
id = (*reg_func) (name, help_page, methods);
return (id);
}
gboolean
mod_color_selector_unregister (GimpColorSelectorID id,
void (*callback)(void *data),
void *data)
{
color_unreg_func unreg_func;
gboolean status;
unreg_func = (color_unreg_func) get_main_func("gimp_color_selector_unregiste");
if (unreg_func)
{
status = (*unreg_func) (id, callback, data);
}
else
status = FALSE;
return (status);
}
#endif
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __MODREGISTER_H__
#define __MODREGISTER_H__
#ifdef __EMX__
struct main_funcs_struc {
gchar *name;
void (*func)();
};
typedef GimpColorSelectorID (*color_reg_func)(const char *,
const char *,
GimpColorSelectorMethods *);
typedef gboolean (*color_unreg_func) (GimpColorSelectorID,
void (*)(void *),
void *);
GimpColorSelectorID
mod_color_selector_register (const char *name,
const char *help_page,
GimpColorSelectorMethods *methods);
gboolean
mod_color_selector_unregister (GimpColorSelectorID id,
void (*callback)(void *data),
void *data);
#endif
#endif /* __MODREGISTER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment