~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to vmware-user/notify.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
    * define them above, with file-level scope, and then add them to this
101
101
    * list.
102
102
    */
103
 
   struct FuncEntry
104
103
   {
105
 
      void **funcPtr;
106
 
      const char *symName;
107
 
   } vtable[] = {
108
 
      { (void **) &notify_init, "notify_init" },
109
 
      { (void **) &notify_uninit, "notify_uninit" },
110
 
      { (void **) &notify_notification_show, "notify_notification_show" },
111
 
      { (void **) &notify_notification_new_with_status_icon,
112
 
         "notify_notification_new_with_status_icon" },
113
 
      { (void **) &notify_notification_set_timeout,
114
 
         "notify_notification_set_timeout" },
115
 
      { NULL, NULL }
116
 
   };
 
104
      struct FuncEntry
 
105
      {
 
106
         void **funcPtr;
 
107
         const char *symName;
 
108
      } vtable[] = {
 
109
         { (void **) &notify_init, "notify_init" },
 
110
         { (void **) &notify_uninit, "notify_uninit" },
 
111
         { (void **) &notify_notification_show, "notify_notification_show" },
 
112
         { (void **) &notify_notification_new_with_status_icon,
 
113
           "notify_notification_new_with_status_icon" },
 
114
         { (void **) &notify_notification_set_timeout,
 
115
           "notify_notification_set_timeout" },
 
116
         { NULL, NULL }
 
117
      };
117
118
 
118
 
   /*
119
 
    * Load each of the above symbols from libnotify, checking to make sure
120
 
    * that they exist.
121
 
    */
122
 
   for (i = 0; vtable[i].funcPtr != NULL; i++) {
123
 
      *(vtable[i].funcPtr) = dlsym(libNotifyHandle, vtable[i].symName);
124
 
      if ( *(vtable[i].funcPtr) == NULL) {
125
 
         Debug("Could not find %s in libnotify\n", vtable[i].symName);
126
 
         UnloadLibNotify();
127
 
         return FALSE;
 
119
      /*
 
120
       * Load each of the above symbols from libnotify, checking to make sure
 
121
       * that they exist.
 
122
       */
 
123
      for (i = 0; vtable[i].funcPtr != NULL; i++) {
 
124
         *(vtable[i].funcPtr) = dlsym(libNotifyHandle, vtable[i].symName);
 
125
         if ( *(vtable[i].funcPtr) == NULL) {
 
126
            Debug("Could not find %s in libnotify\n", vtable[i].symName);
 
127
            UnloadLibNotify();
 
128
            return FALSE;
 
129
         }
128
130
      }
129
131
   }
130
132
 
275
277
                                         // IN: The left-click callback
276
278
{
277
279
   char *iconPath;
 
280
   Notifier *n;
278
281
 
279
282
   if (!initialized) {
280
283
      return FALSE;
281
284
   }
282
285
 
283
 
   Notifier *n = g_new0(Notifier, 1);
 
286
   n = g_new0(Notifier, 1);
284
287
   iconPath = Str_Asprintf(NULL, "%s/share/icons/vmware.png", vmLibDir);
285
288
   n->statusIcon = gtk_status_icon_new_from_file(iconPath);
286
289
   gtk_status_icon_set_tooltip(n->statusIcon, shortMsg);