本文整理汇总了C++中cd_debug函数的典型用法代码示例。如果您正苦于以下问题:C++ cd_debug函数的具体用法?C++ cd_debug怎么用?C++ cd_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cd_debug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cd_rendering_calculate_max_dock_size_3D_plane
void cd_rendering_calculate_max_dock_size_3D_plane (CairoDock *pDock)
{
pDock->pFirstDrawnElement = cairo_dock_calculate_icons_positions_at_rest_linear (pDock->icons, pDock->fFlatDockWidth, pDock->iScrollOffset);
pDock->iMaxDockHeight = (int) ((1 + g_fAmplitude) * pDock->iMaxIconHeight + g_fReflectSize) + g_iconTextDescription.iSize + g_iDockLineWidth + g_iFrameMargin;
double hi = g_fReflectSize + g_iFrameMargin;
double fInclinationOnHorizon = 0, fExtraWidth = 0;
pDock->iMaxDockWidth = ceil (cairo_dock_calculate_max_dock_width (pDock, pDock->pFirstDrawnElement, pDock->fFlatDockWidth, 1., fExtraWidth));
fInclinationOnHorizon = 0.5 * pDock->iMaxDockWidth / iVanishingPointY;
pDock->iDecorationsHeight = hi + (pDock->iMaxIconHeight + g_iFrameMargin) / sqrt (1 + fInclinationOnHorizon * fInclinationOnHorizon);
fExtraWidth = cairo_dock_calculate_extra_width_for_trapeze (pDock->iDecorationsHeight, fInclinationOnHorizon, g_iDockRadius, g_iDockLineWidth);
cd_debug ("iMaxDockWidth <- %d; fInclinationOnHorizon <- %.2f; fExtraWidth <- %.2f", pDock->iMaxDockWidth, fInclinationOnHorizon, fExtraWidth);
pDock->iMaxDockWidth = ceil (cairo_dock_calculate_max_dock_width (pDock, pDock->pFirstDrawnElement, pDock->fFlatDockWidth, 1., fExtraWidth));
cd_debug ("pDock->iMaxDockWidth <- %d", pDock->iMaxDockWidth);
pDock->iDecorationsWidth = pDock->iMaxDockWidth;
pDock->iMinDockWidth = pDock->fFlatDockWidth + fExtraWidth;
pDock->iMinDockHeight = g_iDockLineWidth + g_iFrameMargin + g_fReflectSize + pDock->iMaxIconHeight;
if (my_pFlatSeparatorSurface[0] == NULL && (my_iDrawSeparator3D == CD_FLAT_SEPARATOR || my_iDrawSeparator3D == CD_PHYSICAL_SEPARATOR))
cd_rendering_load_flat_separator (CAIRO_CONTAINER (g_pMainDock));
}
开发者ID:BackupTheBerlios,项目名称:cairo-dock-svn,代码行数:26,代码来源:rendering-3D-plane.c
示例2: cd_indicator_destroy
void cd_indicator_destroy (CDAppletIndicator *pIndicator)
{
if (!pIndicator)
return;
if (pIndicator->iSidGetMenuOnce != 0)
g_source_remove (pIndicator->iSidGetMenuOnce);
if (pIndicator->iSidCheckIndicator != 0)
g_source_remove (pIndicator->iSidCheckIndicator);
pIndicator->bConnected = FALSE;
pIndicator->on_disconnect = NULL; // since the indicator has been explicitely destroyed, we don't want to call the callback when we'll disconnect from the service.
cd_debug ("destroy indicator menu...");
if (pIndicator->pMenu)
g_object_unref (pIndicator->pMenu);
cd_debug ("done.");
if (pIndicator->pServiceProxy)
{
g_object_unref (pIndicator->pServiceProxy);
pIndicator->pServiceProxy = NULL;
}
cd_debug ("destroy service...");
if (pIndicator->service)
{
//g_object_unref (pIndicator->service); // this causes a crash in libindicator (beacuse they keep the service as parameter of the callback 'service_proxy_name_changed'). so just be sure to disconnect from this object, and forget it.
g_signal_handlers_disconnect_by_func (G_OBJECT(pIndicator->service), G_CALLBACK(connection_changed), pIndicator);
g_object_weak_unref (G_OBJECT (pIndicator->service),
(GWeakNotify)_on_service_destroyed,
pIndicator);
pIndicator->service = NULL;
}
cd_debug ("done.");
g_free (pIndicator);
}
开发者ID:kheuton,项目名称:cairo-dock-plug-ins,代码行数:32,代码来源:indicator-applet.c
示例3: cd_mpris2_get_data
/* Recupere le temps ecoule chaque seconde (pas de signal pour ca).
*/
static void cd_mpris2_get_data (void)
{
if (myData.iPlayingStatus == PLAYER_PLAYING)
{
cd_mpris2_get_time_elapsed ();
if (myData.iCurrentTime < 0) // aucune info de temps sur le bus => lecteur ferme.
{
myData.iGetTimeFailed ++; // certains lecteurs (qmmp par exemple) envoient le signal 'playing' trop tot lorsqu'on les relance, ils ne fournissent pas de duree tout de suite, et donc l'applet stoppe. On fait donc 3 tentatives avant de declarer le lecteur ferme.
cd_debug ("failed to get time %d time(s)", myData.iGetTimeFailed);
if (myData.iGetTimeFailed > 2)
{
cd_debug (" => player is likely closed");
myData.iPlayingStatus = PLAYER_NONE;
myData.iCurrentTime = -2; // le temps etait a -1, on le change pour provoquer un redraw.
}
}
else
myData.iGetTimeFailed = 0;
}
else if (myData.iPlayingStatus != PLAYER_PAUSED) // en pause le temps reste constant.
{
myData.iCurrentTime = 0;
myData.iGetTimeFailed = 0;
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:27,代码来源:applet-mpris2.c
示例4: on_unmap_desklet
static gboolean on_unmap_desklet (GtkWidget* pWidget,
G_GNUC_UNUSED GdkEvent *pEvent,
CairoDesklet *pDesklet)
{
cd_debug ("unmap desklet (bAllowMinimize:%d)", pDesklet->bAllowMinimize);
if (pDesklet->iVisibility == CAIRO_DESKLET_ON_WIDGET_LAYER) // on the widget layer, let pass the unmap event..
return FALSE;
if (! pDesklet->bAllowMinimize)
{
if (pDesklet->pUnmapTimer)
{
double fElapsedTime = g_timer_elapsed (pDesklet->pUnmapTimer, NULL);
cd_debug ("fElapsedTime : %fms", fElapsedTime);
g_timer_destroy (pDesklet->pUnmapTimer);
pDesklet->pUnmapTimer = NULL;
if (fElapsedTime < .2)
return TRUE;
}
gtk_window_present (GTK_WINDOW (pWidget));
}
else
{
pDesklet->bAllowMinimize = FALSE;
if (pDesklet->pUnmapTimer == NULL)
pDesklet->pUnmapTimer = g_timer_new (); // starts the timer.
}
return TRUE; // stops other handlers from being invoked for the event.
}
开发者ID:363734,项目名称:cairo-dock-core,代码行数:28,代码来源:cairo-dock-desklet-factory.c
示例5: cd_xkbd_set_prev_next_group
// A scroll on the icon
void cd_xkbd_set_prev_next_group (int iDelta)
{
XklState *state = xkl_engine_get_current_state (myData.pEngine);
cd_debug ("keyboard current state : %d;%d +%d", state->group, state->indicators, iDelta);
int i = 0, n = xkl_engine_get_num_groups (myData.pEngine);
g_return_if_fail (n > 0);
int iCurrentGroup = MAX (0, MIN (n-1, state->group)); // on blinde car libxklavier peut bugger en 64bits.
const gchar **pGroupNames = xkl_engine_get_groups_names (myData.pEngine);
do // on passe au groupe suivant/precedent en sautant les faux (-).
{
i ++;
iCurrentGroup += iDelta; // xkl_engine_get_next_group ne marche pas.
if (iCurrentGroup == n)
iCurrentGroup = 0;
else if (iCurrentGroup < 0)
iCurrentGroup = n - 1;
} while (i < n && (pGroupNames[iCurrentGroup] == NULL || *pGroupNames[iCurrentGroup] == '-'));
state->group = iCurrentGroup;
cd_debug ("keyboard new state : %d", state->group);
xkl_engine_allow_one_switch_to_secondary_group (myData.pEngine); // sert a quoi ??
Window Xid = xkl_engine_get_current_window (myData.pEngine);
xkl_engine_save_state (myData.pEngine, Xid, state);
xkl_engine_lock_group (myData.pEngine, state->group); // sert a quoi ??
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:29,代码来源:applet-xklavier.c
示例6: cd_NetworkMonitor_get_wired_connection_infos
void cd_NetworkMonitor_get_wired_connection_infos (void)
{
cd_debug ("%s ()", __func__);
GHashTable *hProperties;
GValue *v;
//\_____________ On recupere les proprietes du device "wired"
hProperties = cairo_dock_dbus_get_all_properties (myData.dbus_proxy_Device_prop, "org.freedesktop.NetworkManager.Device.Wired");
g_return_if_fail (hProperties != NULL);
v = (GValue *)g_hash_table_lookup (hProperties, "Speed");
if (v != NULL && G_VALUE_HOLDS_UINT (v))
{
myData.iSpeed = g_value_get_uint (v);
cd_debug(" Vitesse de connexion : %d",myData.iSpeed);
}
v = (GValue *)g_hash_table_lookup (hProperties, "HwAddress");
if (v != NULL && G_VALUE_HOLDS_STRING (v))
{
myData.cAccessPointHwAdress = g_strdup(g_value_get_string (v));
cd_debug(" Adresse physique : %s",myData.cAccessPointHwAdress);
}
myData.iQuality = WIRED_NO_CONNECTION;
v = (GValue *)g_hash_table_lookup (hProperties, "Carrier");
if (v != NULL && G_VALUE_HOLDS_BOOLEAN (v))
{
if (g_value_get_boolean (v))
myData.iQuality = WIRED_CONNECTION;
cd_debug(" cable branche : %d", g_value_get_boolean (v));
}
g_hash_table_unref (hProperties);
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:35,代码来源:applet-connections.c
示例7: cd_NetworkMonitor_get_connection
gboolean cd_NetworkMonitor_get_connection (void)
{
cd_debug ("%s ()", __func__);
myData.cServiceName = g_strdup ("org.freedesktop.NetworkManagerUserSettings");
//\_____________ On recupere la liste des connexions disponibles (ce sont les configs tout-en-un de NM).
DBusGProxy *dbus_proxy_Settings = cairo_dock_create_new_system_proxy (
myData.cServiceName,
"/org/freedesktop/NetworkManagerSettings",
"org.freedesktop.NetworkManagerSettings");
GPtrArray *paConnections = cairo_dock_dbus_get_array (dbus_proxy_Settings, "ListConnections");
cd_debug ("%d connections", paConnections->len);
//\_____________ On en choisit une.
gchar *cConnection;
uint i;
for (i = 0; i < paConnections->len; i++)
{
cConnection = (gchar *)g_ptr_array_index(paConnections, i);
cd_debug (" Connection path : %s", cConnection);
myData.cConnection = g_strdup (cConnection);
}
g_ptr_array_free (paConnections, TRUE);
g_object_unref (dbus_proxy_Settings);
return (myData.cConnection != NULL);
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:30,代码来源:applet-connections.c
示例8: _hide_show_appli_icons_on_other_desktops
static void _hide_show_appli_icons_on_other_desktops (GldiWindowActor *pAppli, Icon *icon, CairoDock *pMainDock)
{
if (! myTaskbarParam.bHideVisibleApplis || pAppli->bIsHidden)
{
cd_debug ("%s (%p)", __func__, pAppli);
CairoDock *pParentDock = NULL;
if (gldi_window_is_on_current_desktop (pAppli))
{
cd_debug (" => est sur le bureau actuel.");
if (cairo_dock_get_icon_container(icon) == NULL)
{
pParentDock = gldi_appli_icon_insert_in_dock (icon, pMainDock, ! CAIRO_DOCK_ANIMATE_ICON);
}
}
else
{
cd_debug (" => n'est pas sur le bureau actuel.");
if (cairo_dock_get_icon_container (icon) != NULL) // if in a dock, detach it
pParentDock = gldi_appli_icon_detach (icon);
else // else if inhibited, detach from the inhibitor
gldi_window_detach_from_inhibitors (icon->pAppli);
}
if (pParentDock != NULL)
gtk_widget_queue_draw (pParentDock->container.pWidget);
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-core,代码行数:26,代码来源:cairo-dock-applications-manager.c
示例9: gldi_dialog_show_and_wait
int gldi_dialog_show_and_wait (const gchar *cText, Icon *pIcon, GldiContainer *pContainer, const gchar *cIconPath, GtkWidget *pInteractiveWidget)
{
int iClickedButton = -3;
GMainLoop *pBlockingLoop = g_main_loop_new (NULL, FALSE);
gpointer data[2] = {&iClickedButton, pBlockingLoop}; // it's useless to allocate 'data' because this function will wait for an answer
CairoDialog *pDialog = gldi_dialog_show (cText,
pIcon,
pContainer,
0.,
cIconPath,
pInteractiveWidget,
(CairoDockActionOnAnswerFunc)_cairo_dock_get_answer_from_dialog,
(gpointer) data,
(GFreeFunc)_on_free_blocking_dialog);
if (pDialog != NULL)
{
pDialog->fAppearanceCounter = 1.;
cd_debug ("Start the blocking loop...");
g_main_loop_run (pBlockingLoop);
cd_debug ("End of the blocking loop -> %d", iClickedButton);
}
g_main_loop_unref (pBlockingLoop);
return iClickedButton;
}
开发者ID:363734,项目名称:cairo-dock-core,代码行数:27,代码来源:cairo-dock-dialog-factory.c
示例10: _timer
static gboolean _timer (gpointer data)
{
CD_APPLET_ENTER;
time_t t_cur = (time_t) time (NULL);
if (t_cur >= myConfig.iShutdownTime)
{
cd_debug ("shutdown !\n");
if (g_iDesktopEnv == CAIRO_DOCK_KDE)
cairo_dock_launch_command ("dbus-send --session --type=method_call --dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout int32:0 int32:2 int32:2");
else
cairo_dock_launch_command ("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop");
myData.iSidTimer = 0;
CD_APPLET_LEAVE (FALSE); // inutile de faire quoique ce soit d'autre, puisque l'ordi s'eteint.
}
else
{
cd_debug ("shutdown in %d minutes", (int) (myConfig.iShutdownTime - t_cur) / 60);
CD_APPLET_SET_QUICK_INFO_ON_MY_ICON_PRINTF ("%dmn", (int) ceil ((double)(myConfig.iShutdownTime - t_cur) / 60.));
CD_APPLET_REDRAW_MY_ICON;
if (t_cur >= myConfig.iShutdownTime - 60)
gldi_dialog_show_temporary_with_icon (D_("Your computer will shut-down in 1 minute."), myIcon, myContainer, 8000, "same icon");
}
CD_APPLET_LEAVE (TRUE);
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:26,代码来源:applet-timer.c
示例11: _compute_icons_grid
static inline void _compute_icons_grid (CairoDesklet *pDesklet, CDPanelParameters *pPanel)
{
pPanel->fMargin = .5 * pPanel->iLineWidth + (1. - sqrt (2) / 2) * pPanel->iRadius;
double w = pDesklet->container.iWidth - 2 * pPanel->fMargin;
double h = pDesklet->container.iHeight - 2 * pPanel->fMargin;
pPanel->iMainIconSize = MIN (w, h) / 3;
cd_debug (" desklet: %dx%d", (int)w, (int)h);
int iNbIcons = 0;
Icon *pIcon;
GList *ic;
for (ic = pDesklet->icons; ic != NULL; ic = ic->next)
{
pIcon = ic->data;
if (! CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
iNbIcons ++;
}
pPanel->iNbIcons = iNbIcons;
int dh = myIconsParam.iLabelSize; // taille verticale ajoutee a chaque icone.
int dw = 0; // taille horizontale ajoutee a chaque icone.
int dx = GAP_X_MIN; // ecart entre 2 colonnes.
int dy = GAP_Y_MIN; // ecart entre 2 lignes.
h -= pPanel->iMainIconSize;
if (pPanel->iNbLinesForced == 0)
{
int p, q; // nombre de lignes et colonnes.
int iSize;
pPanel->iIconSize = 0, pPanel->iNbLines = 0, pPanel->iNbColumns = 0;
//g_print ("%d icones sur %dx%d (%d)\n", pPanel->iNbIcons, (int)w, (int)h, myIconsParam.iLabelSize);
for (p = 1; p <= pPanel->iNbIcons; p ++)
{
q = (int) ceil ((double)pPanel->iNbIcons / p);
iSize = MIN ((h - p * dy) / p - dh, ((w - (q - 1) * dx) / q - dw) / 2);
cd_debug (" %dx%d -> %d", p, q, iSize);
if (iSize > pPanel->iIconSize)
{
pPanel->iIconSize = iSize;
pPanel->iNbLines = p;
pPanel->iNbColumns = q;
}
}
}
else
{
int p, q; // nombre de lignes et colonnes.
pPanel->iNbLines = p = pPanel->iNbLinesForced;
pPanel->iNbColumns = q = ceil ((double)iNbIcons / pPanel->iNbLinesForced);
pPanel->iIconSize = MIN ((h - p * dy) / p - dh, ((w - (q - 1) * dx) / q - dw) / 2);
}
pPanel->iIconSize = MIN (pPanel->iIconSize, pPanel->iMainIconSize);
cd_debug (" panel desklet: %dx%d, %d", pPanel->iNbLines, pPanel->iNbColumns, pPanel->iIconSize);
if ((h - pPanel->iNbLines * (pPanel->iIconSize + dh)) / pPanel->iNbLines > dy)
{
pPanel->iMainIconSize += h - pPanel->iNbLines * (pPanel->iIconSize + dh + dy);
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:59,代码来源:rendering-desklet-panel.c
示例12: on_properties_changed
static void on_properties_changed (DBusGProxy *player_proxy, const gchar *cInterface, GHashTable *pChangedProps, const gchar **cInvalidProps, gpointer data)
{
g_return_if_fail (cInterface != NULL);
cd_debug ("");
GValue *v;
if (strcmp (cInterface, "org.mpris.MediaPlayer2.Player") == 0)
{
v = g_hash_table_lookup (pChangedProps, "PlaybackStatus");
if (v != NULL && G_VALUE_HOLDS_STRING (v)) // status has changed
{
const gchar *cStatus = g_value_get_string (v); // "Playing", "Paused" or "Stopped"
myData.iPlayingStatus = _extract_status (cStatus);
cd_debug ("PlaybackStatus: Status: %s, %d", cStatus, myData.iPlayingStatus);
if (myData.iPlayingStatus == PLAYER_PLAYING) // le handler est stoppe lorsque le lecteur ne joue rien.
cd_musicplayer_relaunch_handler ();
cd_musicplayer_update_icon ();
}
v = g_hash_table_lookup (pChangedProps, "Metadata");
if (v != NULL && G_VALUE_HOLDS_BOXED (v))
{
GHashTable *pMetadata = g_value_get_boxed (v);
gboolean bTrackHasChanged = _extract_metadata (pMetadata);
if (bTrackHasChanged) // new song (song changed or started playing)
{
myData.iPlayingStatus = PLAYER_PLAYING; // pour les lecteurs bugues comme Exaile qui envoit un statut "stop" au changement de musique sans envoyer de status "play" par la suite. On considere donc que si le lecteur joue une nouvelle musique, c'est qu'il est en "play".
cd_musicplayer_update_icon ();
}
}
v = g_hash_table_lookup (pChangedProps, "LoopStatus");
if (v != NULL && G_VALUE_HOLDS_STRING (v)) // loop status has changed
{
const gchar *cStatus = g_value_get_string (v); // "Playlist", "None"
s_bIsLoop = (cStatus && strcmp (cStatus, "Playlist") == 0);
cd_debug ("LoopStatus: %s, %d", cStatus, s_bIsLoop);
s_bGotLoopStatus = TRUE;
}
v = g_hash_table_lookup (pChangedProps, "Shuffle");
if (v != NULL && G_VALUE_HOLDS_BOOLEAN (v)) // Shuffle status has changed
{
s_bIsShuffle = g_value_get_boolean (v);
cd_debug ("Shuffle: %d", s_bIsShuffle);
s_bGotShuffleStatus = TRUE;
}
}
/*else if (strcmp (cInterface, "org.mpris.MediaPlayer2.TrackList") == 0)
{
}*/
else
cd_debug ("Another interface: %s", cInterface);
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:57,代码来源:applet-mpris2.c
示例13: on_button_press_desklet
static gboolean on_button_press_desklet(GtkWidget *widget,
GdkEventButton *pButton,
CairoDesklet *pDesklet)
{
if (pButton->button == 1) // clic gauche.
{
if (pButton->type == GDK_BUTTON_PRESS)
{
pDesklet->diff_x = - pButton->x; // pour le deplacement manuel.
pDesklet->diff_y = - pButton->y;
cd_debug ("diff : %d;%d", pDesklet->diff_x, pDesklet->diff_y);
}
else if (pButton->type == GDK_BUTTON_RELEASE)
{
cd_debug ("GDK_BUTTON_RELEASE");
if (pDesklet->moving)
{
pDesklet->moving = FALSE;
}
else
{
Icon *pClickedIcon = cairo_dock_find_clicked_icon_in_desklet (pDesklet);
gpointer data[2] = {pClickedIcon, pDesklet};
cairo_dock_notify (CAIRO_DOCK_CLICK_ICON, data);
}
}
else if (pButton->type == GDK_2BUTTON_PRESS)
{
Icon *pClickedIcon = cairo_dock_find_clicked_icon_in_desklet (pDesklet);
gpointer data[2] = {pClickedIcon, pDesklet};
cairo_dock_notify (CAIRO_DOCK_DOUBLE_CLICK_ICON, data);
}
}
else if (pButton->button == 3 && pButton->type == GDK_BUTTON_PRESS) // clique droit.
{
Icon *pClickedIcon = cairo_dock_find_clicked_icon_in_desklet (pDesklet);
GtkWidget *menu = cairo_dock_build_menu (pClickedIcon, CAIRO_CONTAINER (pDesklet)); // genere un CAIRO_DOCK_BUILD_MENU.
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu),
NULL,
NULL,
NULL,
NULL,
1,
gtk_get_current_event_time ());
pDesklet->bInside = FALSE;
pDesklet->iGradationCount = 0; // on force le fond a redevenir transparent.
gtk_widget_queue_draw (pDesklet->pWidget);
}
else if (pButton->button == 2 && pButton->type == GDK_BUTTON_PRESS) // clique milieu.
{
gpointer data[2] = {pDesklet->pIcon, pDesklet};
cairo_dock_notify (CAIRO_DOCK_MIDDLE_CLICK_ICON, data);
}
return FALSE;
}
开发者ID:BackupTheBerlios,项目名称:cairo-dock-svn,代码行数:56,代码来源:cairo-dock-desklet.c
示例14: cd_toggle_dialog
void cd_toggle_dialog (void)
{
if (myData.pDialog != NULL) // the dialog can be opened in the case it was called from the shortkey.
{
gldi_object_unref (GLDI_OBJECT(myData.pDialog));
myData.pDialog = NULL;
}
else
{
// establish the connection to Zeitgesit.
if (myData.pLog == NULL) // first search.
{
cd_debug ("first search");
myData.pLog = zeitgeist_log_new (); // may launch the Zeitgeist daemon if it's not yet running.
}
#ifdef ZEITGEIST_1_0
if (! zeitgeist_log_is_connected (myData.pLog))
{
cd_debug ("not yet connected");
if (myData.iSidTryDialog == 0)
{
myData.iNbTries = 0;
myData.iSidTryDialog = g_timeout_add_seconds (1, _show_dialog_delayed, NULL);
}
return;
}
#else
gboolean bIsConnected;
g_object_get (G_OBJECT (myData.pLog), "is-connected", &bIsConnected, NULL);
if (! bIsConnected)
{
// will retry when it will be connected
g_signal_connect (myData.pLog, "notify::is-connected",
G_CALLBACK (_show_dialog_delayed), NULL);
return;
}
#endif
// build the dialog and the tree model.
GtkWidget *pInteractiveWidget = cd_build_events_widget ();
myData.pDialog = gldi_dialog_show (D_("Browse and search in recent events"),
myIcon,
myContainer,
0,
"same icon",
pInteractiveWidget,
NULL,
myApplet,
(GFreeFunc) _on_dialog_destroyed);
gtk_widget_grab_focus (myData.pEntry);
// trigger the search that will fill the model.
cd_trigger_search ();
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:55,代码来源:applet-dialog.c
示例15: cd_debug
static CDWM *_get_prefered_wmc (CDWMIndex iCurrentWm)
{
cd_debug ("%s (%s, %d)", __func__, myConfig.cWmCompositor, iCurrentWm);
CDWM *wm;
if (myConfig.cWmCompositor != NULL) // a composite WM is defined.
{
wm = _get_wm_by_name (myConfig.cWmCompositor);
if (wm == NULL) // not one of the known WM -> define and take the custom one.
{
wm = _get_wm_by_index (CD_CUSTOM_WMC);
g_free ((gchar*)wm->cCommand);
wm->cCommand = g_strdup (myConfig.cWmCompositor);
return wm;
}
else if (wm->bIsAvailable)
return wm;
}
// no WM defined, or the one defined is not available -> check if a suitable one is running.
if (iCurrentWm < NB_WM) // one of the know WM is running
{
if (myData.bIsComposited) // and it provides composite => let's take it!
{
wm = _get_wm_by_index (iCurrentWm);
if (wm->bIsAvailable) // just to be sure.
return wm;
}
}
// no succes so far, take the most suitable one.
int index[NB_COMPOSITE_WM] = {CD_COMPIZ, CD_KWIN, CD_XFWM, CD_METACITY}; // in this order by default.
switch (g_iDesktopEnv)
{
case CAIRO_DOCK_GNOME:
index[1] = CD_METACITY;
index[3] = CD_KWIN;
break;
case CAIRO_DOCK_XFCE:
index[1] = CD_XFWM;
index[2] = CD_KWIN;
break;
case CAIRO_DOCK_KDE:
default:
break;
}
int i;
for (i = 0; i < NB_COMPOSITE_WM; i ++)
{
wm = _get_wm_by_index (index[i]);
cd_debug (" %d) %s, %d", index[i], wm->cName, wm->bIsAvailable);
if (wm->bIsAvailable)
return wm;
}
return NULL;
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:55,代码来源:applet-composite-manager.c
示例16: _activate_nth_icon
static void _activate_nth_icon (guint iKeyVal, guint iModifierType) // iKeyVal is already in the correct interval.
{
cd_debug ("%s (%d)", __func__, iKeyVal);
// get the index of the icon: we want "1" to be the first icon, because it's more natural and it follows the keyboard layout. So "0" will actually be the 10th icon.
int iIndex; // from 0
if (iKeyVal >= GDK_KEY_0 && iKeyVal <= GDK_KEY_9)
{
if (iKeyVal == GDK_KEY_0)
iIndex = 9;
else
iIndex = iKeyVal - GDK_KEY_1;
}
else
{
if (iKeyVal == GDK_KEY_KP_0)
iIndex = 9;
else
iIndex = iKeyVal - GDK_KEY_KP_1;
}
cd_debug ("click on %d", iIndex);
// retrieve the nth icon in the current dock.
int n = 0;
Icon *pNthIcon = NULL, *pIcon;
GList *ic;
for (ic = myData.pCurrentDock->icons; ic != NULL; ic = ic->next)
{
pIcon = ic->data;
if (! CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
{
if (n == iIndex)
{
pNthIcon = pIcon;
break;
}
n ++;
}
}
// execute the icon directly.
if (pNthIcon != NULL)
{
cd_debug ("click on %s", pNthIcon->cName);
cd_do_simulate_click (CAIRO_CONTAINER (myData.pCurrentDock), pNthIcon, iModifierType);
gldi_icon_start_animation (pNthIcon);
myData.bIgnoreIconState = FALSE;
if (pNthIcon == myData.pCurrentIcon)
myData.pCurrentIcon = NULL; // sinon on va interrompre l'animation en fermant la session.
cd_do_close_session ();
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:52,代码来源:applet-notifications.c
示例17: _cd_powermanager_dialog
static void _cd_powermanager_dialog (GString *sInfo) {
cd_debug ("%s", __func__);
gchar *cIconPath = NULL;
if (!myData.on_battery || !myData.battery_present)
cIconPath = g_strdup_printf("%s/%s", MY_APPLET_SHARE_DATA_DIR, "sector.svg");
else
cIconPath = g_strdup_printf("%s/%s", MY_APPLET_SHARE_DATA_DIR, "default-battery.svg");
cd_debug ("%s (%s)", sInfo->str, cIconPath);
cairo_dock_show_temporary_dialog_with_icon (sInfo->str, myIcon, myContainer, 6000, cIconPath);
g_free(cIconPath);
}
开发者ID:BackupTheBerlios,项目名称:cairo-dock-svn,代码行数:13,代码来源:powermanager-draw.c
示例18: filter_func
static GdkFilterReturn
filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
{
GdkFilterReturn return_val = GDK_FILTER_CONTINUE;
XEvent *xevent = (XEvent *) gdk_xevent;
guint event_mods;
GSList *iter;
cd_debug ("Got Event! %d, %d", xevent->type, event->type);
switch (xevent->type) {
case KeyPress:
cd_debug ("Got KeyPress! keycode: %d, modifiers: %d",
xevent->xkey.keycode,
xevent->xkey.state);
/*
* Set the last event time for use when showing
* windows to avoid anti-focus-stealing code.
*/
processing_event = TRUE;
last_event_time = xevent->xkey.time;
event_mods = xevent->xkey.state & ~(num_lock_mask |
caps_lock_mask |
scroll_lock_mask);
for (iter = bindings; iter != NULL; iter = iter->next) {
Binding *binding = (Binding *) iter->data;
if (binding->keycode == xevent->xkey.keycode &&
binding->modifiers == event_mods) {
cd_debug ("Calling handler for '%s'...",
binding->keystring);
(binding->handler) (binding->keystring,
binding->user_data);
}
}
processing_event = FALSE;
break;
case KeyRelease:
cd_debug ("Got KeyRelease! ");
break;
}
return return_val;
}
开发者ID:BackupTheBerlios,项目名称:cairo-dock-svn,代码行数:50,代码来源:cairo-dock-keybinder.c
示例19: cd_NetworkMonitor_get_wireless_connection_infos
void cd_NetworkMonitor_get_wireless_connection_infos (void)
{
cd_debug ("%s ()", __func__);
GHashTable *hProperties;
GValue *v;
g_free (myData.cAccessPointHwAdress);
myData.cAccessPointHwAdress = NULL;
myData.iSpeed = 0;
//\_____________ On recupere les proprietes du device "wireless".
hProperties = cairo_dock_dbus_get_all_properties (myData.dbus_proxy_Device_prop, "org.freedesktop.NetworkManager.Device.Wireless");
g_return_if_fail (hProperties != NULL);
v = (GValue *)g_hash_table_lookup (hProperties, "Bitrate");
if (v && G_VALUE_HOLDS_UINT (v))
{
myData.iSpeed = g_value_get_uint (v);
cd_debug (" Bitrate : %d\n",myData.iSpeed);
}
v = (GValue *)g_hash_table_lookup (hProperties, "HwAddress");
if (v && G_VALUE_HOLDS_STRING (v))
{
myData.cAccessPointHwAdress = g_strdup(g_value_get_string (v));
cd_debug (" Adresse physique : %s\n",myData.cAccessPointHwAdress);
}
v = (GValue *)g_hash_table_lookup (hProperties, "ActiveAccessPoint");
if (v && G_VALUE_HOLDS (v, DBUS_TYPE_G_OBJECT_PATH))
{
gchar *cAccessPoint = g_value_get_boxed (v);
cd_debug (" Access point : %s", cAccessPoint);
if (cAccessPoint && strncmp (cAccessPoint, "/org/freedesktop/NetworkManager/AccessPoint/", 44) == 0)
{
g_free (myData.cAccessPoint);
myData.cAccessPoint = g_strdup (cAccessPoint);
}
}
g_hash_table_unref (hProperties);
//\_____________ On recupere le point d'acces courant sur le bus.
myData.iQuality = WIFI_QUALITY_NO_SIGNAL;
if (myData.cAccessPoint != NULL)
{
cd_NetworkMonitor_get_new_access_point ();
}
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:49,代码来源:applet-connections.c
示例20: cd_do_search_matching_icons
void cd_do_search_matching_icons (void)
{
if (myData.sCurrentText->len == 0)
return;
cd_debug ("%s (%s)", __func__, myData.sCurrentText->str);
gchar *str = strchr (myData.sCurrentText->str, ' '); // on ne compte pas les arguments d'une eventuelle commande deja tapee.
guint length = myData.sCurrentText->len;
if (str != NULL)
{
g_string_set_size (myData.sCurrentText, str - myData.sCurrentText->str + 1);
cd_debug (" on ne cherchera que '%s' (len=%d)", myData.sCurrentText->str, myData.sCurrentText->len);
}
if (myData.pMatchingIcons == NULL)
{
cd_debug ("on cherche tout\n");
// on parcours tous les docks.
gldi_icons_foreach_in_docks ((GldiIconFunc) _cd_do_search_in_one_dock, NULL);
myData.pMatchingIcons = g_list_reverse (myData.pMatchingIcons);
// on rajoute les icones ne venant pas du dock.
cd_do_find_matching_applications ();
}
else // optimisation : on peut se contenter de chercher parmi les icones deja trouvees.
{
cd_debug ("on se contente d'enlever celles en trop\n");
GList *ic, *next_ic;
Icon *pIcon;
ic = myData.pMatchingIcons;
while (ic != NULL)
{
pIcon = ic->data;
next_ic = ic->next;
if (! _cd_do_icon_match (pIcon, myData.sCurrentText->str, myData.sCurrentText->len))
myData.pMatchingIcons = g_list_delete_link (myData.pMatchingIcons, ic);
ic = next_ic;
}
}
myData.pCurrentMatchingElement = myData.pMatchingIcons;
myData.iMatchingGlideCount = 0;
myData.iPreviousMatchingOffset = 0;
myData.iCurrentMatchingOffset = 0;
if (myData.pCurrentApplicationToLoad != NULL) // on va continuer le chargement sur la sous-liste.
myData.pCurrentApplicationToLoad = myData.pMatchingIcons; // comme l'ordre de la liste n'a pas ete altere, on n'est sur de ne pas sauter d'icone.
cairo_dock_redraw_container (CAIRO_CONTAINER (g_pMainDock));
//g_print ("%d / %d\n", length , myData.sCurrentText->len);
if (length != myData.sCurrentText->len)
g_string_set_size (myData.sCurrentText, length);
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:49,代码来源:applet-icon-finder.c
注:本文中的cd_debug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论