Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
28f5f06d
Kaydet (Commit)
28f5f06d
authored
Ock 05, 2013
tarafından
Jesús
Kaydeden (comit)
Miklos Vajna
Ock 08, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#54165: Allow localized shortcut names on Windows
Change-Id: I2de53cd8d888ecf819271e96f8eb2cc4a90e554d
üst
92afb61d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
13 deletions
+145
-13
Library_vcl.mk
vcl/Library_vcl.mk
+1
-0
salframe.h
vcl/inc/win/salframe.h
+7
-0
keynames.cxx
vcl/win/source/window/keynames.cxx
+112
-0
salframe.cxx
vcl/win/source/window/salframe.cxx
+25
-13
No files found.
vcl/Library_vcl.mk
Dosyayı görüntüle @
28f5f06d
...
@@ -641,6 +641,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
...
@@ -641,6 +641,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/win/source/gdi/winlayout \
vcl/win/source/gdi/winlayout \
vcl/win/source/gdi/wntgdi \
vcl/win/source/gdi/wntgdi \
vcl/win/source/window/salframe \
vcl/win/source/window/salframe \
vcl/win/source/window/keynames \
vcl/win/source/window/salmenu \
vcl/win/source/window/salmenu \
vcl/win/source/window/salobj \
vcl/win/source/window/salobj \
))
))
...
...
vcl/inc/win/salframe.h
Dosyayı görüntüle @
28f5f06d
...
@@ -137,6 +137,13 @@ public:
...
@@ -137,6 +137,13 @@ public:
void
ImplSalGetWorkArea
(
HWND
hWnd
,
RECT
*
pRect
,
const
RECT
*
pParentRect
);
void
ImplSalGetWorkArea
(
HWND
hWnd
,
RECT
*
pRect
,
const
RECT
*
pParentRect
);
// get foreign key names
namespace
vcl_sal
{
rtl
::
OUString
getKeysReplacementName
(
rtl
::
OUString
pLang
,
LONG
nSymbol
);
}
#endif // _SV_SALFRAME_H
#endif // _SV_SALFRAME_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/win/source/window/keynames.cxx
0 → 100755
Dosyayı görüntüle @
28f5f06d
/* -*- 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <string.h>
#include <rtl/ustring.hxx>
#include <sal/macros.h>
#include <windows.h>
#define KEY_ESC 0x10000
#define KEY_BACK 0xE0000
#define KEY_ENTER 0x1C0000
#define KEY_SPACEBAR 0x390000
#define KEY_HOME 0x1470000
#define KEY_UP 0x1480000
#define KEY_PAGEUP 0x1490000
#define KEY_LEFT 0x14B0000
#define KEY_RIGHT 0x14D0000
#define KEY_END 0x14F0000
#define KEY_DOWN 0x1500000
#define KEY_PAGEDOWN 0x1510000
#define KEY_INSERT 0x1520000
#define KEY_DELETE 0x1530000
#define KEY_CONTROL 0x21D0000
#define KEY_SHIFT 0x22A0000
#define KEY_ALT 0x2380000
namespace
vcl_sal
{
struct
KeysNameReplacement
{
LONG
aSymbol
;
const
char
*
pName
;
};
struct
KeyboardReplacements
{
const
char
*
pLangName
;
const
KeysNameReplacement
*
pReplacements
;
int
nReplacements
;
};
// ====================================================================
//
// CAUTION CAUTION CAUTION
// every string value in the replacements tables must be in UTF8
// be careful with your editor !
//
// ====================================================================
static
const
struct
KeysNameReplacement
aImplReplacements_Catalan
[]
=
{
{
KEY_BACK
,
"Retrocés"
},
{
KEY_ENTER
,
"Retorn"
},
{
KEY_SPACEBAR
,
"Espai"
},
{
KEY_HOME
,
"Inici"
},
{
KEY_UP
,
"Amunt"
},
{
KEY_PAGEUP
,
"Re Pàg"
},
{
KEY_LEFT
,
"Esquerra"
},
{
KEY_RIGHT
,
"Dreta"
},
{
KEY_END
,
"Fi"
},
{
KEY_DOWN
,
"Avall"
},
{
KEY_PAGEDOWN
,
"Av Pàg"
},
{
KEY_INSERT
,
"Ins"
},
{
KEY_DELETE
,
"Supr"
},
{
KEY_SHIFT
,
"Maj"
},
};
static
const
struct
KeyboardReplacements
aKeyboards
[]
=
{
{
"ca"
,
aImplReplacements_Catalan
,
SAL_N_ELEMENTS
(
aImplReplacements_Catalan
)
},
};
// translate keycodes, used within the displayed menu shortcuts
rtl
::
OUString
getKeysReplacementName
(
rtl
::
OUString
pLang
,
LONG
nSymbol
)
{
for
(
unsigned
int
n
=
0
;
n
<
SAL_N_ELEMENTS
(
aKeyboards
);
n
++
)
{
if
(
pLang
.
equalsAscii
(
aKeyboards
[
n
].
pLangName
)
)
{
const
struct
KeysNameReplacement
*
pRepl
=
aKeyboards
[
n
].
pReplacements
;
for
(
int
m
=
aKeyboards
[
n
].
nReplacements
;
m
;
)
{
if
(
nSymbol
==
pRepl
[
--
m
].
aSymbol
)
return
rtl
::
OUString
(
pRepl
[
m
].
pName
,
strlen
(
pRepl
[
m
].
pName
),
RTL_TEXTENCODING_UTF8
);
}
}
}
return
rtl
::
OUString
();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/win/source/window/salframe.cxx
Dosyayı görüntüle @
28f5f06d
...
@@ -2387,23 +2387,35 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
...
@@ -2387,23 +2387,35 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
int
nKeyLen
=
0
;
int
nKeyLen
=
0
;
if
(
lParam
)
if
(
lParam
)
{
{
nKeyLen
=
GetKeyNameTextW
(
lParam
,
aKeyBuf
,
nMaxKeyLen
);
rtl
::
OUString
aLang
=
Application
::
GetSettings
().
GetUILanguageTag
().
getLanguage
();
DBG_ASSERT
(
nKeyLen
<=
nMaxKeyLen
,
"Invalid key name length!"
);
rtl
::
OUString
aRet
;
if
(
nKeyLen
>
nMaxKeyLen
)
nKeyLen
=
0
;
else
if
(
nKeyLen
>
0
)
{
// Capitalize just the first letter of key names
CharLowerBuffW
(
aKeyBuf
,
nKeyLen
);
bool
bUpper
=
true
;
aRet
=
::
vcl_sal
::
getKeysReplacementName
(
aLang
,
lParam
);
for
(
WCHAR
*
pW
=
aKeyBuf
,
*
pE
=
pW
+
nKeyLen
;
pW
<
pE
;
++
pW
)
if
(
aRet
.
isEmpty
()
)
{
nKeyLen
=
GetKeyNameTextW
(
lParam
,
aKeyBuf
,
nMaxKeyLen
);
DBG_ASSERT
(
nKeyLen
<=
nMaxKeyLen
,
"Invalid key name length!"
);
if
(
nKeyLen
>
nMaxKeyLen
)
nKeyLen
=
0
;
else
if
(
nKeyLen
>
0
)
{
{
if
(
bUpper
)
// Capitalize just the first letter of key names
CharUpperBuffW
(
pW
,
1
);
CharLowerBuffW
(
aKeyBuf
,
nKeyLen
);
bUpper
=
(
*
pW
==
'+'
)
||
(
*
pW
==
'-'
)
||
(
*
pW
==
' '
)
||
(
*
pW
==
'.'
);
bool
bUpper
=
true
;
for
(
WCHAR
*
pW
=
aKeyBuf
,
*
pE
=
pW
+
nKeyLen
;
pW
<
pE
;
++
pW
)
{
if
(
bUpper
)
CharUpperBuffW
(
pW
,
1
);
bUpper
=
(
*
pW
==
'+'
)
||
(
*
pW
==
'-'
)
||
(
*
pW
==
' '
)
||
(
*
pW
==
'.'
);
}
}
}
}
}
else
{
nKeyLen
=
aRet
.
getLength
();
wcscpy_s
(
aKeyBuf
,
nMaxKeyLen
,
aRet
.
getStr
()
);
}
}
}
if
(
(
nKeyLen
>
0
)
||
pReplace
)
if
(
(
nKeyLen
>
0
)
||
pReplace
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment