mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
70
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
040ba14063 | ||
|
|
be80bc51a0 | ||
|
|
5a1169caf4 | ||
|
|
16c645a66a | ||
|
|
c6d62b3083 | ||
|
|
3456fc6ed0 | ||
|
|
a17cda378d | ||
|
|
29a22d1e94 | ||
|
|
ffae6fbba5 | ||
|
|
20ce17485c | ||
|
|
2a9492adfb | ||
|
|
260281b6c9 | ||
|
|
f90ce4188e | ||
|
|
8086a122ff | ||
|
|
83e7eb5a5f | ||
|
|
513681856c | ||
|
|
025c01f798 | ||
|
|
f7a234be0a | ||
|
|
130ed633bb | ||
|
|
6b846e4f05 | ||
|
|
f9db162220 | ||
|
|
1cbb9d0fd1 | ||
|
|
02e3bfe88d | ||
|
|
8333b1c064 | ||
|
|
6951d7a846 | ||
|
|
fd26f4ad72 | ||
|
|
f1a4601f63 | ||
|
|
93635de18c | ||
|
|
03a539679a | ||
|
|
308f3d7397 | ||
|
|
346d885fb7 | ||
|
|
1cd6847233 | ||
|
|
c13c56e681 | ||
|
|
c13993c81d | ||
|
|
c0599781c2 | ||
|
|
ecbc6c1927 | ||
|
|
56a7fdbb26 | ||
|
|
61313ab7b9 | ||
|
|
7860421028 | ||
|
|
287234ac2d | ||
|
|
0cf3abd705 | ||
|
|
c575f424c5 | ||
|
|
0f0824da9c | ||
|
|
c533333281 | ||
|
|
1d5dd92e90 | ||
|
|
39e5a34e4e | ||
|
|
67ff494b52 | ||
|
|
eb9c716adf | ||
|
|
f9273fba22 | ||
|
|
00b3528bb0 | ||
|
|
429f2e6c6d | ||
|
|
885b33b002 | ||
|
|
934f3f05ea | ||
|
|
d662f55ada | ||
|
|
8cf7918b9c | ||
|
|
e5530bcf70 | ||
|
|
f62eb990ec | ||
|
|
8de132cb42 | ||
|
|
9d003cf5ab | ||
|
|
08a05f29ca | ||
|
|
ce3cf15e9d | ||
|
|
59e88e678c | ||
|
|
9a78851ed5 | ||
|
|
36eeacf534 | ||
|
|
1088e5a289 | ||
|
|
f8ec2615cd | ||
|
|
acc26bcdc4 | ||
|
|
a853829dd0 | ||
|
|
60fb982f94 | ||
|
|
7f452b7daf |
No files matched your search
@@ -1,19 +1,3 @@
|
||||
2007-11-19 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* configure.in : fix win32 build.
|
||||
|
||||
2007-11-16 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Make --with-moonlight=yes the default.
|
||||
|
||||
2007-11-15 Dick Porter <[email protected]>
|
||||
|
||||
* configure.in: Check for g_strsplit_set() and g_strv_length()
|
||||
|
||||
2007-11-10 Alp Toker <[email protected]>
|
||||
|
||||
* samples/embed/teste.c: Add a newline at the end of this printf()
|
||||
|
||||
2007-11-08 Wade Berrier <[email protected]>
|
||||
|
||||
* configure.in: add sysconfdir for mcs config.make
|
||||
|
||||
+3
-16
@@ -1484,7 +1484,6 @@ else
|
||||
AC_CHECK_LIB(winmm, main, LIBS="$LIBS -lwinmm", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(oleaut32, main, LIBS="$LIBS -loleaut32", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(advapi32, main, LIBS="$LIBS -ladvapi32", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(version, main, LIBS="$LIBS -lversion", AC_ERROR(bad mingw install?))
|
||||
|
||||
dnl *********************************
|
||||
dnl *** Check for struct ip_mreqn ***
|
||||
@@ -1632,18 +1631,6 @@ if test "x$try_shared_handles" != "xyes"; then
|
||||
AC_SUBST(DISABLE_SHARED_HANDLES)
|
||||
fi
|
||||
|
||||
# Check for glib functions that we can do without if they aren't present.
|
||||
# This means we don't have to make the required version too new for some
|
||||
# prehistoric distros we still have to build on.
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
OLD_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
|
||||
AC_CHECK_FUNCS(g_strsplit_set)
|
||||
AC_CHECK_FUNCS(g_strv_length)
|
||||
LIBS="$OLD_LIBS"
|
||||
CPPFLAGS="$OLD_CPPFLAGS"
|
||||
|
||||
AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check'])
|
||||
AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes])
|
||||
|
||||
@@ -1984,10 +1971,10 @@ AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0
|
||||
fi
|
||||
])
|
||||
|
||||
MOONLIGHT=yes
|
||||
MOONLIGHT=no
|
||||
AC_ARG_WITH(moonlight,[ --with-moonlight=yes,no If you want to build the Moonlight 2.1 assemblies],[
|
||||
if test x$with_moonlight = xno; then
|
||||
MOONLIGHT=no
|
||||
if test x$with_moonlight = xyes; then
|
||||
MOONLIGHT=yes
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
2007-11-20 Dick Porter <[email protected]>
|
||||
|
||||
* src/gstr.c: Implement g_strsplit_set() and re-implement
|
||||
g_strsplit() so it passes the additional tests. (g_strsplit()
|
||||
should treat multi-char delimiters as just a single token, rather
|
||||
than a set of delimiters.)
|
||||
|
||||
* src/gslist.c: Implement g_slist_index(), g_slist_nth() and
|
||||
g_slist_nth_data().
|
||||
|
||||
* test/string-util.c: Test g_strsplit_set() and more tests for
|
||||
g_strsplit().
|
||||
|
||||
* test/slist.c: Test g_slist_nth() and
|
||||
g_slist_index().
|
||||
|
||||
2007-11-06 Geoff Norton <[email protected]>
|
||||
|
||||
* configure.ac: Check for libiconv_open as the previous check was failing against
|
||||
|
||||
@@ -212,7 +212,6 @@ gchar *g_strndup (const gchar *str, gsize n);
|
||||
void g_strfreev (gchar **str_array);
|
||||
gchar *g_strconcat (const gchar *first, ...);
|
||||
gchar **g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens);
|
||||
gchar **g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens);
|
||||
gchar *g_strreverse (gchar *str);
|
||||
gboolean g_str_has_prefix (const gchar *str, const gchar *prefix);
|
||||
gboolean g_str_has_suffix (const gchar *str, const gchar *suffix);
|
||||
@@ -333,16 +332,8 @@ GSList *g_slist_insert_before (GSList *list,
|
||||
gpointer data);
|
||||
GSList *g_slist_sort (GSList *list,
|
||||
GCompareFunc func);
|
||||
gint g_slist_index (GSList *list,
|
||||
gconstpointer data);
|
||||
GSList *g_slist_nth (GSList *list,
|
||||
guint n);
|
||||
gpointer g_slist_nth_data (GSList *list,
|
||||
guint n);
|
||||
|
||||
#define g_slist_next(slist) ((slist) ? (((GSList *) (slist))->next) : NULL)
|
||||
|
||||
|
||||
typedef struct _GList GList;
|
||||
struct _GList {
|
||||
gpointer data;
|
||||
|
||||
@@ -300,40 +300,6 @@ g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func)
|
||||
return list;
|
||||
}
|
||||
|
||||
gint
|
||||
g_slist_index (GSList *list, gconstpointer data)
|
||||
{
|
||||
gint index = 0;
|
||||
|
||||
while (list) {
|
||||
if (list->data == data)
|
||||
return index;
|
||||
|
||||
index++;
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
GSList*
|
||||
g_slist_nth (GSList *list, guint n)
|
||||
{
|
||||
for (; list; list = list->next) {
|
||||
if (n == 0)
|
||||
break;
|
||||
n--;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
gpointer
|
||||
g_slist_nth_data (GSList *list, guint n)
|
||||
{
|
||||
GSList *node = g_slist_nth (list, n);
|
||||
return node ? node->data : NULL;
|
||||
}
|
||||
|
||||
typedef GSList list_node;
|
||||
#include "sort.frag.h"
|
||||
|
||||
|
||||
+42
-135
@@ -171,161 +171,68 @@ g_strconcat (const gchar *first, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
add_to_vector (gchar ***vector, int size, gchar *token)
|
||||
{
|
||||
*vector = *vector == NULL ?
|
||||
(gchar **)g_malloc(2 * sizeof(*vector)) :
|
||||
(gchar **)g_realloc(*vector, (size + 1) * sizeof(*vector));
|
||||
|
||||
(*vector)[size - 1] = token;
|
||||
}
|
||||
|
||||
gchar **
|
||||
g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
|
||||
{
|
||||
const gchar *c;
|
||||
gchar *token, **vector;
|
||||
gchar *string_c;
|
||||
gchar *strtok_save, **vector;
|
||||
gchar *token, *token_c;
|
||||
gint size = 1;
|
||||
size_t token_length;
|
||||
|
||||
g_return_val_if_fail(string != NULL, NULL);
|
||||
g_return_val_if_fail(delimiter != NULL, NULL);
|
||||
g_return_val_if_fail(delimiter[0] != 0, NULL);
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
g_return_val_if_fail (delimiter != NULL, NULL);
|
||||
g_return_val_if_fail (delimiter[0] != 0, NULL);
|
||||
|
||||
if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
|
||||
vector = (gchar **)g_malloc (2 * sizeof(vector));
|
||||
vector[0] = g_strdup ("");
|
||||
token_length = strlen(string);
|
||||
string_c = (gchar *)g_malloc(token_length + 1);
|
||||
memcpy(string_c, string, token_length);
|
||||
string_c[token_length] = 0;
|
||||
|
||||
if (strncmp (string_c, delimiter, strlen (delimiter)) == 0){
|
||||
vector = (gchar **) g_malloc (2 * sizeof (vector));
|
||||
vector [0] = g_strdup ("");
|
||||
size++;
|
||||
string += strlen (delimiter);
|
||||
} else {
|
||||
} else
|
||||
vector = NULL;
|
||||
}
|
||||
token = (gchar *)strtok_r(string_c, delimiter, &strtok_save);
|
||||
|
||||
while (*string && !(max_tokens > 0 && size >= max_tokens)) {
|
||||
c = string;
|
||||
if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
|
||||
token = g_strdup ("");
|
||||
string += strlen (delimiter);
|
||||
} else {
|
||||
while (*string && strncmp (string, delimiter, strlen (delimiter)) != 0) {
|
||||
string++;
|
||||
}
|
||||
|
||||
if (*string) {
|
||||
int toklen = (string - c);
|
||||
token = g_strndup (c, toklen);
|
||||
|
||||
/* Need to leave a trailing empty
|
||||
* token if the delimiter is the last
|
||||
* part of the string
|
||||
*/
|
||||
if (strcmp (string, delimiter) != 0) {
|
||||
string += strlen (delimiter);
|
||||
if (!(max_tokens > 0 && size >= max_tokens)){
|
||||
while(token != NULL) {
|
||||
token_length = strlen(token);
|
||||
token_c = (gchar *)g_malloc(token_length + 1);
|
||||
memcpy(token_c, token, token_length);
|
||||
token_c[token_length] = 0;
|
||||
|
||||
vector = vector == NULL ?
|
||||
(gchar **)g_malloc(2 * sizeof(vector)) :
|
||||
(gchar **)g_realloc(vector, (size + 1) * sizeof(vector));
|
||||
|
||||
vector[size - 1] = token_c;
|
||||
size++;
|
||||
|
||||
if(max_tokens > 0 && size >= max_tokens) {
|
||||
if(size > max_tokens) {
|
||||
break;
|
||||
}
|
||||
|
||||
token = *strtok_save ? strtok_save : NULL;
|
||||
} else {
|
||||
token = g_strdup (c);
|
||||
token = (gchar *)strtok_r(NULL, delimiter, &strtok_save);
|
||||
}
|
||||
}
|
||||
|
||||
add_to_vector (&vector, size, token);
|
||||
size++;
|
||||
}
|
||||
|
||||
if (*string) {
|
||||
/* Add the rest of the string as the last element */
|
||||
add_to_vector (&vector, size, g_strdup (string));
|
||||
size++;
|
||||
}
|
||||
|
||||
if (vector == NULL) {
|
||||
if (vector == NULL){
|
||||
vector = (gchar **) g_malloc (2 * sizeof (vector));
|
||||
vector [0] = NULL;
|
||||
} else if (size > 0) {
|
||||
} else if (size > 0){
|
||||
vector[size - 1] = NULL;
|
||||
}
|
||||
|
||||
return vector;
|
||||
}
|
||||
g_free(string_c);
|
||||
string_c = NULL;
|
||||
|
||||
static gboolean
|
||||
charcmp (gchar testchar, const gchar *compare)
|
||||
{
|
||||
while(*compare) {
|
||||
if (*compare == testchar) {
|
||||
return TRUE;
|
||||
}
|
||||
compare++;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gchar **
|
||||
g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens)
|
||||
{
|
||||
const gchar *c;
|
||||
gchar *token, **vector;
|
||||
gint size = 1;
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
g_return_val_if_fail (delimiter != NULL, NULL);
|
||||
g_return_val_if_fail (delimiter[0] != 0, NULL);
|
||||
|
||||
if (charcmp (*string, delimiter)) {
|
||||
vector = (gchar **)g_malloc (2 * sizeof(vector));
|
||||
vector[0] = g_strdup ("");
|
||||
size++;
|
||||
string++;
|
||||
} else {
|
||||
vector = NULL;
|
||||
}
|
||||
|
||||
c = string;
|
||||
while (*string && !(max_tokens > 0 && size >= max_tokens)) {
|
||||
if (charcmp (*string, delimiter)) {
|
||||
int toklen = (string - c);
|
||||
if (toklen == 0) {
|
||||
token = g_strdup ("");
|
||||
} else {
|
||||
token = g_strndup (c, toklen);
|
||||
}
|
||||
|
||||
c = string + 1;
|
||||
|
||||
add_to_vector (&vector, size, token);
|
||||
size++;
|
||||
}
|
||||
|
||||
string++;
|
||||
}
|
||||
|
||||
if (max_tokens > 0 && size >= max_tokens) {
|
||||
if (*string) {
|
||||
/* Add the rest of the string as the last element */
|
||||
add_to_vector (&vector, size, g_strdup (string));
|
||||
size++;
|
||||
}
|
||||
} else {
|
||||
if (*c) {
|
||||
/* Fill in the trailing last token */
|
||||
add_to_vector (&vector, size, g_strdup (c));
|
||||
size++;
|
||||
} else {
|
||||
/* Need to leave a trailing empty token if the
|
||||
* delimiter is the last part of the string
|
||||
*/
|
||||
add_to_vector (&vector, size, g_strdup (""));
|
||||
size++;
|
||||
}
|
||||
}
|
||||
|
||||
if (vector == NULL) {
|
||||
vector = (gchar **) g_malloc (2 * sizeof (vector));
|
||||
vector [0] = NULL;
|
||||
} else if (size > 0) {
|
||||
vector[size - 1] = NULL;
|
||||
}
|
||||
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,66 +3,6 @@
|
||||
#include <glib.h>
|
||||
#include "test.h"
|
||||
|
||||
|
||||
RESULT
|
||||
test_slist_nth ()
|
||||
{
|
||||
char *foo = "foo";
|
||||
char *bar = "bar";
|
||||
char *baz = "baz";
|
||||
GSList *nth, *list;
|
||||
list = g_slist_prepend (NULL, baz);
|
||||
list = g_slist_prepend (list, bar);
|
||||
list = g_slist_prepend (list, foo);
|
||||
|
||||
nth = g_slist_nth (list, 0);
|
||||
if (nth->data != foo)
|
||||
return FAILED ("nth failed. #0");
|
||||
|
||||
nth = g_slist_nth (list, 1);
|
||||
if (nth->data != bar)
|
||||
return FAILED ("nth failed. #1");
|
||||
|
||||
nth = g_slist_nth (list, 2);
|
||||
if (nth->data != baz)
|
||||
return FAILED ("nth failed. #2");
|
||||
|
||||
nth = g_slist_nth (list, 3);
|
||||
if (nth)
|
||||
return FAILED ("nth failed. #3: %s", nth->data);
|
||||
|
||||
g_slist_free (list);
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_slist_index ()
|
||||
{
|
||||
int i;
|
||||
char *foo = "foo";
|
||||
char *bar = "bar";
|
||||
char *baz = "baz";
|
||||
GSList *list;
|
||||
list = g_slist_prepend (NULL, baz);
|
||||
list = g_slist_prepend (list, bar);
|
||||
list = g_slist_prepend (list, foo);
|
||||
|
||||
i = g_slist_index (list, foo);
|
||||
if (i != 0)
|
||||
return FAILED ("index failed. #0: %d", i);
|
||||
|
||||
i = g_slist_index (list, bar);
|
||||
if (i != 1)
|
||||
return FAILED ("index failed. #1: %d", i);
|
||||
|
||||
i = g_slist_index (list, baz);
|
||||
if (i != 2)
|
||||
return FAILED ("index failed. #2: %d", i);
|
||||
|
||||
g_slist_free (list);
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_slist_append ()
|
||||
{
|
||||
@@ -299,8 +239,6 @@ test_slist_sort ()
|
||||
}
|
||||
|
||||
static Test slist_tests [] = {
|
||||
{"nth", test_slist_nth},
|
||||
{"index", test_slist_index},
|
||||
{"append", test_slist_append},
|
||||
{"concat", test_slist_concat},
|
||||
{"find", test_slist_find},
|
||||
|
||||
@@ -90,206 +90,6 @@ test_split ()
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 4);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 0");
|
||||
|
||||
if (strcmp (v [1], "defXghi") != 0)
|
||||
return FAILED ("Invalid value 1");
|
||||
|
||||
if (strcmp (v [2], "jklYmno") != 0)
|
||||
return FAILED ("Invalid value 2");
|
||||
|
||||
if (v [3] != NULL)
|
||||
return FAILED ("Expected only 3 elements (1)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 2);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 3");
|
||||
|
||||
if (strcmp (v [1], "defXghiXYjklYmno") != 0)
|
||||
return FAILED ("Invalid value 4");
|
||||
|
||||
if (v [2] != NULL)
|
||||
return FAILED ("Expected only 2 elements (2)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit ("abcXYdefXghiXYjklYmnoXY", "XY", 3);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 5");
|
||||
|
||||
if (strcmp (v [1], "defXghi") != 0)
|
||||
return FAILED ("Invalid value 6");
|
||||
|
||||
if (strcmp (v [2], "jklYmnoXY") != 0)
|
||||
return FAILED ("Invalid value 7");
|
||||
|
||||
if (v [3] != NULL)
|
||||
return FAILED ("Expected only 3 elements (3)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit ("abcXYXYXYdefXY", "XY", -1);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 8");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 9");
|
||||
|
||||
if (strcmp (v [2], "") != 0)
|
||||
return FAILED ("Invalid value 10");
|
||||
|
||||
if (strcmp (v [3], "def") != 0)
|
||||
return FAILED ("Invalid value 11");
|
||||
|
||||
if (strcmp (v [4], "") != 0)
|
||||
return FAILED ("Invalid value 12");
|
||||
|
||||
if (v [5] != NULL)
|
||||
return FAILED ("Expected only 5 elements (4)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit ("XYXYXYabcXYdef", "XY", -1);
|
||||
if (strcmp (v [0], "") != 0)
|
||||
return FAILED ("Invalid value 13");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 14");
|
||||
|
||||
if (strcmp (v [2], "") != 0)
|
||||
return FAILED ("Invalid value 15");
|
||||
|
||||
if (strcmp (v [3], "abc") != 0)
|
||||
return FAILED ("Invalid value 16");
|
||||
|
||||
if (strcmp (v [4], "def") != 0)
|
||||
return FAILED ("Invalid value 17");
|
||||
|
||||
if (v [5] != NULL)
|
||||
return FAILED ("Expected only 5 elements (5)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_split_set ()
|
||||
{
|
||||
gchar **v;
|
||||
|
||||
v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 6);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 0");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 1");
|
||||
|
||||
if (strcmp (v [2], "def") != 0)
|
||||
return FAILED ("Invalid value 2");
|
||||
|
||||
if (strcmp (v [3], "ghi") != 0)
|
||||
return FAILED ("Invalid value 3");
|
||||
|
||||
if (strcmp (v [4], "") != 0)
|
||||
return FAILED ("Invalid value 4");
|
||||
|
||||
if (strcmp (v [5], "jklYmno") != 0)
|
||||
return FAILED ("Invalid value 5");
|
||||
|
||||
if (v [6] != NULL)
|
||||
return FAILED ("Expected only 6 elements (1)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 3);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 6");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 7");
|
||||
|
||||
if (strcmp (v [2], "defXghiXYjklYmno") != 0)
|
||||
return FAILED ("Invalid value 8");
|
||||
|
||||
if (v [3] != NULL)
|
||||
return FAILED ("Expected only 3 elements (2)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit_set ("abcXdefYghiXjklYmnoX", "XY", 5);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 9");
|
||||
|
||||
if (strcmp (v [1], "def") != 0)
|
||||
return FAILED ("Invalid value 10");
|
||||
|
||||
if (strcmp (v [2], "ghi") != 0)
|
||||
return FAILED ("Invalid value 11");
|
||||
|
||||
if (strcmp (v [3], "jkl") != 0)
|
||||
return FAILED ("Invalid value 12");
|
||||
|
||||
if (strcmp (v [4], "mnoX") != 0)
|
||||
return FAILED ("Invalid value 13");
|
||||
|
||||
if (v [5] != NULL)
|
||||
return FAILED ("Expected only 5 elements (5)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit_set ("abcXYXdefXY", "XY", -1);
|
||||
if (strcmp (v [0], "abc") != 0)
|
||||
return FAILED ("Invalid value 14");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 15");
|
||||
|
||||
if (strcmp (v [2], "") != 0)
|
||||
return FAILED ("Invalid value 16");
|
||||
|
||||
if (strcmp (v [3], "def") != 0)
|
||||
return FAILED ("Invalid value 17");
|
||||
|
||||
if (strcmp (v [4], "") != 0)
|
||||
return FAILED ("Invalid value 18");
|
||||
|
||||
if (strcmp (v [5], "") != 0)
|
||||
return FAILED ("Invalid value 19");
|
||||
|
||||
if (v [6] != NULL)
|
||||
return FAILED ("Expected only 6 elements (4)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
v = g_strsplit_set ("XYXabcXYdef", "XY", -1);
|
||||
if (strcmp (v [0], "") != 0)
|
||||
return FAILED ("Invalid value 20");
|
||||
|
||||
if (strcmp (v [1], "") != 0)
|
||||
return FAILED ("Invalid value 21");
|
||||
|
||||
if (strcmp (v [2], "") != 0)
|
||||
return FAILED ("Invalid value 22");
|
||||
|
||||
if (strcmp (v [3], "abc") != 0)
|
||||
return FAILED ("Invalid value 23");
|
||||
|
||||
if (strcmp (v [4], "") != 0)
|
||||
return FAILED ("Invalid value 24");
|
||||
|
||||
if (strcmp (v [5], "def") != 0)
|
||||
return FAILED ("Invalid value 25");
|
||||
|
||||
if (v [6] != NULL)
|
||||
return FAILED ("Expected only 6 elements (5)");
|
||||
|
||||
g_strfreev (v);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -625,7 +425,6 @@ static Test strutil_tests [] = {
|
||||
{"g_strfreev", test_strfreev},
|
||||
{"g_strconcat", test_concat},
|
||||
{"g_strsplit", test_split},
|
||||
{"g_strsplit_set", test_split_set},
|
||||
{"g_strreverse", test_strreverse},
|
||||
{"g_strjoin", test_strjoin},
|
||||
{"g_strchug", test_strchug},
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2007-12-07 Mark Probst <[email protected]>
|
||||
|
||||
* mono.1: Added a short paragraph on the MONO_GENERIC_SHARING
|
||||
environment variable.
|
||||
|
||||
2007-11-21 Marek Habersack <[email protected]>
|
||||
|
||||
* mconfig.1: modify to reflect parameter changes in mconfig.
|
||||
|
||||
2007-10-23 Marek Habersack <[email protected]>
|
||||
|
||||
* mconfig.1: added
|
||||
|
||||
+3
-8
@@ -8,6 +8,9 @@ mconfig can be used to edit .NET configuration files, by adding "features"
|
||||
(that is sets of xml statements) defined in one of the config files read
|
||||
by mconfig. The config file can also define layouts of default configuration
|
||||
files, which may be useful for bootstrapping your .NET projects.
|
||||
|
||||
To see the list of recognized commands, default configuration files and features, run
|
||||
mconfig without passing any parameters.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -c <config_file>, --config=<config_file>
|
||||
@@ -21,14 +24,6 @@ can be assigned to one of the three targets - \fIweb\fR (for ASP.NET features/co
|
||||
\fIapplication\fR - for .NET applications, \fIany\fR - applicable in both of the previous
|
||||
targets. Defaults to \fIany\fR.
|
||||
.TP
|
||||
.B -C, --list-configs
|
||||
List all the default configuration file names that are defined in the mconfig
|
||||
configuration files.
|
||||
.TP
|
||||
.B -F, --list-features
|
||||
List all the features that are defined in the mconfig configuration files and
|
||||
which can be added to your existing (or new) .NET configuration files.
|
||||
.TP
|
||||
.B -?, -h, --help
|
||||
Show a summary usage screen.
|
||||
.TP
|
||||
|
||||
+11
-17
@@ -88,11 +88,6 @@ code sharing across multiple mono processes and avoid just-in-time
|
||||
compilation program startup costs. The original assembly must still
|
||||
be present, as the metadata is contained there.
|
||||
.Sp
|
||||
AOT code typically can not be moved from one computer to another
|
||||
(CPU-specific optimizations that are detected at runtime) so you
|
||||
should not try to move the pre-generated assemblies or package the
|
||||
pre-generated assemblies for deployment.
|
||||
.Sp
|
||||
For more information about AOT, see: http://www.mono-project.com/AOT
|
||||
.TP
|
||||
.I "--config filename"
|
||||
@@ -115,10 +110,6 @@ MODE is a comma separated list of optimizations. They also allow
|
||||
optimizations to be turned off by prefixing the optimization name with
|
||||
a minus sign.
|
||||
.Sp
|
||||
In general, Mono has been tuned to use the default set of flags,
|
||||
before using these flags for a deployment setting, you might want to
|
||||
actually measure the benefits of using them.
|
||||
.Sp
|
||||
The following optimizations are implemented:
|
||||
.nf
|
||||
all Turn on all optimizations
|
||||
@@ -130,19 +121,19 @@ The following optimizations are implemented:
|
||||
copyprop Copy propagation
|
||||
deadce Dead code elimination
|
||||
linears Linear scan global reg allocation
|
||||
cmov Conditional moves [arch-dependency]
|
||||
cmov Conditional moves
|
||||
shared Emit per-domain code
|
||||
sched Instruction scheduling
|
||||
intrins Intrinsic method implementations
|
||||
tailc Tail recursion and tail calls
|
||||
loop Loop related optimizations
|
||||
fcmov Fast x86 FP compares [arch-dependency]
|
||||
fcmov Fast x86 FP compares
|
||||
leaf Leaf procedures optimizations
|
||||
aot Usage of Ahead Of Time compiled code
|
||||
precomp Precompile all methods before executing Main
|
||||
abcrem Array bound checks removal
|
||||
ssapre SSA based Partial Redundancy Elimination
|
||||
sse2 SSE2 instructions on x86 [arch-dependency]
|
||||
sse2 SSE2 instructions on x86
|
||||
.fi
|
||||
.Sp
|
||||
For example, to enable all the optimization but dead code
|
||||
@@ -150,11 +141,6 @@ elimination and inlining, you can use:
|
||||
.nf
|
||||
-O=all,-deadce,-inline
|
||||
.fi
|
||||
.Sp
|
||||
The flags that are flagged with [arch-dependency] indicate that the
|
||||
given option if used in combination with Ahead of Time compilation
|
||||
(--aot flag) would produce pre-compiled code that will depend on the
|
||||
current CPU and might not be safely moved to another computer.
|
||||
.TP
|
||||
.I "--runtime=VERSION"
|
||||
Mono supports different runtime versions. The version used depends on the program
|
||||
@@ -921,6 +907,14 @@ with the X11 backend. This is used to debug problems in Windows.Forms
|
||||
as it forces all of the commands send to X11 server to be done
|
||||
synchronously. The default mode of operation is asynchronous which
|
||||
makes it hard to isolate the root of certain problems.
|
||||
.TP
|
||||
.I "MONO_GENERIC_SHARING"
|
||||
This environment variable is completely unsupported, don't use it.
|
||||
This controls for which classes to enable generic code sharing in
|
||||
principle. Permissible values are "all", "corlib" and "none". The
|
||||
default is "none", meaning that sharing can only happen for corlib
|
||||
classes. Note that to enable generation of shared code the "gshared"
|
||||
compiler option has to be set as well.
|
||||
.SH VALGRIND
|
||||
If you want to use Valgrind, you will find the file `mono.supp'
|
||||
useful, it contains the suppressions for the GC which trigger
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2007-11-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile: In 2.0 System.EnterpriseServices.dll depends on
|
||||
System.Transactions.dll.
|
||||
|
||||
2007-10-09 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile: In 2.0 System.Design.dll has cyclic dep on
|
||||
|
||||
+1
-1
@@ -41,12 +41,12 @@ common_dirs := \
|
||||
System.XML \
|
||||
I18N \
|
||||
System.Drawing \
|
||||
System.Transactions \
|
||||
System.EnterpriseServices \
|
||||
Mono.C5 \
|
||||
Mono.Data.Tds \
|
||||
Mono.Cecil \
|
||||
Mono.Cecil.Mdb \
|
||||
System.Transactions \
|
||||
System.Data \
|
||||
Mono.Data \
|
||||
Mono.GetOptions \
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2007-11-15 Geoff Norton <[email protected]>
|
||||
|
||||
* System.Windows.Forms.dll.sources: Reflect the changes for the new OSX->Carbon
|
||||
refactoring.
|
||||
|
||||
2007-10-23 Geoff Norton <[email protected]>
|
||||
|
||||
* System.Windows.Forms.dll.sources: Added OSXKeyboard.cs
|
||||
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class ApplicationHandler : EventHandlerBase, IEventHandler {
|
||||
internal const uint kEventAppActivated = 1;
|
||||
internal const uint kEventAppDeactivated = 2;
|
||||
internal const uint kEventAppQuit = 3;
|
||||
internal const uint kEventAppLaunchNotification = 4;
|
||||
internal const uint kEventAppLaunched = 5;
|
||||
internal const uint kEventAppTerminated = 6;
|
||||
internal const uint kEventAppFrontSwitched = 7;
|
||||
internal const uint kEventAppFocusMenuBar = 8;
|
||||
internal const uint kEventAppFocusNextDocumentWindow = 9;
|
||||
internal const uint kEventAppFocusNextFloatingWindow = 10;
|
||||
internal const uint kEventAppFocusToolbar = 11;
|
||||
internal const uint kEventAppFocusDrawer = 12;
|
||||
internal const uint kEventAppGetDockTileMenu = 20;
|
||||
internal const uint kEventAppIsEventInInstantMouser = 104;
|
||||
internal const uint kEventAppHidden = 107;
|
||||
internal const uint kEventAppShown = 108;
|
||||
internal const uint kEventAppSystemUIModeChanged = 109;
|
||||
internal const uint kEventAppAvailableWindowBoundsChanged = 110;
|
||||
internal const uint kEventAppActiveWindowChanged = 111;
|
||||
|
||||
internal ApplicationHandler (XplatUICarbon driver) : base (driver) {}
|
||||
|
||||
public bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg) {
|
||||
switch (kind) {
|
||||
case kEventAppDeactivated: {
|
||||
if (XplatUICarbon.FocusWindow != IntPtr.Zero) {
|
||||
Driver.SendMessage (XplatUICarbon.FocusWindow, Msg.WM_KILLFOCUS, IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
if (XplatUICarbon.GrabHwnd != null) {
|
||||
Driver.SendMessage (XplatUICarbon.GrabHwnd.Handle, Msg.WM_LBUTTONDOWN, (IntPtr)MsgButtons.MK_LBUTTON, (IntPtr) (Driver.MousePosition.X << 16 | Driver.MousePosition.Y));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
2007-11-15 Geoff Norton <[email protected]>
|
||||
|
||||
* EventHandler.cs: The new event handler dispatcher for the Carbon port.
|
||||
Every event is dispatched thru this class and directed to the appropriate
|
||||
event type handler.
|
||||
* ApplicationHandler.cs: Handles the application level events AppActivated
|
||||
and AppDeactivated. We hook these to remove overlay windows when the application
|
||||
looses focus.
|
||||
* ControlHandler.cs: Handles the control level events Click, Track, Draw and BoundsChanged.
|
||||
Translates these events to their WndProc equivalents and routes them to the appropriate
|
||||
Control.
|
||||
* KeyboardHandler.cs: Handles the keyboard level events KeyDown, KeyUp, KeyRepeat, KeyModifiersChanged
|
||||
translated them to the WndProc message and routes it to the keyboard focus control.
|
||||
* MouseHandler.cs: Handles the global mouse events and sends the appropriate WM_MOUSEMOVE to the
|
||||
control affected.
|
||||
* WindowHandler.cs: Handles the window level events BoundsChanged and Close and resizes the Hwnds
|
||||
or destroys them accordingly.
|
||||
* EventHandlerBase.cs: Base class for all the EventHandlers.
|
||||
* IEventHandler.cs: Interface declaring the methods needed for all EventHandlers.
|
||||
* Enums.cs: Contains needed enums for the Carbon port.
|
||||
* Structs.cs: Contains all the needed structs for the Carbon port.
|
||||
-342
@@ -1,342 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class ControlHandler : EventHandlerBase, IEventHandler {
|
||||
internal const uint kEventControlInitialize = 1000;
|
||||
internal const uint kEventControlDispose = 1001;
|
||||
internal const uint kEventControlGetOptimalBounds = 1003;
|
||||
internal const uint kEventControlDefInitialize = kEventControlInitialize;
|
||||
internal const uint kEventControlDefDispose = kEventControlDispose;
|
||||
internal const uint kEventControlHit = 1;
|
||||
internal const uint kEventControlSimulateHit = 2;
|
||||
internal const uint kEventControlHitTest = 3;
|
||||
internal const uint kEventControlDraw = 4;
|
||||
internal const uint kEventControlApplyBackground = 5;
|
||||
internal const uint kEventControlApplyTextColor = 6;
|
||||
internal const uint kEventControlSetFocusPart = 7;
|
||||
internal const uint kEventControlGetFocusPart = 8;
|
||||
internal const uint kEventControlActivate = 9;
|
||||
internal const uint kEventControlDeactivate = 10;
|
||||
internal const uint kEventControlSetCursor = 11;
|
||||
internal const uint kEventControlContextualMenuClick = 12;
|
||||
internal const uint kEventControlClick = 13;
|
||||
internal const uint kEventControlGetNextFocusCandidate = 14;
|
||||
internal const uint kEventControlGetAutoToggleValue = 15;
|
||||
internal const uint kEventControlInterceptSubviewClick = 16;
|
||||
internal const uint kEventControlGetClickActivation = 17;
|
||||
internal const uint kEventControlDragEnter = 18;
|
||||
internal const uint kEventControlDragWithin = 19;
|
||||
internal const uint kEventControlDragLeave = 20;
|
||||
internal const uint kEventControlDragReceive = 21;
|
||||
internal const uint kEventControlInvalidateForSizeChange = 22;
|
||||
internal const uint kEventControlTrackingAreaEntered = 23;
|
||||
internal const uint kEventControlTrackingAreaExited = 24;
|
||||
internal const uint kEventControlTrack = 51;
|
||||
internal const uint kEventControlGetScrollToHereStartPoint = 52;
|
||||
internal const uint kEventControlGetIndicatorDragConstraint = 53;
|
||||
internal const uint kEventControlIndicatorMoved = 54;
|
||||
internal const uint kEventControlGhostingFinished = 55;
|
||||
internal const uint kEventControlGetActionProcPart = 56;
|
||||
internal const uint kEventControlGetPartRegion = 101;
|
||||
internal const uint kEventControlGetPartBounds = 102;
|
||||
internal const uint kEventControlSetData = 103;
|
||||
internal const uint kEventControlGetData = 104;
|
||||
internal const uint kEventControlGetSizeConstraints= 105;
|
||||
internal const uint kEventControlGetFrameMetrics = 106;
|
||||
internal const uint kEventControlValueFieldChanged = 151;
|
||||
internal const uint kEventControlAddedSubControl = 152;
|
||||
internal const uint kEventControlRemovingSubControl = 153;
|
||||
internal const uint kEventControlBoundsChanged = 154;
|
||||
internal const uint kEventControlVisibilityChanged = 157;
|
||||
internal const uint kEventControlTitleChanged = 158;
|
||||
internal const uint kEventControlOwningWindowChanged = 159;
|
||||
internal const uint kEventControlHiliteChanged = 160;
|
||||
internal const uint kEventControlEnabledStateChanged = 161;
|
||||
internal const uint kEventControlLayoutInfoChanged = 162;
|
||||
internal const uint kEventControlArbitraryMessage = 201;
|
||||
|
||||
internal const uint kEventParamCGContextRef = 1668183160;
|
||||
internal const uint kEventParamDirectObject = 757935405;
|
||||
internal const uint kEventParamMouseButton = 1835168878;
|
||||
internal const uint kEventParamMouseLocation = 1835822947;
|
||||
internal const uint typeControlRef = 1668575852;
|
||||
internal const uint typeCGContextRef = 1668183160;
|
||||
internal const uint typeMouseButton = 1835168878;
|
||||
internal const uint typeQDPoint = 1363439732;
|
||||
|
||||
internal ControlHandler (XplatUICarbon driver) : base (driver) {}
|
||||
|
||||
public bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg) {
|
||||
Hwnd hwnd;
|
||||
bool client;
|
||||
|
||||
GetEventParameter (eventref, kEventParamDirectObject, typeControlRef, IntPtr.Zero, (uint) Marshal.SizeOf (typeof (IntPtr)), IntPtr.Zero, ref handle);
|
||||
hwnd = Hwnd.ObjectFromHandle (handle);
|
||||
|
||||
if (hwnd == null)
|
||||
return false;
|
||||
|
||||
msg.hwnd = hwnd.Handle;
|
||||
client = (hwnd.ClientWindow == handle ? true : false);
|
||||
|
||||
switch (kind) {
|
||||
case kEventControlDraw: {
|
||||
HIRect view_bounds = new HIRect ();
|
||||
|
||||
HIViewGetBounds (handle, ref view_bounds);
|
||||
Driver.AddExpose (hwnd, client, view_bounds);
|
||||
DrawBackground (hwnd, eventref, view_bounds);
|
||||
if (!client)
|
||||
DrawBorders (hwnd);
|
||||
|
||||
break;
|
||||
}
|
||||
case kEventControlBoundsChanged: {
|
||||
HIRect view_frame = new HIRect ();
|
||||
|
||||
HIViewGetFrame (handle, ref view_frame);
|
||||
if (!client) {
|
||||
hwnd.X = (int) view_frame.origin.x;
|
||||
hwnd.Y = (int) view_frame.origin.y;
|
||||
hwnd.Width = (int) view_frame.size.width;
|
||||
hwnd.Height = (int) view_frame.size.height;
|
||||
Driver.PerformNCCalc (hwnd);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case kEventControlClick: {
|
||||
QDPoint point = new QDPoint ();
|
||||
ushort button = 0;
|
||||
|
||||
if (XplatUICarbon.GrabHwnd != null) {
|
||||
hwnd = XplatUICarbon.GrabHwnd;
|
||||
msg.hwnd = hwnd.Handle;
|
||||
client = true;
|
||||
}
|
||||
|
||||
GetEventParameter (eventref, kEventParamMouseLocation, typeQDPoint, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (QDPoint)), IntPtr.Zero, ref point);
|
||||
GetEventParameter (eventref, kEventParamMouseButton, typeMouseButton, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (ushort)), IntPtr.Zero, ref button);
|
||||
|
||||
Driver.ScreenToClient (hwnd.Handle, ref point);
|
||||
|
||||
msg.wParam = ButtonTowParam (button);
|
||||
msg.lParam = (IntPtr) ((ushort) point.y << 16 | (ushort) point.x);
|
||||
msg.message = (client ? Msg.WM_MOUSEMOVE : Msg.WM_NCMOUSEMOVE) + ((button - 1) * 3) + 1;
|
||||
|
||||
Driver.mouse_position.X = (int) point.x;
|
||||
Driver.mouse_position.Y = (int) point.y;
|
||||
|
||||
NativeWindow.WndProc (msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
|
||||
HandleControlClick (handle, point, 0, IntPtr.Zero);
|
||||
break;
|
||||
}
|
||||
case kEventControlTrack: {
|
||||
QDPoint point = new QDPoint ();
|
||||
MouseTrackingResult mousestatus = MouseTrackingResult.kMouseTrackingMouseDown;
|
||||
|
||||
if (XplatUICarbon.GrabHwnd != null) {
|
||||
hwnd = XplatUICarbon.GrabHwnd;
|
||||
client = true;
|
||||
msg.hwnd = hwnd.Handle;
|
||||
}
|
||||
|
||||
GetEventParameter (eventref, kEventParamMouseLocation, typeQDPoint, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (QDPoint)), IntPtr.Zero, ref point);
|
||||
|
||||
while (mousestatus != MouseTrackingResult.kMouseTrackingMouseUp) {
|
||||
uint modifiers = 0;
|
||||
|
||||
if (mousestatus == MouseTrackingResult.kMouseTrackingMouseDragged) {
|
||||
Driver.ScreenToClient (hwnd.Handle, ref point);
|
||||
NativeWindow.WndProc (hwnd.Handle, (client ? Msg.WM_MOUSEMOVE : Msg.WM_NCMOUSEMOVE), Driver.GetMousewParam (0), (IntPtr) ((ushort) point.y << 16 | (ushort) point.x));
|
||||
}
|
||||
Driver.FlushQueue ();
|
||||
|
||||
TrackMouseLocationWithOptions (IntPtr.Zero, 0, 0.01, ref point, ref modifiers, ref mousestatus);
|
||||
}
|
||||
Driver.ScreenToClient (hwnd.Handle, ref point);
|
||||
|
||||
msg.message = (client ? Msg.WM_MOUSEMOVE : Msg.WM_NCMOUSEMOVE) + ((StateToButton (XplatUICarbon.MouseState) - 1) * 3) + 2;
|
||||
msg.wParam = StateTowParam (XplatUICarbon.MouseState);
|
||||
msg.lParam = (IntPtr) ((ushort) point.y << 16 | (ushort) point.x);
|
||||
|
||||
Driver.mouse_position.X = (int) point.x;
|
||||
Driver.mouse_position.Y = (int) point.y;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int StateToButton (MouseButtons state) {
|
||||
int button = 0;
|
||||
|
||||
switch (state) {
|
||||
case MouseButtons.Left:
|
||||
button = 1;
|
||||
break;
|
||||
case MouseButtons.Right:
|
||||
button = 2;
|
||||
break;
|
||||
case MouseButtons.Middle:
|
||||
button = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
private IntPtr StateTowParam (MouseButtons state) {
|
||||
int wparam = (int) Driver.GetMousewParam (0);
|
||||
|
||||
switch (state) {
|
||||
case MouseButtons.Left:
|
||||
XplatUICarbon.MouseState &= ~MouseButtons.Left;
|
||||
wparam &= (int)MsgButtons.MK_LBUTTON;
|
||||
break;
|
||||
case MouseButtons.Right:
|
||||
XplatUICarbon.MouseState &= ~MouseButtons.Right;
|
||||
wparam &= (int)MsgButtons.MK_RBUTTON;
|
||||
break;
|
||||
case MouseButtons.Middle:
|
||||
XplatUICarbon.MouseState &= ~MouseButtons.Middle;
|
||||
wparam &= (int)MsgButtons.MK_MBUTTON;
|
||||
break;
|
||||
}
|
||||
|
||||
return (IntPtr) wparam;
|
||||
}
|
||||
|
||||
private IntPtr ButtonTowParam (ushort button) {
|
||||
int wparam = (int) Driver.GetMousewParam (0);
|
||||
|
||||
switch (button) {
|
||||
case 1:
|
||||
XplatUICarbon.MouseState |= MouseButtons.Left;
|
||||
wparam |= (int)MsgButtons.MK_LBUTTON;
|
||||
break;
|
||||
case 2:
|
||||
XplatUICarbon.MouseState |= MouseButtons.Right;
|
||||
wparam |= (int)MsgButtons.MK_RBUTTON;
|
||||
break;
|
||||
case 3:
|
||||
XplatUICarbon.MouseState |= MouseButtons.Middle;
|
||||
wparam |= (int)MsgButtons.MK_MBUTTON;
|
||||
break;
|
||||
}
|
||||
|
||||
return (IntPtr) wparam;
|
||||
}
|
||||
|
||||
private void DrawBackground (Hwnd hwnd, IntPtr eventref, HIRect bounds) {
|
||||
if (XplatUICarbon.WindowBackgrounds [hwnd] != null) {
|
||||
IntPtr context = IntPtr.Zero;
|
||||
Color color = (Color) XplatUICarbon.WindowBackgrounds [hwnd];
|
||||
|
||||
GetEventParameter (eventref, kEventParamCGContextRef, typeCGContextRef, IntPtr.Zero, (uint) Marshal.SizeOf (typeof (IntPtr)), IntPtr.Zero, ref context);
|
||||
|
||||
CGContextSetRGBFillColor (context, (float) color.R / 255, (float) color.G / 255, (float) color.B / 255, (float) color.A / 255);
|
||||
CGContextFillRect (context, bounds);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawBorders (Hwnd hwnd) {
|
||||
switch (hwnd.border_style) {
|
||||
case FormBorderStyle.Fixed3D: {
|
||||
Graphics g;
|
||||
|
||||
g = Graphics.FromHwnd(hwnd.whole_window);
|
||||
if (hwnd.border_static)
|
||||
ControlPaint.DrawBorder3D(g, new Rectangle(0, 0, hwnd.Width, hwnd.Height), Border3DStyle.SunkenOuter);
|
||||
else
|
||||
ControlPaint.DrawBorder3D(g, new Rectangle(0, 0, hwnd.Width, hwnd.Height), Border3DStyle.Sunken);
|
||||
g.Dispose();
|
||||
break;
|
||||
}
|
||||
|
||||
case FormBorderStyle.FixedSingle: {
|
||||
Graphics g;
|
||||
|
||||
g = Graphics.FromHwnd(hwnd.whole_window);
|
||||
ControlPaint.DrawBorder(g, new Rectangle(0, 0, hwnd.Width, hwnd.Height), Color.Black, ButtonBorderStyle.Solid);
|
||||
g.Dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
case Constants.kEventControlSetFocusPart: {
|
||||
// This handles setting focus
|
||||
short pcode = 1;
|
||||
GetEventParameter (inEvent, Constants.EventParamName.kEventParamControlPart, Constants.EventParamType.typeControlPartCode, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (short)), IntPtr.Zero, ref pcode);
|
||||
switch (pcode) {
|
||||
case 0:
|
||||
case -1:
|
||||
case -2:
|
||||
pcode = 0;
|
||||
break;
|
||||
}
|
||||
SetEventParameter (inEvent, Constants.EventParamName.kEventParamControlPart, Constants.EventParamType.typeControlPartCode, (uint)Marshal.SizeOf (typeof (short)), ref pcode);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -9874;
|
||||
}
|
||||
*/
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref IntPtr data);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref ushort data);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref QDPoint data);
|
||||
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int HIViewGetBounds (IntPtr handle, ref HIRect rect);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int HIViewGetFrame (IntPtr handle, ref HIRect rect);
|
||||
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern void HandleControlClick (IntPtr handle, QDPoint point, uint modifiers, IntPtr callback);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern void TrackMouseLocationWithOptions (IntPtr port, int options, double eventtimeout, ref QDPoint point, ref uint modifier, ref MouseTrackingResult status);
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int CGContextSetRGBFillColor (IntPtr cgContext, float r, float g, float b, float alpha);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int CGContextFillRect (IntPtr context, HIRect rect);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software",, to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal enum EventParamName : uint {
|
||||
kEventParamControlPart = 1668313716,
|
||||
}
|
||||
|
||||
internal enum EventParamType : uint {
|
||||
typeControlPartCode = 1668313716,
|
||||
}
|
||||
|
||||
internal enum WindowClass : uint {
|
||||
kAlertWindowClass = 1,
|
||||
kMovableAlertWindowClass = 2,
|
||||
kModalWindowClass = 3,
|
||||
kMovableModalWindowClass = 4,
|
||||
kFloatingWindowClass = 5,
|
||||
kDocumentWindowClass = 6,
|
||||
kUtilityWindowClass = 8,
|
||||
kHelpWindowClass = 10,
|
||||
kSheetWindowClass = 11,
|
||||
kToolbarWindowClass = 12,
|
||||
kPlainWindowClass = 13,
|
||||
kOverlayWindowClass = 14,
|
||||
kSheetAlertWindowClass = 15,
|
||||
kAltPlainWindowClass = 16,
|
||||
kDrawerWindowClass = 20,
|
||||
kAllWindowClasses = 0xFFFFFFFF
|
||||
}
|
||||
|
||||
internal enum WindowAttributes : uint {
|
||||
kWindowNoAttributes = 0,
|
||||
kWindowCloseBoxAttribute = (1u << 0),
|
||||
kWindowHorizontalZoomAttribute = (1u << 1),
|
||||
kWindowVerticalZoomAttribute = (1u << 2),
|
||||
kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute),
|
||||
kWindowCollapseBoxAttribute = (1u << 3),
|
||||
kWindowResizableAttribute = (1u << 4),
|
||||
kWindowSideTitlebarAttribute = (1u << 5),
|
||||
kWindowToolbarButtonAttribute = (1u << 6),
|
||||
kWindowMetalAttribute = (1u << 8),
|
||||
kWindowNoUpdatesAttribute = (1u << 16),
|
||||
kWindowNoActivatesAttribute = (1u << 17),
|
||||
kWindowOpaqueForEventsAttribute = (1u << 18),
|
||||
kWindowCompositingAttribute = (1u << 19),
|
||||
kWindowNoShadowAttribute = (1u << 21),
|
||||
kWindowHideOnSuspendAttribute = (1u << 24),
|
||||
kWindowStandardHandlerAttribute = (1u << 25),
|
||||
kWindowHideOnFullScreenAttribute = (1u << 26),
|
||||
kWindowInWindowMenuAttribute = (1u << 27),
|
||||
kWindowuiveResizeAttribute = (1u << 28),
|
||||
kWindowIgnoreClicksAttribute = (1u << 29),
|
||||
kWindowNoConstrainAttribute = (1u << 31),
|
||||
kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute),
|
||||
kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
|
||||
}
|
||||
|
||||
internal enum ThemeCursor : uint {
|
||||
kThemeArrowCursor = 0,
|
||||
kThemeCopyArrowCursor = 1,
|
||||
kThemeAliasArrowCursor = 2,
|
||||
kThemeContextualMenuArrowCursor = 3,
|
||||
kThemeIBeamCursor = 4,
|
||||
kThemeCrossCursor = 5,
|
||||
kThemePlusCursor = 6,
|
||||
kThemeWatchCursor = 7,
|
||||
kThemeClosedHandCursor = 8,
|
||||
kThemeOpenHandCursor = 9,
|
||||
kThemePointingHandCursor = 10,
|
||||
kThemeCountingUpHandCursor = 11,
|
||||
kThemeCountingDownHandCursor = 12,
|
||||
kThemeCountingUpAndDownHandCursor = 13,
|
||||
kThemeSpinningCursor = 14,
|
||||
kThemeResizeLeftCursor = 15,
|
||||
kThemeResizeRightCursor = 16,
|
||||
kThemeResizeLeftRightCursor = 17,
|
||||
kThemeNotAllowedCursor = 18
|
||||
}
|
||||
|
||||
internal enum MouseTrackingResult : ushort {
|
||||
kMouseTrackingMouseDown = 1,
|
||||
kMouseTrackingMouseUp = 2,
|
||||
kMouseTrackingMouseExited = 3,
|
||||
kMouseTrackingMouseEntered = 4,
|
||||
kMouseTrackingMouseDragged = 5,
|
||||
kMouseTrackingKeyModifiersChanged = 6,
|
||||
kMouseTrackingUserCancelled = 7,
|
||||
kMouseTrackingTimedOut = 8,
|
||||
kMouseTrackingMouseMoved = 9
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal delegate int EventDelegate (IntPtr callref, IntPtr eventref, IntPtr user_data);
|
||||
|
||||
internal class EventHandler {
|
||||
internal static EventDelegate EventHandlerDelegate = new EventDelegate (EventCallback);
|
||||
internal static XplatUICarbon Driver;
|
||||
|
||||
internal const int EVENT_NOT_HANDLED = 0;
|
||||
internal const int EVENT_HANDLED = -9874;
|
||||
|
||||
internal const uint kEventClassMouse = 1836021107;
|
||||
internal const uint kEventClassKeyboard = 1801812322;
|
||||
internal const uint kEventClassTextInput = 1952807028;
|
||||
internal const uint kEventClassApplication = 1634758764;
|
||||
internal const uint kEventClassAppleEvent = 1701867619;
|
||||
internal const uint kEventClassMenu = 1835363957;
|
||||
internal const uint kEventClassWindow = 2003398244;
|
||||
internal const uint kEventClassControl = 1668183148;
|
||||
internal const uint kEventClassCommand = 1668113523;
|
||||
internal const uint kEventClassTablet = 1952607348;
|
||||
internal const uint kEventClassVolume = 1987013664;
|
||||
internal const uint kEventClassAppearance = 1634758765;
|
||||
internal const uint kEventClassService = 1936028278;
|
||||
internal const uint kEventClassToolbar = 1952604530;
|
||||
internal const uint kEventClassToolbarItem = 1952606580;
|
||||
internal const uint kEventClassAccessibility = 1633903461;
|
||||
|
||||
internal static EventTypeSpec [] ControlEvents = new EventTypeSpec [] {
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlSetFocusPart),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlClick),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlContextualMenuClick),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlTrack),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlSimulateHit),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlBoundsChanged),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlTrackingAreaEntered),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlTrackingAreaExited),
|
||||
new EventTypeSpec (kEventClassControl, ControlHandler.kEventControlDraw)
|
||||
};
|
||||
|
||||
internal static EventTypeSpec [] ApplicationEvents = new EventTypeSpec[] {
|
||||
new EventTypeSpec (kEventClassApplication, ApplicationHandler.kEventAppActivated),
|
||||
new EventTypeSpec (kEventClassApplication, ApplicationHandler.kEventAppDeactivated)
|
||||
};
|
||||
|
||||
private static EventTypeSpec [] WindowEvents = new EventTypeSpec[] {
|
||||
new EventTypeSpec (kEventClassMouse, MouseHandler.kEventMouseMoved),
|
||||
|
||||
new EventTypeSpec (kEventClassWindow, WindowHandler.kEventWindowBoundsChanged),
|
||||
new EventTypeSpec (kEventClassWindow, WindowHandler.kEventWindowClose),
|
||||
|
||||
new EventTypeSpec (kEventClassKeyboard, KeyboardHandler.kEventRawKeyModifiersChanged),
|
||||
new EventTypeSpec (kEventClassKeyboard, KeyboardHandler.kEventRawKeyDown),
|
||||
new EventTypeSpec (kEventClassKeyboard, KeyboardHandler.kEventRawKeyRepeat),
|
||||
new EventTypeSpec (kEventClassKeyboard, KeyboardHandler.kEventRawKeyUp)
|
||||
};
|
||||
|
||||
internal static int EventCallback (IntPtr callref, IntPtr eventref, IntPtr handle) {
|
||||
uint klass = GetEventClass (eventref);
|
||||
uint kind = GetEventKind (eventref);
|
||||
MSG msg = new MSG ();
|
||||
IEventHandler handler = null;
|
||||
|
||||
switch (klass) {
|
||||
case kEventClassKeyboard:
|
||||
handler = (IEventHandler) Driver.KeyboardHandler;
|
||||
break;
|
||||
case kEventClassWindow:
|
||||
handler = (IEventHandler) Driver.WindowHandler;
|
||||
break;
|
||||
case kEventClassMouse:
|
||||
handler = (IEventHandler) Driver.MouseHandler;
|
||||
break;
|
||||
case kEventClassControl:
|
||||
handler = (IEventHandler) Driver.ControlHandler;
|
||||
break;
|
||||
case kEventClassApplication:
|
||||
handler = (IEventHandler) Driver.ApplicationHandler;
|
||||
break;
|
||||
default:
|
||||
return EVENT_NOT_HANDLED;
|
||||
}
|
||||
|
||||
if (handler.ProcessEvent (eventref, handle, kind, ref msg)) {
|
||||
Driver.EnqueueMessage (msg);
|
||||
return EVENT_HANDLED;
|
||||
}
|
||||
|
||||
return EVENT_NOT_HANDLED;
|
||||
}
|
||||
|
||||
internal static bool TranslateMessage (ref MSG msg) {
|
||||
bool result = false;
|
||||
|
||||
if (!result)
|
||||
result = Driver.KeyboardHandler.TranslateMessage (ref msg);
|
||||
if (!result)
|
||||
result = Driver.MouseHandler.TranslateMessage (ref msg);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static void InstallApplicationHandler () {
|
||||
InstallEventHandler (GetApplicationEventTarget (), EventHandlerDelegate, (uint)ApplicationEvents.Length, ApplicationEvents, IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static void InstallControlHandler (IntPtr control) {
|
||||
InstallEventHandler (GetControlEventTarget (control), EventHandlerDelegate, (uint)ControlEvents.Length, ControlEvents, control, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static void InstallWindowHandler (IntPtr window) {
|
||||
InstallEventHandler (GetWindowEventTarget (window), EventHandlerDelegate, (uint)WindowEvents.Length, WindowEvents, window, IntPtr.Zero);
|
||||
}
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern IntPtr GetApplicationEventTarget ();
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern IntPtr GetControlEventTarget (IntPtr control);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern IntPtr GetWindowEventTarget (IntPtr window);
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern uint GetEventClass (IntPtr eventref);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern uint GetEventKind (IntPtr eventref);
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int InstallEventHandler (IntPtr window, EventDelegate event_handler, uint count, EventTypeSpec [] types, IntPtr user_data, IntPtr handlerref);
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal abstract class EventHandlerBase {
|
||||
internal XplatUICarbon Driver;
|
||||
|
||||
public EventHandlerBase () {
|
||||
}
|
||||
|
||||
public EventHandlerBase (XplatUICarbon driver) {
|
||||
Driver = driver;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal interface IEventHandler {
|
||||
bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg);
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class MouseHandler : EventHandlerBase, IEventHandler {
|
||||
internal const uint kEventMouseDown = 1;
|
||||
internal const uint kEventMouseUp = 2;
|
||||
internal const uint kEventMouseMoved = 5;
|
||||
internal const uint kEventMouseDragged = 6;
|
||||
internal const uint kEventMouseEntered = 8;
|
||||
internal const uint kEventMouseExited = 9;
|
||||
internal const uint kEventMouseWheelMoved = 10;
|
||||
|
||||
internal const uint kEventParamMouseLocation = 1835822947;
|
||||
internal const uint typeQDPoint = 1363439732;
|
||||
|
||||
internal MouseHandler (XplatUICarbon driver) : base (driver) {}
|
||||
|
||||
public bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg) {
|
||||
QDPoint qdpoint = new QDPoint ();
|
||||
CGPoint point = new CGPoint ();
|
||||
|
||||
GetEventParameter (eventref, kEventParamMouseLocation, typeQDPoint, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (QDPoint)), IntPtr.Zero, ref qdpoint);
|
||||
|
||||
point.x = qdpoint.x;
|
||||
point.y = qdpoint.y;
|
||||
|
||||
switch (kind) {
|
||||
case kEventMouseMoved: {
|
||||
Rect window_bounds = new Rect ();
|
||||
IntPtr view_handle = IntPtr.Zero;
|
||||
IntPtr window_handle = IntPtr.Zero;
|
||||
bool client = true;
|
||||
Hwnd hwnd;
|
||||
|
||||
GetWindowBounds (handle, 33, ref window_bounds);
|
||||
HIViewFindByID (HIViewGetRoot (handle), new HIViewID (EventHandler.kEventClassWindow, 1), ref window_handle);
|
||||
|
||||
point.x -= window_bounds.left;
|
||||
point.y -= window_bounds.top;
|
||||
|
||||
HIViewGetSubviewHit (window_handle, ref point, true, ref view_handle);
|
||||
HIViewConvertPoint (ref point, window_handle, view_handle);
|
||||
|
||||
hwnd = Hwnd.ObjectFromHandle (view_handle);
|
||||
if (XplatUICarbon.GrabHwnd != null)
|
||||
hwnd = XplatUICarbon.GrabHwnd;
|
||||
if (hwnd == null)
|
||||
return false;
|
||||
|
||||
client = (hwnd.ClientWindow == view_handle ? true : hwnd == XplatUICarbon.GrabHwnd ? true : false);
|
||||
|
||||
msg.hwnd = hwnd.Handle;
|
||||
msg.message = (client ? Msg.WM_MOUSEMOVE : Msg.WM_NCMOUSEMOVE);
|
||||
msg.lParam = (IntPtr) ((ushort)point.y << 16 | (ushort)point.x);
|
||||
msg.wParam = Driver.GetMousewParam (0);
|
||||
|
||||
Driver.mouse_position.X = (int)point.x;
|
||||
Driver.mouse_position.Y = (int)point.y;
|
||||
XplatUICarbon.Hover.Hwnd = hwnd.Handle;
|
||||
XplatUICarbon.Hover.Timer.Enabled = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal bool TranslateMessage (ref MSG msg) {
|
||||
if (msg.message == Msg.WM_MOUSEMOVE || msg.message == Msg.WM_NCMOUSEMOVE) {
|
||||
Hwnd hwnd = Hwnd.ObjectFromHandle (msg.hwnd);
|
||||
if (XplatUICarbon.MouseHwnd == null)
|
||||
Driver.PostMessage (hwnd.Handle, Msg.WM_MOUSE_ENTER, IntPtr.Zero, IntPtr.Zero);
|
||||
else if (XplatUICarbon.MouseHwnd.Handle != hwnd.Handle) {
|
||||
Driver.PostMessage (XplatUICarbon.MouseHwnd.Handle, Msg.WM_MOUSELEAVE, IntPtr.Zero, IntPtr.Zero);
|
||||
Driver.PostMessage (hwnd.Handle, Msg.WM_MOUSE_ENTER, IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
XplatUICarbon.MouseHwnd = hwnd;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref QDPoint data);
|
||||
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int GetWindowBounds (IntPtr handle, uint region, ref Rect bounds);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int HIViewConvertPoint (ref CGPoint point, IntPtr source_view, IntPtr target_view);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern IntPtr HIViewGetRoot (IntPtr handle);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int HIViewGetSubviewHit (IntPtr content_view, ref CGPoint point, bool tval, ref IntPtr hit_view);
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int HIViewFindByID (IntPtr root_window, HIViewID id, ref IntPtr view_handle);
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software",, to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal struct CGSize {
|
||||
public float width;
|
||||
public float height;
|
||||
|
||||
public CGSize (int w, int h) {
|
||||
this.width = (float)w;
|
||||
this.height = (float)h;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct QDPoint {
|
||||
public short y;
|
||||
public short x;
|
||||
|
||||
public QDPoint (short x, short y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CGPoint {
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
public CGPoint (int x, int y) {
|
||||
this.x = (float)x;
|
||||
this.y = (float)y;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct HIRect {
|
||||
public CGPoint origin;
|
||||
public CGSize size;
|
||||
|
||||
public HIRect (int x, int y, int w, int h) {
|
||||
this.origin = new CGPoint (x, y);
|
||||
this.size = new CGSize (w, h);
|
||||
}
|
||||
}
|
||||
|
||||
internal struct HIViewID {
|
||||
public uint type;
|
||||
public uint id;
|
||||
|
||||
public HIViewID (uint type, uint id) {
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct EventTypeSpec {
|
||||
public UInt32 eventClass;
|
||||
public UInt32 eventKind;
|
||||
|
||||
public EventTypeSpec (UInt32 eventClass, UInt32 eventKind)
|
||||
{
|
||||
this.eventClass = eventClass;
|
||||
this.eventKind = eventKind;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CarbonEvent {
|
||||
public IntPtr hWnd;
|
||||
public IntPtr evt;
|
||||
|
||||
public CarbonEvent (IntPtr hWnd, IntPtr evt)
|
||||
{
|
||||
this.hWnd = hWnd;
|
||||
this.evt = evt;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct RGBColor {
|
||||
public short red;
|
||||
public short green;
|
||||
public short blue;
|
||||
}
|
||||
|
||||
internal struct Rect {
|
||||
public short top;
|
||||
public short left;
|
||||
public short bottom;
|
||||
public short right;
|
||||
}
|
||||
|
||||
internal struct Caret {
|
||||
internal Timer Timer;
|
||||
internal IntPtr Hwnd;
|
||||
internal int X;
|
||||
internal int Y;
|
||||
internal int Width;
|
||||
internal int Height;
|
||||
internal int Visible;
|
||||
internal bool On;
|
||||
internal bool Paused;
|
||||
}
|
||||
|
||||
internal struct Hover {
|
||||
internal Timer Timer;
|
||||
internal IntPtr Hwnd;
|
||||
internal int X;
|
||||
internal int Y;
|
||||
internal int Interval;
|
||||
}
|
||||
|
||||
internal struct CGAffineTransform {
|
||||
internal float a;
|
||||
internal float b;
|
||||
internal float c;
|
||||
internal float d;
|
||||
internal float tx;
|
||||
internal float ty;
|
||||
}
|
||||
|
||||
internal struct MouseTrackingRegionID {
|
||||
public uint signature;
|
||||
public uint id;
|
||||
|
||||
public MouseTrackingRegionID (uint signature, uint id) {
|
||||
this.signature = signature;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ProcessSerialNumber {
|
||||
public ulong highLongOfPSN;
|
||||
public ulong lowLongOfPSN;
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2007 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class WindowHandler : EventHandlerBase, IEventHandler {
|
||||
internal const uint kEventWindowUpdate = 1;
|
||||
internal const uint kEventWindowDrawContent = 2;
|
||||
internal const uint kEventWindowActivated = 5;
|
||||
internal const uint kEventWindowDeactivated = 6;
|
||||
internal const uint kEventWindowGetClickActivation = 7;
|
||||
internal const uint kEventWindowShowing = 22;
|
||||
internal const uint kEventWindowHiding = 23;
|
||||
internal const uint kEventWindowShown = 24;
|
||||
internal const uint kEventWindowHidden = 25;
|
||||
internal const uint kEventWindowCollapsing = 86;
|
||||
internal const uint kEventWindowExpanding = 87;
|
||||
internal const uint kEventWindowZoomed = 76;
|
||||
internal const uint kEventWindowBoundsChanging = 26;
|
||||
internal const uint kEventWindowBoundsChanged = 27;
|
||||
internal const uint kEventWindowResizeStarted = 28;
|
||||
internal const uint kEventWindowResizeCompleted = 29;
|
||||
internal const uint kEventWindowDragStarted = 30;
|
||||
internal const uint kEventWindowDragCompleted = 31;
|
||||
internal const uint kEventWindowTransitionStarted = 88;
|
||||
internal const uint kEventWindowTransitionCompleted = 89;
|
||||
internal const uint kEventWindowClickDragRgn = 32;
|
||||
internal const uint kEventWindowClickResizeRgn = 33;
|
||||
internal const uint kEventWindowClickCollapseRgn = 34;
|
||||
internal const uint kEventWindowClickCloseRgn = 35;
|
||||
internal const uint kEventWindowClickZoomRgn = 36;
|
||||
internal const uint kEventWindowClickContentRgn = 37;
|
||||
internal const uint kEventWindowClickProxyIconRgn = 38;
|
||||
internal const uint kEventWindowClickToolbarButtonRgn = 41;
|
||||
internal const uint kEventWindowClickStructureRgn = 42;
|
||||
internal const uint kEventWindowCursorChange = 40;
|
||||
internal const uint kEventWindowCollapse = 66;
|
||||
internal const uint kEventWindowCollapsed = 67;
|
||||
internal const uint kEventWindowCollapseAll = 68;
|
||||
internal const uint kEventWindowExpand = 69;
|
||||
internal const uint kEventWindowExpanded = 70;
|
||||
internal const uint kEventWindowExpandAll = 71;
|
||||
internal const uint kEventWindowClose = 72;
|
||||
internal const uint kEventWindowClosed = 73;
|
||||
internal const uint kEventWindowCloseAll = 74;
|
||||
internal const uint kEventWindowZoom = 75;
|
||||
internal const uint kEventWindowZoomAll = 77;
|
||||
internal const uint kEventWindowContextualMenuSelect = 78;
|
||||
internal const uint kEventWindowPathSelect = 79;
|
||||
internal const uint kEventWindowGetIdealSize = 80;
|
||||
internal const uint kEventWindowGetMinimumSize = 81;
|
||||
internal const uint kEventWindowGetMaximumSize = 82;
|
||||
internal const uint kEventWindowConstrain = 83;
|
||||
internal const uint kEventWindowHandleContentClick = 85;
|
||||
internal const uint kEventWindowGetDockTileMenu = 90;
|
||||
internal const uint kEventWindowHandleActivate = 91;
|
||||
internal const uint kEventWindowHandleDeactivate = 92;
|
||||
internal const uint kEventWindowProxyBeginDrag = 128;
|
||||
internal const uint kEventWindowProxyEndDrag = 129;
|
||||
internal const uint kEventWindowToolbarSwitchMode = 150;
|
||||
internal const uint kEventWindowFocusAcquired = 200;
|
||||
internal const uint kEventWindowFocusRelinquish = 201;
|
||||
internal const uint kEventWindowFocusContent = 202;
|
||||
internal const uint kEventWindowFocusToolbar = 203;
|
||||
internal const uint kEventWindowDrawerOpening = 220;
|
||||
internal const uint kEventWindowDrawerOpened = 221;
|
||||
internal const uint kEventWindowDrawerClosing = 222;
|
||||
internal const uint kEventWindowDrawerClosed = 223;
|
||||
internal const uint kEventWindowDrawFrame = 1000;
|
||||
internal const uint kEventWindowDrawPart = 1001;
|
||||
internal const uint kEventWindowGetRegion = 1002;
|
||||
internal const uint kEventWindowHitTest = 1003;
|
||||
internal const uint kEventWindowInit = 1004;
|
||||
internal const uint kEventWindowDispose = 1005;
|
||||
internal const uint kEventWindowDragHilite = 1006;
|
||||
internal const uint kEventWindowModified = 1007;
|
||||
internal const uint kEventWindowSetupProxyDragImage = 1008;
|
||||
internal const uint kEventWindowStateChanged = 1009;
|
||||
internal const uint kEventWindowMeasureTitle = 1010;
|
||||
internal const uint kEventWindowDrawGrowBox = 1011;
|
||||
internal const uint kEventWindowGetGrowImageRegion = 1012;
|
||||
internal const uint kEventWindowPaint = 1013;
|
||||
|
||||
internal WindowHandler (XplatUICarbon driver) : base (driver) {}
|
||||
|
||||
public bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg) {
|
||||
IntPtr window = Driver.HandleToWindow (handle);
|
||||
if (window != IntPtr.Zero) {
|
||||
switch (kind) {
|
||||
case kEventWindowClose:
|
||||
NativeWindow.WndProc (window, Msg.WM_DESTROY, IntPtr.Zero, IntPtr.Zero);
|
||||
return false;
|
||||
case kEventWindowBoundsChanged: {
|
||||
Rect window_bounds = new Rect ();
|
||||
HIRect view_bounds = new HIRect ();
|
||||
Hwnd hwnd = Hwnd.ObjectFromHandle (window);
|
||||
Size size;
|
||||
|
||||
GetWindowBounds (handle, 33, ref window_bounds);
|
||||
|
||||
view_bounds.size.width = window_bounds.right - window_bounds.left;
|
||||
view_bounds.size.height = window_bounds.bottom - window_bounds.top;
|
||||
|
||||
HIViewSetFrame (hwnd.WholeWindow, ref view_bounds);
|
||||
|
||||
size = XplatUICarbon.TranslateQuartzWindowSizeToWindowSize (Control.FromHandle (hwnd.Handle).GetCreateParams (), (int)view_bounds.size.width, (int)view_bounds.size.height);
|
||||
|
||||
hwnd.X = (int) window_bounds.left;
|
||||
hwnd.Y = (int) window_bounds.top;
|
||||
hwnd.Width = (int) size.Width;
|
||||
hwnd.Height = (int) size.Height;
|
||||
|
||||
Driver.PerformNCCalc (hwnd);
|
||||
|
||||
msg.message = Msg.WM_WINDOWPOSCHANGED;
|
||||
msg.hwnd = hwnd.Handle;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int GetWindowBounds (IntPtr handle, uint region, ref Rect bounds);
|
||||
|
||||
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
internal static extern int HIViewSetFrame (IntPtr handle, ref HIRect bounds);
|
||||
}
|
||||
}
|
||||
@@ -506,6 +506,8 @@ System.Windows.Forms/NumericUpDown.cs
|
||||
System.Windows.Forms/NumericUpDownAcceleration.cs
|
||||
System.Windows.Forms/NumericUpDownAccelerationCollection.cs
|
||||
System.Windows.Forms/OSFeature.cs
|
||||
System.Windows.Forms/OSXKeyboard.cs
|
||||
System.Windows.Forms/OSXStructs.cs
|
||||
System.Windows.Forms/OpacityConverter.cs
|
||||
System.Windows.Forms/OpenFileDialog.cs
|
||||
System.Windows.Forms/OpenTreeNodeEnumerator.cs
|
||||
@@ -799,8 +801,8 @@ System.Windows.Forms/X11Keyboard.cs
|
||||
System.Windows.Forms/X11Structs.cs
|
||||
System.Windows.Forms/XEventQueue.cs
|
||||
System.Windows.Forms/XplatUI.cs
|
||||
System.Windows.Forms/XplatUICarbon.cs
|
||||
System.Windows.Forms/XplatUIDriver.cs
|
||||
System.Windows.Forms/XplatUIOSX.cs
|
||||
System.Windows.Forms/XplatUIStructs.cs
|
||||
System.Windows.Forms/XplatUIWin32.cs
|
||||
System.Windows.Forms/XplatUIX11.cs
|
||||
@@ -809,16 +811,6 @@ System.Windows.Forms.Layout/DefaultLayout.cs
|
||||
System.Windows.Forms.Layout/FlowLayout.cs
|
||||
System.Windows.Forms.Layout/TableLayout.cs
|
||||
System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs
|
||||
System.Windows.Forms.CarbonInternal/ApplicationHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/ControlHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/EventHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/EventHandlerBase.cs
|
||||
System.Windows.Forms.CarbonInternal/Enums.cs
|
||||
System.Windows.Forms.CarbonInternal/IEventHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/KeyboardHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/MouseHandler.cs
|
||||
System.Windows.Forms.CarbonInternal/Structs.cs
|
||||
System.Windows.Forms.CarbonInternal/WindowHandler.cs
|
||||
System.Windows.Forms.Theming/ThemeElements.cs
|
||||
System.Windows.Forms.Theming/ThemeElementsClearlooks.cs
|
||||
System.Windows.Forms.Theming/ThemeElementsDefault.cs
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace System.Windows.Forms
|
||||
|
||||
public static string ExecutablePath {
|
||||
get {
|
||||
return Path.GetFullPath (Process.GetCurrentProcess ().MainModule.FileName);
|
||||
return Assembly.GetEntryAssembly().Location;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,12 +791,14 @@ namespace System.Windows.Forms
|
||||
continue;
|
||||
case PreProcessControlState.MessageNeeded:
|
||||
case PreProcessControlState.MessageNotNeeded:
|
||||
if ((m.Msg == (int)Msg.WM_KEYDOWN && !keyboard_capture.ProcessControlMnemonic ((char)m.WParam))) {
|
||||
if (((m.Msg == (int)Msg.WM_KEYDOWN || m.Msg == (int)Msg.WM_CHAR) && !keyboard_capture.ProcessControlMnemonic ((char)m.WParam))) {
|
||||
if (c == null || !ControlOnToolStrip (c))
|
||||
continue;
|
||||
else
|
||||
m.HWnd = msg.hwnd;
|
||||
}
|
||||
} else
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,170 +1,93 @@
|
||||
2007-11-20 Everaldo Canuto <[email protected]>
|
||||
2007-12-10 Everaldo Canuto <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* MenuAPI.cs: When process menu keys return true by default only if menu is
|
||||
active. Fixes bug #342892.
|
||||
|
||||
2007-12-09 Andreia Gaita <[email protected]>
|
||||
[Backport to 1.2.6]
|
||||
* Control.cs: check if windows are actually mapped before
|
||||
trying to zorder. Fixes #342509, #346955
|
||||
|
||||
2007-12-05 Andreia Gaita <[email protected]>
|
||||
[Backport to 1.2.6]
|
||||
* Control.cs: When updating the zorder, ignore windows that are not
|
||||
mapped. Fixes #342509
|
||||
|
||||
2007-12-04 Rolf Bjarne Kvinge <[email protected]>
|
||||
[Backport to 1.2.6]
|
||||
* XplatUIX11.cs: Make toolwindows' decorations show up without causing any
|
||||
tests to fail (hopefully).
|
||||
|
||||
2007-12-03 Jonathan Pobst <[email protected]>
|
||||
[Backport to 1.2.6]
|
||||
* Application.cs: Let WM_CHAR messages flow through to controls
|
||||
hosted in Strips. [Fixes bug #343972]
|
||||
|
||||
2007-11-20 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* ListView.cs: When setting focused item, try to give focus to the
|
||||
previous one _only_ if the previous one remains valid.
|
||||
Fixes #342504.
|
||||
|
||||
2007-11-20 Everaldo Canuto <[email protected]>
|
||||
[Backport to 1.2.6]
|
||||
* ThemeWin32Classic.cs: Fix extra space on end of tooltip.
|
||||
|
||||
2007-11-20 Everaldo Canuto <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* ThemeWin32Classic.cs: Fix tooltip text align removing horizontal
|
||||
alignment. [Fixes #324228]
|
||||
|
||||
2007-11-19 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* ToolStrip.cs: Handle flow layout in GetPreferredSize to fix PDN3.
|
||||
[Fixes bug #342123]
|
||||
|
||||
2007-11-19 Everaldo Canuto <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* Form.cs: Check for empty Text before assign to cp.Caption in CreateParams
|
||||
it prevent problems when empty captions. [Fixes #342141]
|
||||
|
||||
2007-11-19 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* Label.cs: Use Size instead of None. Fixes bug #342077.
|
||||
|
||||
2007-11-18 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListViewItem.cs: Implement 2.0 FindNearestItem method.
|
||||
|
||||
2007-11-17 Jonathan Pobst <[email protected]>
|
||||
|
||||
* MenuStrip.cs: Guard against a NRE when a MdiWindowItem is set
|
||||
but there isn't a MdiContainer.
|
||||
[Fixes bug #342358]
|
||||
|
||||
2007-11-17 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* TextControl.cs: Don't recalculate document if the recalc_start and
|
||||
recalc_end hasn't changed.
|
||||
[Fixes bug #342505]
|
||||
|
||||
2007-11-17 Gert Driesen <[email protected]>
|
||||
|
||||
* DataGridViewTextBoxCell.cs: Removed CWL.
|
||||
|
||||
2007-11-16 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: Implement 2.0 SearchForVirtualItem event support.
|
||||
|
||||
2007-11-16 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* TextControl.cs: Missed some code for bug 341534 to trigger a
|
||||
recalculation when the font changes.
|
||||
|
||||
2007-11-16 Andreia Gaita <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* Control.cs: When updating the zorder, check if the child to update is
|
||||
the same control that is set to always be on top (i.e., scrollbars), and
|
||||
just put it on top directly. Fixes BadMatch error on pdn3
|
||||
|
||||
2007-11-16 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: Throw the needed exceptions for FindNearestItem.
|
||||
|
||||
2007-11-16 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* Control.cs: Don't perform a new layout when a label changes its text,
|
||||
cause label handles its own autosizing.
|
||||
[Fixes bug #342077]
|
||||
|
||||
2007-11-16 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: Implement 2.0 FindNearestItem methods.
|
||||
|
||||
2007-11-15 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripPanel.cs: Make Join at least add the control to the panel,
|
||||
even if the rest of what Join does isn't supported. Add some more
|
||||
support for vertical toolbars.
|
||||
* ToolStripPanelRow.cs: Add some more support for vertical toolbars.
|
||||
[Fixes the application breaking parts of bug #341998]
|
||||
|
||||
2007-11-15 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripItem.cs: When determining if we have a check/image margin,
|
||||
we need to look at ShowCheckMargin as well as ShowImageMargin.
|
||||
|
||||
2007-11-15 Geoff Norton <[email protected]>
|
||||
|
||||
* XplatUIOSX.cs: Rename to...
|
||||
* XplatUICarbon.cs: and refactor all event handling out to the new event handling
|
||||
system in System.Windows.Forms.CarbonInternal. Lots of code cleanup as well.
|
||||
|
||||
2007-11-15 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* KeysConverter.cs: The default values should be an array of Keys, not
|
||||
strings. Also, the array has more values for 2.0.
|
||||
[Fixes bug #341851]
|
||||
|
||||
2007-11-14 Jonathan Pobst <[email protected]>
|
||||
|
||||
* Application.cs: Change ExecutablePath to use
|
||||
Process.GetCurrentProcess ().MainModule.FileName instead of Assembly.GetEntryAssembly.
|
||||
[Fixes bug #323552]
|
||||
|
||||
2007-11-14 Jonathan Pobst <[email protected]>
|
||||
|
||||
* LineTag.cs: Don't attempt to draw '\r', treat it like it doesn't exist.
|
||||
When measureing CR or LF, use /u000D instead of /u0013. (Hex, not decimal.)
|
||||
* TextControl.cs: Fix a case in GetLineEnding where a \n before a \r would
|
||||
be ignored. Create a new GetLineEnding that can specify which types of
|
||||
line endings to look for. On Insert, only create new lines for \n and \r\n.
|
||||
[Fixes bug #324274]
|
||||
|
||||
2007-11-14 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 1.2.6]
|
||||
* TextBoxBase.cs: As we loop through each line changing the font, tell
|
||||
the document that the line needs to be recalculated. Fixes bug #341534.
|
||||
|
||||
2007-11-13 Jonathan Pobst <[email protected]>
|
||||
[Another round of refactoring]
|
||||
* Line.cs: Add DeleteCharacters.
|
||||
* LineTag.cs: Add Delete.
|
||||
* TextBoxBase.cs: Update to use new methods.
|
||||
* TextControl.cs: Refactor the Delete* methods.
|
||||
|
||||
2007-11-13 Everaldo Canuto <[email protected]>
|
||||
|
||||
* Win32DnD.cs: Implement Win32 Drop files, thank you Srikanth Madikeri for
|
||||
the patch. [Fixes #324856]
|
||||
|
||||
2007-11-12 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs:
|
||||
* ListViewItem.cs: Add an initial implementation of
|
||||
2.0 ListViewItem.Position getter.
|
||||
|
||||
2007-11-12 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: Add a reordered_items_indices array, to allow us
|
||||
to have a different sorting than that of Items (the sorting in Items
|
||||
could not match the actual sorting in screen). This is needed to
|
||||
implement a pair of 2.0 features.
|
||||
* ListViewItem.cs: Add a DisplayIndex property to keep track of the
|
||||
actual position in the ListView grid, since it could have a position
|
||||
different than its Index (position in ListViewItemCollection).
|
||||
|
||||
2007-11-09 Jonathan Pobst <[email protected]>
|
||||
|
||||
* Label.cs: Add StringFormatFlags.LineLimit. This tells DrawString to
|
||||
not draw partial lines.
|
||||
* LinkLabel.cs: Change FormatFlags setter from = to |= so that the
|
||||
LineLimit flag from the base is preserved.
|
||||
Fixes the windows part of bug #338965.
|
||||
|
||||
2007-11-09 Jonathan Pobst <[email protected]>
|
||||
|
||||
* TextBoxBase.cs: Move handling of the enter key from KEYDOWN to CHAR
|
||||
so that it can be canceled in KeyPress.
|
||||
Fixes bug #340078.
|
||||
|
||||
2007-11-08 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: In ItemControl, reset mouse-handling related
|
||||
fields even if we dont' have items (we still should reset them when
|
||||
we had items but then called Items.Clear). Partially based in a patch
|
||||
by George Giolfan.
|
||||
Fixes #338399.
|
||||
|
||||
2007-11-08 Gert Driesen <[email protected]>
|
||||
|
||||
* Application.cs: In ProductVersion first try AssemblyFileVersion
|
||||
|
||||
@@ -4889,14 +4889,19 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
private void UpdateZOrderOfChild(Control child) {
|
||||
if (IsHandleCreated && child.IsHandleCreated && (child.parent == this)) {
|
||||
if (IsHandleCreated && child.IsHandleCreated && (child.parent == this) && Hwnd.ObjectFromHandle(child.Handle).Mapped) {
|
||||
// Need to take into account all controls
|
||||
int index;
|
||||
Control [] all_controls = child_controls.GetAllControls ();
|
||||
|
||||
index = Array.IndexOf (all_controls, child);
|
||||
|
||||
if (index > 0) {
|
||||
int index = Array.IndexOf (all_controls, child);
|
||||
|
||||
for (; index > 0; index--) {
|
||||
if (!all_controls [index - 1].IsHandleCreated || !all_controls [index - 1].VisibleInternal || !Hwnd.ObjectFromHandle(all_controls [index - 1].Handle).Mapped)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if (index > 0) {
|
||||
XplatUI.SetZOrder(child.Handle, all_controls [index - 1].Handle, false, false);
|
||||
} else {
|
||||
IntPtr after = AfterTopMostControl ();
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
DataGridView.EditingControlInternal = null;
|
||||
|
||||
Console.WriteLine("Detached: ({0}, {1});", RowIndex, ColumnIndex);
|
||||
}
|
||||
|
||||
public override void InitializeEditingControl (int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
|
||||
|
||||
@@ -139,7 +139,6 @@ namespace System.Windows.Forms
|
||||
autosize = false;
|
||||
TabStop = false;
|
||||
string_format = new StringFormat();
|
||||
string_format.FormatFlags = StringFormatFlags.LineLimit;
|
||||
TextAlign = ContentAlignment.TopLeft;
|
||||
image = null;
|
||||
UseMnemonic = true;
|
||||
|
||||
@@ -201,79 +201,6 @@ namespace System.Windows.Forms
|
||||
#endregion // Internal Properties
|
||||
|
||||
#region Internal Methods
|
||||
public void DeleteCharacters (int pos, int count)
|
||||
{
|
||||
LineTag tag;
|
||||
bool streamline = false;
|
||||
|
||||
// Can't delete more than the line has
|
||||
if (pos >= text.Length)
|
||||
return;
|
||||
|
||||
// Find the first tag that we are deleting from
|
||||
tag = FindTag (pos);
|
||||
|
||||
// Remove the characters from the line
|
||||
text.Remove (pos, count);
|
||||
|
||||
if (tag == null)
|
||||
return;
|
||||
|
||||
// Check if we're crossing tag boundaries
|
||||
if ((pos + count) > (tag.Start + tag.Length - 1)) {
|
||||
int left;
|
||||
|
||||
// We have to delete cross tag boundaries
|
||||
streamline = true;
|
||||
left = count;
|
||||
|
||||
left -= tag.Start + tag.Length - pos - 1;
|
||||
tag = tag.Next;
|
||||
|
||||
// Update the start of each tag
|
||||
while ((tag != null) && (left > 0)) {
|
||||
tag.Start -= count - left;
|
||||
|
||||
if (tag.Length > left) {
|
||||
left = 0;
|
||||
} else {
|
||||
left -= tag.Length;
|
||||
tag = tag.Next;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// We got off easy, same tag
|
||||
|
||||
if (tag.Length == 0)
|
||||
streamline = true;
|
||||
}
|
||||
|
||||
// Delete empty orphaned tags at the end
|
||||
LineTag walk = tag;
|
||||
while (walk != null && walk.Next != null && walk.Next.Length == 0) {
|
||||
LineTag t = walk;
|
||||
walk.Next = walk.Next.Next;
|
||||
if (walk.Next != null)
|
||||
walk.Next.Previous = t;
|
||||
walk = walk.Next;
|
||||
}
|
||||
|
||||
// Adjust the start point of any tags following
|
||||
if (tag != null) {
|
||||
tag = tag.Next;
|
||||
while (tag != null) {
|
||||
tag.Start -= count;
|
||||
tag = tag.Next;
|
||||
}
|
||||
}
|
||||
|
||||
recalc = true;
|
||||
|
||||
if (streamline)
|
||||
Streamline (document.Lines);
|
||||
}
|
||||
|
||||
// This doesn't do exactly what you would think, it just pulls off the \n part of the ending
|
||||
internal void DrawEnding (Graphics dc, float y)
|
||||
{
|
||||
@@ -353,8 +280,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
// Make sure we always have enoughs space in text and widths
|
||||
internal void Grow (int minimum)
|
||||
{
|
||||
internal void Grow (int minimum) {
|
||||
int length;
|
||||
float[] new_widths;
|
||||
|
||||
|
||||
@@ -177,9 +177,9 @@ namespace System.Windows.Forms
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region Internal Methods
|
||||
///<summary>Break a tag into two with identical attributes; pos is 1-based; returns tag starting at >pos< or null if end-of-line</summary>
|
||||
public LineTag Break (int pos)
|
||||
internal LineTag Break (int pos)
|
||||
{
|
||||
LineTag new_tag;
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
/// <summary>Combines 'this' tag with 'other' tag</summary>
|
||||
public bool Combine (LineTag other)
|
||||
internal bool Combine (LineTag other)
|
||||
{
|
||||
if (!this.Equals (other))
|
||||
return false;
|
||||
@@ -223,45 +223,19 @@ namespace System.Windows.Forms
|
||||
back_color = other.back_color;
|
||||
}
|
||||
|
||||
public void Delete ()
|
||||
internal virtual void Draw (Graphics dc, Color color, float x, float y, int start, int end)
|
||||
{
|
||||
// If we are the only tag, we can't be deleted
|
||||
if (previous == null && next == null)
|
||||
return;
|
||||
|
||||
// If we are the last tag, deletion is easy
|
||||
if (next == null) {
|
||||
previous.next = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Easy cases gone, little tougher, delete ourself
|
||||
// Update links, and start
|
||||
next.previous = null;
|
||||
|
||||
LineTag loop = next;
|
||||
|
||||
while (loop != null) {
|
||||
loop.Start -= Length;
|
||||
loop = loop.next;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public virtual void Draw (Graphics dc, Color color, float x, float y, int start, int end)
|
||||
{
|
||||
TextBoxTextRenderer.DrawText (dc, line.text.ToString (start, end).Replace ("\r", string.Empty), font, color, x, y, false);
|
||||
TextBoxTextRenderer.DrawText (dc, line.text.ToString (start, end), font, color, x, y, false);
|
||||
}
|
||||
|
||||
public virtual void Draw (Graphics dc, Color color, float xoff, float y, int start, int end, string text)
|
||||
internal virtual void Draw (Graphics dc, Color color, float xoff, float y, int start, int end, string text)
|
||||
{
|
||||
while (start < end) {
|
||||
int tab_index = text.IndexOf ("\t", start);
|
||||
if (tab_index == -1)
|
||||
tab_index = end;
|
||||
|
||||
TextBoxTextRenderer.DrawText (dc, text.Substring (start, tab_index - start).Replace ("\r", string.Empty), font, color, xoff + line.widths[start], y, false);
|
||||
TextBoxTextRenderer.DrawText (dc, text.Substring (start, tab_index - start), font, color, xoff + line.widths[start], y, false);
|
||||
|
||||
// non multilines get the unknown char
|
||||
if (!line.document.multiline && tab_index != end)
|
||||
@@ -297,7 +271,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
/// <summary>Finds the tag that describes the character at position 'pos' on 'line'</summary>
|
||||
public static LineTag FindTag (Line line, int pos)
|
||||
internal static LineTag FindTag (Line line, int pos)
|
||||
{
|
||||
LineTag tag = line.tags;
|
||||
|
||||
@@ -319,7 +293,7 @@ namespace System.Windows.Forms
|
||||
/// Removes any previous tags overlapping the same area;
|
||||
/// returns true if lineheight has changed</summary>
|
||||
/// <param name="start">1-based character position on line</param>
|
||||
public static bool FormatText (Line line, int start, int length, Font font, Color color, Color back_color, FormatSpecified specified)
|
||||
internal static bool FormatText (Line line, int start, int length, Font font, Color color, Color back_color, FormatSpecified specified)
|
||||
{
|
||||
LineTag tag;
|
||||
LineTag start_tag;
|
||||
@@ -405,7 +379,7 @@ namespace System.Windows.Forms
|
||||
|
||||
// There can be multiple tags at the same position, we want to make
|
||||
// sure we are using the very last tag at the given position
|
||||
public static LineTag GetFinalTag (LineTag tag)
|
||||
internal static LineTag GetFinalTag (LineTag tag)
|
||||
{
|
||||
LineTag res = tag;
|
||||
|
||||
@@ -437,7 +411,7 @@ namespace System.Windows.Forms
|
||||
// Console.WriteLine ("setting format: {0} {1} new color {2}", color.Color, specified, tag.color.Color);
|
||||
}
|
||||
|
||||
public virtual SizeF SizeOfPosition (Graphics dc, int pos)
|
||||
internal virtual SizeF SizeOfPosition (Graphics dc, int pos)
|
||||
{
|
||||
if (pos >= line.TextLengthWithoutEnding () && line.document.multiline)
|
||||
return SizeF.Empty;
|
||||
@@ -452,7 +426,7 @@ namespace System.Windows.Forms
|
||||
return res;
|
||||
case 10:
|
||||
case 13:
|
||||
return TextBoxTextRenderer.MeasureText (dc, "\u000D", font);
|
||||
return TextBoxTextRenderer.MeasureText (dc, "\u0013", font);
|
||||
}
|
||||
|
||||
return TextBoxTextRenderer.MeasureText (dc, text, font);
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace System.Windows.Forms
|
||||
pieces = null;
|
||||
focused_index = -1;
|
||||
|
||||
string_format.FormatFlags |= StringFormatFlags.NoClip;
|
||||
string_format.FormatFlags = StringFormatFlags.NoClip;
|
||||
|
||||
ActiveLinkColor = Color.Red;
|
||||
DisabledLinkColor = ThemeEngine.Current.ColorGrayText;
|
||||
|
||||
@@ -98,7 +98,6 @@ namespace System.Windows.Forms
|
||||
private string keysearch_text;
|
||||
static private readonly int keysearch_keydelay = 1000;
|
||||
private int[] reordered_column_indices;
|
||||
private int[] reordered_items_indices;
|
||||
private Point [] items_location;
|
||||
private ItemMatrixLocation [] items_matrix_location;
|
||||
private Size item_size; // used for caching item size
|
||||
@@ -136,7 +135,6 @@ namespace System.Windows.Forms
|
||||
static object CacheVirtualItemsEvent = new object ();
|
||||
static object RetrieveVirtualItemEvent = new object ();
|
||||
static object RightToLeftLayoutChangedEvent = new object ();
|
||||
static object SearchForVirtualItemEvent = new object ();
|
||||
static object VirtualItemsSelectionRangeChangedEvent = new object ();
|
||||
#endif
|
||||
|
||||
@@ -265,11 +263,6 @@ namespace System.Windows.Forms
|
||||
add { Events.AddHandler (RightToLeftLayoutChangedEvent, value); }
|
||||
remove { Events.RemoveHandler (RightToLeftLayoutChangedEvent, value); }
|
||||
}
|
||||
|
||||
public event SearchForVirtualItemEventHandler SearchForVirtualItem {
|
||||
add { Events.AddHandler (SearchForVirtualItemEvent, value); }
|
||||
remove { Events.AddHandler (SearchForVirtualItemEvent, value); }
|
||||
}
|
||||
|
||||
public event ListViewVirtualItemsSelectionRangeChangedEventHandler VirtualItemsSelectionRangeChanged {
|
||||
add { Events.AddHandler (VirtualItemsSelectionRangeChangedEvent, value); }
|
||||
@@ -295,7 +288,6 @@ namespace System.Windows.Forms
|
||||
selected_items = new SelectedListViewItemCollection (this);
|
||||
items_location = new Point [16];
|
||||
items_matrix_location = new ItemMatrixLocation [16];
|
||||
reordered_items_indices = new int [16];
|
||||
#if NET_2_0
|
||||
item_tooltip = new ToolTip ();
|
||||
item_tooltip.Active = false;
|
||||
@@ -1540,6 +1532,7 @@ namespace System.Windows.Forms
|
||||
return item_height;
|
||||
}
|
||||
|
||||
|
||||
void SetItemLocation (int index, int x, int y, int row, int col)
|
||||
{
|
||||
Point old_location = items_location [index];
|
||||
@@ -1552,68 +1545,12 @@ namespace System.Windows.Forms
|
||||
items_location [index] = new Point (x, y);
|
||||
items_matrix_location [index] = new ItemMatrixLocation (row, col);
|
||||
|
||||
//
|
||||
// Initial position matches item's position in ListViewItemCollection
|
||||
//
|
||||
reordered_items_indices [index] = index;
|
||||
|
||||
// Invalidate both previous and new bounds
|
||||
item_control.Invalidate (old_rect);
|
||||
item_control.Invalidate (new Rectangle (GetItemLocation (index), item_size));
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
void ShiftItemsPositions (int from, int to, bool forward)
|
||||
{
|
||||
if (forward) {
|
||||
for (int i = to + 1; i > from; i--) {
|
||||
reordered_items_indices [i] = reordered_items_indices [i - 1];
|
||||
items [reordered_items_indices [i]].DisplayIndex = i;
|
||||
}
|
||||
} else {
|
||||
for (int i = from - 1; i < to; i++) {
|
||||
reordered_items_indices [i] = reordered_items_indices [i + 1];
|
||||
items [reordered_items_indices [i]].DisplayIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void ChangeItemLocation (int display_index, Point new_pos)
|
||||
{
|
||||
int new_display_index = GetDisplayIndexFromLocation (new_pos);
|
||||
if (new_display_index == display_index)
|
||||
return;
|
||||
|
||||
int item_index = reordered_items_indices [display_index];
|
||||
|
||||
bool forward = new_display_index < display_index;
|
||||
int index_from, index_to;
|
||||
if (forward) {
|
||||
index_from = new_display_index;
|
||||
index_to = display_index - 1;
|
||||
} else {
|
||||
index_from = display_index + 1;
|
||||
index_to = new_display_index;
|
||||
}
|
||||
|
||||
ShiftItemsPositions (index_from, index_to, forward);
|
||||
|
||||
reordered_items_indices [new_display_index] = item_index;
|
||||
items [item_index].DisplayIndex = new_display_index;
|
||||
}
|
||||
|
||||
int GetDisplayIndexFromLocation (Point loc)
|
||||
{
|
||||
// TODO: We could try to compute the corresponding
|
||||
// position using rows, cols and other information, instead
|
||||
// of iterating over all the positions
|
||||
ListViewItem item = GetItemAt (loc.X, loc.Y);
|
||||
if (item == null)
|
||||
return -1;
|
||||
|
||||
return item.DisplayIndex;
|
||||
}
|
||||
|
||||
// When using groups, the items with no group assigned
|
||||
// belong to the DefaultGroup
|
||||
int GetDefaultGroupItems ()
|
||||
@@ -1711,12 +1648,9 @@ namespace System.Windows.Forms
|
||||
for (int i = 0; i < items.Count; i++) {
|
||||
ListViewItem item = items [i];
|
||||
#if NET_2_0
|
||||
if (!virtual_mode)
|
||||
if (!virtual_mode)
|
||||
#endif
|
||||
{
|
||||
item.Layout ();
|
||||
item.DisplayIndex = i;
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
if (using_groups) {
|
||||
@@ -1851,10 +1785,7 @@ namespace System.Windows.Forms
|
||||
#if NET_2_0
|
||||
if (!virtual_mode) // Virtual mode sets Layout until draw time
|
||||
#endif
|
||||
{
|
||||
item.Layout ();
|
||||
item.DisplayIndex = i;
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
if (using_groups) {
|
||||
@@ -1889,11 +1820,10 @@ namespace System.Windows.Forms
|
||||
if (items_location.Length >= count)
|
||||
return;
|
||||
|
||||
// items_location, items_matrix_location and reordered_items_indices must keep the same length
|
||||
// items_location and items_matrix_location must keep the same length
|
||||
count = Math.Max (count, items_location.Length * 2);
|
||||
items_location = new Point [count];
|
||||
items_matrix_location = new ItemMatrixLocation [count];
|
||||
reordered_items_indices = new int [count];
|
||||
}
|
||||
|
||||
private void CalculateListView (ListViewAlignment align)
|
||||
@@ -1943,11 +1873,6 @@ namespace System.Windows.Forms
|
||||
return loc;
|
||||
}
|
||||
|
||||
internal int GetItemIndex (int display_index)
|
||||
{
|
||||
return reordered_items_indices [display_index];
|
||||
}
|
||||
|
||||
private bool KeySearchString (KeyEventArgs ke)
|
||||
{
|
||||
int current_tickcnt = Environment.TickCount;
|
||||
@@ -2641,7 +2566,6 @@ namespace System.Windows.Forms
|
||||
|
||||
Capture = false;
|
||||
if (owner.Items.Count == 0) {
|
||||
ResetMouseState ();
|
||||
owner.OnMouseUp (owner_me);
|
||||
return;
|
||||
}
|
||||
@@ -2678,18 +2602,13 @@ namespace System.Windows.Forms
|
||||
owner.SelectedItems.Clear ();
|
||||
}
|
||||
|
||||
ResetMouseState ();
|
||||
owner.OnMouseUp (owner_me);
|
||||
}
|
||||
|
||||
private void ResetMouseState ()
|
||||
{
|
||||
clicked_item = null;
|
||||
box_select_start = Point.Empty;
|
||||
BoxSelectRectangle = Rectangle.Empty;
|
||||
prev_selection = null;
|
||||
box_select_mode = BoxSelect.None;
|
||||
checking = false;
|
||||
owner.OnMouseUp (owner_me);
|
||||
}
|
||||
|
||||
private void LabelEditFinished (object sender, EventArgs e)
|
||||
@@ -3087,7 +3006,7 @@ namespace System.Windows.Forms
|
||||
{
|
||||
if (index != -1)
|
||||
items [index].Focused = true;
|
||||
else if (focused_item_index != -1) // Previous focused item
|
||||
else if (focused_item_index != -1 && focused_item_index < items.Count) // Previous focused item
|
||||
items [focused_item_index].Focused = false;
|
||||
|
||||
focused_item_index = index;
|
||||
@@ -3357,13 +3276,6 @@ namespace System.Windows.Forms
|
||||
if (eh != null)
|
||||
eh (this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnSearchForVirtualItem (SearchForVirtualItemEventArgs args)
|
||||
{
|
||||
SearchForVirtualItemEventHandler eh = (SearchForVirtualItemEventHandler) Events [SearchForVirtualItemEvent];
|
||||
if (eh != null)
|
||||
eh (this, args);
|
||||
}
|
||||
|
||||
protected virtual void OnVirtualItemsSelectionRangeChanged (ListViewVirtualItemsSelectionRangeChangedEventArgs args)
|
||||
{
|
||||
@@ -3512,19 +3424,6 @@ namespace System.Windows.Forms
|
||||
if (text == null)
|
||||
throw new ArgumentNullException ("text");
|
||||
|
||||
if (virtual_mode) {
|
||||
SearchForVirtualItemEventArgs args = new SearchForVirtualItemEventArgs (true,
|
||||
prefixSearch, includeSubItems, text, Point.Empty,
|
||||
SearchDirectionHint.Down, startIndex);
|
||||
|
||||
OnSearchForVirtualItem (args);
|
||||
int idx = args.Index;
|
||||
if (idx >= 0 && idx < virtual_list_size)
|
||||
return items [idx];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = startIndex; i < items.Count; i++) {
|
||||
ListViewItem lvi = items [i];
|
||||
|
||||
@@ -3545,83 +3444,6 @@ namespace System.Windows.Forms
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ListViewItem FindNearestItem (SearchDirectionHint direction, int x, int y)
|
||||
{
|
||||
return FindNearestItem (direction, new Point (x, y));
|
||||
}
|
||||
|
||||
public ListViewItem FindNearestItem (SearchDirectionHint direction, Point location)
|
||||
{
|
||||
if (direction < SearchDirectionHint.Left || direction > SearchDirectionHint.Down)
|
||||
throw new ArgumentOutOfRangeException ("searchDirection");
|
||||
|
||||
if (view != View.LargeIcon && view != View.SmallIcon)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (virtual_mode) {
|
||||
SearchForVirtualItemEventArgs args = new SearchForVirtualItemEventArgs (false,
|
||||
false, false, String.Empty, location,
|
||||
direction, 0);
|
||||
|
||||
OnSearchForVirtualItem (args);
|
||||
int idx = args.Index;
|
||||
if (idx >= 0 && idx < virtual_list_size)
|
||||
return items [idx];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
ListViewItem item = null;
|
||||
int min_dist = Int32.MaxValue;
|
||||
|
||||
//
|
||||
// It looks like .Net does a previous adjustment
|
||||
//
|
||||
switch (direction) {
|
||||
case SearchDirectionHint.Up:
|
||||
location.Y -= item_size.Height;
|
||||
break;
|
||||
case SearchDirectionHint.Down:
|
||||
location.Y += item_size.Height;
|
||||
break;
|
||||
case SearchDirectionHint.Left:
|
||||
location.X -= item_size.Width;
|
||||
break;
|
||||
case SearchDirectionHint.Right:
|
||||
location.X += item_size.Width;
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < items.Count; i++) {
|
||||
Point item_loc = GetItemLocation (i);
|
||||
|
||||
if (direction == SearchDirectionHint.Up) {
|
||||
if (location.Y < item_loc.Y)
|
||||
continue;
|
||||
} else if (direction == SearchDirectionHint.Down) {
|
||||
if (location.Y > item_loc.Y)
|
||||
continue;
|
||||
} else if (direction == SearchDirectionHint.Left) {
|
||||
if (location.X < item_loc.X)
|
||||
continue;
|
||||
} else if (direction == SearchDirectionHint.Right) {
|
||||
if (location.X > item_loc.X)
|
||||
continue;
|
||||
}
|
||||
|
||||
int x_dist = location.X - item_loc.X;
|
||||
int y_dist = location.Y - item_loc.Y;
|
||||
|
||||
int dist = x_dist * x_dist + y_dist * y_dist;
|
||||
if (dist < min_dist) {
|
||||
item = items [i];
|
||||
min_dist = dist;
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
#endif
|
||||
|
||||
public ListViewItem GetItemAt (int x, int y)
|
||||
@@ -5189,7 +5011,7 @@ namespace System.Windows.Forms
|
||||
owner.OnRetrieveVirtualItem (args);
|
||||
ListViewItem retval = args.Item;
|
||||
retval.Owner = owner;
|
||||
retval.DisplayIndex = displayIndex;
|
||||
retval.SetIndex (displayIndex);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ namespace System.Windows.Forms
|
||||
private ListViewSubItemCollection sub_items;
|
||||
private object tag;
|
||||
private bool use_item_style = true;
|
||||
int display_index = -1; // actual position in ListView
|
||||
#if NET_2_0
|
||||
private ListViewGroup group = null;
|
||||
private string name = String.Empty;
|
||||
private string image_key = String.Empty;
|
||||
string tooltip_text = String.Empty;
|
||||
int indent_count;
|
||||
int index; // cached index for VirtualMode
|
||||
Point position = new Point (-1, -1); // cached to mimic .Net behaviour
|
||||
#endif
|
||||
Rectangle bounds;
|
||||
@@ -428,13 +428,10 @@ namespace System.Windows.Forms
|
||||
return -1;
|
||||
#if NET_2_0
|
||||
if (owner.VirtualMode)
|
||||
return display_index;
|
||||
return index;
|
||||
#endif
|
||||
|
||||
if (display_index == -1)
|
||||
else
|
||||
return owner.Items.IndexOf (this);
|
||||
|
||||
return owner.GetItemIndex (display_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,19 +457,10 @@ namespace System.Windows.Forms
|
||||
public Point Position {
|
||||
get {
|
||||
if (owner != null && owner.VirtualMode)
|
||||
return owner.GetItemLocation (display_index);
|
||||
return owner.GetItemLocation (Index);
|
||||
|
||||
return position;
|
||||
}
|
||||
set {
|
||||
if (owner == null || owner.View == View.Details || owner.View == View.List)
|
||||
return;
|
||||
|
||||
if (owner.VirtualMode)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
owner.ChangeItemLocation (display_index, value);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -671,17 +659,6 @@ namespace System.Windows.Forms
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public ListViewItem FindNearestItem (SearchDirectionHint searchDirection)
|
||||
{
|
||||
if (owner == null)
|
||||
return null;
|
||||
|
||||
Point loc = owner.GetItemLocation (display_index);
|
||||
return owner.FindNearestItem (searchDirection, loc);
|
||||
}
|
||||
#endif
|
||||
|
||||
public Rectangle GetBounds (ItemBoundsPortion portion)
|
||||
{
|
||||
if (owner == null)
|
||||
@@ -716,7 +693,7 @@ namespace System.Windows.Forms
|
||||
throw new ArgumentException ("Invalid value for portion.");
|
||||
}
|
||||
|
||||
Point item_loc = owner.GetItemLocation (DisplayIndex);
|
||||
Point item_loc = owner.GetItemLocation (Index);
|
||||
rect.X += item_loc.X;
|
||||
rect.Y += item_loc.Y;
|
||||
return rect;
|
||||
@@ -773,7 +750,7 @@ namespace System.Windows.Forms
|
||||
internal Rectangle CheckRectReal {
|
||||
get {
|
||||
Rectangle rect = checkbox_rect;
|
||||
Point item_loc = owner.GetItemLocation (DisplayIndex);
|
||||
Point item_loc = owner.GetItemLocation (Index);
|
||||
rect.X += item_loc.X;
|
||||
rect.Y += item_loc.Y;
|
||||
return rect;
|
||||
@@ -784,27 +761,13 @@ namespace System.Windows.Forms
|
||||
internal Rectangle TextBounds {
|
||||
get {
|
||||
Rectangle result = text_bounds;
|
||||
Point loc = owner.GetItemLocation (DisplayIndex);
|
||||
Point loc = owner.GetItemLocation (Index);
|
||||
result.X += loc.X;
|
||||
result.Y += loc.Y;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
internal int DisplayIndex {
|
||||
get {
|
||||
// Special case for Details view
|
||||
// and no columns (which means no Layout at all)
|
||||
if (display_index == -1)
|
||||
return owner.Items.IndexOf (this);
|
||||
|
||||
return display_index;
|
||||
}
|
||||
set {
|
||||
display_index = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
internal bool Hot {
|
||||
get {
|
||||
@@ -832,6 +795,11 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
internal void SetIndex (int index)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
internal void SetGroup (ListViewGroup group)
|
||||
{
|
||||
this.group = group;
|
||||
|
||||
@@ -744,7 +744,7 @@ namespace System.Windows.Forms {
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
return active;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,10 +228,6 @@ namespace System.Windows.Forms
|
||||
|
||||
MdiClient mdi = parent_form.MdiContainer;
|
||||
|
||||
// If there isn't a MdiContainer, we don't need to worry about MdiItems :)
|
||||
if (mdi == null)
|
||||
return;
|
||||
|
||||
// Make a copy so we can delete from the real one
|
||||
ToolStripItem[] loopitems = new ToolStripItem[this.mdi_window_list_item.DropDownItems.Count];
|
||||
this.mdi_window_list_item.DropDownItems.CopyTo (loopitems, 0);
|
||||
|
||||
+35
-45
@@ -29,43 +29,31 @@ using System.Text;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class KeyboardHandler : EventHandlerBase, IEventHandler {
|
||||
internal const uint kEventRawKeyDown = 1;
|
||||
internal const uint kEventRawKeyRepeat = 2;
|
||||
internal const uint kEventRawKeyUp = 3;
|
||||
internal const uint kEventRawKeyModifiersChanged = 4;
|
||||
internal const uint kEventHotKeyPressed = 5;
|
||||
internal const uint kEventHotKeyReleased = 6;
|
||||
|
||||
internal const uint kEventParamKeyMacCharCodes = 1801676914;
|
||||
internal const uint kEventParamKeyModifiers = 1802334052;
|
||||
|
||||
internal const uint typeChar = 1413830740;
|
||||
internal const uint typeUInt32 = 1835100014;
|
||||
|
||||
namespace System.Windows.Forms {
|
||||
internal class OSXKeyboard {
|
||||
UInt32 modifiers = 0;
|
||||
|
||||
internal KeyboardHandler (XplatUICarbon driver) : base (driver) {}
|
||||
public OSXKeyboard () {
|
||||
}
|
||||
|
||||
private bool ModifiersToVirtualKeys (UInt32 new_modifiers, ref MSG msg, out int vkey) {
|
||||
// TODO: X11 appears to only generate VK_SHIFT rather than VK_LSHIFT/VK_RSHIFT
|
||||
if ((new_modifiers & (uint)KeyboardModifiers.shiftKey) == (uint)KeyboardModifiers.shiftKey && ((modifiers & (uint)KeyboardModifiers.shiftKey) == 0)) {
|
||||
if ((new_modifiers & (uint)OSXKeyboardModifiers.shiftKey) == (uint)OSXKeyboardModifiers.shiftKey && ((modifiers & (uint)OSXKeyboardModifiers.shiftKey) == 0)) {
|
||||
msg.message = Msg.WM_KEYDOWN;
|
||||
vkey = (int) VirtualKeys.VK_SHIFT;
|
||||
} else if ((new_modifiers & (uint)KeyboardModifiers.shiftKey) == 0 && ((modifiers & (uint)KeyboardModifiers.shiftKey) == (uint)KeyboardModifiers.shiftKey)) {
|
||||
} else if ((new_modifiers & (uint)OSXKeyboardModifiers.shiftKey) == 0 && ((modifiers & (uint)OSXKeyboardModifiers.shiftKey) == (uint)OSXKeyboardModifiers.shiftKey)) {
|
||||
msg.message = Msg.WM_KEYUP;
|
||||
vkey = (int) VirtualKeys.VK_SHIFT;
|
||||
} else if ((new_modifiers & (uint)KeyboardModifiers.rightShiftKey) == (uint)KeyboardModifiers.rightShiftKey && ((modifiers & (uint)KeyboardModifiers.rightShiftKey) == 0)) {
|
||||
} else if ((new_modifiers & (uint)OSXKeyboardModifiers.rightShiftKey) == (uint)OSXKeyboardModifiers.rightShiftKey && ((modifiers & (uint)OSXKeyboardModifiers.rightShiftKey) == 0)) {
|
||||
msg.message = Msg.WM_KEYDOWN;
|
||||
vkey = (int) VirtualKeys.VK_SHIFT;
|
||||
} else if ((new_modifiers & (uint)KeyboardModifiers.rightShiftKey) == 0 && ((modifiers & (uint)KeyboardModifiers.rightShiftKey) == (uint)KeyboardModifiers.rightShiftKey)) {
|
||||
} else if ((new_modifiers & (uint)OSXKeyboardModifiers.rightShiftKey) == 0 && ((modifiers & (uint)OSXKeyboardModifiers.rightShiftKey) == (uint)OSXKeyboardModifiers.rightShiftKey)) {
|
||||
msg.message = Msg.WM_KEYUP;
|
||||
vkey = (int) VirtualKeys.VK_SHIFT;
|
||||
} else if ((new_modifiers & (uint)KeyboardModifiers.cmdKey) == (uint)KeyboardModifiers.cmdKey && ((modifiers & (uint)KeyboardModifiers.cmdKey) == 0)) {
|
||||
} else if ((new_modifiers & (uint)OSXKeyboardModifiers.cmdKey) == (uint)OSXKeyboardModifiers.cmdKey && ((modifiers & (uint)OSXKeyboardModifiers.cmdKey) == 0)) {
|
||||
msg.message = Msg.WM_KEYDOWN;
|
||||
vkey = (int) VirtualKeys.VK_LWIN;
|
||||
} else if ((new_modifiers & (uint)KeyboardModifiers.cmdKey) == 0 && ((modifiers & (uint)KeyboardModifiers.cmdKey) == (uint)KeyboardModifiers.cmdKey)) {
|
||||
} else if ((new_modifiers & (uint)OSXKeyboardModifiers.cmdKey) == 0 && ((modifiers & (uint)OSXKeyboardModifiers.cmdKey) == (uint)OSXKeyboardModifiers.cmdKey)) {
|
||||
msg.message = Msg.WM_KEYUP;
|
||||
vkey = (int) VirtualKeys.VK_LWIN;
|
||||
} else {
|
||||
@@ -82,40 +70,42 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
}
|
||||
|
||||
|
||||
public bool ProcessEvent (IntPtr eventref, IntPtr handle, uint kind, ref MSG msg) {
|
||||
Hwnd hwnd = Hwnd.ObjectFromHandle (handle);
|
||||
public bool KeyEvent (IntPtr inEvent, IntPtr handle, uint eventKind, ref MSG msg) {
|
||||
int vkey = -1;
|
||||
bool result = true;
|
||||
byte charCode = 0x0;
|
||||
UInt32 new_modifiers = 0;
|
||||
|
||||
if (hwnd == null)
|
||||
return false;
|
||||
|
||||
msg.hwnd = hwnd.Handle;
|
||||
|
||||
GetEventParameter (eventref, kEventParamKeyMacCharCodes, typeChar, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (byte)), IntPtr.Zero, ref charCode);
|
||||
GetEventParameter (eventref, kEventParamKeyModifiers, typeUInt32, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (UInt32)), IntPtr.Zero, ref new_modifiers);
|
||||
|
||||
switch (kind) {
|
||||
case kEventRawKeyDown:
|
||||
case kEventRawKeyRepeat:
|
||||
switch (eventKind) {
|
||||
case OSXConstants.kEventRawKeyDown: {
|
||||
msg.message = Msg.WM_KEYDOWN;
|
||||
GetEventParameter (inEvent, OSXConstants.EventParamName.kEventParamKeyMacCharCodes, OSXConstants.EventParamType.typeChar, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (byte)), IntPtr.Zero, ref charCode);
|
||||
result = CharCodeToVirtualKeys (charCode, out vkey);
|
||||
break;
|
||||
case kEventRawKeyUp:
|
||||
}
|
||||
case OSXConstants.kEventRawKeyUp: {
|
||||
msg.message = Msg.WM_KEYUP;
|
||||
GetEventParameter (inEvent, OSXConstants.EventParamName.kEventParamKeyMacCharCodes, OSXConstants.EventParamType.typeChar, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (byte)), IntPtr.Zero, ref charCode);
|
||||
result = CharCodeToVirtualKeys (charCode, out vkey);
|
||||
break;
|
||||
case kEventRawKeyModifiersChanged:
|
||||
}
|
||||
case OSXConstants.kEventRawKeyRepeat: {
|
||||
msg.message = Msg.WM_KEYDOWN;
|
||||
GetEventParameter (inEvent, OSXConstants.EventParamName.kEventParamKeyMacCharCodes, OSXConstants.EventParamType.typeChar, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (byte)), IntPtr.Zero, ref charCode);
|
||||
result = CharCodeToVirtualKeys (charCode, out vkey);
|
||||
break;
|
||||
}
|
||||
case OSXConstants.kEventRawKeyModifiersChanged: {
|
||||
UInt32 new_modifiers = 0;
|
||||
GetEventParameter (inEvent, OSXConstants.EventParamName.kEventParamKeyModifiers, OSXConstants.EventParamType.typeUInt32, IntPtr.Zero, (uint)Marshal.SizeOf (typeof (UInt32)), IntPtr.Zero, ref new_modifiers);
|
||||
result = ModifiersToVirtualKeys (new_modifiers, ref msg, out vkey);
|
||||
modifiers = new_modifiers;
|
||||
break;
|
||||
}
|
||||
}
|
||||
msg.wParam = (IntPtr) vkey;
|
||||
|
||||
if (result) {
|
||||
GetKeyboardFocus (handle, ref msg.hwnd);
|
||||
msg.lParam = IntPtr.Zero;
|
||||
msg.wParam = (IntPtr) vkey;
|
||||
GetKeyboardFocus (handle, ref msg.hwnd);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -138,14 +128,14 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
}
|
||||
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref byte data);
|
||||
static extern int GetEventParameter (IntPtr evt, OSXConstants.EventParamName inName, OSXConstants.EventParamType inType, IntPtr outActualType, uint bufSize, IntPtr outActualSize, ref byte outData);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetEventParameter (IntPtr eventref, uint name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref UInt32 data);
|
||||
static extern int GetEventParameter (IntPtr evt, OSXConstants.EventParamName inName, OSXConstants.EventParamType inType, IntPtr outActualType, uint bufSize, IntPtr outActualSize, ref UInt32 outData);
|
||||
[DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
|
||||
static extern int GetKeyboardFocus (IntPtr handle, ref IntPtr control);
|
||||
static extern int GetKeyboardFocus (IntPtr handle, ref IntPtr cntrl);
|
||||
}
|
||||
|
||||
internal enum KeyboardModifiers : uint {
|
||||
internal enum OSXKeyboardModifiers : uint {
|
||||
activeFlag = 1 << 0,
|
||||
btnState = 1 << 7,
|
||||
cmdKey = 1 << 8,
|
||||
@@ -0,0 +1,532 @@
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software",, to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// Copyright (c) 2005 Novell, Inc.
|
||||
//
|
||||
// Authors:
|
||||
// Geoff Norton <[email protected]>
|
||||
//
|
||||
|
||||
|
||||
// NOT COMPLETE
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// Mac OSX Version
|
||||
namespace System.Windows.Forms {
|
||||
|
||||
internal class OSXConstants {
|
||||
|
||||
#region EventClass constants
|
||||
internal const uint kEventClassMouse = 1836021107;
|
||||
internal const uint kEventClassKeyboard = 1801812322;
|
||||
internal const uint kEventClassTextInput = 1952807028;
|
||||
internal const uint kEventClassApplication = 1634758764;
|
||||
internal const uint kEventClassAppleEvent = 1701867619;
|
||||
internal const uint kEventClassMenu = 1835363957;
|
||||
internal const uint kEventClassWindow = 2003398244;
|
||||
internal const uint kEventClassControl = 1668183148;
|
||||
internal const uint kEventClassCommand = 1668113523;
|
||||
internal const uint kEventClassTablet = 1952607348;
|
||||
internal const uint kEventClassVolume = 1987013664;
|
||||
internal const uint kEventClassAppearance = 1634758765;
|
||||
internal const uint kEventClassService = 1936028278;
|
||||
internal const uint kEventClassToolbar = 1952604530;
|
||||
internal const uint kEventClassToolbarItem = 1952606580;
|
||||
internal const uint kEventClassAccessibility = 1633903461;
|
||||
#endregion
|
||||
|
||||
#region kEventClassMouse constants
|
||||
internal const uint kEventMouseDown = 1;
|
||||
internal const uint kEventMouseUp = 2;
|
||||
internal const uint kEventMouseMoved = 5;
|
||||
internal const uint kEventMouseDragged = 6;
|
||||
internal const uint kEventMouseEntered = 8;
|
||||
internal const uint kEventMouseExited = 9;
|
||||
internal const uint kEventMouseWheelMoved = 10;
|
||||
#endregion
|
||||
|
||||
#region kEventClassKeyboard constants
|
||||
internal const uint kEventRawKeyDown = 1;
|
||||
internal const uint kEventRawKeyRepeat = 2;
|
||||
internal const uint kEventRawKeyUp = 3;
|
||||
internal const uint kEventRawKeyModifiersChanged = 4;
|
||||
internal const uint kEventHotKeyPressed = 5;
|
||||
internal const uint kEventHotKeyReleased = 6;
|
||||
#endregion
|
||||
|
||||
#region kEventClassTextInput constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassApplication constants
|
||||
internal const uint kEventAppActivated = 1;
|
||||
internal const uint kEventAppDeactivated = 2;
|
||||
internal const uint kEventAppQuit = 3;
|
||||
internal const uint kEventAppLaunchNotification = 4;
|
||||
internal const uint kEventAppLaunched = 5;
|
||||
internal const uint kEventAppTerminated = 6;
|
||||
internal const uint kEventAppFrontSwitched = 7;
|
||||
internal const uint kEventAppFocusMenuBar = 8;
|
||||
internal const uint kEventAppFocusNextDocumentWindow = 9;
|
||||
internal const uint kEventAppFocusNextFloatingWindow = 10;
|
||||
internal const uint kEventAppFocusToolbar = 11;
|
||||
internal const uint kEventAppFocusDrawer = 12;
|
||||
internal const uint kEventAppGetDockTileMenu = 20;
|
||||
internal const uint kEventAppIsEventInInstantMouser = 104;
|
||||
internal const uint kEventAppHidden = 107;
|
||||
internal const uint kEventAppShown = 108;
|
||||
internal const uint kEventAppSystemUIModeChanged = 109;
|
||||
internal const uint kEventAppAvailableWindowBoundsChanged = 110;
|
||||
internal const uint kEventAppActiveWindowChanged = 111;
|
||||
#endregion
|
||||
|
||||
#region kEventClassAppleEvent constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassMenu constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassWindow constants
|
||||
internal const uint kEventWindowUpdate = 1;
|
||||
internal const uint kEventWindowDrawContent = 2;
|
||||
internal const uint kEventWindowActivated = 5;
|
||||
internal const uint kEventWindowDeactivated = 6;
|
||||
internal const uint kEventWindowGetClickActivation = 7;
|
||||
internal const uint kEventWindowShowing = 22;
|
||||
internal const uint kEventWindowHiding = 23;
|
||||
internal const uint kEventWindowShown = 24;
|
||||
internal const uint kEventWindowHidden = 25;
|
||||
internal const uint kEventWindowCollapsing = 86;
|
||||
internal const uint kEventWindowExpanding = 87;
|
||||
internal const uint kEventWindowZoomed = 76;
|
||||
internal const uint kEventWindowBoundsChanging = 26;
|
||||
internal const uint kEventWindowBoundsChanged = 27;
|
||||
internal const uint kEventWindowResizeStarted = 28;
|
||||
internal const uint kEventWindowResizeCompleted = 29;
|
||||
internal const uint kEventWindowDragStarted = 30;
|
||||
internal const uint kEventWindowDragCompleted = 31;
|
||||
internal const uint kEventWindowTransitionStarted = 88;
|
||||
internal const uint kEventWindowTransitionCompleted = 89;
|
||||
internal const uint kEventWindowClickDragRgn = 32;
|
||||
internal const uint kEventWindowClickResizeRgn = 33;
|
||||
internal const uint kEventWindowClickCollapseRgn = 34;
|
||||
internal const uint kEventWindowClickCloseRgn = 35;
|
||||
internal const uint kEventWindowClickZoomRgn = 36;
|
||||
internal const uint kEventWindowClickContentRgn = 37;
|
||||
internal const uint kEventWindowClickProxyIconRgn = 38;
|
||||
internal const uint kEventWindowClickToolbarButtonRgn = 41;
|
||||
internal const uint kEventWindowClickStructureRgn = 42;
|
||||
internal const uint kEventWindowCursorChange = 40;
|
||||
internal const uint kEventWindowCollapse = 66;
|
||||
internal const uint kEventWindowCollapsed = 67;
|
||||
internal const uint kEventWindowCollapseAll = 68;
|
||||
internal const uint kEventWindowExpand = 69;
|
||||
internal const uint kEventWindowExpanded = 70;
|
||||
internal const uint kEventWindowExpandAll = 71;
|
||||
internal const uint kEventWindowClose = 72;
|
||||
internal const uint kEventWindowClosed = 73;
|
||||
internal const uint kEventWindowCloseAll = 74;
|
||||
internal const uint kEventWindowZoom = 75;
|
||||
internal const uint kEventWindowZoomAll = 77;
|
||||
internal const uint kEventWindowContextualMenuSelect = 78;
|
||||
internal const uint kEventWindowPathSelect = 79;
|
||||
internal const uint kEventWindowGetIdealSize = 80;
|
||||
internal const uint kEventWindowGetMinimumSize = 81;
|
||||
internal const uint kEventWindowGetMaximumSize = 82;
|
||||
internal const uint kEventWindowConstrain = 83;
|
||||
internal const uint kEventWindowHandleContentClick = 85;
|
||||
internal const uint kEventWindowGetDockTileMenu = 90;
|
||||
internal const uint kEventWindowHandleActivate = 91;
|
||||
internal const uint kEventWindowHandleDeactivate = 92;
|
||||
internal const uint kEventWindowProxyBeginDrag = 128;
|
||||
internal const uint kEventWindowProxyEndDrag = 129;
|
||||
internal const uint kEventWindowToolbarSwitchMode = 150;
|
||||
internal const uint kEventWindowFocusAcquired = 200;
|
||||
internal const uint kEventWindowFocusRelinquish = 201;
|
||||
internal const uint kEventWindowFocusContent = 202;
|
||||
internal const uint kEventWindowFocusToolbar = 203;
|
||||
internal const uint kEventWindowDrawerOpening = 220;
|
||||
internal const uint kEventWindowDrawerOpened = 221;
|
||||
internal const uint kEventWindowDrawerClosing = 222;
|
||||
internal const uint kEventWindowDrawerClosed = 223;
|
||||
internal const uint kEventWindowDrawFrame = 1000;
|
||||
internal const uint kEventWindowDrawPart = 1001;
|
||||
internal const uint kEventWindowGetRegion = 1002;
|
||||
internal const uint kEventWindowHitTest = 1003;
|
||||
internal const uint kEventWindowInit = 1004;
|
||||
internal const uint kEventWindowDispose = 1005;
|
||||
internal const uint kEventWindowDragHilite = 1006;
|
||||
internal const uint kEventWindowModified = 1007;
|
||||
internal const uint kEventWindowSetupProxyDragImage = 1008;
|
||||
internal const uint kEventWindowStateChanged = 1009;
|
||||
internal const uint kEventWindowMeasureTitle = 1010;
|
||||
internal const uint kEventWindowDrawGrowBox = 1011;
|
||||
internal const uint kEventWindowGetGrowImageRegion = 1012;
|
||||
internal const uint kEventWindowPaint = 1013;
|
||||
#endregion
|
||||
|
||||
#region kEventClassControl constants
|
||||
internal const uint kEventControlInitialize = 1000;
|
||||
internal const uint kEventControlDispose = 1001;
|
||||
internal const uint kEventControlGetOptimalBounds = 1003;
|
||||
internal const uint kEventControlDefInitialize = kEventControlInitialize;
|
||||
internal const uint kEventControlDefDispose = kEventControlDispose;
|
||||
internal const uint kEventControlHit = 1;
|
||||
internal const uint kEventControlSimulateHit = 2;
|
||||
internal const uint kEventControlHitTest = 3;
|
||||
internal const uint kEventControlDraw = 4;
|
||||
internal const uint kEventControlApplyBackground = 5;
|
||||
internal const uint kEventControlApplyTextColor = 6;
|
||||
internal const uint kEventControlSetFocusPart = 7;
|
||||
internal const uint kEventControlGetFocusPart = 8;
|
||||
internal const uint kEventControlActivate = 9;
|
||||
internal const uint kEventControlDeactivate = 10;
|
||||
internal const uint kEventControlSetCursor = 11;
|
||||
internal const uint kEventControlContextualMenuClick = 12;
|
||||
internal const uint kEventControlClick = 13;
|
||||
internal const uint kEventControlGetNextFocusCandidate = 14;
|
||||
internal const uint kEventControlGetAutoToggleValue = 15;
|
||||
internal const uint kEventControlInterceptSubviewClick = 16;
|
||||
internal const uint kEventControlGetClickActivation = 17;
|
||||
internal const uint kEventControlDragEnter = 18;
|
||||
internal const uint kEventControlDragWithin = 19;
|
||||
internal const uint kEventControlDragLeave = 20;
|
||||
internal const uint kEventControlDragReceive = 21;
|
||||
internal const uint kEventControlInvalidateForSizeChange = 22;
|
||||
internal const uint kEventControlTrackingAreaEntered = 23;
|
||||
internal const uint kEventControlTrackingAreaExited = 24;
|
||||
internal const uint kEventControlTrack = 51;
|
||||
internal const uint kEventControlGetScrollToHereStartPoint = 52;
|
||||
internal const uint kEventControlGetIndicatorDragConstraint = 53;
|
||||
internal const uint kEventControlIndicatorMoved = 54;
|
||||
internal const uint kEventControlGhostingFinished = 55;
|
||||
internal const uint kEventControlGetActionProcPart = 56;
|
||||
internal const uint kEventControlGetPartRegion = 101;
|
||||
internal const uint kEventControlGetPartBounds = 102;
|
||||
internal const uint kEventControlSetData = 103;
|
||||
internal const uint kEventControlGetData = 104;
|
||||
internal const uint kEventControlGetSizeConstraints= 105;
|
||||
internal const uint kEventControlGetFrameMetrics = 106;
|
||||
internal const uint kEventControlValueFieldChanged = 151;
|
||||
internal const uint kEventControlAddedSubControl = 152;
|
||||
internal const uint kEventControlRemovingSubControl = 153;
|
||||
internal const uint kEventControlBoundsChanged = 154;
|
||||
internal const uint kEventControlVisibilityChanged = 157;
|
||||
internal const uint kEventControlTitleChanged = 158;
|
||||
internal const uint kEventControlOwningWindowChanged = 159;
|
||||
internal const uint kEventControlHiliteChanged = 160;
|
||||
internal const uint kEventControlEnabledStateChanged = 161;
|
||||
internal const uint kEventControlLayoutInfoChanged = 162;
|
||||
internal const uint kEventControlArbitraryMessage = 201;
|
||||
#endregion
|
||||
|
||||
#region kEventClassCommand constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassTablet constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassVolume constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassAppearance constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassService constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassToolbar constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassToolbarItem constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventClassAccessibility constants
|
||||
// TODO: We dont use these yet; fill if needed
|
||||
#endregion
|
||||
|
||||
#region kEventParam constants
|
||||
|
||||
internal enum EventParamName : uint {
|
||||
// source: /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEvents.h
|
||||
|
||||
/* Keyboard event parameter and types*/
|
||||
kEventParamKeyMacCharCodes = 1801676914, // 'kchr'
|
||||
kEventParamKeyModifiers = 1802334052, // 'kmod'
|
||||
|
||||
/* Mouse event parameters and types*/
|
||||
kEventParamMouseLocation = 1835822947, // 'mloc', /* typeHIPoint*/
|
||||
kEventParamMouseButton = 1835168878, // 'mbtn' /* type MouseButton*/
|
||||
|
||||
/* Generic toolbox parameters and types */
|
||||
kEventParamCGContextRef = 1668183160, // 'cntx' /* typeCGContextRef*/
|
||||
kEventParamRgnHandle = 1919381096, // 'rgnh'
|
||||
|
||||
/* Control event parameters and types */
|
||||
kEventParamControlPart = 1668313716, // 'cprt' /* typeControlPartCode*/
|
||||
|
||||
// source: /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h
|
||||
/* Core Event Types */
|
||||
kEventParamDirectObject = 757935405, // '----' /* type varies depending on event*/
|
||||
}
|
||||
|
||||
internal enum EventParamType : uint {
|
||||
typeControlPartCode = 1668313716, // 'cprt' /* ControlPartCode*/
|
||||
typeQDPoint = 1363439732, // 'QDpt'
|
||||
typeControlRef = 1668575852, // 'ctrl'
|
||||
typeCGContextRef = 1668183160, // 'cntx' /* CGContextRef*/
|
||||
typeMouseButton = 1835168878, // 'mbtn' /* EventMouseButton*/
|
||||
typeQDRgnHandle = 1919381096, // 'rgnh'
|
||||
typeChar = 1413830740, // 'TEXT'
|
||||
typeUInt32 = 1835100014, // 'TEXT'
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
internal enum WindowClass : uint {
|
||||
kAlertWindowClass = 1,
|
||||
kMovableAlertWindowClass = 2,
|
||||
kModalWindowClass = 3,
|
||||
kMovableModalWindowClass = 4,
|
||||
kFloatingWindowClass = 5,
|
||||
kDocumentWindowClass = 6,
|
||||
kUtilityWindowClass = 8,
|
||||
kHelpWindowClass = 10,
|
||||
kSheetWindowClass = 11,
|
||||
kToolbarWindowClass = 12,
|
||||
kPlainWindowClass = 13,
|
||||
kOverlayWindowClass = 14,
|
||||
kSheetAlertWindowClass = 15,
|
||||
kAltPlainWindowClass = 16,
|
||||
kDrawerWindowClass = 20,
|
||||
kAllWindowClasses = 0xFFFFFFFF
|
||||
}
|
||||
|
||||
internal enum WindowAttributes : uint {
|
||||
kWindowNoAttributes = 0,
|
||||
kWindowCloseBoxAttribute = (1u << 0),
|
||||
kWindowHorizontalZoomAttribute = (1u << 1),
|
||||
kWindowVerticalZoomAttribute = (1u << 2),
|
||||
kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute),
|
||||
kWindowCollapseBoxAttribute = (1u << 3),
|
||||
kWindowResizableAttribute = (1u << 4),
|
||||
kWindowSideTitlebarAttribute = (1u << 5),
|
||||
kWindowToolbarButtonAttribute = (1u << 6),
|
||||
kWindowMetalAttribute = (1u << 8),
|
||||
kWindowNoUpdatesAttribute = (1u << 16),
|
||||
kWindowNoActivatesAttribute = (1u << 17),
|
||||
kWindowOpaqueForEventsAttribute = (1u << 18),
|
||||
kWindowCompositingAttribute = (1u << 19),
|
||||
kWindowNoShadowAttribute = (1u << 21),
|
||||
kWindowHideOnSuspendAttribute = (1u << 24),
|
||||
kWindowStandardHandlerAttribute = (1u << 25),
|
||||
kWindowHideOnFullScreenAttribute = (1u << 26),
|
||||
kWindowInWindowMenuAttribute = (1u << 27),
|
||||
kWindowuiveResizeAttribute = (1u << 28),
|
||||
kWindowIgnoreClicksAttribute = (1u << 29),
|
||||
kWindowNoConstrainAttribute = (1u << 31),
|
||||
kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute),
|
||||
kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
|
||||
}
|
||||
internal enum ThemeCursor : uint {
|
||||
kThemeArrowCursor = 0,
|
||||
kThemeCopyArrowCursor = 1,
|
||||
kThemeAliasArrowCursor = 2,
|
||||
kThemeContextualMenuArrowCursor = 3,
|
||||
kThemeIBeamCursor = 4,
|
||||
kThemeCrossCursor = 5,
|
||||
kThemePlusCursor = 6,
|
||||
kThemeWatchCursor = 7,
|
||||
kThemeClosedHandCursor = 8,
|
||||
kThemeOpenHandCursor = 9,
|
||||
kThemePointingHandCursor = 10,
|
||||
kThemeCountingUpHandCursor = 11,
|
||||
kThemeCountingDownHandCursor = 12,
|
||||
kThemeCountingUpAndDownHandCursor = 13,
|
||||
kThemeSpinningCursor = 14,
|
||||
kThemeResizeLeftCursor = 15,
|
||||
kThemeResizeRightCursor = 16,
|
||||
kThemeResizeLeftRightCursor = 17,
|
||||
kThemeNotAllowedCursor = 18
|
||||
}
|
||||
|
||||
internal struct CGSize {
|
||||
public float width;
|
||||
public float height;
|
||||
|
||||
public CGSize (int w, int h) {
|
||||
this.width = (float)w;
|
||||
this.height = (float)h;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct QDPoint {
|
||||
public short y;
|
||||
public short x;
|
||||
|
||||
public QDPoint (short x, short y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
internal struct CGPoint {
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
public CGPoint (int x, int y) {
|
||||
this.x = (float)x;
|
||||
this.y = (float)y;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct HIRect {
|
||||
public CGPoint origin;
|
||||
public CGSize size;
|
||||
|
||||
public HIRect (int x, int y, int w, int h) {
|
||||
this.origin = new CGPoint (x, y);
|
||||
this.size = new CGSize (w, h);
|
||||
}
|
||||
}
|
||||
|
||||
internal struct HIViewID {
|
||||
public uint type;
|
||||
public uint id;
|
||||
|
||||
public HIViewID (uint type, uint id) {
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct EventTypeSpec
|
||||
{
|
||||
public UInt32 eventClass;
|
||||
public UInt32 eventKind;
|
||||
|
||||
public EventTypeSpec (UInt32 eventClass, UInt32 eventKind)
|
||||
{
|
||||
this.eventClass = eventClass;
|
||||
this.eventKind = eventKind;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CarbonEvent
|
||||
{
|
||||
public IntPtr hWnd;
|
||||
public IntPtr evt;
|
||||
|
||||
public CarbonEvent (IntPtr hWnd, IntPtr evt)
|
||||
{
|
||||
this.hWnd = hWnd;
|
||||
this.evt = evt;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct RGBColor
|
||||
{
|
||||
public short red;
|
||||
public short green;
|
||||
public short blue;
|
||||
}
|
||||
|
||||
internal struct Rect
|
||||
{
|
||||
public short top;
|
||||
public short left;
|
||||
public short bottom;
|
||||
public short right;
|
||||
}
|
||||
|
||||
internal struct OSXCaret
|
||||
{
|
||||
internal Timer Timer;
|
||||
internal IntPtr Hwnd;
|
||||
internal int X;
|
||||
internal int Y;
|
||||
internal int Width;
|
||||
internal int Height;
|
||||
internal int Visible;
|
||||
internal bool On;
|
||||
internal bool Paused;
|
||||
}
|
||||
|
||||
internal struct OSXHover {
|
||||
internal Timer Timer;
|
||||
internal IntPtr Hwnd;
|
||||
internal int X;
|
||||
internal int Y;
|
||||
internal int Interval;
|
||||
}
|
||||
|
||||
internal struct CGAffineTransform
|
||||
{
|
||||
internal float a;
|
||||
internal float b;
|
||||
internal float c;
|
||||
internal float d;
|
||||
internal float tx;
|
||||
internal float ty;
|
||||
}
|
||||
|
||||
internal enum MouseTrackingResult : ushort
|
||||
{
|
||||
kMouseTrackingMouseDown = 1,
|
||||
kMouseTrackingMouseUp = 2,
|
||||
kMouseTrackingMouseExited = 3,
|
||||
kMouseTrackingMouseEntered = 4,
|
||||
kMouseTrackingMouseDragged = 5,
|
||||
kMouseTrackingKeyModifiersChanged = 6,
|
||||
kMouseTrackingUserCancelled = 7,
|
||||
kMouseTrackingTimedOut = 8,
|
||||
kMouseTrackingMouseMoved = 9
|
||||
}
|
||||
|
||||
internal struct MouseTrackingRegionID
|
||||
{
|
||||
public uint signature;
|
||||
public uint id;
|
||||
|
||||
public MouseTrackingRegionID (uint signature, uint id) {
|
||||
this.signature = signature;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ProcessSerialNumber
|
||||
{
|
||||
public ulong highLongOfPSN;
|
||||
public ulong lowLongOfPSN;
|
||||
}
|
||||
}
|
||||
@@ -1165,7 +1165,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
} else {
|
||||
if (!control) {
|
||||
document.DeleteChar(document.CaretTag.Line, document.CaretPosition, true);
|
||||
document.DeleteChar(document.CaretTag, document.CaretPosition, true);
|
||||
} else {
|
||||
int end_pos;
|
||||
|
||||
@@ -1178,7 +1178,7 @@ namespace System.Windows.Forms
|
||||
if (end_pos < document.CaretLine.Text.Length) {
|
||||
end_pos++;
|
||||
}
|
||||
document.DeleteChars(document.CaretTag.Line, document.CaretPosition, end_pos - document.CaretPosition);
|
||||
document.DeleteChars(document.CaretTag, document.CaretPosition, end_pos - document.CaretPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1309,29 +1309,29 @@ namespace System.Windows.Forms
|
||||
return true;
|
||||
}
|
||||
|
||||
//case Keys.Enter: {
|
||||
// // ignoring accepts_return, fixes bug #76355
|
||||
// if (!read_only && document.multiline && (accepts_return || (FindForm() != null && FindForm().AcceptButton == null) || ((Control.ModifierKeys & Keys.Control) != 0))) {
|
||||
// Line line;
|
||||
case Keys.Enter: {
|
||||
// ignoring accepts_return, fixes bug #76355
|
||||
if (!read_only && document.multiline && (accepts_return || (FindForm() != null && FindForm().AcceptButton == null) || ((Control.ModifierKeys & Keys.Control) != 0))) {
|
||||
Line line;
|
||||
|
||||
// if (document.selection_visible) {
|
||||
// document.ReplaceSelection("\n", false);
|
||||
// }
|
||||
if (document.selection_visible) {
|
||||
document.ReplaceSelection("\n", false);
|
||||
}
|
||||
|
||||
// line = document.CaretLine;
|
||||
line = document.CaretLine;
|
||||
|
||||
// document.Split (document.CaretLine, document.CaretTag, document.CaretPosition);
|
||||
// line.ending = LineEnding.Rich;
|
||||
// document.InsertString (line, line.text.Length,
|
||||
// document.LineEndingToString (line.ending));
|
||||
// OnTextChanged(EventArgs.Empty);
|
||||
document.Split (document.CaretLine, document.CaretTag, document.CaretPosition);
|
||||
line.ending = LineEnding.Rich;
|
||||
document.InsertString (line, line.text.Length,
|
||||
document.LineEndingToString (line.ending));
|
||||
OnTextChanged(EventArgs.Empty);
|
||||
|
||||
// document.UpdateView (line, document.Lines - line.line_no, 0);
|
||||
// CaretMoved(this, null);
|
||||
// return true;
|
||||
// }
|
||||
// break;
|
||||
//}
|
||||
document.UpdateView (line, document.Lines - line.line_no, 0);
|
||||
CaretMoved(this, null);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Keys.Tab: {
|
||||
if (!read_only && accepts_tab && document.multiline) {
|
||||
@@ -1409,7 +1409,7 @@ namespace System.Windows.Forms
|
||||
LineTag tag = document.CaretTag;
|
||||
int pos = document.CaretPosition;
|
||||
document.MoveCaret (CaretDirection.CharBack);
|
||||
document.DeleteChar (tag.Line, pos, false);
|
||||
document.DeleteChar (tag, pos, false);
|
||||
document.SetSelectionToCaret (true);
|
||||
} else {
|
||||
int start_pos;
|
||||
@@ -1421,7 +1421,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
document.undo.BeginUserAction (Locale.GetText ("Delete"));
|
||||
document.DeleteChars(document.CaretTag.Line, start_pos, document.CaretPosition - start_pos);
|
||||
document.DeleteChars(document.CaretTag, start_pos, document.CaretPosition - start_pos);
|
||||
document.undo.EndUserAction ();
|
||||
document.PositionCaret(document.CaretLine, start_pos);
|
||||
document.SetSelectionToCaret (true);
|
||||
@@ -1435,28 +1435,6 @@ namespace System.Windows.Forms
|
||||
CaretMoved(this, null);
|
||||
}
|
||||
|
||||
private void HandleEnter ()
|
||||
{
|
||||
// ignoring accepts_return, fixes bug #76355
|
||||
if (!read_only && document.multiline && (accepts_return || (FindForm() != null && FindForm().AcceptButton == null) || ((Control.ModifierKeys & Keys.Control) != 0))) {
|
||||
Line line;
|
||||
|
||||
if (document.selection_visible)
|
||||
document.ReplaceSelection ("\n", false);
|
||||
|
||||
line = document.CaretLine;
|
||||
|
||||
document.Split (document.CaretLine, document.CaretTag, document.CaretPosition);
|
||||
line.ending = LineEnding.Rich;
|
||||
document.InsertString (line, line.text.Length, document.LineEndingToString (line.ending));
|
||||
|
||||
OnTextChanged (EventArgs.Empty);
|
||||
|
||||
document.UpdateView (line, document.Lines - line.line_no, 0);
|
||||
CaretMoved (this, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
|
||||
{
|
||||
// Make sure we don't get sized bigger than we want to be
|
||||
@@ -1539,8 +1517,7 @@ namespace System.Windows.Forms
|
||||
return;
|
||||
} else if (ch == 8) {
|
||||
HandleBackspace(false);
|
||||
} else if (ch == 13)
|
||||
HandleEnter ();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,13 +95,13 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
internal enum LineEnding {
|
||||
Wrap = 1, // line wraps to the next line
|
||||
Limp = 2, // \r
|
||||
Hard = 4, // \r\n
|
||||
Soft = 8, // \r\r\n
|
||||
Rich = 16, // \n
|
||||
Wrap, // line wraps to the next line
|
||||
Limp, // \r
|
||||
Hard, // \r\n
|
||||
Soft, // \r\r\n
|
||||
Rich, // \n
|
||||
|
||||
None = 0
|
||||
None
|
||||
}
|
||||
|
||||
internal class Document : ICloneable, IEnumerable {
|
||||
@@ -1511,26 +1511,11 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
}
|
||||
|
||||
private int GetLineEnding (string line, int start, out LineEnding ending)
|
||||
internal int GetLineEnding (string line, int start, out LineEnding ending)
|
||||
{
|
||||
int res;
|
||||
int rich_index;
|
||||
|
||||
if (start >= line.Length) {
|
||||
ending = LineEnding.Wrap;
|
||||
return -1;
|
||||
}
|
||||
|
||||
res = line.IndexOf ('\r', start);
|
||||
rich_index = line.IndexOf ('\n', start);
|
||||
|
||||
// Handle the case where we find both of them, and the \n is before the \r
|
||||
if (res != -1 && rich_index != -1)
|
||||
if (rich_index < res) {
|
||||
ending = LineEnding.Rich;
|
||||
return rich_index;
|
||||
}
|
||||
|
||||
if (res != -1) {
|
||||
if (res + 2 < line.Length && line [res + 1] == '\r' && line [res + 2] == '\n') {
|
||||
ending = LineEnding.Soft;
|
||||
@@ -1544,30 +1529,16 @@ namespace System.Windows.Forms {
|
||||
return res;
|
||||
}
|
||||
|
||||
if (rich_index != -1) {
|
||||
res = line.IndexOf ('\n', start);
|
||||
if (res != -1) {
|
||||
ending = LineEnding.Rich;
|
||||
return rich_index;
|
||||
return res;
|
||||
}
|
||||
|
||||
ending = LineEnding.Wrap;
|
||||
return line.Length;
|
||||
}
|
||||
|
||||
// Get the line ending, but only of the types specified
|
||||
private int GetLineEnding (string line, int start, out LineEnding ending, LineEnding type)
|
||||
{
|
||||
int index = start;
|
||||
int last_length = 0;
|
||||
|
||||
do {
|
||||
index = GetLineEnding (line, index + last_length, out ending);
|
||||
last_length = LineEndingLength (ending);
|
||||
} while
|
||||
((ending & type) != ending && index != -1);
|
||||
|
||||
return index == -1 ? line.Length : index;
|
||||
}
|
||||
|
||||
internal int LineEndingLength (LineEnding ending)
|
||||
{
|
||||
switch (ending) {
|
||||
@@ -1618,7 +1589,7 @@ namespace System.Windows.Forms {
|
||||
base_line = line.line_no;
|
||||
old_line_count = lines;
|
||||
|
||||
break_index = GetLineEnding (s, 0, out ending, LineEnding.Hard | LineEnding.Rich);
|
||||
break_index = GetLineEnding (s, 0, out ending);
|
||||
|
||||
// There are no line feeds in our text to be pasted
|
||||
if (break_index == s.Length) {
|
||||
@@ -1635,7 +1606,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
// Insert brand new lines for any more line feeds in the inserted string
|
||||
while (true) {
|
||||
int next_break = GetLineEnding (s, break_index, out ending, LineEnding.Hard | LineEnding.Rich);
|
||||
int next_break = GetLineEnding (s, break_index, out ending);
|
||||
|
||||
if (next_break == s.Length)
|
||||
break;
|
||||
@@ -1753,12 +1724,12 @@ namespace System.Windows.Forms {
|
||||
SuspendUpdate ();
|
||||
|
||||
if (start.line == end.line) {
|
||||
DeleteChars (start.line, pos, end.pos - pos);
|
||||
DeleteChars (start.tag, pos, end.pos - pos);
|
||||
} else {
|
||||
|
||||
// Delete first and last lines
|
||||
DeleteChars (start.line, start.pos, start.line.text.Length - start.pos);
|
||||
DeleteChars (end.line, 0, end.pos);
|
||||
DeleteChars (start.tag, start.pos, start.line.text.Length - start.pos);
|
||||
DeleteChars (end.line.tags, 0, end.pos);
|
||||
|
||||
int current = start.line.line_no + 1;
|
||||
if (current < end.line.line_no) {
|
||||
@@ -1780,17 +1751,88 @@ namespace System.Windows.Forms {
|
||||
|
||||
// Deletes n characters at the given position; it will not delete past line limits
|
||||
// pos is 0-based
|
||||
public void DeleteChars (Line line, int pos, int count)
|
||||
{
|
||||
// Reduce our character count
|
||||
CharCount -= count;
|
||||
|
||||
line.DeleteCharacters (pos, count);
|
||||
internal void DeleteChars(LineTag tag, int pos, int count) {
|
||||
Line line;
|
||||
bool streamline;
|
||||
|
||||
streamline = false;
|
||||
line = tag.Line;
|
||||
|
||||
CharCount -= count;
|
||||
|
||||
if (pos == line.text.Length) {
|
||||
return;
|
||||
}
|
||||
|
||||
line.text.Remove(pos, count);
|
||||
|
||||
// Make sure the tag points to the right spot
|
||||
while ((tag != null) && (tag.End) < pos) {
|
||||
tag = tag.Next;
|
||||
}
|
||||
|
||||
if (tag == null) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Check if we're crossing tag boundaries
|
||||
if ((pos + count) > (tag.Start + tag.Length - 1)) {
|
||||
int left;
|
||||
|
||||
// We have to delete cross tag boundaries
|
||||
streamline = true;
|
||||
left = count;
|
||||
|
||||
left -= tag.Start + tag.Length - pos - 1;
|
||||
|
||||
tag = tag.Next;
|
||||
while ((tag != null) && (left > 0)) {
|
||||
tag.Start -= count - left;
|
||||
|
||||
if (tag.Length > left) {
|
||||
left = 0;
|
||||
} else {
|
||||
left -= tag.Length;
|
||||
tag = tag.Next;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// We got off easy, same tag
|
||||
|
||||
if (tag.Length == 0) {
|
||||
streamline = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete empty orphaned tags at the end
|
||||
LineTag walk = tag;
|
||||
while (walk != null && walk.Next != null && walk.Next.Length == 0) {
|
||||
LineTag t = walk;
|
||||
walk.Next = walk.Next.Next;
|
||||
if (walk.Next != null)
|
||||
walk.Next.Previous = t;
|
||||
walk = walk.Next;
|
||||
}
|
||||
|
||||
// Adjust the start point of any tags following
|
||||
if (tag != null) {
|
||||
tag = tag.Next;
|
||||
while (tag != null) {
|
||||
tag.Start -= count;
|
||||
tag = tag.Next;
|
||||
}
|
||||
}
|
||||
|
||||
line.recalc = true;
|
||||
if (streamline) {
|
||||
line.Streamline(lines);
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
if (pos >= line.TextLengthWithoutEnding ()) {
|
||||
LineEnding ending = line.ending;
|
||||
GetLineEnding (line.text.ToString (), 0, out ending);
|
||||
|
||||
if (ending != line.ending) {
|
||||
line.ending = ending;
|
||||
|
||||
@@ -1805,19 +1847,95 @@ namespace System.Windows.Forms {
|
||||
UpdateView (line, lines, pos);
|
||||
owner.Invalidate ();
|
||||
} else
|
||||
UpdateView (line, pos);
|
||||
UpdateView(line, pos);
|
||||
}
|
||||
|
||||
// Deletes a character at or after the given position (depending on forward); it will not delete past line limits
|
||||
public void DeleteChar (Line line, int pos, bool forward)
|
||||
{
|
||||
if ((pos == 0 && forward == false) || (pos == line.text.Length && forward == true))
|
||||
internal void DeleteChar(LineTag tag, int pos, bool forward) {
|
||||
Line line;
|
||||
bool streamline;
|
||||
|
||||
CharCount--;
|
||||
|
||||
streamline = false;
|
||||
line = tag.Line;
|
||||
|
||||
if ((pos == 0 && forward == false) || (pos == line.text.Length && forward == true)) {
|
||||
return;
|
||||
|
||||
if (forward)
|
||||
DeleteChars (line, pos, 1);
|
||||
else
|
||||
DeleteChars (line, pos - 1, 1);
|
||||
}
|
||||
|
||||
|
||||
if (forward) {
|
||||
line.text.Remove(pos, 1);
|
||||
|
||||
while ((tag != null) && (tag.Start + tag.Length - 1) <= pos) {
|
||||
tag = tag.Next;
|
||||
}
|
||||
|
||||
if (tag == null) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// tag.length--;
|
||||
|
||||
if (tag.Length == 0) {
|
||||
streamline = true;
|
||||
}
|
||||
} else {
|
||||
pos--;
|
||||
line.text.Remove(pos, 1);
|
||||
if (pos >= (tag.Start - 1)) {
|
||||
// tag.length--;
|
||||
if (tag.Length == 0) {
|
||||
streamline = true;
|
||||
}
|
||||
} else if (tag.Previous != null) {
|
||||
// tag.previous.length--;
|
||||
if (tag.Previous.Length == 0) {
|
||||
streamline = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete empty orphaned tags at the end
|
||||
LineTag walk = tag;
|
||||
while (walk != null && walk.Next != null && walk.Next.Length == 0) {
|
||||
LineTag t = walk;
|
||||
walk.Next = walk.Next.Next;
|
||||
if (walk.Next != null)
|
||||
walk.Next.Previous = t;
|
||||
walk = walk.Next;
|
||||
}
|
||||
|
||||
tag = tag.Next;
|
||||
while (tag != null) {
|
||||
tag.Start--;
|
||||
tag = tag.Next;
|
||||
}
|
||||
line.recalc = true;
|
||||
if (streamline) {
|
||||
line.Streamline(lines);
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
if (pos >= line.TextLengthWithoutEnding ()) {
|
||||
LineEnding ending = line.ending;
|
||||
GetLineEnding (line.text.ToString (), 0, out ending);
|
||||
if (ending != line.ending) {
|
||||
line.ending = ending;
|
||||
|
||||
if (!multiline) {
|
||||
UpdateView (line, lines, pos);
|
||||
owner.Invalidate ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!multiline) {
|
||||
UpdateView (line, lines, pos);
|
||||
owner.Invalidate ();
|
||||
} else
|
||||
UpdateView(line, pos);
|
||||
}
|
||||
|
||||
// Combine two lines
|
||||
@@ -2128,22 +2246,22 @@ namespace System.Windows.Forms {
|
||||
return clone;
|
||||
}
|
||||
|
||||
private void Delete (int LineNo)
|
||||
{
|
||||
internal void Delete(int LineNo) {
|
||||
Line line;
|
||||
|
||||
if (LineNo > lines)
|
||||
if (LineNo>lines) {
|
||||
return;
|
||||
}
|
||||
|
||||
line = GetLine (LineNo);
|
||||
line = GetLine(LineNo);
|
||||
|
||||
CharCount -= line.text.Length;
|
||||
|
||||
DecrementLines (LineNo + 1);
|
||||
Delete (line);
|
||||
DecrementLines(LineNo + 1);
|
||||
Delete(line);
|
||||
}
|
||||
|
||||
private void Delete(Line line1) {
|
||||
internal void Delete(Line line1) {
|
||||
Line line2;// = new Line();
|
||||
Line line3;
|
||||
|
||||
@@ -2736,7 +2854,7 @@ namespace System.Windows.Forms {
|
||||
if (selection_start.line == selection_end.line) {
|
||||
undo.RecordDeleteString (selection_start.line, selection_start.pos, selection_end.line, selection_end.pos);
|
||||
|
||||
DeleteChars (selection_start.line, selection_start.pos, selection_end.pos - selection_start.pos);
|
||||
DeleteChars(selection_start.tag, selection_start.pos, selection_end.pos - selection_start.pos);
|
||||
|
||||
// The tag might have been removed, we need to recalc it
|
||||
selection_start.tag = selection_start.line.FindTag(selection_start.pos);
|
||||
@@ -2752,11 +2870,11 @@ namespace System.Windows.Forms {
|
||||
InvalidateSelectionArea ();
|
||||
|
||||
// Delete first line
|
||||
DeleteChars (selection_start.line, selection_start.pos, selection_start.line.text.Length - selection_start.pos);
|
||||
DeleteChars(selection_start.tag, selection_start.pos, selection_start.line.text.Length - selection_start.pos);
|
||||
selection_start.line.recalc = true;
|
||||
|
||||
// Delete last line
|
||||
DeleteChars(selection_end.line, 0, selection_end.pos);
|
||||
DeleteChars(selection_end.line.tags, 0, selection_end.pos);
|
||||
|
||||
start++;
|
||||
if (start < end) {
|
||||
@@ -3589,7 +3707,7 @@ namespace System.Windows.Forms {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override SizeF SizeOfPosition (Graphics dc, int pos)
|
||||
internal override SizeF SizeOfPosition (Graphics dc, int pos)
|
||||
{
|
||||
return picture.Size;
|
||||
}
|
||||
@@ -3599,12 +3717,12 @@ namespace System.Windows.Forms {
|
||||
return (int) (picture.Height + 0.5F);
|
||||
}
|
||||
|
||||
public override void Draw (Graphics dc, Color color, float xoff, float y, int start, int end)
|
||||
internal override void Draw (Graphics dc, Color color, float xoff, float y, int start, int end)
|
||||
{
|
||||
picture.DrawImage (dc, xoff + Line.widths [start], y, false);
|
||||
}
|
||||
|
||||
public override void Draw (Graphics dc, Color color, float xoff, float y, int start, int end, string text)
|
||||
internal override void Draw (Graphics dc, Color color, float xoff, float y, int start, int end, string text)
|
||||
{
|
||||
picture.DrawImage (dc, xoff + + Line.widths [start], y, false);
|
||||
}
|
||||
|
||||
@@ -1819,7 +1819,7 @@ namespace System.Windows.Forms
|
||||
|
||||
ToolStripDropDownMenu tsddm = (ToolStripDropDownMenu)this.Owner;
|
||||
|
||||
return tsddm.ShowImageMargin || tsddm.ShowCheckMargin;
|
||||
return tsddm.ShowImageMargin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,21 +102,7 @@ namespace System.Windows.Forms
|
||||
|
||||
public override DockStyle Dock {
|
||||
get { return base.Dock; }
|
||||
set {
|
||||
base.Dock = value;
|
||||
|
||||
switch (value) {
|
||||
case DockStyle.Top:
|
||||
case DockStyle.Bottom:
|
||||
case DockStyle.None:
|
||||
this.orientation = Orientation.Horizontal;
|
||||
break;
|
||||
case DockStyle.Left:
|
||||
case DockStyle.Right:
|
||||
this.orientation = Orientation.Vertical;
|
||||
break;
|
||||
}
|
||||
}
|
||||
set { base.Dock = value; }
|
||||
}
|
||||
|
||||
public override LayoutEngine LayoutEngine {
|
||||
@@ -236,26 +222,21 @@ namespace System.Windows.Forms
|
||||
[MonoTODO("Not implemented")]
|
||||
public void Join (ToolStrip toolStripToDrag)
|
||||
{
|
||||
if (!Contains (toolStripToDrag))
|
||||
Controls.Add (toolStripToDrag);
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
public void Join (ToolStrip toolStripToDrag, int row)
|
||||
{
|
||||
Join (toolStripToDrag);
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
public void Join (ToolStrip toolStripToDrag, Point location)
|
||||
{
|
||||
Join (toolStripToDrag);
|
||||
}
|
||||
|
||||
[MonoTODO("Not implemented")]
|
||||
public void Join (ToolStrip toolStripToDrag, int x, int y)
|
||||
{
|
||||
Join (toolStripToDrag);
|
||||
}
|
||||
|
||||
public ToolStripPanelRow PointToRow (Point clientLocation)
|
||||
@@ -281,11 +262,6 @@ namespace System.Windows.Forms
|
||||
|
||||
protected override void OnControlAdded (ControlEventArgs e)
|
||||
{
|
||||
if (this.Dock == DockStyle.Left || this.Dock == DockStyle.Right)
|
||||
(e.Control as ToolStrip).LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
|
||||
else
|
||||
(e.Control as ToolStrip).LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
|
||||
|
||||
if (done_first_layout && e.Control is ToolStrip)
|
||||
this.AddControlToRows (e.Control);
|
||||
|
||||
@@ -327,34 +303,18 @@ namespace System.Windows.Forms
|
||||
// Lay out all the rows
|
||||
Point position = this.DisplayRectangle.Location;
|
||||
|
||||
if (this.Dock == DockStyle.Left || this.Dock == DockStyle.Right) {
|
||||
foreach (ToolStripPanelRow row in this.rows) {
|
||||
row.SetBounds (new Rectangle (position, new Size (row.Bounds.Width, this.Height)));
|
||||
foreach (ToolStripPanelRow row in this.rows) {
|
||||
row.SetBounds (new Rectangle (position, new Size (this.Width, row.Bounds.Height)));
|
||||
|
||||
position.X += row.Bounds.Width;
|
||||
}
|
||||
position.Y += row.Bounds.Height;
|
||||
}
|
||||
|
||||
// Find how big we are so we can autosize ourself
|
||||
if (this.rows.Count > 0) {
|
||||
int last_row_right = this.rows[this.rows.Count - 1].Bounds.Right;
|
||||
|
||||
if (last_row_right != this.Width)
|
||||
this.SetBounds (bounds.X, bounds.Y, last_row_right, bounds.Bottom);
|
||||
}
|
||||
} else {
|
||||
foreach (ToolStripPanelRow row in this.rows) {
|
||||
row.SetBounds (new Rectangle (position, new Size (this.Width, row.Bounds.Height)));
|
||||
|
||||
position.Y += row.Bounds.Height;
|
||||
}
|
||||
|
||||
// Find how big we are so we can autosize ourself
|
||||
if (this.rows.Count > 0) {
|
||||
int last_row_bottom = this.rows[this.rows.Count - 1].Bounds.Bottom;
|
||||
|
||||
if (last_row_bottom != this.Height)
|
||||
this.SetBounds (bounds.X, bounds.Y, bounds.Width, last_row_bottom);
|
||||
}
|
||||
// Find how big we are so we can autosize ourself
|
||||
if (this.rows.Count > 0) {
|
||||
int last_row_bottom = this.rows[this.rows.Count - 1].Bounds.Bottom;
|
||||
|
||||
if (last_row_bottom != this.Height)
|
||||
this.SetBounds (bounds.X, bounds.Y, bounds.Width, last_row_bottom);
|
||||
}
|
||||
|
||||
this.Invalidate ();
|
||||
@@ -455,12 +415,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
ToolStripPanelRow new_row = new ToolStripPanelRow (this);
|
||||
|
||||
if (this.Dock == DockStyle.Left || this.Dock == DockStyle.Right)
|
||||
new_row.SetBounds (new Rectangle (0, 0, 25, this.Height));
|
||||
else
|
||||
new_row.SetBounds (new Rectangle (0, 0, this.Width, 25));
|
||||
|
||||
new_row.SetBounds (new Rectangle (0, 0, this.Width, 25));
|
||||
this.rows.Add (new_row);
|
||||
new_row.OnControlAdded (control, 0);
|
||||
}
|
||||
|
||||
@@ -151,21 +151,12 @@ namespace System.Windows.Forms
|
||||
{
|
||||
int height = 0;
|
||||
|
||||
if (this.Orientation == Orientation.Horizontal) {
|
||||
foreach (ToolStrip ts in this.controls)
|
||||
if (ts.Height > height)
|
||||
height = ts.Height;
|
||||
|
||||
if (height != this.bounds.Height)
|
||||
this.bounds.Height = height;
|
||||
} else {
|
||||
foreach (ToolStrip ts in this.controls)
|
||||
if (ts.GetPreferredSize (Size.Empty).Width > height)
|
||||
height = ts.GetPreferredSize (Size.Empty).Width;
|
||||
|
||||
if (height != this.bounds.Width)
|
||||
this.bounds.Width = height;
|
||||
}
|
||||
foreach (ToolStrip ts in this.controls)
|
||||
if (ts.Height > height)
|
||||
height = ts.Height;
|
||||
|
||||
if (height != this.bounds.Height)
|
||||
this.bounds.Height = height;
|
||||
|
||||
this.Layout (this, e);
|
||||
}
|
||||
@@ -192,27 +183,15 @@ namespace System.Windows.Forms
|
||||
Point position = tspr.DisplayRectangle.Location;
|
||||
foreach (ToolStrip ts in tspr.Controls)
|
||||
{
|
||||
if (Orientation == Orientation.Horizontal) {
|
||||
if (ts.Stretch)
|
||||
ts.Width = this.bounds.Width - ts.Margin.Horizontal - this.Padding.Horizontal;
|
||||
else
|
||||
ts.Width = ts.GetToolStripPreferredSize (Size.Empty).Width;
|
||||
|
||||
position.X += ts.Margin.Left;
|
||||
ts.Location = position;
|
||||
if (ts.Stretch)
|
||||
ts.Width = this.bounds.Width - ts.Margin.Horizontal - this.Padding.Horizontal;
|
||||
else
|
||||
ts.Width = ts.GetToolStripPreferredSize (Size.Empty).Width;
|
||||
|
||||
position.X += (ts.Width + ts.Margin.Left);
|
||||
} else {
|
||||
if (ts.Stretch)
|
||||
ts.Size = new Size (ts.GetToolStripPreferredSize (Size.Empty).Width, this.bounds.Height - ts.Margin.Vertical - this.Padding.Vertical);
|
||||
else
|
||||
ts.Size = ts.GetToolStripPreferredSize (Size.Empty);
|
||||
|
||||
position.Y += ts.Margin.Top;
|
||||
ts.Location = position;
|
||||
|
||||
position.Y += (ts.Height + ts.Margin.Top);
|
||||
}
|
||||
position.X += ts.Margin.Left;
|
||||
ts.Location = position;
|
||||
|
||||
position.X += (ts.Width + ts.Margin.Left);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
//
|
||||
// Authors:
|
||||
// Peter Bartok ([email protected])
|
||||
// Srikanth Madikeri ([email protected]) - Win32 Drop files.
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
// NOT COMPLETE
|
||||
|
||||
@@ -788,27 +788,41 @@ namespace System.Windows.Forms {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
internal static uint Drop(IntPtr @this, IntPtr pDataObj, uint grfkeyState, IntPtr pt_x, IntPtr pt_y, IntPtr pdwEffect)
|
||||
{
|
||||
IntPtr window;
|
||||
|
||||
window = Marshal.ReadIntPtr (@this, Marshal.SizeOf (typeof (IntPtr)));
|
||||
internal static uint Drop(IntPtr @this, IntPtr pDataObj, uint grfkeyState, IntPtr pt_x, IntPtr pt_y, IntPtr pdwEffect) {
|
||||
throw new Exception("Yeah baby, gimme a ride to WM_DROPFILES land");
|
||||
|
||||
DragDropEventArgs.x = pt_x.ToInt32 ();
|
||||
DragDropEventArgs.y = pt_y.ToInt32 ();
|
||||
DragDropEventArgs.allowed_effect = (DragDropEffects) Marshal.ReadIntPtr (pdwEffect).ToInt32();
|
||||
DragDropEventArgs.current_effect = DragDropEventArgs.AllowedEffect;
|
||||
DragDropEventArgs.keystate = (int) grfkeyState;
|
||||
#if InTheFuture
|
||||
ComIDataObjectUnmanaged data_object;
|
||||
FORMATETC format;
|
||||
STGMEDIUM medium;
|
||||
uint result;
|
||||
IntPtr mem;
|
||||
|
||||
Control control = Control.FromHandle (window);
|
||||
if (control == null) {
|
||||
control.DndDrop (DragDropEventArgs);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
Marshal.WriteInt32 (pdwEffect, (int) DragDropEventArgs.Effect);
|
||||
|
||||
return S_OK;
|
||||
data_object = new ComIDataObjectUnmanaged(pDataObj);
|
||||
|
||||
format = new FORMATETC();
|
||||
format.cfFormat = ClipboardFormats.CF_HDROP;
|
||||
format.ptd = IntPtr.Zero;
|
||||
format.dwAspect = DVASPECT.DVASPECT_CONTENT;
|
||||
format.lindex = -1;
|
||||
format.tymed = TYMED.TYMED_HGLOBAL;
|
||||
|
||||
medium = new STGMEDIUM();
|
||||
medium.tymed = TYMED.TYMED_HGLOBAL;
|
||||
|
||||
//mem = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
|
||||
//result = data_object.QueryInterface(IID_IDataObject, mem);
|
||||
//Marshal.FreeHGlobal(mem);
|
||||
|
||||
//result = data_object.AddRef();
|
||||
|
||||
result = data_object.QueryGetData(format);
|
||||
|
||||
result = data_object.GetData(format, ref medium);
|
||||
|
||||
return E_NOTIMPL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ namespace System.Windows.Forms {
|
||||
default_class_name = "SWFClass" + System.Threading.Thread.GetDomainID().ToString();
|
||||
|
||||
if (RunningOnUnix) {
|
||||
if (Environment.GetEnvironmentVariable ("MONO_MWF_USE_CARBON_BACKEND") != null)
|
||||
driver=XplatUICarbon.GetInstance ();
|
||||
if (Environment.GetEnvironmentVariable ("MONO_MWF_USE_QUARTZ_BACKEND") != null)
|
||||
driver=XplatUIOSX.GetInstance ();
|
||||
else if (Environment.GetEnvironmentVariable ("not_supported_MONO_MWF_USE_NEW_X11_BACKEND") != null)
|
||||
driver=XplatUIX11_new.GetInstance ();
|
||||
else
|
||||
|
||||
+1024
-447
File diff suppressed because it is too large.
Load diff
@@ -783,7 +783,7 @@ namespace System.Windows.Forms {
|
||||
if (form != null)
|
||||
cp = form.GetCreateParams ();
|
||||
|
||||
if (form != null && (form.window_manager == null || cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
if (form != null && (form.window_manager == null && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
|
||||
Rectangle xrect = rect;
|
||||
|
||||
@@ -818,7 +818,7 @@ namespace System.Windows.Forms {
|
||||
* we're painting in only)
|
||||
*/
|
||||
Form form = cp.control as Form;
|
||||
if (form != null && (form.window_manager == null || cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
if (form != null && (form.window_manager == null && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
|
||||
Size xrect = size;
|
||||
|
||||
@@ -843,7 +843,7 @@ namespace System.Windows.Forms {
|
||||
*/
|
||||
Size rect = new Size (xWidth, xHeight);
|
||||
Form form = cp.control as Form;
|
||||
if (form != null && (form.window_manager == null || cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
if (form != null && (form.window_manager == null && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
|
||||
Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
|
||||
Size xrect = rect;
|
||||
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
2007-11-19 Everaldo Canuto <[email protected]>
|
||||
|
||||
* NotifyIconTest.cs: Add Balloon test, bug #342141.
|
||||
|
||||
2007-11-16 Gert Driesen <[email protected]>
|
||||
|
||||
* ComboBoxTest.cs: Enabled test for bug #331144.
|
||||
|
||||
2007-11-16 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListViewTest.cs: New exception test for 2.0 FindNearestItem method.
|
||||
|
||||
2007-11-13 Jonathan Pobst <[email protected]>
|
||||
|
||||
* DateTimePickerTest.cs: Remove a compare on seconds in a format
|
||||
string so that we get a Assert.AreEqual (DateTime.Now, DateTime.Now)
|
||||
failure 60x less often on the buildbots. (I've never actually seen
|
||||
the minutes be different, but the possibility is still there.)
|
||||
|
||||
2007-11-07 Gert Driesen <[email protected]>
|
||||
|
||||
* FormTest.cs: Added reference to bug #339641. Remove CWLs.
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[Test] // bug #331144
|
||||
[Category ("NotWorking")]
|
||||
public void DropDownStyle ()
|
||||
{
|
||||
ComboBox comboBox = new ComboBox ();
|
||||
|
||||
@@ -3380,7 +3380,7 @@ namespace MonoTests.System.Windows.Forms {
|
||||
Assert.IsTrue (log.ContainsEventsOrdered ("ValueChanged", "TextChanged"), "#4.1, expected ValueChanged+TextChanged, got: " + log.EventsJoined ());
|
||||
|
||||
log.Clear ();
|
||||
dt.CustomFormat = "yyyy-MM-dd HH-mm";
|
||||
dt.CustomFormat = "yyyy-MM-dd HH-mm-ss";
|
||||
dt.Format = DateTimePickerFormat.Custom;
|
||||
Assert.AreEqual (DateTime.Now.ToString (dt.CustomFormat), dt.Text, "#5");
|
||||
Assert.IsTrue (log.ContainsEventsOrdered ("HandleDestroyed", "HandleCreated", "FormatChanged"), "#5.1");
|
||||
|
||||
@@ -77,7 +77,6 @@ namespace MonoTests.System.Windows.Forms
|
||||
myform.Dispose ();
|
||||
}
|
||||
|
||||
// Hey
|
||||
[Test]
|
||||
public void BeginEndUpdateTest ()
|
||||
{
|
||||
@@ -195,8 +194,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsNull(lv.StateImageList, "#B3");
|
||||
}
|
||||
|
||||
// Hey
|
||||
//[Test]
|
||||
[Test]
|
||||
public void EnsureVisibleTest ()
|
||||
{
|
||||
Form myform = new Form ();
|
||||
@@ -501,41 +499,6 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindNearestItem_Exceptions ()
|
||||
{
|
||||
ListView lvw = new ListView ();
|
||||
lvw.Items.Add ("A");
|
||||
lvw.Items.Add ("B");
|
||||
|
||||
lvw.View = View.Details;
|
||||
try {
|
||||
lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
|
||||
Assert.Fail ("#A1");
|
||||
} catch (InvalidOperationException) {
|
||||
}
|
||||
|
||||
lvw.View = View.List;
|
||||
try {
|
||||
lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
|
||||
Assert.Fail ("#A2");
|
||||
} catch (InvalidOperationException) {
|
||||
}
|
||||
|
||||
lvw.View = View.Tile;
|
||||
try {
|
||||
lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
|
||||
Assert.Fail ("#A3");
|
||||
} catch (InvalidOperationException) {
|
||||
}
|
||||
|
||||
lvw.View = View.LargeIcon;
|
||||
try {
|
||||
lvw.FindNearestItem ((SearchDirectionHint)666, 0, 0);
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FocusedItem ()
|
||||
{
|
||||
|
||||
@@ -34,18 +34,6 @@ namespace MonoTests.System.Windows.Forms
|
||||
ni.ContextMenuStrip = cms;
|
||||
Assert.AreSame (cms, ni.ContextMenuStrip, "B2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Balloon ()
|
||||
{
|
||||
NotifyIcon ni = new NotifyIcon ();
|
||||
ni.Text = "NotifyIcon Text";
|
||||
ni.BalloonTipTitle = "Balloon Tip Title";
|
||||
ni.BalloonTipText = "Balloon Tip Text.";
|
||||
ni.BalloonTipIcon = ToolTipIcon.None;
|
||||
ni.Visible = true;
|
||||
ni.ShowBalloonTip (1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,3 @@
|
||||
2007-11-15 Rodrigo B. de Oliveira <[email protected]>
|
||||
|
||||
* Mono.Cecil.Cil/MethodBody.cs:
|
||||
Fixed Optimize for ldc_i4
|
||||
|
||||
2007-11-15 Rodrigo B. de Oliveira <[email protected]>
|
||||
|
||||
* Mono.Cecil.Cil/DocumentLanguage.cs
|
||||
Mono.Cecil.Cil/DocumentLanguageVendor.cs:
|
||||
Compact Framework support by using Guid(string) if CF_2_0 is defined
|
||||
|
||||
2007-11-01 Jb Evain <[email protected]>
|
||||
|
||||
* Mono.Cecil/MethodReturnType.cs: based on a patch by
|
||||
|
||||
@@ -31,20 +31,6 @@ namespace Mono.Cecil.Cil {
|
||||
using System;
|
||||
|
||||
public abstract class DocumentLanguage {
|
||||
#if CF_2_0
|
||||
public static readonly Guid None = new Guid ("00000000-0000-0000-0000-000000000000");
|
||||
public static readonly Guid C = new Guid ("63a08714-fc37-11d2-904c-00c04fa302a1");
|
||||
public static readonly Guid Cpp = new Guid ("3a12d0b7-c26c-11d0-b442-00a0244a1dd2");
|
||||
public static readonly Guid CSharp = new Guid ("3f5162f8-07c6-11d3-9053-00c04fa302a1");
|
||||
public static readonly Guid Basic = new Guid ("3a12d0b8-c26c-11d0-b442-00a0244a1dd2");
|
||||
public static readonly Guid Java = new Guid ("3a12d0b4-c26c-11d0-b442-00a0244a1dd2");
|
||||
public static readonly Guid Cobol = new Guid ("af046cd1-d0e1-11d2-977c-00a0c9b4d50c");
|
||||
public static readonly Guid Pascal = new Guid ("af046cd2-d0e1-11d2-977c-00a0c9b4d50c");
|
||||
public static readonly Guid CIL = new Guid ("af046cd3-d0e1-11d2-977c-00a0c9b4d50c");
|
||||
public static readonly Guid JScript = new Guid ("3a12d0b6-c26c-11d0-b442-00a0244a1dd2");
|
||||
public static readonly Guid SMC = new Guid ("0d9b9f7b-6611-11d3-bd2a-0000f80849bd");
|
||||
public static readonly Guid MCpp = new Guid ("4b35fde8-07c6-11d3-9053-00c04fa302a1");
|
||||
#else
|
||||
public static readonly Guid None = new Guid (0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
public static readonly Guid C = new Guid (0x63a08714, 0xfc37, 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
|
||||
public static readonly Guid Cpp = new Guid (0x3a12d0b7, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
|
||||
@@ -57,6 +43,5 @@ namespace Mono.Cecil.Cil {
|
||||
public static readonly Guid JScript = new Guid (0x3a12d0b6, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);
|
||||
public static readonly Guid SMC = new Guid (0xd9b9f7b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);
|
||||
public static readonly Guid MCpp = new Guid (0x4b35fde8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -31,12 +31,7 @@ namespace Mono.Cecil.Cil {
|
||||
using System;
|
||||
|
||||
public abstract class DocumentLanguageVendor {
|
||||
#if CF_2_0
|
||||
public static readonly Guid Other = new Guid ("00000000-0000-0000-0000-000000000000");
|
||||
public static readonly Guid Microsoft = new Guid ("994b45c4-e6e9-11d2-903f-00c04fa302a1");
|
||||
#else
|
||||
public static readonly Guid Other = new Guid (0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
public static readonly Guid Microsoft = new Guid (0x994b45c4, 0xe6e9, 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -474,7 +474,7 @@ namespace Mono.Cecil.Cil {
|
||||
Modify (instr, OpCodes.Ldc_I4_8, null);
|
||||
break;
|
||||
default:
|
||||
if (i >= -128 && i < 128)
|
||||
if (i >= -128 || i < 128)
|
||||
Modify (instr, OpCodes.Ldc_I4_S, (sbyte) i);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1140,7 +1140,6 @@ namespace Mono.Cecil {
|
||||
int size = 0;
|
||||
TypeReference fieldType = field.FieldType;
|
||||
switch (fieldType.FullName) {
|
||||
case Constants.Boolean:
|
||||
case Constants.Byte:
|
||||
case Constants.SByte:
|
||||
size = 1;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-12-06 Marek Habersack <[email protected]>
|
||||
|
||||
* SQLiteFunction.cs: scan only assemblies which reference Sqlite,
|
||||
saves heap memory.
|
||||
|
||||
2007-07-31 Ben Motmans <[email protected]>
|
||||
|
||||
* SR.Designer.cs: use the correct resource name
|
||||
|
||||
@@ -445,12 +445,30 @@ namespace Mono.Data.Sqlite
|
||||
SqliteFunctionAttribute at;
|
||||
System.Reflection.Assembly[] arAssemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
||||
int w = arAssemblies.Length;
|
||||
System.Reflection.AssemblyName sqlite = System.Reflection.Assembly.GetCallingAssembly().GetName();
|
||||
|
||||
for (int n = 0; n < w; n++)
|
||||
{
|
||||
Type[] arTypes;
|
||||
bool found = false;
|
||||
System.Reflection.AssemblyName[] references;
|
||||
try
|
||||
{
|
||||
// Inspect only assemblies that reference SQLite
|
||||
references = arAssemblies[n].GetReferencedAssemblies();
|
||||
int t = references.Length;
|
||||
for (int z = 0; z < t; z++)
|
||||
{
|
||||
if (references[z].Name == sqlite.Name)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false)
|
||||
continue;
|
||||
|
||||
arTypes = arAssemblies[n].GetTypes();
|
||||
}
|
||||
catch (System.Reflection.ReflectionTypeLoadException e)
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
2007-11-10 Gert Driesen <[email protected]>
|
||||
|
||||
* Tds.cs: Round milliseconds for datetime. Fixes part of bug #323646.
|
||||
* Tds70.cs: Include milliseconds for datetime parameters. Fixes part
|
||||
of bug #323646.
|
||||
|
||||
2007-10-17 Nagappan <[email protected]>
|
||||
|
||||
* TdsConnectionPool.cs: Default the pooling is enabled. It has to be
|
||||
|
||||
@@ -858,15 +858,15 @@ namespace Mono.Data.Tds.Protocol {
|
||||
case 8 :
|
||||
result = epoch.AddDays (comm.GetTdsInt ());
|
||||
int seconds = comm.GetTdsInt ();
|
||||
long millis = (long) System.Math.Round (((((long) seconds) % 300L) * 1000L) / 300f);
|
||||
long millis = ((((long) seconds) % 300L) * 1000L) / 300L;
|
||||
if (seconds != 0 || millis != 0) {
|
||||
result = ((DateTime) result).AddSeconds (seconds / 300);
|
||||
result = ((DateTime) result).AddMilliseconds (millis);
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// MSDN says small datetime is stored in 2 bytes as no of days
|
||||
// *after* 1/1/1900. so, cast to unsigned short
|
||||
// MSDN says small datetime is stored in 2 bytes as no of days
|
||||
// *after* 1/1/1900. so, cast to unsigned short
|
||||
result = epoch.AddDays ((ushort) comm.GetTdsShort ());
|
||||
short minutes = comm.GetTdsShort ();
|
||||
if (minutes != 0)
|
||||
|
||||
@@ -533,8 +533,8 @@ namespace Mono.Data.Tds.Protocol {
|
||||
case "datetime":
|
||||
DateTime d = Convert.ToDateTime (parameter.Value);
|
||||
value = String.Format (base.Locale,
|
||||
"'{0:MMM dd yyyy hh:mm:ss.fff tt}'", d);
|
||||
break;
|
||||
"'{0:MMM dd yyyy hh:mm:ss tt}'", d);
|
||||
break;
|
||||
case "bigint":
|
||||
case "decimal":
|
||||
case "float":
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
2007-11-18 Sebastien Pouliot <[email protected]>
|
||||
|
||||
[Backport r89889]
|
||||
* RSAManaged.cs: Fix the rare case where the inverse of q modulo p
|
||||
can result in bigint one byte shorter than expected, which could
|
||||
mess up the export/import of the key.
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
|
||||
2007-11-15 Francisco Figueiredo Jr. <[email protected]>
|
||||
*Npgsql/NpgsqlCommand.cs: [#1010187] Problem with parsing parameters and "<" or ">" operator with Prepare().
|
||||
[#1010186] Thread safety problem when Parsing command text.
|
||||
Thanks Hubert FONGARNAND for patches!
|
||||
|
||||
2007-11-09 Francisco Figueiredo Jr. <[email protected]>
|
||||
|
||||
*NpgsqlTypes/NpgsqlTypesHelper.cs: This is a single line patch version for handling Standard conforming strings parameter in postgresql.conf. You only need this version instead of 1.0 is you are using this setting or is planning to use it. Also, starting with 8.4 postgresql version, this parameter will be default to on in postgresql.conf. Today it is off.
|
||||
More info can be obtained on this link: http://pgfoundry.org/tracker/index.php?func=detail&aid=1009624&group_id=1000140&atid=592
|
||||
Thanks Laurenz Albe & Erich Lerch for their patch!
|
||||
|
||||
|
||||
2006-11-01 Francisco Figueiredo Jr. <[email protected]>
|
||||
|
||||
*Npgsql/NpgsqlCommand.cs: [#1000765] InvalidCastException for ByteA
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Npgsql
|
||||
// Logging related values
|
||||
private static readonly String CLASSNAME = "NpgsqlCommand";
|
||||
private static ResourceManager resman = new ResourceManager(typeof(NpgsqlCommand));
|
||||
private readonly Regex parameterReplace = new Regex(@"([:@][\w\.]*)", RegexOptions.Singleline);
|
||||
private static readonly Regex parameterReplace = new Regex(@"([:@][\w\.]*)", RegexOptions.Singleline);
|
||||
|
||||
private NpgsqlConnection connection;
|
||||
private NpgsqlConnector connector;
|
||||
@@ -1373,7 +1373,7 @@ namespace Npgsql
|
||||
{
|
||||
|
||||
String quote_pattern = @"['][^']*[']";
|
||||
String pattern = "[- |\n\r\t,)(;=+/<>]" + parameterName + "([- |\n\r\t,)(;=+/<>]|$)";
|
||||
String pattern = "[- |\n\r\t,)(;=+/]" + parameterName + "([- |\n\r\t,)(;=+/]|$)";
|
||||
Int32 start, end;
|
||||
String withoutquote = result;
|
||||
Boolean found = false;
|
||||
|
||||
@@ -714,7 +714,7 @@ namespace NpgsqlTypes
|
||||
|
||||
private static String QuoteString(String S)
|
||||
{
|
||||
return String.Format("E'{0}'", S);
|
||||
return String.Format("'{0}'", S);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2007-11-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DelegatingConfigHost.cs: 2.0 API fix.
|
||||
|
||||
2006-01-16 Chris Toshok <[email protected]>
|
||||
|
||||
* DelegatingConfigHost.cs: flesh out the rest of this
|
||||
|
||||
+7
-7
@@ -147,7 +147,7 @@ namespace System.Configuration.Internal
|
||||
return host.IsFile (streamName);
|
||||
}
|
||||
|
||||
public virtual bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord)
|
||||
public bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord)
|
||||
{
|
||||
return host.IsFullTrustSectionWithoutAptcaAllowed (configRecord);
|
||||
}
|
||||
@@ -157,16 +157,16 @@ namespace System.Configuration.Internal
|
||||
return host.IsLocationApplicable (configPath);
|
||||
}
|
||||
|
||||
public virtual bool IsRemote {
|
||||
public bool IsRemote {
|
||||
get { return host.IsRemote; }
|
||||
}
|
||||
|
||||
public virtual bool IsSecondaryRoot (string configPath)
|
||||
public bool IsSecondaryRoot (string configPath)
|
||||
{
|
||||
return host.IsSecondaryRoot (configPath);
|
||||
}
|
||||
|
||||
public virtual bool IsTrustedConfigPath (string configPath)
|
||||
public bool IsTrustedConfigPath (string configPath)
|
||||
{
|
||||
return host.IsTrustedConfigPath (configPath);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace System.Configuration.Internal
|
||||
return host.OpenStreamForRead (streamName);
|
||||
}
|
||||
|
||||
public virtual Stream OpenStreamForRead (string streamName, bool assertPermissions)
|
||||
public Stream OpenStreamForRead (string streamName, bool assertPermissions)
|
||||
{
|
||||
return host.OpenStreamForRead (streamName, assertPermissions);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ namespace System.Configuration.Internal
|
||||
return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext);
|
||||
}
|
||||
|
||||
public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions)
|
||||
public Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions)
|
||||
{
|
||||
return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext, assertPermissions);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ namespace System.Configuration.Internal
|
||||
host.WriteCompleted (streamName, success, writeContext);
|
||||
}
|
||||
|
||||
public virtual void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
|
||||
public void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
|
||||
{
|
||||
host.WriteCompleted (streamName, success, writeContext, assertPermissions);
|
||||
}
|
||||
|
||||
@@ -1,25 +1,7 @@
|
||||
2007-11-15 Atsushi Enomoto <[email protected]>
|
||||
|
||||
Part of fix for bug #323708.
|
||||
* ConfigurationSection.cs : in GetRuntimeObject(), take parent
|
||||
section instance into consideration.
|
||||
* SectionInformation.cs : to make it possible, GetParentSection()
|
||||
should be implemented.
|
||||
* Configuration.cs : to make it possible, GetSectionInstance()
|
||||
should set parent section on its SectionInformation. It used to
|
||||
just steal parent's xml when its own xml does not exist, but
|
||||
it now blocks correct configuration retrieval.
|
||||
|
||||
2007-11-15 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SectionGroupInfo.cs : remove extra StringBuilder creation.
|
||||
|
||||
2007-11-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Configuration.cs : (Save) when the given file path is relative
|
||||
it failed to create directory. Fixed standalone test t25/t26.
|
||||
* InternalConfigurationHost.cs : pass userLevel to create a host
|
||||
instance.
|
||||
|
||||
2007-10-04 Atsushi Enomoto <[email protected]>
|
||||
|
||||
|
||||
@@ -266,13 +266,11 @@ namespace System.Configuration {
|
||||
sec = ds;
|
||||
}
|
||||
|
||||
ConfigurationSection parentSection = null;
|
||||
if (parent != null) {
|
||||
parentSection = parent.GetSectionInstance (config, true);
|
||||
sec.SectionInformation.SetParentSection (parentSection);
|
||||
}
|
||||
ConfigurationSection parentSection = parent != null ? parent.GetSectionInstance (config, true) : null;
|
||||
|
||||
string xml = data as string;
|
||||
if (xml == null && parentSection != null)
|
||||
xml = parentSection.RawXml;
|
||||
sec.RawXml = xml;
|
||||
sec.Reset (parentSection);
|
||||
|
||||
@@ -464,7 +462,7 @@ namespace System.Configuration {
|
||||
}
|
||||
|
||||
|
||||
void ReadConfigFile (XmlTextReader reader, string fileName)
|
||||
internal void ReadConfigFile (XmlTextReader reader, string fileName)
|
||||
{
|
||||
reader.MoveToContent ();
|
||||
|
||||
|
||||
@@ -60,17 +60,17 @@ namespace System.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO ("Provide ConfigContext. Likely the culprit of bug #322493")]
|
||||
[MonoTODO]
|
||||
protected internal virtual object GetRuntimeObject ()
|
||||
{
|
||||
// FIXME: this hack is nasty. We should make some
|
||||
// refactory on the entire assembly.
|
||||
if (SectionHandler != null) {
|
||||
ConfigurationSection parentSection = sectionInformation != null ? sectionInformation.GetParentSection () : null;
|
||||
object parent = parentSection != null ? parentSection.GetRuntimeObject () : null;
|
||||
if (RawXml == null)
|
||||
return parent;
|
||||
return null;
|
||||
XmlDocument doc = new XmlDocument ();
|
||||
doc.LoadXml (RawXml);
|
||||
return SectionHandler.Create (parent, null, doc.DocumentElement);
|
||||
return SectionHandler.Create (null, null, doc.DocumentElement);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,6 @@ namespace System.Configuration
|
||||
public override void Init (IInternalConfigRoot root, params object[] hostInitParams)
|
||||
{
|
||||
map = (ExeConfigurationFileMap) hostInitParams [0];
|
||||
level = (ConfigurationUserLevel) hostInitParams [1];
|
||||
}
|
||||
|
||||
public override string GetStreamName (string configPath)
|
||||
|
||||
@@ -283,8 +283,11 @@ namespace System.Configuration
|
||||
|
||||
void ReadContent (XmlTextReader reader, Configuration config, bool overrideAllowed, bool root)
|
||||
{
|
||||
StringBuilder spacing = new StringBuilder ();
|
||||
while (reader.NodeType != XmlNodeType.EndElement && reader.NodeType != XmlNodeType.None) {
|
||||
if (reader.NodeType != XmlNodeType.Element) {
|
||||
if (reader.NodeType == XmlNodeType.Whitespace)
|
||||
spacing.Append (reader.Value);
|
||||
reader.Skip ();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -146,16 +146,12 @@ namespace System.Configuration
|
||||
set { type_name = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ConfigurationSection GetParentSection ()
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
internal void SetParentSection (ConfigurationSection parent)
|
||||
{
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public string GetRawXml ()
|
||||
{
|
||||
return raw_xml;
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2007-11-15 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Makefile : added -r:System.Data.
|
||||
* t45.cs, t45.exe.expected : test for bug #323708.
|
||||
|
||||
2007-03-15 Vladimir Krasnov <[email protected]>
|
||||
|
||||
* t44.cs: added test for case sensitivity check
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t26.exe t27.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe
|
||||
TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t26.exe t27.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe
|
||||
# t13.exe t14.exe
|
||||
|
||||
check: local compare
|
||||
@@ -23,4 +23,4 @@ t36.exe : t36.cs t36-lib.cs
|
||||
gmcs /debug -r:System.Configuration.dll -r:t36-lib.dll t36.cs
|
||||
|
||||
%.exe: %.cs
|
||||
gmcs /debug $< -r:System.Configuration.dll -r:System.Web.dll -r:System.Data.dll
|
||||
gmcs /debug $< -r:System.Configuration.dll -r:System.Web.dll
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
public class Test
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
DataTable dt = DbProviderFactories.GetFactoryClasses ();
|
||||
foreach (DataRow row in dt.Rows) {
|
||||
string name = row ["Name"] as string;
|
||||
if (name.IndexOf ("Odbc") >= 0)
|
||||
Console.WriteLine ("Provider=" + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Provider=Odbc Data Provider
|
||||
@@ -1,15 +1,3 @@
|
||||
2007-11-13 Jb Evain <[email protected]>
|
||||
|
||||
* Enumerable.cs: make the new unit tests pass.
|
||||
|
||||
2007-11-09 Jb Evain <[email protected]>
|
||||
|
||||
* Enumerable.cs: refactor the ArgumentNullException checks.
|
||||
|
||||
2007-11-08 Jb Evain <[email protected]>
|
||||
|
||||
* Enumerable.cs: Implement SequenceEqual.
|
||||
|
||||
2007-11-08 Jb Evain <[email protected]>
|
||||
|
||||
* Enumerable.cs: Complete Union.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,10 +5,10 @@
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
@@ -17,7 +17,7 @@
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
//
|
||||
// Authors:
|
||||
// Alejandro Serrano "Serras" ([email protected])
|
||||
// Alejandro Serrano "Serras" ([email protected])
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -26,30 +26,30 @@ using System.Collections.Generic;
|
||||
|
||||
namespace System.Linq
|
||||
{
|
||||
public class Grouping<K, T> : IGrouping<K, T>
|
||||
{
|
||||
K key;
|
||||
IEnumerable<T> group;
|
||||
|
||||
public Grouping (K key, IEnumerable<T> group)
|
||||
{
|
||||
this.group = group;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public K Key {
|
||||
get { return key; }
|
||||
set { key = value; }
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator ()
|
||||
{
|
||||
return group.GetEnumerator ();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return group.GetEnumerator ();
|
||||
}
|
||||
}
|
||||
public class Grouping<K, T> : IGrouping<K, T>
|
||||
{
|
||||
K key;
|
||||
IEnumerable<T> group;
|
||||
|
||||
public Grouping (K key, IEnumerable<T> group)
|
||||
{
|
||||
this.group = group;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public K Key {
|
||||
get { return key; }
|
||||
set { key = value; }
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator ()
|
||||
{
|
||||
return group.GetEnumerator ();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return group.GetEnumerator ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,3 @@
|
||||
2007-11-13 Jb Evain <[email protected]>
|
||||
|
||||
* EnumerableTest.cs: unit tests are good.
|
||||
|
||||
2007-11-08 Jb Evain <[email protected]>
|
||||
|
||||
* EnumerableTest.cs: add test for SequenceEqual.
|
||||
|
||||
2007-11-08 Jb Evain <[email protected]>
|
||||
|
||||
* EnumerableTest.cs: add simple test for Union.
|
||||
|
||||
@@ -69,172 +69,6 @@ namespace MonoTests.System.Linq {
|
||||
AssertAreSame (result, first.Union (second));
|
||||
}
|
||||
|
||||
class Foo {}
|
||||
class Bar : Foo {}
|
||||
|
||||
[Test]
|
||||
public void TestCast ()
|
||||
{
|
||||
Bar a = new Bar ();
|
||||
Bar b = new Bar ();
|
||||
Bar c = new Bar ();
|
||||
|
||||
Foo [] foos = new Foo [] {a, b, c};
|
||||
Bar [] result = new Bar [] {a, b, c};
|
||||
|
||||
AssertAreSame (result, foos.Cast<Bar> ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLast ()
|
||||
{
|
||||
int [] data = {1, 2, 3};
|
||||
|
||||
Assert.AreEqual (3, data.Last ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLastOrDefault ()
|
||||
{
|
||||
int [] data = {};
|
||||
|
||||
Assert.AreEqual (default (int), data.LastOrDefault ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFirst ()
|
||||
{
|
||||
int [] data = {1, 2, 3};
|
||||
|
||||
Assert.AreEqual (1, data.First ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFirstOrDefault ()
|
||||
{
|
||||
int [] data = {};
|
||||
|
||||
Assert.AreEqual (default (int), data.FirstOrDefault ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSequenceEqual ()
|
||||
{
|
||||
int [] first = {0, 1, 2, 3, 4, 5};
|
||||
int [] second = {0, 1, 2};
|
||||
int [] third = {0, 1, 2, 3, 4, 5};
|
||||
|
||||
Assert.IsFalse (first.SequenceEqual (second));
|
||||
Assert.IsTrue (first.SequenceEqual (third));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSkip ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4, 5};
|
||||
int [] result = {3, 4, 5};
|
||||
|
||||
AssertAreSame (result, data.Skip (3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSkipWhile ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4, 5};
|
||||
int [] result = {3, 4, 5};
|
||||
|
||||
AssertAreSame (result, data.SkipWhile (i => i < 3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestTake ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4, 5};
|
||||
int [] result = {0, 1, 2};
|
||||
|
||||
AssertAreSame (result, data.Take (3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestTakeWhile ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4, 5};
|
||||
int [] result = {0, 1, 2};
|
||||
|
||||
AssertAreSame (result, data.TakeWhile (i => i < 3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSelect ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
int [] result = {1, 3, 5, 7, 9};
|
||||
|
||||
AssertAreSame (result, data.Where (i => i % 2 != 0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestReverse ()
|
||||
{
|
||||
int [] data = {0, 1, 2, 3, 4};
|
||||
int [] result = {4, 3, 2, 1, 0};
|
||||
|
||||
AssertAreSame (result, data.Reverse ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSum ()
|
||||
{
|
||||
int [] data = {1, 2, 3, 4};
|
||||
|
||||
Assert.AreEqual (10, data.Sum ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMax ()
|
||||
{
|
||||
int [] data = {1, 3, 5, 2};
|
||||
|
||||
Assert.AreEqual (5, data.Max ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMin ()
|
||||
{
|
||||
int [] data = {3, 5, 2, 6, 1, 7};
|
||||
|
||||
Assert.AreEqual (1, data.Min ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestToList ()
|
||||
{
|
||||
int [] data = {3, 5, 2};
|
||||
|
||||
var list = data.ToList ();
|
||||
|
||||
AssertAreSame (data, list);
|
||||
|
||||
Assert.AreEqual (typeof (List<int>), list.GetType ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestToArray ()
|
||||
{
|
||||
ICollection<int> coll = new List<int> ();
|
||||
coll.Add (0);
|
||||
coll.Add (1);
|
||||
coll.Add (2);
|
||||
|
||||
int [] result = {0, 1, 2};
|
||||
|
||||
var array = coll.ToArray ();
|
||||
|
||||
AssertAreSame (result, array);
|
||||
|
||||
Assert.AreEqual (typeof (int []), array.GetType ());
|
||||
}
|
||||
|
||||
static void AssertAreSame<T> (IEnumerable<T> expected, IEnumerable<T> actual)
|
||||
{
|
||||
if (expected == null) {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
2007-11-11 Leszek Ciesielski <[email protected]>
|
||||
* OracleCommands.cs: fix for binging procedure parameters by name
|
||||
rather than position (by Gary Thomas)
|
||||
2007-11-01 Marek Safar <[email protected]>
|
||||
|
||||
* OracleCommand.cs,
|
||||
|
||||
@@ -643,10 +643,10 @@ namespace System.Data.OracleClient
|
||||
foreach (OracleParameter parm in Parameters) {
|
||||
if (sb.Length > 0)
|
||||
sb.Append (",");
|
||||
sb.Append (parm.ParameterName + "=>:" + parm.ParameterName);
|
||||
sb.Append (":" + parm.ParameterName);
|
||||
}
|
||||
|
||||
string sql = "begin " + commandText + "(" + sb.ToString() + "); end;";
|
||||
string sql = "call " + commandText + "(" + sb.ToString() + ")";
|
||||
statement.Prepare (sql);
|
||||
}
|
||||
else // Text
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2007-11-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* System.Data_test.dll.sources: added MonkeyDataSet.cs, test helper.
|
||||
|
||||
2007-10-20 Gert Driesen <[email protected]>
|
||||
|
||||
* System.Data_test.dll.sources: Added DbDataAdapterTest.cs,
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
2007-11-15 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DbProviderFactoriesConfigurationHandler.cs : Create() now takes
|
||||
parent DataSet into consideration i.e. it now merges items in
|
||||
different configurations. Fixed bug #323708.
|
||||
|
||||
2007-10-21 Gert Driesen <[email protected]>
|
||||
|
||||
* DbDataPermissionAttribute.cs: In KeyRestrictionBehavior, reuse
|
||||
|
||||
@@ -54,14 +54,13 @@ namespace System.Data.Common
|
||||
|
||||
public virtual object Create (object parent, object configContext, XmlNode section)
|
||||
{
|
||||
DataSet ds = parent as DataSet ?? CreateDataSet ();
|
||||
FillDataTables (ds, section);
|
||||
DataSet ds = new DataSet (DbProviderFactories.CONFIG_SECTION_NAME);
|
||||
CreateDataTables (ds, section);
|
||||
return ds;
|
||||
}
|
||||
|
||||
DataSet CreateDataSet ()
|
||||
internal virtual void CreateDataTables (DataSet ds, XmlNode section)
|
||||
{
|
||||
DataSet ds = new DataSet (DbProviderFactories.CONFIG_SECTION_NAME);
|
||||
DataTable dt = ds.Tables.Add (DbProviderFactories.CONFIG_SEC_TABLE_NAME);
|
||||
DataColumn [] columns = new DataColumn [4];
|
||||
columns [0] = new DataColumn ("Name", typeof (string));
|
||||
@@ -70,12 +69,7 @@ namespace System.Data.Common
|
||||
columns [3] = new DataColumn ("AssemblyQualifiedName", typeof (string));
|
||||
dt.Columns.AddRange (columns);
|
||||
dt.PrimaryKey = new DataColumn [] { columns [2] };
|
||||
return ds;
|
||||
}
|
||||
|
||||
void FillDataTables (DataSet ds, XmlNode section)
|
||||
{
|
||||
DataTable dt = ds.Tables [0];
|
||||
foreach (XmlNode node in section.ChildNodes) {
|
||||
if (node.NodeType != XmlNodeType.Element)
|
||||
continue;
|
||||
|
||||
@@ -54,7 +54,6 @@ System.Data/DataViewTest_IBindingList.cs
|
||||
System.Data/DataViewTest_IBindingListView.cs
|
||||
System.Data/ForeignKeyConstraintTest.cs
|
||||
System.Data/ForeignKeyConstraintTest2.cs
|
||||
System.Data/MonkeyDataSet.cs
|
||||
System.Data/TypedDataSetGeneratorTest.cs
|
||||
System.Data/UniqueConstraintTest.cs
|
||||
System.Data/UniqueConstraintTest2.cs
|
||||
|
||||
@@ -170,9 +170,6 @@
|
||||
<Compile Include="System.Data\InRowChangingEventExceptionTest.cs" />
|
||||
<Compile Include="System.Data\InvalidConstraintExceptionTest.cs" />
|
||||
<Compile Include="System.Data\MissingPrimaryKeyExceptionTest.cs" />
|
||||
<Compile Include="System.Data\MonkeyDataSet.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="System.Data\NoNullAllowedExceptionTest.cs" />
|
||||
<Compile Include="System.Data\ReadOnlyExceptionTest.cs" />
|
||||
<Compile Include="System.Data\RowNotInTableExceptionTest.cs" />
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
2007-11-14 Atushi Enomoto <[email protected]>
|
||||
|
||||
* DataSetTest.cs : added test for r89307 fix (it is for XmlSerializer
|
||||
but needs to be in sys.data).
|
||||
* MonkeyDataSet.cs : test support classes (generated by xsd).
|
||||
|
||||
2007-10-21 Gert Driesen <[email protected]>
|
||||
|
||||
* DataColumnTest.cs: No longer derive from deprecated Assertion class.
|
||||
|
||||
@@ -2260,17 +2260,6 @@ namespace MonoTests.System.Data
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
// it is basically a test for XmlSerializer, but I need it
|
||||
// here to not add dependency on sys.data.dll in sys.xml test.
|
||||
[Test]
|
||||
public void ReflectTypedDataSet ()
|
||||
{
|
||||
XmlReflectionImporter imp = new XmlReflectionImporter ();
|
||||
// it used to cause "missing GetDataSetSchema" error.
|
||||
imp.ImportTypeMapping (typeof (MonkeyDataSet));
|
||||
}
|
||||
|
||||
#region DataSet.CreateDataReader Tests and DataSet.Load Tests
|
||||
|
||||
private DataSet ds;
|
||||
|
||||
@@ -1,361 +0,0 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
//This source code was auto-generated by MonoXSD
|
||||
//
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml;
|
||||
|
||||
|
||||
public class MonkeyDataSet : System.Data.DataSet, System.Xml.Serialization.IXmlSerializable {
|
||||
|
||||
public delegate void MonkeyTableRowChangedEventHandler(object o, MonkeyTableRowChangedEventArgs e);
|
||||
|
||||
private MonkeyTableDataTable __tableMonkeyTable;
|
||||
|
||||
public MonkeyDataSet() {
|
||||
this.InitializeClass();
|
||||
System.ComponentModel.CollectionChangeEventHandler handler = new System.ComponentModel.CollectionChangeEventHandler(new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged));
|
||||
this.Tables.CollectionChanged += handler;
|
||||
this.Relations.CollectionChanged += handler;
|
||||
}
|
||||
|
||||
protected MonkeyDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext ctx) {
|
||||
// TODO: implement
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual MonkeyTableDataTable MonkeyTable {
|
||||
get {
|
||||
return this.__tableMonkeyTable;
|
||||
}
|
||||
}
|
||||
|
||||
public override System.Data.DataSet Clone() {
|
||||
MonkeyDataSet set = ((MonkeyDataSet)(base.Clone()));
|
||||
set.InitializeFields();
|
||||
return set;
|
||||
}
|
||||
|
||||
protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
|
||||
System.IO.StringWriter sw = new System.IO.StringWriter();
|
||||
this.WriteXmlSchema(sw);
|
||||
return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(new System.IO.StringReader(sw.ToString())), null);
|
||||
}
|
||||
|
||||
System.Xml.Schema.XmlSchema System.Xml.Serialization.IXmlSerializable.GetSchema() {
|
||||
return this.GetSchemaSerializable();
|
||||
}
|
||||
|
||||
internal void InitializeClass() {
|
||||
this.DataSetName = "MonkeyDataSet";
|
||||
this.Prefix = "";
|
||||
this.Namespace = "";
|
||||
this.Locale = new System.Globalization.CultureInfo("ja-JP");
|
||||
this.CaseSensitive = false;
|
||||
this.EnforceConstraints = true;
|
||||
this.__tableMonkeyTable = new MonkeyTableDataTable();
|
||||
this.Tables.Add(this.__tableMonkeyTable);
|
||||
}
|
||||
|
||||
internal void InitializeFields() {
|
||||
this.__tableMonkeyTable.InitializeFields();
|
||||
}
|
||||
|
||||
private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
|
||||
if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
|
||||
this.InitializeFields();
|
||||
}
|
||||
}
|
||||
|
||||
public class MonkeyTableDataTable : System.Data.DataTable, System.Collections.IEnumerable {
|
||||
|
||||
private System.Data.DataColumn __columnID;
|
||||
|
||||
private System.Data.DataColumn __columnName;
|
||||
|
||||
private System.Data.DataColumn __columnAge;
|
||||
|
||||
private System.Data.DataColumn __columnExists;
|
||||
|
||||
internal MonkeyTableDataTable() :
|
||||
base("MonkeyTable") {
|
||||
this.InitializeClass();
|
||||
this.InitializeFields();
|
||||
}
|
||||
|
||||
internal MonkeyTableDataTable(System.Data.DataTable tableMonkeyTable) :
|
||||
base(tableMonkeyTable.TableName) {
|
||||
// TODO: implement
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual int Count {
|
||||
get {
|
||||
return this.Rows.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual MonkeyTableRow this[int i] {
|
||||
get {
|
||||
return ((MonkeyTableRow)(this.Rows[i]));
|
||||
}
|
||||
}
|
||||
|
||||
internal System.Data.DataColumn IDColumn {
|
||||
get {
|
||||
return this.__columnID;
|
||||
}
|
||||
}
|
||||
|
||||
internal System.Data.DataColumn NameColumn {
|
||||
get {
|
||||
return this.__columnName;
|
||||
}
|
||||
}
|
||||
|
||||
internal System.Data.DataColumn AgeColumn {
|
||||
get {
|
||||
return this.__columnAge;
|
||||
}
|
||||
}
|
||||
|
||||
internal System.Data.DataColumn ExistsColumn {
|
||||
get {
|
||||
return this.__columnExists;
|
||||
}
|
||||
}
|
||||
|
||||
public event MonkeyTableRowChangedEventHandler MonkeyTableRowChanging;
|
||||
|
||||
public event MonkeyTableRowChangedEventHandler MonkeyTableRowChanged;
|
||||
|
||||
public event MonkeyTableRowChangedEventHandler MonkeyTableRowDeleting;
|
||||
|
||||
public event MonkeyTableRowChangedEventHandler MonkeyTableRowDeleted;
|
||||
|
||||
private void InitializeClass() {
|
||||
this.Columns.Add(new System.Data.DataColumn("ID", typeof(System.Guid)));
|
||||
this.Columns.Add(new System.Data.DataColumn("Name", typeof(string)));
|
||||
this.Columns.Add(new System.Data.DataColumn("Age", typeof(int)));
|
||||
this.Columns.Add(new System.Data.DataColumn("Exists", typeof(bool)));
|
||||
}
|
||||
|
||||
internal void InitializeFields() {
|
||||
this.__columnID = this.Columns["ID"];
|
||||
this.__columnName = this.Columns["Name"];
|
||||
this.__columnAge = this.Columns["Age"];
|
||||
this.__columnExists = this.Columns["Exists"];
|
||||
}
|
||||
|
||||
public virtual System.Collections.IEnumerator GetEnumerator() {
|
||||
return this.Rows.GetEnumerator();
|
||||
}
|
||||
|
||||
public override System.Data.DataTable Clone() {
|
||||
MonkeyTableDataTable t = ((MonkeyTableDataTable)(base.Clone()));
|
||||
t.InitializeFields();
|
||||
return t;
|
||||
}
|
||||
|
||||
protected override System.Data.DataTable CreateInstance() {
|
||||
return new MonkeyTableDataTable();
|
||||
}
|
||||
|
||||
public virtual void AddMonkeyTableRow(MonkeyTableRow row) {
|
||||
this.Rows.Add(row);
|
||||
}
|
||||
|
||||
public virtual MonkeyTableRow AddMonkeyTableRow(System.Guid ID, string Name, int Age, bool Exists) {
|
||||
MonkeyTableRow row = this.NewMonkeyTableRow();
|
||||
row["ID"] = ID;
|
||||
row["Name"] = Name;
|
||||
row["Age"] = Age;
|
||||
row["Exists"] = Exists;
|
||||
this.Rows.Add(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
public virtual MonkeyTableRow NewMonkeyTableRow() {
|
||||
return ((MonkeyTableRow)(this.NewRow()));
|
||||
}
|
||||
|
||||
protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
|
||||
return new MonkeyTableRow(builder);
|
||||
}
|
||||
|
||||
public virtual void RemoveMonkeyTableRow(MonkeyTableRow row) {
|
||||
this.Rows.Remove(row);
|
||||
}
|
||||
|
||||
protected override System.Type GetRowType() {
|
||||
return typeof(MonkeyTableRow);
|
||||
}
|
||||
|
||||
protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) {
|
||||
base.OnRowChanging(e);
|
||||
if ((this.MonkeyTableRowChanging != null)) {
|
||||
this.MonkeyTableRowChanging(this, new MonkeyTableRowChangedEventArgs(((MonkeyTableRow)(e.Row)), e.Action));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) {
|
||||
base.OnRowChanged(e);
|
||||
if ((this.MonkeyTableRowChanged != null)) {
|
||||
this.MonkeyTableRowChanged(this, new MonkeyTableRowChangedEventArgs(((MonkeyTableRow)(e.Row)), e.Action));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) {
|
||||
base.OnRowDeleting(e);
|
||||
if ((this.MonkeyTableRowDeleting != null)) {
|
||||
this.MonkeyTableRowDeleting(this, new MonkeyTableRowChangedEventArgs(((MonkeyTableRow)(e.Row)), e.Action));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) {
|
||||
base.OnRowDeleted(e);
|
||||
if ((this.MonkeyTableRowDeleted != null)) {
|
||||
this.MonkeyTableRowDeleted(this, new MonkeyTableRowChangedEventArgs(((MonkeyTableRow)(e.Row)), e.Action));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MonkeyTableRow : System.Data.DataRow {
|
||||
|
||||
private MonkeyTableDataTable tableMonkeyTable;
|
||||
|
||||
internal MonkeyTableRow(System.Data.DataRowBuilder builder) :
|
||||
base(builder) {
|
||||
this.tableMonkeyTable = ((MonkeyTableDataTable)(this.Table));
|
||||
}
|
||||
|
||||
public virtual System.Guid ID {
|
||||
get {
|
||||
object ret = this[this.tableMonkeyTable.IDColumn];
|
||||
if ((ret == System.DBNull.Value)) {
|
||||
throw new System.Data.StrongTypingException("Cannot get strong typed value since it is DB null.", null);
|
||||
}
|
||||
else {
|
||||
return ((System.Guid)(ret));
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableMonkeyTable.IDColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string Name {
|
||||
get {
|
||||
object ret = this[this.tableMonkeyTable.NameColumn];
|
||||
if ((ret == System.DBNull.Value)) {
|
||||
throw new System.Data.StrongTypingException("Cannot get strong typed value since it is DB null.", null);
|
||||
}
|
||||
else {
|
||||
return ((string)(ret));
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableMonkeyTable.NameColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int Age {
|
||||
get {
|
||||
object ret = this[this.tableMonkeyTable.AgeColumn];
|
||||
if ((ret == System.DBNull.Value)) {
|
||||
throw new System.Data.StrongTypingException("Cannot get strong typed value since it is DB null.", null);
|
||||
}
|
||||
else {
|
||||
return ((int)(ret));
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableMonkeyTable.AgeColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Exists {
|
||||
get {
|
||||
object ret = this[this.tableMonkeyTable.ExistsColumn];
|
||||
if ((ret == System.DBNull.Value)) {
|
||||
throw new System.Data.StrongTypingException("Cannot get strong typed value since it is DB null.", null);
|
||||
}
|
||||
else {
|
||||
return ((bool)(ret));
|
||||
}
|
||||
}
|
||||
set {
|
||||
this[this.tableMonkeyTable.ExistsColumn] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool IsIDNull() {
|
||||
return this.IsNull(this.tableMonkeyTable.IDColumn);
|
||||
}
|
||||
|
||||
public virtual void SetIDNull() {
|
||||
this[this.tableMonkeyTable.IDColumn] = System.DBNull.Value;
|
||||
}
|
||||
|
||||
public virtual bool IsNameNull() {
|
||||
return this.IsNull(this.tableMonkeyTable.NameColumn);
|
||||
}
|
||||
|
||||
public virtual void SetNameNull() {
|
||||
this[this.tableMonkeyTable.NameColumn] = System.DBNull.Value;
|
||||
}
|
||||
|
||||
public virtual bool IsAgeNull() {
|
||||
return this.IsNull(this.tableMonkeyTable.AgeColumn);
|
||||
}
|
||||
|
||||
public virtual void SetAgeNull() {
|
||||
this[this.tableMonkeyTable.AgeColumn] = System.DBNull.Value;
|
||||
}
|
||||
|
||||
public virtual bool IsExistsNull() {
|
||||
return this.IsNull(this.tableMonkeyTable.ExistsColumn);
|
||||
}
|
||||
|
||||
public virtual void SetExistsNull() {
|
||||
this[this.tableMonkeyTable.ExistsColumn] = System.DBNull.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public class MonkeyTableRowChangedEventArgs : System.EventArgs {
|
||||
|
||||
private MonkeyTableRow eventRow;
|
||||
|
||||
private System.Data.DataRowAction eventAction;
|
||||
|
||||
public MonkeyTableRowChangedEventArgs(MonkeyTableRow r, System.Data.DataRowAction a) {
|
||||
this.eventRow = r;
|
||||
this.eventAction = a;
|
||||
}
|
||||
|
||||
public MonkeyTableRow Row {
|
||||
get {
|
||||
return this.eventRow;
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.DataRowAction Action {
|
||||
get {
|
||||
return this.eventAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,3 @@
|
||||
2007-11-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* ToolboxItemCreator.cs, ToolboxService.cs, ToolboxItemContainer.cs:
|
||||
couple of 2.0 API fixes.
|
||||
|
||||
2007-05-30 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* CursorEditor.cs: Add new (2.0) IsDropDownResizable property.
|
||||
|
||||
@@ -56,18 +56,13 @@ namespace System.Drawing.Design {
|
||||
}
|
||||
|
||||
|
||||
[MonoTODO]
|
||||
public bool IsCreated {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool IsTransient {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual IDataObject ToolboxData {
|
||||
public IDataObject ToolboxData {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@ namespace System.Drawing.Design {
|
||||
|
||||
public sealed class ToolboxItemCreator {
|
||||
|
||||
internal ToolboxItemCreator ()
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ToolboxItem Create (IDataObject data)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace System.Drawing.Design {
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual ToolboxItemContainer CreateItemContainer (ToolboxItem item, IDesignerHost link)
|
||||
protected virtual ToolboxItemContainer CreateItemContainer (IDataObject dataObject, IDesignerHost link)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace System.Drawing.Design {
|
||||
protected abstract IList GetItemContainers (string categoryName);
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual bool IsItemContainer (IDataObject dataObject, IDesignerHost host)
|
||||
protected virtual void IsItemContainer (IDataObject dataObject, IDesignerHost host)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
@@ -101,13 +101,7 @@ namespace System.Drawing.Design {
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual bool SetCursor ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void UnloadToolboxItems ()
|
||||
protected virtual void SetCursor ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2007-11-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* GraphicsPath.cs : AddBeziers(Point[]) arg is "params" in 2.0.
|
||||
|
||||
2007-10-30 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* GraphicsPath.cs: Remove some TODO specific to libgdiplus.
|
||||
|
||||
@@ -279,11 +279,7 @@ namespace System.Drawing.Drawing2D
|
||||
//
|
||||
// AddBeziers
|
||||
//
|
||||
#if NET_2_0
|
||||
public void AddBeziers (params Point [] pts)
|
||||
#else
|
||||
public void AddBeziers (Point [] pts)
|
||||
#endif
|
||||
{
|
||||
if (pts == null)
|
||||
throw new ArgumentNullException ("pts");
|
||||
|
||||
Loaded 100 of 456 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user