Tk-Components

Check-in [1cafb6a6d8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More progress on launcher
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1cafb6a6d82366c71338b433bf841b90b45ff257
User & Date: kevin 2015-07-09 02:36:31
Context
2015-07-10
02:52
Add aem package check-in: 38182a035f user: kevin tags: trunk
2015-07-09
02:36
More progress on launcher check-in: 1cafb6a6d8 user: kevin tags: trunk
02:28
Fix line endings in launcher check-in: ec2041d5c3 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to launcher/macosx/launcher.c.

100
101
102
103
104
105
106




107
108

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
  /* Get url string, convert to CFStringRef. */
  CFStringRef url = CFStringCreateWithCString(NULL, Tcl_GetString(objv[1]),
					      kCFStringEncodingUTF8);

  CFStringRef defaultApp;
  defaultApp =  LSCopyDefaultHandlerForURLScheme(url);





  /* Convert the URL reference into a string reference. */
  CFStringRef appPath = CFURLCopyFileSystemPath(defaultApp, kCFURLPOSIXPathStyle);

 
  /* Get the system encoding method. */
  CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
 
  /* Convert the string reference into a C string. */
  char *path = CFStringGetCStringPtr(appPath, encodingMethod);

  Tcl_SetResult(ip, path, NULL);

  CFRelease(defaultApp);
  CFRelease(appPath);
    CFRelease(url);

  return TCL_OK;

}

/*Tcl function to set default app for URL.*/
int SetDefaultApp(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) {







>
>
>
>

|
>

|
|

|
|

|

|
|
|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  /* Get url string, convert to CFStringRef. */
  CFStringRef url = CFStringCreateWithCString(NULL, Tcl_GetString(objv[1]),
					      kCFStringEncodingUTF8);

  CFStringRef defaultApp;
  defaultApp =  LSCopyDefaultHandlerForURLScheme(url);

  OSStatus result;
   CFURLRef appURL = NULL;
   result = LSFindApplicationForInfo(kLSUnknownCreator, defaultApp, NULL, NULL, &appURL);

  /* Convert the URL reference into a string reference. */
  CFStringRef appPath = CFURLCopyFileSystemPath(appURL, kCFURLPOSIXPathStyle);
  CFShow(appPath);
 
  /* /\* Get the system encoding method. *\/ */
  /* CFStringEncoding encodingMethod = CFStringGetSystemEncoding(); */
 
  /* /\* Convert the string reference into a C string. *\/ */
  /* char *path = CFStringGetCStringPtr(appPath, encodingMethod); */

  /* Tcl_SetResult(ip, path, NULL); */

  /* CFRelease(defaultApp); */
  /* CFRelease(appPath); */
  /* CFRelease(url); */

  return TCL_OK;

}

/*Tcl function to set default app for URL.*/
int SetDefaultApp(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]) {