Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
artem78 committed Apr 28, 2022
2 parents 0f1dc34 + 3dd5464 commit 40893a8
Show file tree
Hide file tree
Showing 16 changed files with 144 additions and 96 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artem78 <[email protected]>
2 changes: 1 addition & 1 deletion data/S60Maps.l04
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ CHARACTER_SET UTF8
#define qtn_show "Mostrar"
#define qtn_hide "Ocultar"
#define qtn_signal_indicator "Indicador de señal GPS"
#define qtn_scale_bar "Barra de nivel"
#define qtn_scale_bar "Barra de escala"
2 changes: 1 addition & 1 deletion data/S60Maps.l103
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ CHARACTER_SET UTF8
#define qtn_show "Amosar"
#define qtn_hide "Ocultar"
#define qtn_signal_indicator "Indicador do sinal GPS"
#define qtn_scale_bar "Barra de nível"
#define qtn_scale_bar "Barra de escala"
2 changes: 1 addition & 1 deletion data/S60Maps.l13
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ CHARACTER_SET UTF8
#define qtn_show "Mostrar"
#define qtn_hide "Ocultar"
#define qtn_signal_indicator "Indicador do sinal GPS"
#define qtn_scale_bar "Barra de nível"
#define qtn_scale_bar "Barra de escala"
16 changes: 8 additions & 8 deletions data/S60Maps.l27
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CHARACTER_SET UTF8

#define qtn_find_me "Podążaj za mną"
//#define qtn_help "Pomoc"
#define qtn_about "O"
#define qtn_about "Informacje"
#define qtn_exit "Wyjdź"
#define qtn_tile_providers_title "Mapy"
#define qtn_service_title "Usługa"
Expand Down Expand Up @@ -54,13 +54,13 @@ CHARACTER_SET UTF8

// Added in version 1.7:

#define qtn_settings "Settings"
#define qtn_language "Language"
#define qtn_settings "Ustawienia"
#define qtn_language "Język"

// Added in version 1.8:

#define qtn_reload_visible_area "Reload visible area"
#define qtn_show "Show"
#define qtn_hide "Hide"
#define qtn_signal_indicator "GPS signal indicator"
#define qtn_scale_bar "Scale bar"
#define qtn_reload_visible_area "Przeładuj widoczny obszar"
#define qtn_show "Pokaż"
#define qtn_hide "Ukryj"
#define qtn_signal_indicator "Wskaźnik sygnału GPS"
#define qtn_scale_bar "Pasek skali"
33 changes: 23 additions & 10 deletions data/S60Maps.rss
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,37 @@ RESOURCE DIALOG r_landmark_name_input_query
// List query dialog for landmarks
RESOURCE DIALOG r_landmarks_query_dialog
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
flags = EAknDialogSelectionList;
buttons = R_AVKON_SOFTKEYS_SELECT_CANCEL;
items =
{
AVKON_LIST_QUERY_DLG_LINE
DLG_LINE
{
control = AVKON_LIST_QUERY_CONTROL
type = EAknCtSingleListBox;
id = ESelectionListControl;
control = LISTBOX
{
listtype = EAknCtSinglePopupMenuListBox;
listbox = AVKON_LIST_QUERY_LIST
{
};
heading = qtn_landmarks;
flags = EAknListBoxSelectionList;
};
},

DLG_LINE
{
itemflags = EEikDlgItemNonFocusing;
id = EFindControl;
type = EAknCtSelectionListFixedFind /*EAknCtSelectionListPopupFind*/;
}
};
}

RESOURCE MENU_BAR r_landmarks_query_dialog_menubar
{
titles =
{
MENU_TITLE { menu_pane = R_AVKON_MENUPANE_SELECTION_LIST; }
};
};

