Skip to content

Commit 0173790

Browse files
quikeesmehrbrodt
authored andcommitted
Adapt the code for the mass rename in core
This adapts the code for LOK to COK / Kit changes in core. In addition renamed the DummyLibreOfficeKit to DummyCOKit. Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Change-Id: I42a98468db173227477a73c0779d740a9b74b04d
1 parent 08f21f0 commit 0173790

50 files changed

Lines changed: 581 additions & 582 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile.am

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ kit_headers = \
552552
kit/ChildSession.hpp \
553553
kit/Delta.hpp \
554554
kit/DeltaSimd.h \
555-
kit/DummyLibreOfficeKit.hpp \
555+
kit/DummyCOKit.hpp \
556556
kit/Kit.hpp \
557557
kit/KitHelper.hpp \
558558
kit/KitWebSocket.hpp \
@@ -580,13 +580,13 @@ noinst_HEADERS = \
580580

581581
dist-hook:
582582
git log -1 --format=%h --abbrev=10 > $(distdir)/dist_git_hash 2> /dev/null || rm $(distdir)/dist_git_hash
583-
$(QUIET_MKDIRP) mkdir -p $(distdir)/bundled/include/LibreOfficeKit/
584-
cp @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKit.h \
585-
@LOKIT_PATH@/LibreOfficeKit/LibreOfficeKit.hxx \
586-
@LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitEnums.h \
587-
@LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitInit.h \
588-
@LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitTypes.h \
589-
$(distdir)/bundled/include/LibreOfficeKit/
583+
$(QUIET_MKDIRP) mkdir -p $(distdir)/bundled/include/COKit/
584+
cp @LOKIT_PATH@/COKit/COKit.h \
585+
@LOKIT_PATH@/COKit/COKit.hxx \
586+
@LOKIT_PATH@/COKit/COKitEnums.h \
587+
@LOKIT_PATH@/COKit/COKitInit.h \
588+
@LOKIT_PATH@/COKit/COKitTypes.h \
589+
$(distdir)/bundled/include/COKit/
590590

591591
EXTRA_DIST = \
592592
$(man_MANS) \

android/lib/src/main/cpp/androidapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <common/Util.hpp>
2323

2424
#define LIBO_INTERNAL_ONLY
25-
#include <LibreOfficeKit/LibreOfficeKit.hxx>
25+
#include <COKit/COKit.hxx>
2626

2727
#include <osl/detail/android-bootstrap.h>
2828

common/MobileApp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
// On iOS at least we want to be able to have several documents open in the same app process.
2525

26-
// It is somewhat complicated to make sure we access the same LibreOfficeKit object for the document
26+
// It is somewhat complicated to make sure we access the same COKit object for the document
2727
// in both the iOS-specific Objective-C++ code and in the mostly generic Online C++ code.
2828

2929
// We pass around a numeric ever-increasing document identifier that gets bumped for each document
@@ -36,7 +36,7 @@
3636
// and opening of several documents in sequence very quickly might cause discrepancies, so it is
3737
// better to use a different counter to be sure. Patches to use just one counter welcome.
3838

39-
namespace lok
39+
namespace kit
4040
{
4141
class Document;
4242
}
@@ -53,7 +53,7 @@ class DocumentData
5353
{
5454
}
5555

56-
lok::Document *loKitDocument;
56+
kit::Document *loKitDocument;
5757

5858
static DocumentData &allocate(unsigned docId);
5959
static DocumentData &get(unsigned docId);

common/Png.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ unpremultiply_rgba_data (png_structp /*png*/, png_row_infop row_info, png_bytep
165165
/// png_write_row(), so can't use const here for pixmap.
166166
inline bool impl_encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t startY,
167167
int width, int height, int bufferWidth, int bufferHeight,
168-
std::vector<char>& output, LibreOfficeKitTileMode mode)
168+
std::vector<char>& output, COKitTileMode mode)
169169
{
170170
if (bufferWidth < width || bufferHeight < height)
171171
{
@@ -203,10 +203,10 @@ inline bool impl_encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size
203203

204204
switch (mode)
205205
{
206-
case LOK_TILEMODE_BGRA:
206+
case KIT_TILEMODE_BGRA:
207207
png_set_write_user_transform_fn (png_ptr, unpremultiply_bgra_data);
208208
break;
209-
case LOK_TILEMODE_RGBA:
209+
case KIT_TILEMODE_RGBA:
210210
png_set_write_user_transform_fn (png_ptr, unpremultiply_rgba_data);
211211
break;
212212
}
@@ -228,7 +228,7 @@ inline bool impl_encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size
228228
/// png_write_row(), so can't use const here for pixmap.
229229
inline bool encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t startY, int width,
230230
int height, int bufferWidth, int bufferHeight,
231-
std::vector<char>& output, LibreOfficeKitTileMode mode)
231+
std::vector<char>& output, COKitTileMode mode)
232232
{
233233
ProfileZone pz("encodeSubBufferToPNG");
234234

@@ -267,7 +267,7 @@ inline bool encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t st
267267

268268
inline
269269
bool encodeBufferToPNG(unsigned char* pixmap, int width, int height,
270-
std::vector<char>& output, LibreOfficeKitTileMode mode)
270+
std::vector<char>& output, COKitTileMode mode)
271271
{
272272
return encodeSubBufferToPNG(pixmap, 0, 0, width, height, width, height, output, mode);
273273
}

