Module: wine
Branch: master
Commit: 3b52d42ab4151f4620313dae351f4ae35366f00f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3b52d42ab4151f4620313dae3…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com>
Date: Wed Jun 10 21:11:48 2009 +0200
start.exe: Add infrastructure to launch windows file open associations from freedesktop.
---
programs/start/Cs.rc | 1 +
programs/start/De.rc | 1 +
programs/start/En.rc | 1 +
programs/start/Es.rc | 1 +
programs/start/Fr.rc | 1 +
programs/start/It.rc | 1 +
programs/start/Ko.rc | 1 +
programs/start/Nl.rc | 1 +
programs/start/Pl.rc | 1 +
programs/start/Pt.rc | 1 +
programs/start/Ru.rc | 1 +
programs/start/Si.rc | 1 +
programs/start/Tr.rc | 1 +
programs/start/start.c | 21 +++++++++++++++++++--
14 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/programs/start/Cs.rc b/programs/start/Cs.rc
index b319f8d..1693f8b 100644
--- a/programs/start/Cs.rc
+++ b/programs/start/Cs.rc
@@ -37,6 +37,7 @@ Volby:\n\
/MAX[imalizovan�] Spust� program maximalizovan�.\n\
/R Spust� program norm�ln� (ani minimalizovan� ani maximalizovan�).\n\
/W �ek� na dokon�en� spu�t�n�ho programu, vrac� n�vratov� k�d.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Zobraz� licenci.\n\
\n\
start.exe verze 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/De.rc b/programs/start/De.rc
index 3ab7aa0..4f54a53 100644
--- a/programs/start/De.rc
+++ b/programs/start/De.rc
@@ -34,6 +34,7 @@ Optionen:\n\
/MAX[imized] Starte das Programm maximiert.\n\
/R[estored] Starte das Programm normal (weder minimiert noch maximiert).\n\
/W[ait] Wartet bis das gestartete Programm sich beendet,\n\t dann beendet sich start mit dessen Exitcode des Programmes.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Zeige die Endbenutzerlizenz an.\n\
\n\
start.exe Version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/En.rc b/programs/start/En.rc
index f44ba11..0429fe9 100644
--- a/programs/start/En.rc
+++ b/programs/start/En.rc
@@ -34,6 +34,7 @@ Options:\n\
/R[estored] Start the program normally (neither minimized nor maximized).\n\
/W[ait] Wait for started program to finish, then exit with its exit code.\n\
/Unix Use a Unix filename and start the file like windows explorer.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Show end-user license.\n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Es.rc b/programs/start/Es.rc
index fd74d8f..ac1c6d7 100644
--- a/programs/start/Es.rc
+++ b/programs/start/Es.rc
@@ -34,6 +34,7 @@ Opciones:\n\
/R[estored] Inicia el programa normalmente (ni minimizado ni maximizado).\n\
/W[ait] Espera que termine el programa iniciado y despu�s sale con su c�digo de salida.\n\
/Unix Usa un nombre de archivo de Unix e inicia el archivo como en el explorador de windows.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Muestra la licencia para el usuario final.\n\
\n\
start.exe versi�n 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Fr.rc b/programs/start/Fr.rc
index 7373637..a2c8fd7 100644
--- a/programs/start/Fr.rc
+++ b/programs/start/Fr.rc
@@ -37,6 +37,7 @@ Options :\n\
/MAX[imized] Lance le programme maximisé.\n\
/R[estored] Lance le programme normalement (ni minimisé ni maximisé).\n\
/W[ait] Attend que le programme lancé se termine, et termine ensuite avec son code de sortie.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Montre la licence d'utilisation.\n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/It.rc b/programs/start/It.rc
index aa83497..42f59ac 100644
--- a/programs/start/It.rc
+++ b/programs/start/It.rc
@@ -35,6 +35,7 @@ Options:\n\
/MAX[imized] Avvia il programma massimizato.\n\
/R[estored] Avvia il programma normalmente (n� minimizzato n� massimizato).\n\
/W[ait] Attendi l'uscita del programma, poi esci con il suo codice di uscita.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Mostra l'accordo di licenza con l'utente finale.\n\
\n\
start.exe versione 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Ko.rc b/programs/start/Ko.rc
index 6c177fe..bc58ebc 100644
--- a/programs/start/Ko.rc
+++ b/programs/start/Ko.rc
@@ -35,6 +35,7 @@ Options:\n\
/R[estored] Ǯ���� ������·� ���۽�Ű�� (�ּ�ȭ�� �ƴϰ� �ִ�ȭ�� �ƴ�).\n\
/W[ait] ���۵� Ǯ���� ���� ������ ��ٸ�, ���� �� �����ڵ带 ����.\n\
/Unix ������ �ͽ��÷ξ�� ���н� �����̸��� ����ؼ� ����.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L ����� ���̼��� ������\n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Nl.rc b/programs/start/Nl.rc
index 725789a..69012a1 100644
--- a/programs/start/Nl.rc
+++ b/programs/start/Nl.rc
@@ -34,6 +34,7 @@ Options:\n\
/R[estored] Start het programma normaal (noch geminimaliseerd noch gemaximaliseerd).\n\
/W[ait] Wacht totdat het gestarte programma is be�indigd, eindig dan met de exit code van dat programma.\n\
/Unix Gebruik een Unix bestandsnaam en start het bestand als de windows verkenner.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Laat de gebruikerslicentie zien.\n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Pl.rc b/programs/start/Pl.rc
index 514c192..09b9f51 100644
--- a/programs/start/Pl.rc
+++ b/programs/start/Pl.rc
@@ -35,6 +35,7 @@ Opcje:\n\
/R[estored] Uruchamia program normalnie (bez minimalizacji ani maksymalizacji).\n\
/W[ait] Zaczekaj a� program zako�czy dzia�anie (i zako�cz\n\
\t kodem wyj�cia programu).\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Poka� licencj� u�ytkownika.\n\
\n\
start.exe wersja 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Pt.rc b/programs/start/Pt.rc
index 9030238..51ff53b 100644
--- a/programs/start/Pt.rc
+++ b/programs/start/Pt.rc
@@ -34,6 +34,7 @@ Options:\n\
/MAX[imized] Inicia o programa maximizado.\n\
/R[estored] Inicia o programa normalmente (sem minimizar nem maximizar).\n\
/W[ait] Aguarda que o programa iniciado termine e ent�o retorno um c�digo (exit code).\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Mostra a licen�a ao usu�rio.\n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Ru.rc b/programs/start/Ru.rc
index 3e9cf62..97e9854 100644
--- a/programs/start/Ru.rc
+++ b/programs/start/Ru.rc
@@ -34,6 +34,7 @@ start [options]
/R[estored] ��������� ��������� ��������� (�� ���������������� � �� ���������������).\n\
/W[ait] ������� ���������� ���������� ��������� � ����� � ����� � ������.\n\
/Unix ������������ ���� Unix ��� ������� �������� ��� ������� ���������.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L �������� �������� ��������� ������������.\n\
\n\
start.exe ������ 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Si.rc b/programs/start/Si.rc
index b7ff270..e10ddf7 100644
--- a/programs/start/Si.rc
+++ b/programs/start/Si.rc
@@ -35,6 +35,7 @@ Možnosti:\n\
/MAX[imized] Zažene program z razširjenim oknom.\n\
/R[estored] Zažene program z običajno velikostjo okna.\n\
/W[ait] Počaka, da se zagnani program zaključi, nato se zaključi in vrne izhodno kodo programa.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Prikaže licenčno pogodbo.\n\
\n\
start.exe različica 0.2 Copyright (C) 2003, Dan Kegel\n\
diff --git a/programs/start/Tr.rc b/programs/start/Tr.rc
index 28f15a2..de7a69d 100644
--- a/programs/start/Tr.rc
+++ b/programs/start/Tr.rc
@@ -33,6 +33,7 @@ Se
/MAX[imized] Ekran� kaplayacak �ekilde ba�lat.\n\
/R[estored] Program� normal bir �ekilde ba�lat (simge halinde veya b�y�t�lm�� halde olabilir).\n\
/W[ait] Ba�lat�lm�� program�n bitmesini bekle, sonra ��k�� koduyla ��k.\n\
+/ProgIDOpen Open a document using the following progID.\n\
/L Son-kullan�c� lisans�n� g�ster.\n\
\n\
start.exe s�r�m 0.2 Telif Hakk� (C) 2003, Dan Kegel\n\
diff --git a/programs/start/start.c b/programs/start/start.c
index ed7df03..e58d4c0 100644
--- a/programs/start/start.c
+++ b/programs/start/start.c
@@ -176,12 +176,15 @@ int wmain (int argc, WCHAR *argv[])
WCHAR *args = NULL;
int i;
int unix_mode = 0;
+ int progid_open = 0;
WCHAR *dos_filename = NULL;
WCHAR *parent_directory = NULL;
DWORD binary_type;
static const WCHAR openW[] = { 'o', 'p', 'e', 'n', 0 };
static const WCHAR unixW[] = { 'u', 'n', 'i', 'x', 0 };
+ static const WCHAR progIDOpenW[] =
+ { 'p', 'r', 'o', 'g', 'I', 'D', 'O', 'p', 'e', 'n', 0};
memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei);
@@ -203,7 +206,7 @@ int wmain (int argc, WCHAR *argv[])
break;
/* Unix paths can start with / so we have to assume anything following /U is not a flag */
- if (unix_mode)
+ if (unix_mode || progid_open)
break;
/* Handle all options in this word */
@@ -235,6 +238,15 @@ int wmain (int argc, WCHAR *argv[])
usage();
}
break;
+ case 'p':
+ case 'P':
+ if (strncmpiW(&argv[i][ci], progIDOpenW, 17) == 0)
+ progid_open = 1;
+ else {
+ WINE_ERR("Option '%s' not recognized\n", wine_dbgstr_w( argv[i]+ci-1));
+ usage();
+ }
+ break;
case 'w':
case 'W':
sei.fMask |= SEE_MASK_NOCLOSEPROCESS;
@@ -252,12 +264,17 @@ int wmain (int argc, WCHAR *argv[])
if (i == argc)
usage();
+ if (progid_open) {
+ sei.lpClass = argv[i++];
+ sei.fMask |= SEE_MASK_CLASSNAME;
+ }
+
sei.lpFile = argv[i++];
args = build_args( argc - i, &argv[i] );
sei.lpParameters = args;
- if (unix_mode) {
+ if (unix_mode || progid_open) {
LPWSTR (*CDECL wine_get_dos_file_name_ptr)(LPCSTR);
char* multibyte_unixpath;
int multibyte_unixpath_len;
Module: wine
Branch: master
Commit: 3a228fb59382d692d3005dae468f0905ed463a19
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a228fb59382d692d3005dae4…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com>
Date: Wed Jun 10 13:17:45 2009 +0200
riched32/tests: Correct a test to better show the behavior.
---
dlls/riched32/tests/editor.c | 56 ++++++++++++++++++++++++++++++-----------
1 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c
index 8e0388c..da74b72 100644
--- a/dlls/riched32/tests/editor.c
+++ b/dlls/riched32/tests/editor.c
@@ -827,7 +827,7 @@ static void test_word_wrap(void)
POINTL point = {0, 60}; /* This point must be below the first line */
const char *text = "Must be long enough to test line wrapping";
DWORD dwCommonStyle = WS_VISIBLE|WS_POPUP|WS_VSCROLL|ES_MULTILINE;
- int res, pos, lines;
+ int res, pos, lines, prevlines, reflines[3];
/* Test the effect of WS_HSCROLL and ES_AUTOHSCROLL styles on wrapping
* when specified on window creation and set later. */
@@ -920,29 +920,55 @@ static void test_word_wrap(void)
ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
DestroyWindow(hwnd);
- /* Test to see if wrapping happens with redraw disabled. */
+ /* First lets see if the text would wrap normally (needed for reference) */
hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle,
- 0, 0, 400, 80, NULL, NULL, hmoduleRichEdit, NULL);
+ 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "error: %d\n", (int) GetLastError());
+ ok(IsWindowVisible(hwnd), "Window should be visible.\n");
+ res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text);
+ ok(res, "EM_REPLACESEL failed.\n");
+ /* Should have wrapped */
+ reflines[0] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
+ ok(reflines[0] > 1, "Line was expected to wrap (%d lines).\n", reflines[0]);
+ /* Resize the window to fit the line */
+ MoveWindow(hwnd, 0, 0, 600, 80, TRUE);
+ /* Text should not be wrapped */
+ reflines[1] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
+ ok(reflines[1] == 1, "Line wasn't expected to wrap (%d lines).\n", reflines[1]);
+ /* Resize the window again to make sure the line wraps again */
+ MoveWindow(hwnd, 0, 0, 10, 80, TRUE);
+ reflines[2] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
+ ok(reflines[2] > 1, "Line was expected to wrap (%d lines).\n", reflines[2]);
+ DestroyWindow(hwnd);
+
+ /* Same test with redraw disabled */
+ hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle,
+ 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL);
ok(hwnd != NULL, "error: %d\n", (int) GetLastError());
ok(IsWindowVisible(hwnd), "Window should be visible.\n");
+ /* Redraw is disabled by making the window invisible. */
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
- /* redraw is disabled by making the window invisible. */
ok(!IsWindowVisible(hwnd), "Window shouldn't be visible.\n");
res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text);
ok(res, "EM_REPLACESEL failed.\n");
- MoveWindow(hwnd, 0, 0, 100, 80, TRUE);
- SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
- /* Wrapping didn't happen while redraw was disabled. */
+ /* Should have wrapped */
+ prevlines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
+ ok(prevlines == reflines[0],
+ "Line was expected to wrap (%d lines).\n", prevlines);
+ /* Resize the window to fit the line, no change to the number of lines */
+ MoveWindow(hwnd, 0, 0, 600, 80, TRUE);
lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
- todo_wine ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines);
- /* There isn't even a rewrap from resizing the window. */
+ todo_wine
+ ok(lines == prevlines ||
+ broken(lines == reflines[1]), /* Win98, WinME and NT4 */
+ "Expected no change in the number of lines\n");
+ /* Resize the window again to make sure the line wraps again */
+ MoveWindow(hwnd, 0, 0, 10, 80, TRUE);
lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
- todo_wine ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines);
- res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text);
- ok(res, "EM_REPLACESEL failed.\n");
- lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
- ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines);
-
+ todo_wine
+ ok(lines == prevlines ||
+ broken(lines == reflines[2]), /* Win98, WinME and NT4 */
+ "Expected no change in the number of lines\n");
DestroyWindow(hwnd);
}