// Location query dialog
RESOURCE DIALOG r_location_query_dialog
{
Expand Down Expand Up @@ -453,7 +466,7 @@ RESOURCE TBUF r_positioning_disabled { buf=qtn_positioning_disabled; }
//RESOURCE TBUF r_wait { buf=qtn_wait; }
RESOURCE TBUF r_meters_unit_short { buf=qtn_meters_unit_short; }
RESOURCE TBUF r_kilometers_unit_short { buf=qtn_kilometers_unit_short; }
//RESOURCE TBUF r_landmarks { buf=qtn_landmarks; }
RESOURCE TBUF r_landmarks { buf=qtn_landmarks; }
//RESOURCE TBUD r_display { buf=qtn_display; }
//RESOURCE TBUD r_create { buf=qtn_create; }
RESOURCE TBUF r_input_name { buf=qtn_input_name; }
Expand Down
2 changes: 1 addition & 1 deletion group/S60Maps.mmp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ LIBRARY efsrv.lib
LIBRARY estor.lib
LIBRARY aknnotify.lib
LIBRARY hlplch.lib lbs.lib gdi.lib imageconversion.lib fbscli.lib bitgdi.lib http.lib bafl.lib inetprotutil.lib remconcoreapi.lib remconinterfacebase.lib ws32.lib charconv.lib hash.lib eikcoctl.lib
LIBRARY apgrfx.lib eikcdlg.lib eikctl.lib eposlandmarks.lib eposlmsearchlib.lib
LIBRARY apgrfx.lib eikcdlg.lib eikctl.lib eposlandmarks.lib eposlmsearchlib.lib hwrmlightclient.lib



Expand Down
4 changes: 0 additions & 4 deletions inc/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class CMapLayerDebugInfo : public CMapLayerBase
// Own
private:
TInt iRedrawingsCount;
CFont* iFont;

void DrawInfoL(CWindowGc &aGc);
};
Expand Down Expand Up @@ -173,7 +172,6 @@ class CScaleBarLayer : public CMapLayerBase
private:
HBufC* iMetersUnit;
HBufC* iKilometersUnit;
/*const*/ CFont* iFont;

void GetOptimalLength(TInt &optimalLength, TReal32 &optimalDistance);

Expand Down Expand Up @@ -203,7 +201,6 @@ class CLandmarksLayer : public CMapLayerBase
CPosLandmarkDatabase* iLandmarksDb; // Not owned
CFbsBitmap* iIconBitmap;
CFbsBitmap* iIconMaskBitmap;
CFont* iFont; // For drawing labels

// Result may be NULL if nothing found
CArrayPtr<CPosLandmark>* GetVisibleLandmarksL(); // ToDo: Is moving to another class needed?
Expand Down Expand Up @@ -266,7 +263,6 @@ class CSignalIndicatorLayer : public CMapLayerBase
KBarsTotalHeight = KStartBarHeight + (KBarsCount - 1) * KBarHeightIncremement
};

CFont* iFont;
CFbsBitmap* iSatelliteIconBitmap;
CFbsBitmap* iSatelliteIconMaskBitmap;

Expand Down
3 changes: 3 additions & 0 deletions inc/MapControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class CMapControl : public CCoeControlWithDelayedDraw
TBool iIsSoftkeysShown;
TBool iIsCrosshairVisible;
CPeriodic* /*iUserInactivityTimer*/ iCrosshairAutoHideTimer;
CFont* iDefaultFont;

void Move(const TPoint &aPoint, TBool savePos = ETrue); // Used by all another Move methods
public:
Expand Down Expand Up @@ -241,6 +242,8 @@ class CMapControl : public CCoeControlWithDelayedDraw
{ return iIsSoftkeysShown; };
void HandleLanguageChangedL();
void ReloadVisibleAreaL();
inline const CFont* DefaultFont() const
{ return iDefaultFont; };

};

Expand Down
4 changes: 4 additions & 0 deletions inc/S60MapsAppUi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <aknwaitdialog.h> // For CAknWaitDialog
#include <epos_cposlandmarkdatabase.h> // For CPosLandmarkDatabase
#include <lbssatellite.h>
#include <hwrmlight.h> // For CHWRMLight