common/Protocol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <string>
2424
#include <string_view>
2525

26-
#define LOK_USE_UNSTABLE_API
27-
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
26+
#define KIT_USE_UNSTABLE_API
27+
#include <COKit/COKitEnums.h>
2828

2929
namespace COOLProtocol
3030
{

common/Protocol.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <string_view>
2424
#include <vector>
2525

26-
#define LOK_USE_UNSTABLE_API
27-
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
26+
#define KIT_USE_UNSTABLE_API
27+
#include <COKit/COKitEnums.h>
2828

2929
namespace COOLProtocol
3030
{

common/RenderTiles.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <kit/Delta.hpp>
1818
#include <wsd/TileDesc.hpp>
1919

20-
#include <LibreOfficeKit/LibreOfficeKit.hxx>
20+
#include <COKit/COKit.hxx>
2121

2222
#include <cassert>
2323
#include <memory>
@@ -58,11 +58,11 @@ namespace RenderTiles
5858
}
5959

6060
bool doRender(
61-
const std::shared_ptr<lok::Document>& document, DeltaGenerator& deltaGen,
61+
const std::shared_ptr<kit::Document>& document, DeltaGenerator& deltaGen,
6262
TileCombined& tileCombined, ThreadPool& pngPool,
6363
const std::function<void(unsigned char* data, int offsetX, int offsetY, size_t pixmapWidth,
6464
size_t pixmapHeight, int pixelWidth, int pixelHeight,
65-
LibreOfficeKitTileMode mode)>& blendWatermark,
65+
COKitTileMode mode)>& blendWatermark,
6666
const std::function<void(const char* buffer, size_t length)>& outputMessage,
6767
[[maybe_unused]] unsigned mobileAppDocId, CanonicalViewId canonicalViewId, bool dumpTiles)
6868
{
@@ -136,7 +136,7 @@ namespace RenderTiles
136136
<< renderArea.getWidth() << ", " << renderArea.getHeight() << ") "
137137
<< " took " << elapsedUs << " (" << area / elapsedUs.count() << " MP/s).");
138138

139-
const auto mode = static_cast<LibreOfficeKitTileMode>(document->getTileMode());
139+
const auto mode = static_cast<COKitTileMode>(document->getTileMode());
140140

141141
const size_t pixmapSize = 4 * pixmapWidth * pixmapHeight;
142142
std::vector<char> output;

common/Unit.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <test/testlog.hpp>
2424

25-
#include <LibreOfficeKit/LibreOfficeKitInit.h>
25+
#include <COKit/COKitInit.h>
2626

2727
class UnitBase;
2828
class UnitWSD;
@@ -703,10 +703,10 @@ class UnitKit : public UnitBase
703703
/// After the kit process created a ChildSession
704704
virtual void postKitSessionCreated(Session* /*session*/) {}
705705

706-
/// Allow a custom LibreOfficeKit wrapper
707-
virtual LibreOfficeKit *lok_init(const char * /* instdir */,
706+
/// Allow a custom COKit wrapper
707+
virtual COKit *cok_init(const char * /* instdir */,
708708
const char * /* userdir */,
709-
LokHookFunction2 /* fn */)
709+
CokHookFunction2 /* fn */)
710710
{
711711
return nullptr;
712712
}

common/Util.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <common/StringVector.hpp>
1515
#include <common/Log.hpp>
1616

17-
#define LOK_USE_UNSTABLE_API
18-
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
17+
#define KIT_USE_UNSTABLE_API
18+
#include <COKit/COKitEnums.h>
1919

2020
#include <typeinfo>
2121

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ AC_ARG_ENABLE([seccomp],
284284
Beware of the security consequences!]))
285285
AC_ARG_WITH([lokit-path],
286286
AS_HELP_STRING([--with-lokit-path=<path>],
287-
[Path to the "include" directory with the LibreOfficeKit headers]))
287+
[Path to the "include" directory with the COKit headers]))
288288

289289
AC_ARG_WITH([lo-path],
290290
AS_HELP_STRING([--with-lo-path=<path>],
@@ -1791,9 +1791,9 @@ AS_IF([test "$ENABLE_SSL" = "true"],
17911791
[LIBS="$LIBS -lssl -lcrypto"])
17921792

17931793
AS_IF([test "$ENABLE_IOSAPP" != "true" -a "$ENABLE_WINDOWSAPP" != "true" -a "$ENABLE_ANDROIDAPP" != "true" -a "$ENABLE_MACOSAPP" != "true" -a "$host_os" != "emscripten"],
1794-
[AC_CHECK_HEADERS([LibreOfficeKit/LibreOfficeKit.h],
1794+
[AC_CHECK_HEADERS([COKit/COKit.h],
17951795
[],
1796-
[AC_MSG_ERROR([header LibreOfficeKit/LibreOfficeKit.h not found, perhaps you want to use --with-lokit-path])])
1796+
[AC_MSG_ERROR([header COKit/COKit.h not found, perhaps you want to use --with-lokit-path])])
17971797
AC_CHECK_HEADERS([Poco/Net/WebSocket.h],
17981798
[],
17991799
[AC_MSG_ERROR([header Poco/Net/WebSocket.h not found, perhaps you want to use --with-poco-includes])])

0 commit comments

Comments
 (0)