Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e3055bcc
Kaydet (Commit)
e3055bcc
authored
Eki 24, 2012
tarafından
Antonio Fernandez
Kaydeden (comit)
Bjoern Michaelsen
Kas 14, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added missing files for HUD awareness support.
Change-Id: If3544734e8c4a1c632a24976e9340ef84869d22a
üst
5339d69b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
0 deletions
+172
-0
hudawareness.h
vcl/inc/unx/gtk/hudawareness.h
+45
-0
hudawareness.cxx
vcl/unx/gtk/window/hudawareness.cxx
+126
-0
gtk3hudawareness.cxx
vcl/unx/gtk3/window/gtk3hudawareness.cxx
+1
-0
No files found.
vcl/inc/unx/gtk/hudawareness.h
0 → 100644
Dosyayı görüntüle @
e3055bcc
/*
* Copyright © 2012 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of the
* licence, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
* Author: Ryan Lortie <desrt@desrt.ca>
*/
#ifndef _hudawareness_h_
#define _hudawareness_h_
#include <gio/gio.h>
G_BEGIN_DECLS
typedef
void
(
*
HudAwarenessCallback
)
(
gboolean
hud_active
,
gpointer
user_data
);
guint
hud_awareness_register
(
GDBusConnection
*
connection
,
const
gchar
*
object_path
,
HudAwarenessCallback
callback
,
gpointer
user_data
,
GDestroyNotify
notify
,
GError
**
error
);
void
hud_awareness_unregister
(
GDBusConnection
*
connection
,
guint
awareness_id
);
G_END_DECLS
#endif
/* _hudawareness_h_ */
vcl/unx/gtk/window/hudawareness.cxx
0 → 100644
Dosyayı görüntüle @
e3055bcc
/*
* Copyright © 2012 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of the
* licence, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
* Author: Ryan Lortie <desrt@desrt.ca>
*/
#include <unx/gtk/hudawareness.h>
typedef
struct
{
GDBusConnection
*
connection
;
HudAwarenessCallback
callback
;
gpointer
user_data
;
GDestroyNotify
notify
;
}
HudAwarenessHandle
;
static
void
hud_awareness_method_call
(
GDBusConnection
*
connection
,
const
gchar
*
sender
,
const
gchar
*
object_path
,
const
gchar
*
interface_name
,
const
gchar
*
method_name
,
GVariant
*
parameters
,
GDBusMethodInvocation
*
invocation
,
gpointer
user_data
)
{
HudAwarenessHandle
*
handle
=
(
HudAwarenessHandle
*
)
user_data
;
if
(
g_str_equal
(
method_name
,
"HudActiveChanged"
))
{
gboolean
active
;
g_variant_get
(
parameters
,
"(b)"
,
&
active
);
(
*
handle
->
callback
)
(
active
,
handle
->
user_data
);
}
g_dbus_method_invocation_return_value
(
invocation
,
NULL
);
}
static
void
hud_awareness_handle_free
(
gpointer
data
)
{
HudAwarenessHandle
*
handle
=
(
HudAwarenessHandle
*
)
data
;
g_object_unref
(
handle
->
connection
);
if
(
handle
->
notify
)
(
*
handle
->
notify
)
(
handle
->
user_data
);
g_slice_free
(
HudAwarenessHandle
,
handle
);
}
guint
hud_awareness_register
(
GDBusConnection
*
connection
,
const
gchar
*
object_path
,
HudAwarenessCallback
callback
,
gpointer
user_data
,
GDestroyNotify
notify
,
GError
**
error
)
{
static
GDBusInterfaceInfo
*
iface
;
GDBusInterfaceVTable
vtable
=
{
hud_awareness_method_call
};
HudAwarenessHandle
*
handle
;
guint
object_id
;
if
G_UNLIKELY
(
iface
==
NULL
)
{
GError
*
error
=
NULL
;
GDBusNodeInfo
*
info
;
info
=
g_dbus_node_info_new_for_xml
(
"<node>"
"<interface name='com.canonical.hud.Awareness'>"
"<method name='CheckAwareness'/>"
"<method name='HudActiveChanged'>"
"<arg type='b'/>"
"</method>"
"</interface>"
"</node>"
,
&
error
);
g_assert_no_error
(
error
);
iface
=
g_dbus_node_info_lookup_interface
(
info
,
"com.canonical.hud.Awareness"
);
g_assert
(
iface
!=
NULL
);
}
handle
=
g_slice_new
(
HudAwarenessHandle
);
object_id
=
g_dbus_connection_register_object
(
connection
,
object_path
,
iface
,
&
vtable
,
handle
,
NULL
,
error
);
if
(
object_id
==
0
)
{
g_slice_free
(
HudAwarenessHandle
,
handle
);
return
0
;
}
handle
->
connection
=
(
GDBusConnection
*
)
g_object_ref
(
connection
);
handle
->
callback
=
callback
;
handle
->
user_data
=
user_data
;
handle
->
notify
=
notify
;
return
object_id
;
}
void
hud_awareness_unregister
(
GDBusConnection
*
connection
,
guint
subscription_id
)
{
g_dbus_connection_unregister_object
(
connection
,
subscription_id
);
}
vcl/unx/gtk3/window/gtk3hudawareness.cxx
0 → 100644
Dosyayı görüntüle @
e3055bcc
#include "../../gtk/window/hudawareness.cxx"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment