|
| 1 | +/* Copyright (C) 2015 Runtime Revolution Ltd. |
| 2 | + |
| 3 | + This file is part of LiveCode. |
| 4 | + |
| 5 | + LiveCode is free software; you can redistribute it and/or modify it under |
| 6 | + the terms of the GNU General Public License v3 as published by the Free |
| 7 | + Software Foundation. |
| 8 | + |
| 9 | + LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY |
| 10 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | + for more details. |
| 13 | + |
| 14 | + You should have received a copy of the GNU General Public License |
| 15 | + along with LiveCode. If not see <http://www.gnu.org/licenses/>. */ |
| 16 | + |
| 17 | +#include "prefix.h" |
| 18 | + |
| 19 | +#include "widget.h" |
| 20 | +#include "widget-ref.h" |
| 21 | + |
| 22 | +#include "exec.h" |
| 23 | + |
| 24 | +#include "exec-interface.h" |
| 25 | + |
| 26 | +MC_EXEC_DEFINE_EXEC_METHOD(Interface, GoBackInWidget, 1) |
| 27 | +MC_EXEC_DEFINE_EXEC_METHOD(Interface, GoForwardInWidget, 1) |
| 28 | +MC_EXEC_DEFINE_EXEC_METHOD(Interface, LaunchUrlInWidget, 2) |
| 29 | +MC_EXEC_DEFINE_EXEC_METHOD(Interface, DoInWidget, 2); |
| 30 | + |
| 31 | +void MCInterfaceExecGoBackInWidget(MCExecContext& ctxt, MCWidget *p_widget) |
| 32 | +{ |
| 33 | + MCWidgetPost(p_widget->getwidget(), MCNAME("OnGoBack"), kMCEmptyProperList); |
| 34 | +} |
| 35 | + |
| 36 | +void MCInterfaceExecGoForwardInWidget(MCExecContext& ctxt, MCWidget *p_widget) |
| 37 | +{ |
| 38 | + MCWidgetPost(p_widget->getwidget(), MCNAME("OnGoForward"), kMCEmptyProperList); |
| 39 | +} |
| 40 | + |
| 41 | +void MCInterfaceExecLaunchUrlInWidget(MCExecContext& ctxt, MCStringRef p_url, MCWidget *p_widget) |
| 42 | +{ |
| 43 | + MCAutoProperListRef t_list; |
| 44 | + |
| 45 | + /* UNCHECKED */ MCProperListCreate((MCValueRef*)&p_url, 1, &t_list); |
| 46 | + MCWidgetPost(p_widget->getwidget(), MCNAME("OnLaunchUrl"), *t_list); |
| 47 | +} |
| 48 | + |
| 49 | +void MCInterfaceExecDoInWidget(MCExecContext& ctxt, MCStringRef p_script, MCWidget *p_widget) |
| 50 | +{ |
| 51 | + MCAutoProperListRef t_list; |
| 52 | + |
| 53 | + /* UNCHECKED */ MCProperListCreate((MCValueRef*)&p_script, 1, &t_list); |
| 54 | + MCWidgetPost(p_widget->getwidget(), MCNAME("OnDo"), *t_list); |
| 55 | +} |
0 commit comments