Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-10-07 18:59:19 +0000
committerAndrew Niefer2009-10-07 18:59:19 +0000
commit34841c7f7a576a7eb2d8d7022fafc00eedb3d342 (patch)
treeb79da08ed0e30b9708d45d5be5ba63a2d3acd07e /bundles/org.eclipse.equinox.executable
parent7695bdc0e7a5a0884a1fb5e70e562e6d55f8a949 (diff)
downloadrt.equinox.framework-34841c7f7a576a7eb2d8d7022fafc00eedb3d342.tar.gz
rt.equinox.framework-34841c7f7a576a7eb2d8d7022fafc00eedb3d342.tar.xz
rt.equinox.framework-34841c7f7a576a7eb2d8d7022fafc00eedb3d342.zip
bug 174187 - no name in task bar
bug 235027 - task bar entry on windows
Diffstat (limited to 'bundles/org.eclipse.equinox.executable')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c12
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseCommon.h8
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseJNI.c25
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseJNI.h9
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseMain.c4
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c3
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c12
7 files changed, 67 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index d0493706a..58d318ff9 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -925,6 +925,18 @@ _TCHAR* getOfficialName() {
return officialName;
}
+void setOfficialName(_TCHAR* name) {
+ officialName = name;
+}
+
+_TCHAR* getProgramPath() {
+ return program;
+}
+
+void setProgramPath(_TCHAR* path) {
+ program = path;
+}
+
/*
* Determine the default official application name
*
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
index 1cf471024..59267d9e0 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,6 +59,12 @@ extern _TCHAR* getProgramDir();
extern _TCHAR* getOfficialName();
+extern void setOfficialName(_TCHAR * name);
+
+extern _TCHAR* getProgramPath();
+
+extern void setProgramPath(_TCHAR* name);
+
extern _TCHAR* resolveSymlinks( _TCHAR* path );
/** Display a Message
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
index 8f0f267c8..728abbba1 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
static JNINativeMethod natives[] = {{"_update_splash", "()V", (void *)&update_splash},
{"_get_splash_handle", "()J", (void *)&get_splash_handle},
{"_set_exit_data", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)&set_exit_data},
+ {"_set_launcher_info", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)&set_launcher_info},
{"_show_splash", "(Ljava/lang/String;)V", (void *)&show_splash},
{"_takedown_splash", "()V", (void *)&takedown_splash}};
@@ -74,6 +75,28 @@ JNIEXPORT void JNICALL set_exit_data(JNIEnv * env, jobject obj, jstring id, jstr
}
}
+JNIEXPORT void JNICALL set_launcher_info(JNIEnv * env, jobject obj, jstring launcher, jstring name){
+ const _TCHAR* launcherPath = NULL;
+ const _TCHAR* launcherName = NULL;
+
+ if (launcher != NULL) {
+ launcherPath = JNI_GetStringChars(env, launcher);
+ if (launcherPath != NULL) {
+ setProgramPath(_tcsdup(launcherPath));
+ JNI_ReleaseStringChars(env, launcher, launcherPath);
+ }
+ }
+
+ if (name != NULL) {
+ launcherName = JNI_GetStringChars(env, name);
+ if (launcherName != NULL) {
+ setOfficialName(_tcsdup(launcherName));
+ JNI_ReleaseStringChars(env, name, launcherName);
+ }
+ }
+}
+
+
JNIEXPORT void JNICALL update_splash(JNIEnv * env, jobject obj){
dispatchMessages();
}
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
index b253ada78..138b55177 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@ typedef jint (JNICALL *JNI_createJavaVM)(JavaVM **pvm, JNIEnv **env, void *args)
/* JNI Callback methods */
/* Use name mangling since we may be linking these from java with System.LoadLibrary */
#define set_exit_data Java_org_eclipse_equinox_launcher_JNIBridge__1set_1exit_1data
+#define set_launcher_info Java_org_eclipse_equinox_launcher_JNIBridge__1set_1launcher_1info
#define update_splash Java_org_eclipse_equinox_launcher_JNIBridge__1update_1splash
#define show_splash Java_org_eclipse_equinox_launcher_JNIBridge__1show_1splash
#define get_splash_handle Java_org_eclipse_equinox_launcher_JNIBridge__1get_1splash_1handle
@@ -35,6 +36,12 @@ extern "C" {
JNIEXPORT void JNICALL set_exit_data(JNIEnv *, jobject, jstring, jstring);
/*
+ * org_eclipse_equinox_launcher_JNIBridge#_set_launcher_info
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL set_launcher_info(JNIEnv *, jobject, jstring, jstring);
+
+/*
* org_eclipse_equinox_launcher_JNIBridge#_update_splash
* Signature: ()V
*/
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseMain.c b/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
index c1f1885d7..fbe791c3b 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
@@ -200,6 +200,10 @@ int main( int argc, _TCHAR* argv[] )
return exitCode;
}
+_TCHAR* getProgramPath() {
+ return NULL;
+}
+
static _TCHAR* findProgram(_TCHAR* argv[]) {
_TCHAR * program;
#ifdef _WIN32
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
index a6dfe1727..84eca11ee 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
@@ -71,6 +71,9 @@ int initWindowSystem(int* pArgc, char* argv[], int showSplash)
if (loadGtk() != 0)
return -1;
+ if (getOfficialName() != NULL)
+ defaultArgv[0] = getOfficialName();
+
if (argv == NULL) {
/* gtk_init_check on Solaris 9 doesn't like NULL or empty argv */
pArgc = &defaultArgc;
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c
index 20a45cd90..48f38b3c8 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWinCommon.c
@@ -52,10 +52,17 @@ int initWindowSystem( int* pArgc, _TCHAR* argv[], int showSplash )
if(initialized)
return 0;
- /* Create a window that has no decorations. */
+
+ icon = LoadIcon(module, MAKEINTRESOURCE(ECLIPSE_ICON));
+ if (icon == NULL) {
+ HMODULE hm = LoadLibraryEx(getProgramPath(), 0, LOAD_LIBRARY_AS_DATAFILE & 0x2 /*LOAD_LIBRARY_AS_IMAGE_RESOURCE*/);
+ if (hm != NULL)
+ icon = LoadIcon(hm, MAKEINTRESOURCE(ECLIPSE_ICON));
+ }
+ /* Create a window that has no decorations. */
InitCommonControls();
- topWindow = CreateWindowEx ( WS_EX_TOOLWINDOW,
+ topWindow = CreateWindowEx ( icon != NULL ? 0 : WS_EX_TOOLWINDOW,
_T("STATIC"),
getOfficialName(),
SS_BITMAP | WS_POPUP | WS_CLIPCHILDREN,
@@ -68,7 +75,6 @@ int initWindowSystem( int* pArgc, _TCHAR* argv[], int showSplash )
module,
NULL);
- icon = LoadIcon(module, MAKEINTRESOURCE(ECLIPSE_ICON));
if (icon != NULL)
#ifdef WIN64
SetClassLongPtr(topWindow, GCLP_HICON, (LONG_PTR)icon);

Back to the top