2006-07-13 16:46:02 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2006 Richard Wilson <info@tinct.net>
|
2010-10-05 23:14:46 +04:00
|
|
|
* Copyright 2010 Stephen Fryatt <stevef@netsurf-browser.org>
|
2007-08-08 20:16:03 +04:00
|
|
|
*
|
|
|
|
* 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/>.
|
2006-07-13 16:46:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* Cookies (implementation).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include "oslib/wimp.h"
|
|
|
|
#include "oslib/wimpspriteop.h"
|
2007-05-31 02:39:54 +04:00
|
|
|
#include "content/urldb.h"
|
2013-09-02 19:19:16 +04:00
|
|
|
#include "desktop/cookie_manager.h"
|
2007-05-31 02:39:54 +04:00
|
|
|
#include "desktop/tree.h"
|
2013-09-03 01:41:04 +04:00
|
|
|
#include "desktop/textinput.h"
|
2007-05-31 02:39:54 +04:00
|
|
|
#include "riscos/cookies.h"
|
|
|
|
#include "riscos/dialog.h"
|
|
|
|
#include "riscos/menus.h"
|
2013-05-26 01:46:27 +04:00
|
|
|
#include "utils/nsoption.h"
|
2011-02-21 02:16:33 +03:00
|
|
|
#include "riscos/toolbar.h"
|
2007-05-31 02:39:54 +04:00
|
|
|
#include "riscos/treeview.h"
|
|
|
|
#include "riscos/wimp.h"
|
|
|
|
#include "riscos/wimp_event.h"
|
|
|
|
#include "utils/messages.h"
|
|
|
|
#include "utils/log.h"
|
|
|
|
#include "utils/utils.h"
|
2006-07-13 16:46:02 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
static void ro_gui_cookies_toolbar_update_buttons(void);
|
|
|
|
static void ro_gui_cookies_toolbar_save_buttons(char *config);
|
|
|
|
static bool ro_gui_cookies_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
|
|
|
|
wimp_pointer *pointer);
|
|
|
|
static void ro_gui_cookies_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
|
|
|
|
wimp_selection *selection, menu_action action);
|
|
|
|
static bool ro_gui_cookies_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
|
|
|
|
wimp_selection *selection, menu_action action);
|
|
|
|
static void ro_gui_cookies_toolbar_click(button_bar_action action);
|
|
|
|
|
|
|
|
struct ro_treeview_callbacks ro_cookies_treeview_callbacks = {
|
|
|
|
ro_gui_cookies_toolbar_click,
|
|
|
|
ro_gui_cookies_toolbar_update_buttons,
|
|
|
|
ro_gui_cookies_toolbar_save_buttons
|
|
|
|
};
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/* The RISC OS cookie window, toolbar and treeview data. */
|
|
|
|
|
|
|
|
static struct ro_cookies_window {
|
|
|
|
wimp_w window;
|
|
|
|
struct toolbar *toolbar;
|
|
|
|
ro_treeview *tv;
|
|
|
|
wimp_menu *menu;
|
|
|
|
} cookies_window;
|
2006-07-13 16:46:02 +04:00
|
|
|
|
|
|
|
/**
|
2010-10-05 23:14:46 +04:00
|
|
|
* Pre-Initialise the cookies tree. This is called for things that
|
|
|
|
* need to be done at the gui_init() stage, such as loading templates.
|
2006-07-13 16:46:02 +04:00
|
|
|
*/
|
2010-10-05 23:14:46 +04:00
|
|
|
|
|
|
|
void ro_gui_cookies_preinitialise(void)
|
2006-07-13 16:46:02 +04:00
|
|
|
{
|
2010-10-05 23:14:46 +04:00
|
|
|
/* Create our window. */
|
|
|
|
|
|
|
|
cookies_window.window = ro_gui_dialog_create("tree");
|
|
|
|
ro_gui_set_window_title(cookies_window.window,
|
2006-07-13 16:46:02 +04:00
|
|
|
messages_get("Cookies"));
|
2010-10-05 23:14:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise cookies tree, at the gui_init2() stage.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ro_gui_cookies_postinitialise(void)
|
|
|
|
{
|
|
|
|
/* Create our toolbar. */
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
cookies_window.toolbar = ro_toolbar_create(NULL, cookies_window.window,
|
|
|
|
THEME_STYLE_COOKIES_TOOLBAR, TOOLBAR_FLAGS_NONE,
|
|
|
|
ro_treeview_get_toolbar_callbacks(), NULL,
|
|
|
|
"HelpCookiesToolbar");
|
|
|
|
if (cookies_window.toolbar != NULL) {
|
|
|
|
ro_toolbar_add_buttons(cookies_window.toolbar,
|
|
|
|
cookies_toolbar_buttons,
|
2012-03-22 13:34:34 +04:00
|
|
|
nsoption_charp(toolbar_cookies));
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_rebuild(cookies_window.toolbar);
|
|
|
|
}
|
2010-10-05 23:14:46 +04:00
|
|
|
|
|
|
|
/* Create the treeview with the window and toolbar. */
|
|
|
|
|
|
|
|
cookies_window.tv = ro_treeview_create(cookies_window.window,
|
2011-02-21 02:16:33 +03:00
|
|
|
cookies_window.toolbar, &ro_cookies_treeview_callbacks,
|
2013-09-02 17:33:53 +04:00
|
|
|
TREE_COOKIES);
|
2010-10-05 23:14:46 +04:00
|
|
|
if (cookies_window.tv == NULL) {
|
2015-05-28 18:08:46 +03:00
|
|
|
LOG("Failed to allocate treeview");
|
2009-05-30 02:58:13 +04:00
|
|
|
return;
|
2006-07-13 16:46:02 +04:00
|
|
|
}
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_update_client_data(cookies_window.toolbar,
|
|
|
|
cookies_window.tv);
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/* Build the cookies window menu. */
|
|
|
|
|
|
|
|
static const struct ns_menu cookies_definition = {
|
|
|
|
"Cookies", {
|
|
|
|
{ "Cookies", NO_ACTION, 0 },
|
|
|
|
{ "Cookies.Expand", TREE_EXPAND_ALL, 0 },
|
|
|
|
{ "Cookies.Expand.All", TREE_EXPAND_ALL, 0 },
|
|
|
|
{ "Cookies.Expand.Folders", TREE_EXPAND_FOLDERS, 0 },
|
|
|
|
{ "Cookies.Expand.Links", TREE_EXPAND_LINKS, 0 },
|
|
|
|
{ "Cookies.Collapse", TREE_COLLAPSE_ALL, 0 },
|
|
|
|
{ "Cookies.Collapse.All", TREE_COLLAPSE_ALL, 0 },
|
|
|
|
{ "Cookies.Collapse.Folders", TREE_COLLAPSE_FOLDERS, 0 },
|
|
|
|
{ "Cookies.Collapse.Links", TREE_COLLAPSE_LINKS, 0 },
|
|
|
|
{ "Cookies.Toolbars", NO_ACTION, 0 },
|
|
|
|
{ "_Cookies.Toolbars.ToolButtons", TOOLBAR_BUTTONS, 0 },
|
|
|
|
{ "Cookies.Toolbars.EditToolbar",TOOLBAR_EDIT, 0 },
|
|
|
|
{ "Selection", TREE_SELECTION, 0 },
|
|
|
|
{ "Selection.Delete", TREE_SELECTION_DELETE, 0 },
|
|
|
|
{ "SelectAll", TREE_SELECT_ALL, 0 },
|
|
|
|
{ "Clear", TREE_CLEAR_SELECTION, 0 },
|
|
|
|
{NULL, 0, 0}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
cookies_window.menu = ro_gui_menu_define_menu(&cookies_definition);
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_gui_wimp_event_register_menu(cookies_window.window,
|
|
|
|
cookies_window.menu, false, false);
|
|
|
|
ro_gui_wimp_event_register_menu_prepare(cookies_window.window,
|
|
|
|
ro_gui_cookies_menu_prepare);
|
|
|
|
ro_gui_wimp_event_register_menu_selection(cookies_window.window,
|
|
|
|
ro_gui_cookies_menu_select);
|
|
|
|
ro_gui_wimp_event_register_menu_warning(cookies_window.window,
|
|
|
|
ro_gui_cookies_menu_warning);
|
2006-07-13 16:46:02 +04:00
|
|
|
}
|
|
|
|
|
2013-09-08 22:04:45 +04:00
|
|
|
/**
|
|
|
|
* Destroy the cookies window.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ro_gui_cookies_destroy(void)
|
|
|
|
{
|
|
|
|
if (cookies_window.tv == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ro_treeview_destroy(cookies_window.tv);
|
|
|
|
}
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/**
|
2011-02-21 02:16:33 +03:00
|
|
|
* Open the cookies window.
|
2010-10-05 23:14:46 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ro_gui_cookies_open(void)
|
|
|
|
{
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_gui_cookies_toolbar_update_buttons();
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
if (!ro_gui_dialog_open_top(cookies_window.window,
|
|
|
|
cookies_window.toolbar, 600, 800)) {
|
|
|
|
ro_treeview_set_origin(cookies_window.tv, 0,
|
2011-02-21 02:16:33 +03:00
|
|
|
-(ro_toolbar_height(cookies_window.toolbar)));
|
2010-10-05 23:14:46 +04:00
|
|
|
}
|
|
|
|
}
|
2006-07-13 16:46:02 +04:00
|
|
|
|
2010-10-25 00:00:45 +04:00
|
|
|
|
|
|
|
/**
|
2011-02-21 02:16:33 +03:00
|
|
|
* Handle toolbar button clicks.
|
2010-10-25 00:00:45 +04:00
|
|
|
*
|
2011-02-21 02:16:33 +03:00
|
|
|
* \param action The action to handle
|
2010-10-25 00:00:45 +04:00
|
|
|
*/
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
void ro_gui_cookies_toolbar_click(button_bar_action action)
|
2010-10-25 00:00:45 +04:00
|
|
|
{
|
2011-02-21 02:16:33 +03:00
|
|
|
switch (action) {
|
|
|
|
case TOOLBAR_BUTTON_DELETE:
|
2015-03-27 12:36:19 +03:00
|
|
|
cookie_manager_keypress(NS_KEY_DELETE_LEFT);
|
2011-02-21 02:16:33 +03:00
|
|
|
break;
|
2010-10-25 03:17:21 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
case TOOLBAR_BUTTON_EXPAND:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_expand(false);
|
2011-02-21 02:16:33 +03:00
|
|
|
break;
|
2010-10-25 01:52:16 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
case TOOLBAR_BUTTON_COLLAPSE:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_contract(false);
|
2010-10-25 00:00:45 +04:00
|
|
|
break;
|
2011-02-21 02:16:33 +03:00
|
|
|
|
|
|
|
case TOOLBAR_BUTTON_OPEN:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_expand(true);
|
2010-10-25 00:00:45 +04:00
|
|
|
break;
|
2011-02-21 02:16:33 +03:00
|
|
|
|
|
|
|
case TOOLBAR_BUTTON_CLOSE:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_contract(true);
|
2011-02-21 02:16:33 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2010-10-25 00:00:45 +04:00
|
|
|
break;
|
|
|
|
}
|
2011-02-21 02:16:33 +03:00
|
|
|
}
|
2010-10-25 00:00:45 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the button state in the cookies toolbar.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ro_gui_cookies_toolbar_update_buttons(void)
|
|
|
|
{
|
|
|
|
ro_toolbar_set_button_shaded_state(cookies_window.toolbar,
|
|
|
|
TOOLBAR_BUTTON_DELETE,
|
2013-09-02 19:19:16 +04:00
|
|
|
!cookie_manager_has_selection());
|
2010-10-25 00:00:45 +04:00
|
|
|
}
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save a new button arrangement in the cookies toolbar.
|
|
|
|
*
|
|
|
|
* \param *config The new button configuration string.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ro_gui_cookies_toolbar_save_buttons(char *config)
|
|
|
|
{
|
2012-03-22 13:34:34 +04:00
|
|
|
nsoption_set_charp(toolbar_cookies, config);
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_gui_save_options();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-07-13 16:46:02 +04:00
|
|
|
/**
|
2010-10-05 23:14:46 +04:00
|
|
|
* Prepare the cookies menu for opening
|
2006-07-13 16:46:02 +04:00
|
|
|
*
|
2011-02-21 02:16:33 +03:00
|
|
|
* \param w The window owning the menu.
|
|
|
|
* \param i The icon owning the menu.
|
2010-10-05 23:14:46 +04:00
|
|
|
* \param *menu The menu about to be opened.
|
2011-02-21 02:16:33 +03:00
|
|
|
* \param *pointer Pointer to the relevant wimp event block, or
|
|
|
|
* NULL for an Adjust click.
|
|
|
|
* \return true if the event was handled; else false.
|
2006-07-13 16:46:02 +04:00
|
|
|
*/
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
bool ro_gui_cookies_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
|
|
|
|
wimp_pointer *pointer)
|
2006-07-13 16:46:02 +04:00
|
|
|
{
|
2010-10-05 23:14:46 +04:00
|
|
|
bool selection;
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
if (menu != cookies_window.menu)
|
|
|
|
return false;
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2013-09-02 19:19:16 +04:00
|
|
|
selection = cookie_manager_has_selection();
|
2010-10-25 03:17:21 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_gui_menu_set_entry_shaded(cookies_window.menu,
|
|
|
|
TREE_SELECTION, !selection);
|
|
|
|
ro_gui_menu_set_entry_shaded(cookies_window.menu,
|
|
|
|
TREE_CLEAR_SELECTION, !selection);
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2010-10-25 03:17:21 +04:00
|
|
|
ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_menu_option_shade(cookies_window.toolbar));
|
2010-10-25 03:17:21 +04:00
|
|
|
ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_menu_buttons_tick(cookies_window.toolbar));
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2010-10-25 03:17:21 +04:00
|
|
|
ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_menu_edit_shade(cookies_window.toolbar));
|
2010-10-25 03:17:21 +04:00
|
|
|
ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_menu_edit_tick(cookies_window.toolbar));
|
|
|
|
|
|
|
|
return true;
|
2006-07-13 16:46:02 +04:00
|
|
|
}
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/**
|
|
|
|
* Handle submenu warnings for the cookies menu
|
|
|
|
*
|
2011-02-21 02:16:33 +03:00
|
|
|
* \param w The window owning the menu.
|
|
|
|
* \param i The icon owning the menu.
|
2010-10-05 23:14:46 +04:00
|
|
|
* \param *menu The menu to which the warning applies.
|
|
|
|
* \param *selection The wimp menu selection data.
|
|
|
|
* \param action The selected menu action.
|
|
|
|
*/
|
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
void ro_gui_cookies_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
|
2010-10-05 23:14:46 +04:00
|
|
|
wimp_selection *selection, menu_action action)
|
|
|
|
{
|
|
|
|
/* Do nothing */
|
|
|
|
}
|
2006-07-13 16:46:02 +04:00
|
|
|
|
|
|
|
/**
|
2010-10-05 23:14:46 +04:00
|
|
|
* Handle selections from the cookies menu
|
2006-07-13 16:46:02 +04:00
|
|
|
*
|
2011-02-21 02:16:33 +03:00
|
|
|
* \param w The window owning the menu.
|
|
|
|
* \param i The icon owning the menu.
|
2010-10-05 23:14:46 +04:00
|
|
|
* \param *menu The menu from which the selection was made.
|
|
|
|
* \param *selection The wimp menu selection data.
|
|
|
|
* \param action The selected menu action.
|
|
|
|
* \return true if action accepted; else false.
|
2006-07-13 16:46:02 +04:00
|
|
|
*/
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2011-02-21 02:16:33 +03:00
|
|
|
bool ro_gui_cookies_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
|
2010-10-05 23:14:46 +04:00
|
|
|
wimp_selection *selection, menu_action action)
|
2006-07-13 16:46:02 +04:00
|
|
|
{
|
2010-10-05 23:14:46 +04:00
|
|
|
switch (action) {
|
|
|
|
case TREE_EXPAND_ALL:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_expand(false);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_EXPAND_FOLDERS:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_expand(true);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_EXPAND_LINKS:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_expand(false);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_COLLAPSE_ALL:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_contract(true);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_COLLAPSE_FOLDERS:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_contract(true);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_COLLAPSE_LINKS:
|
2013-09-03 15:36:55 +04:00
|
|
|
cookie_manager_contract(false);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_SELECTION_DELETE:
|
2015-03-27 12:36:19 +03:00
|
|
|
cookie_manager_keypress(NS_KEY_DELETE_LEFT);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_SELECT_ALL:
|
2015-03-27 12:36:19 +03:00
|
|
|
cookie_manager_keypress(NS_KEY_SELECT_ALL);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
|
|
|
case TREE_CLEAR_SELECTION:
|
2015-03-27 12:36:19 +03:00
|
|
|
cookie_manager_keypress(NS_KEY_CLEAR_SELECTION);
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
2010-10-25 01:52:16 +04:00
|
|
|
case TOOLBAR_BUTTONS:
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_set_display_buttons(cookies_window.toolbar,
|
|
|
|
!ro_toolbar_get_display_buttons(
|
|
|
|
cookies_window.toolbar));
|
2010-10-25 01:52:16 +04:00
|
|
|
return true;
|
|
|
|
case TOOLBAR_EDIT:
|
2011-02-21 02:16:33 +03:00
|
|
|
ro_toolbar_toggle_edit(cookies_window.toolbar);
|
2010-10-25 01:52:16 +04:00
|
|
|
return true;
|
2010-10-05 23:14:46 +04:00
|
|
|
default:
|
|
|
|
return false;
|
2006-07-13 16:46:02 +04:00
|
|
|
}
|
2006-11-27 18:35:18 +03:00
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
return false;
|
|
|
|
}
|
2006-11-27 18:35:18 +03:00
|
|
|
|
2006-07-13 16:46:02 +04:00
|
|
|
/**
|
2010-10-05 23:14:46 +04:00
|
|
|
* Check if a particular window handle is the cookies window
|
2006-07-13 16:46:02 +04:00
|
|
|
*
|
2010-10-05 23:14:46 +04:00
|
|
|
* \param window the window in question
|
|
|
|
* \return true if this window is the cookies
|
2006-07-13 16:46:02 +04:00
|
|
|
*/
|
2010-10-05 23:14:46 +04:00
|
|
|
|
|
|
|
bool ro_gui_cookies_check_window(wimp_w window)
|
2006-07-13 16:46:02 +04:00
|
|
|
{
|
2010-10-25 01:52:16 +04:00
|
|
|
if (cookies_window.window == window)
|
2010-10-05 23:14:46 +04:00
|
|
|
return true;
|
2010-10-25 01:52:16 +04:00
|
|
|
else
|
2010-10-05 23:14:46 +04:00
|
|
|
return false;
|
|
|
|
}
|
2006-07-13 16:46:02 +04:00
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/**
|
|
|
|
* Check if a particular menu handle is the cookies menu
|
|
|
|
*
|
|
|
|
* \param *menu The menu in question.
|
|
|
|
* \return true if this menu is the cookies menu
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool ro_gui_cookies_check_menu(wimp_menu *menu)
|
|
|
|
{
|
|
|
|
if (cookies_window.menu == menu)
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
2006-07-13 16:46:02 +04:00
|
|
|
}
|
2010-10-05 23:14:46 +04:00
|
|
|
|