// FORWARD DECLARATIONS
class CMapView;
Expand Down Expand Up @@ -167,10 +168,13 @@ class CS60MapsAppUi : public CAknViewAppUi, public MAsyncFileManObserver,
CPosLandmarkDatabase* iLandmarksDb;
CPosLmPartialReadParameters* iLandmarkPartialParameters;
TInt iResourceOffset;
CHWRMLight* iLight;
CPeriodic* iResetInactivityTimer;

//static TInt UpdateTilesClearingProgress(TAny* aSelfPtr);

TLanguage PreferredLanguage();
static TInt ResetInactivityTimer(TAny* aPtr);


// Command handlers
Expand Down
2 changes: 2 additions & 0 deletions inc/S60MapsApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class CS60MapsApplication : public CAknApplication
// Transform relative path to absolute from program root data directory
void RelPathToAbsFromDataDir(const TDesC &aRelPath, TFileName &anAbsPath) const;
void CacheDir(TFileName &aCacheDir) const;
void IconFileL(TFileName &aFileName) const;

};

#endif // __S60MAPSAPPLICATION_H__
Expand Down
80 changes: 17 additions & 63 deletions src/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,10 @@ CMapLayerDebugInfo* CMapLayerDebugInfo::NewL(CMapControl* aMapView)

void CMapLayerDebugInfo::ConstructL()
{
// Set font
_LIT(KFontName, "Series 60 Sans");
const TInt KFontHeightInTwips = 11 * 12;
TFontSpec fontSpec(KFontName, KFontHeightInTwips);
fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
CGraphicsDevice* screenDevice = CCoeEnv::Static()->ScreenDevice();
User::LeaveIfError(screenDevice->GetNearestFontInTwips(iFont, fontSpec));
}

CMapLayerDebugInfo::~CMapLayerDebugInfo()
{
CCoeEnv::Static()->ScreenDevice()->ReleaseFont(iFont);
}

void CMapLayerDebugInfo::Draw(CWindowGc &aGc)
Expand Down Expand Up @@ -122,13 +114,13 @@ void CMapLayerDebugInfo::DrawInfoL(CWindowGc &aGc)
aGc.Reset();
aGc.SetPenColor(KRgbDarkBlue);

aGc.UseFont(iFont);
aGc.UseFont(iMapView->DefaultFont());
TRect area = iMapView->Rect();
area.Shrink(4, 4);
TInt baselineOffset = 0;
for (TInt i = 0; i < strings->Count(); i++)
{
baselineOffset += iFont->AscentInPixels() + 5;
baselineOffset += iMapView->DefaultFont()->AscentInPixels() + 5;
aGc.DrawText((*strings)[i], area, baselineOffset, CGraphicsContext::ELeft);
}
aGc.DiscardFont();
Expand Down Expand Up @@ -507,8 +499,6 @@ CScaleBarLayer::CScaleBarLayer(CMapControl* aMapView):

CScaleBarLayer::~CScaleBarLayer()
{
CCoeEnv::Static()->ScreenDevice()->ReleaseFont(iFont);

delete iKilometersUnit;
delete iMetersUnit;
}
Expand All @@ -532,18 +522,6 @@ void CScaleBarLayer::ConstructL()
{
// Read strings from resources
ReloadStringsFromResourceL();

// Load font for label text
//iFont = const_cast<CFont*>(CEikonEnv::Static()->AnnotationFont());
//iFont = CEikonEnv::Static()->AnnotationFont();
_LIT(KFontName, /*"OpenSans"*/ "Series 60 Sans");
const TInt KFontHeightInTwips = /*9*/ 10 * 12; // Twip = 1/12 point
TFontSpec fontSpec(KFontName, KFontHeightInTwips);
fontSpec.iTypeface.SetIsSerif(EFalse);
fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
CGraphicsDevice* screenDevice = CCoeEnv::Static()->ScreenDevice();
TInt r = screenDevice->/*GetNearestFontToMaxHeightInTwips*/ GetNearestFontInTwips(iFont, fontSpec);
User::LeaveIfError(r);
}

void CScaleBarLayer::Draw(CWindowGc &aGc)
Expand Down Expand Up @@ -620,7 +598,7 @@ void CScaleBarLayer::Draw(CWindowGc &aGc)
textRect.iTl.iY -= 30;
textRect.Move(0, -KTextBottomMargin);
TInt baselineOffset = textRect.Height() /*- font->AscentInPixels()*/;
aGc.UseFont(iFont);
aGc.UseFont(iMapView->DefaultFont());
//aGc.DrawText(text, startPoint);
aGc.DrawText(text, textRect, baselineOffset, CGraphicsContext::ECenter);
aGc.DiscardFont();
Expand Down Expand Up @@ -691,7 +669,6 @@ CLandmarksLayer::CLandmarksLayer(CMapControl* aMapView, CPosLandmarkDatabase* aL

CLandmarksLayer::~CLandmarksLayer()
{
CCoeEnv::Static()->ScreenDevice()->ReleaseFont(iFont);
ReleaseLandmarkResources();
delete iIconMaskBitmap;
delete iIconBitmap;
Expand All @@ -714,27 +691,16 @@ CLandmarksLayer* CLandmarksLayer::NewL(CMapControl* aMapView, CPosLandmarkDataba

void CLandmarksLayer::ConstructL()
{
_LIT(KMbmFilePathFmt, "%c:%Sicons.mbm");

TFileName privateDir;
User::LeaveIfError(CEikonEnv::Static()->FsSession().PrivatePath(privateDir));
TFileName mbmFilePath;
mbmFilePath.Format(KMbmFilePathFmt, FileUtils::InstallationDrive(), &privateDir);

CS60MapsAppUi* appUi = static_cast<CS60MapsAppUi*>(CCoeEnv::Static()->AppUi());
CS60MapsApplication* app = static_cast<CS60MapsApplication*>(appUi->Application());
app->IconFileL(mbmFilePath);

iIconBitmap = new (ELeave) CFbsBitmap();
User::LeaveIfError(iIconBitmap->Load(mbmFilePath, EMbmIconsStar));

iIconMaskBitmap = new (ELeave) CFbsBitmap();
User::LeaveIfError(iIconMaskBitmap->Load(mbmFilePath, EMbmIconsStar_mask));

// Load font
_LIT(KFontName, /*"OpenSans"*/ "Series 60 Sans");
const TInt KFontHeightInTwips = 10 /*12*/ * 12; // Twip = 1/12 point
TFontSpec fontSpec(KFontName, KFontHeightInTwips);
fontSpec.iTypeface.SetIsSerif(EFalse);
fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
CGraphicsDevice* screenDevice = CCoeEnv::Static()->ScreenDevice();
User::LeaveIfError(screenDevice->/*GetNearestFontToMaxHeightInTwips*/ GetNearestFontInTwips(iFont, fontSpec));
}

void CLandmarksLayer::Draw(CWindowGc &aGc)
Expand Down Expand Up @@ -819,7 +785,7 @@ void CLandmarksLayer::DrawLandmarks(CWindowGc &aGc,
//const TRgb KPenColor(59, 120, 162);
const TRgb KPenColor(21, 63, 92);
aGc.SetPenColor(KPenColor); // For drawing text
aGc.UseFont(iFont);
aGc.UseFont(iMapView->DefaultFont());

for (TInt i = 0; i < aLandmarks->Count(); i++)
{
Expand Down Expand Up @@ -873,7 +839,7 @@ void CLandmarksLayer::DrawLandmark(CWindowGc &aGc,
const TInt KLabelMargin = 5;
TPoint labelPoint(landmarkPoint);
labelPoint.iX += iconSize.iWidth / 2 + KLabelMargin;
labelPoint.iY += /*iFont->HeightInPixels()*/ iFont->AscentInPixels() / 2;
labelPoint.iY += /*iMapView->DefaultFont()->HeightInPixels()*/ iMapView->DefaultFont()->AscentInPixels() / 2;
aGc.DrawText(landmarkName, labelPoint);
}
}
Expand Down Expand Up @@ -934,34 +900,20 @@ CSignalIndicatorLayer::CSignalIndicatorLayer(CMapControl* aMapView) :
void CSignalIndicatorLayer::ConstructL()
{
// Load icon
_LIT(KMbmFilePathFmt, "%c:%Sicons.mbm");

TFileName privateDir;
User::LeaveIfError(CEikonEnv::Static()->FsSession().PrivatePath(privateDir));
TFileName mbmFilePath;
mbmFilePath.Format(KMbmFilePathFmt, FileUtils::InstallationDrive(), &privateDir);
CS60MapsAppUi* appUi = static_cast<CS60MapsAppUi*>(CCoeEnv::Static()->AppUi());
CS60MapsApplication* app = static_cast<CS60MapsApplication*>(appUi->Application());
app->IconFileL(mbmFilePath);

iSatelliteIconBitmap = new (ELeave) CFbsBitmap();
User::LeaveIfError(iSatelliteIconBitmap->Load(mbmFilePath, EMbmIconsSatellite));

iSatelliteIconMaskBitmap = new (ELeave) CFbsBitmap();
User::LeaveIfError(iSatelliteIconMaskBitmap->Load(mbmFilePath, EMbmIconsSatellite_mask));


// Load font
_LIT(KFontName, /*"OpenSans"*/ "Series 60 Sans");
const TInt KFontHeightInTwips = /*9*/ 10 * 12; // Twip = 1/12 point
TFontSpec fontSpec(KFontName, KFontHeightInTwips);
fontSpec.iTypeface.SetIsSerif(EFalse);
fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
CGraphicsDevice* screenDevice = CCoeEnv::Static()->ScreenDevice();
TInt r = screenDevice->/*GetNearestFontToMaxHeightInTwips*/ GetNearestFontInTwips(iFont, fontSpec);
User::LeaveIfError(r);
}

CSignalIndicatorLayer::~CSignalIndicatorLayer()
{
CCoeEnv::Static()->ScreenDevice()->ReleaseFont(iFont);
delete iSatelliteIconMaskBitmap;
delete iSatelliteIconBitmap;
}
Expand Down Expand Up @@ -1017,21 +969,23 @@ void CSignalIndicatorLayer::Draw(CWindowGc &aGc)

const TInt KSpacing = 6;

const CFont* font = iMapView->DefaultFont();

TRect textArea = iMapView->Rect();
textArea.Shrink(14, 14);
textArea.iBr.iX -= KBarsTotalWidth + KSpacing;
textArea.iBr.iY = 14 + KBarsTotalHeight;
TReal tmp = (textArea.Height() + iFont->AscentInPixels()) / 2.0;
TReal tmp = (textArea.Height() + font->AscentInPixels()) / 2.0;
Math::Round(tmp, tmp, 0);
TInt baselineOffset = static_cast<TInt>(tmp);

aGc.UseFont(iFont);
aGc.UseFont(font);
aGc.DrawText(buff, textArea, baselineOffset, CGraphicsContext::ERight);
aGc.DiscardFont();

DrawBars(aGc, signalStrength);

TPoint satIconPoint(iMapView->Rect().iBr.iX - (14 + KBarsTotalWidth + KSpacing * 2 + iFont->TextWidthInPixels(buff)
TPoint satIconPoint(iMapView->Rect().iBr.iX - (14 + KBarsTotalWidth + KSpacing * 2 + font->TextWidthInPixels(buff)
+ iSatelliteIconBitmap->SizeInPixels().iWidth),
iMapView->Rect().iTl.iY + 14 + KBarsTotalHeight - iSatelliteIconBitmap->SizeInPixels().iHeight);
DrawSatelliteIcon(aGc, satIconPoint);
Expand Down
Loading

0 comments on commit 40893a8

Please sign in to comment.