diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-10-13 20:45:16 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-10-13 23:17:38 +0300 |
commit | e9f260b38076ce56f131914cfb5ece242eb1225c (patch) | |
tree | db04b616a00931ab15cee70975738191bbdafca1 /include | |
parent | 2b1329663a2034bfd622d9227573421b10bdad15 (diff) |
Minor refactoring of iOS code
Rename functions so that functions called by the UI layer for actions
to happen in the LO layer and functions called by the LO layer for
things to happen in the UI layer use different prefixes. Move
declarations to the generic <touch/touch.h> and avoid iOS-specific
types in the API.
Change-Id: Ieb8979065e02a87c4a415c934163265f2790d011
Diffstat (limited to 'include')
-rw-r--r-- | include/osl/detail/ios-bootstrap.h | 66 | ||||
-rw-r--r-- | include/touch/touch.h | 48 |
2 files changed, 36 insertions, 78 deletions
diff --git a/include/osl/detail/ios-bootstrap.h b/include/osl/detail/ios-bootstrap.h deleted file mode 100644 index 0225c9ac38f8..000000000000 --- a/include/osl/detail/ios-bootstrap.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef IOS_BOOSTRAP_H -#define IOS_BOOSTRAP_H - -#if defined(IOS) - -#include <premac.h> -#include <CoreGraphics/CoreGraphics.h> -#include <postmac.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#include <osl/detail/component-mapping.h> - -/* These functions are the interface between the upper GUI layers of a - * LibreOffice-based iOS app and the lower "core" layers, used in cases - * where the core parts need to call functions in the upper parts or - * vice versa. - * - * Thus there are two classes of functions here: - * - * 1) Those to be implemented in the upper layer and called by the - * lower layer - * - * 2) Those implmented in the lower layers to be called by the upper - * layer, in cases where we don't want to include a bunch of the - * "normal" LibreOffice C++ headers in an otherwise purely Objective-C - * CocoaTouch-based source file. Of course it depends on the case - * where that is wanted, and this all is work in progress. - */ - -/* 1) */ - -typedef enum { DOWN, MOVE, UP} LOMouseButtonState; - -void lo_damaged(CGRect rect); - -/* 2) */ - -void lo_runMain(); -void lo_set_view_size(int width, int height); -void lo_render_windows(CGContextRef context, CGRect rect); -void lo_tap(int x, int y); -void lo_pan(int deltaX, int deltaY); -void lo_zoom(int x, int y, float scale); -void lo_mouse_drag(int x, int y, LOMouseButtonState state); -void lo_keyboard_input(int c); - -#ifdef __cplusplus -} -#endif - -#endif // IOS -#endif // IOS_BOOTSTRAP_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/touch/touch.h b/include/touch/touch.h index 05ae335ab920..ebe4b19b8084 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -18,24 +18,48 @@ #if !HAVE_FEATURE_DESKTOP -// Functions to be implemented by the app-specifc upper or less -// app-specific but platform-specific medium layer on touch-based -// platforms. The same API is used on each such platform. There are -// called from low level LibreOffice code. Note that these are just -// declared here in this header in the "touch" module, the -// per-platform implementations are elsewhere. - #ifdef __cplusplus extern "C" { #endif -void lo_show_keyboard(); -void lo_hide_keyboard(); +// These functions are the interface between the upper GUI layers of a +// LibreOffice-based app on a touch platform app and the lower "core" +// layers, used in cases where the core parts need to call +// functionality in the upper parts or vice versa. +// +// Thus there are two classes of functions here: +// +// 1) Those to be implemented in the upper layer and called by the +// lower layer. Prefixed by touch_ui_. The same API is used on each +// such platform. There are called from low level LibreOffice +// code. Note that these are just declared here in a header for a +// "touch" module, the per-platform implementations are elsewhere. + +void touch_ui_damaged(int minX, int minY, int width, int height); + +void touch_ui_show_keyboard(); +void touch_ui_hide_keyboard(); + +// 2) Those implmented in the lower layers to be called by the upper +// layer, in cases where we don't want to include a bunch of the +// "normal" LibreOffice C++ headers in an otherwise purely Objective-C +// CocoaTouch-based source file. Of course it depends on the case +// where that is wanted, and this all is work in progress. Prefixed by +// touch_lo_. + +void touch_lo_keyboard_did_hide(); + +void touch_lo_runMain(); +void touch_lo_set_view_size(int width, int height); +void touch_lo_render_windows(void *context, int minX, int minY, int width, int height); +void touch_lo_tap(int x, int y); +void touch_lo_pan(int deltaX, int deltaY); +void touch_lo_zoom(int x, int y, float scale); +void touch_lo_keyboard_input(int c); -// Functions to be implemented in the medium platform-specific layer -// to be called from the app-specific UI layer. +typedef enum { DOWN, MOVE, UP} LOMouseButtonState; -void lo_keyboard_did_hide(); +void touch_lo_mouse_drag(int x, int y, LOMouseButtonState state); #ifdef __cplusplus } |