2012-12-03 03:07:47 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf 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; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NS_ATARI_MISC_H
|
2011-11-23 23:56:20 +04:00
|
|
|
#define NS_ATARI_MISC_H
|
|
|
|
|
2012-12-03 03:07:47 +04:00
|
|
|
|
|
|
|
#define SBUF8_TO_LBUF8(sbuf,lbuf)\
|
|
|
|
lbuf[0] = (long)sbuf[0];\
|
|
|
|
lbuf[1] = (long)sbuf[1];\
|
|
|
|
lbuf[2] = (long)sbuf[2];\
|
|
|
|
lbuf[3] = (long)sbuf[3];\
|
|
|
|
lbuf[4] = (long)sbuf[4];\
|
|
|
|
lbuf[5] = (long)sbuf[5];\
|
|
|
|
lbuf[6] = (long)sbuf[6];\
|
|
|
|
lbuf[7] = (long)sbuf[7];
|
|
|
|
|
2013-09-16 04:06:49 +04:00
|
|
|
#define RECT_TO_GRECT(r,g) \
|
2013-09-16 04:24:06 +04:00
|
|
|
(g)->g_x = (r->x0 < r->x1) ? r->x0 : r->x1 ; \
|
|
|
|
(g)->g_y = (r->y0 < r->y1) ? r->y0 : r->y1 ; \
|
|
|
|
(g)->g_w = (r->x0 < r->x1) ? r->x1 - r->x0 : r->x0 - r->x1 ; \
|
|
|
|
(g)->g_h = (r->y0 < r->y1) ? r->y1 - r->y0 : r->y0 - r->y1 ;
|
2013-09-16 04:06:49 +04:00
|
|
|
|
|
|
|
|
2011-12-16 03:04:31 +04:00
|
|
|
|
|
|
|
/* Modes for find_gui_window: */
|
|
|
|
#define BY_WINDOM_HANDLE 0x0
|
|
|
|
#define BY_GEM_HANDLE 0x1
|
2012-08-27 22:05:35 +04:00
|
|
|
|
2016-04-20 12:43:58 +03:00
|
|
|
/**
|
|
|
|
*/
|
2012-08-27 22:05:35 +04:00
|
|
|
typedef int (*scan_process_callback)(int pid, void *data);
|
2012-12-03 03:07:47 +04:00
|
|
|
|
2016-04-20 12:43:58 +03:00
|
|
|
/**
|
|
|
|
*/
|
2012-12-03 03:07:47 +04:00
|
|
|
struct gui_window * find_guiwin_by_aes_handle(short handle);
|
2016-04-20 12:43:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
2012-12-03 03:07:47 +04:00
|
|
|
bool is_process_running(const char * name);
|
2016-04-20 12:43:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
2012-04-11 03:10:49 +04:00
|
|
|
void gem_set_cursor( MFORM_EX * cursor );
|
2016-04-20 12:43:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
2012-12-03 03:07:47 +04:00
|
|
|
void dbg_grect(const char * str, GRECT * r);
|
2016-04-20 12:43:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
2012-12-03 03:07:47 +04:00
|
|
|
void dbg_pxy(const char * str, short * pxy);
|
2016-04-20 12:43:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
2012-12-03 03:07:47 +04:00
|
|
|
void dbg_rect(const char * str, int * pxy);
|
2013-10-06 01:31:42 +04:00
|
|
|
|
2016-04-20 12:43:58 +03:00
|
|
|
/**
|
|
|
|
*/
|
2013-12-21 05:07:13 +04:00
|
|
|
const char * file_select(const char * title, const char * name);
|
2013-10-06 01:31:42 +04:00
|
|
|
|
|
|
|
/**
|
2016-04-30 13:34:45 +03:00
|
|
|
* Convert NKC to netsurf input key code and/or to ucs4 (depends on keycode).
|
|
|
|
*
|
|
|
|
* \param[in] nkc atari normalized key code
|
|
|
|
* \param[out] ucs4_out The ucs4 converted keycode
|
|
|
|
* \return The netsurf input keycode or 0 and ucs4_out updated with
|
|
|
|
* the NKC converted to UC4 encoding.
|
2016-04-20 12:43:58 +03:00
|
|
|
*/
|
2011-11-23 23:56:20 +04:00
|
|
|
long nkc_to_input_key(short nkc, long * ucs4_out);
|
2012-04-11 03:10:49 +04:00
|
|
|
|
2014-10-26 15:42:53 +03:00
|
|
|
/**
|
|
|
|
* Cause an abnormal program termination.
|
|
|
|
*
|
|
|
|
* \note This never returns and is intended to terminate without any cleanup.
|
|
|
|
*
|
|
|
|
* \param error The message to display to the user.
|
|
|
|
*/
|
|
|
|
void die(const char * const error) __attribute__ ((noreturn));
|
|
|
|
|
2016-04-26 01:11:55 +03:00
|
|
|
/**
|
|
|
|
* Warn the user of an event.
|
|
|
|
*
|
|
|
|
* \param[in] message A warning looked up in the message translation table
|
|
|
|
* \param[in] detail Additional text to be displayed or NULL.
|
|
|
|
* \return NSERROR_OK on success or error code if there was a
|
|
|
|
* faliure displaying the message to the user.
|
|
|
|
*/
|
|
|
|
nserror atari_warn_user(const char *warning, const char *detail);
|
|
|
|
|
2012-12-03 03:07:47 +04:00
|
|
|
#endif
|