Remove debug prints, add docs
Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
parent
88fb91c118
commit
11ca4e8426
2 changed files with 12 additions and 17 deletions
|
@ -11,13 +11,9 @@ namespace MediaPlayer {
|
|||
|
||||
[CCode (cname = "g_io_phosh_plugin_media_player_load")]
|
||||
public static void stub (GLib.TypeModule module) {
|
||||
message ("Stub called");
|
||||
|
||||
Thread.usleep (1000);
|
||||
if (typeof (Player) == 0) {
|
||||
message ("Player type poshol po pizde");
|
||||
message ("Trying to init %s", module.use () ? "Module OK" : "Module Fail");
|
||||
load (module);
|
||||
module.use (); // We don't want to unuse it. Just beleve me
|
||||
init (module);
|
||||
}
|
||||
IOExtensionPoint.implement ("phosh-quick-setting-widget",
|
||||
typeof (QuickSetting),
|
||||
|
@ -28,20 +24,25 @@ namespace MediaPlayer {
|
|||
"media-player",
|
||||
10);
|
||||
if (css == null) {
|
||||
message ("Loading CSS");
|
||||
css = new Gtk.CssProvider ();
|
||||
css.load_from_resource ("/mobi/phosh/plugins/media-player/style.css");
|
||||
Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Weird hack.
|
||||
* Move this attribute to stub and see what will happen
|
||||
* We don't need to register type on all loads.
|
||||
* In `stub` we're checking if any our types was registred if no, call module init
|
||||
*/
|
||||
[ModuleInit]
|
||||
public static void load (GLib.TypeModule module) {
|
||||
public static void init (GLib.TypeModule module) {
|
||||
}
|
||||
|
||||
[CCode (cname = "g_io_phosh_plugin_media_player_unload")]
|
||||
public static void unload (GLib.TypeModule module) {
|
||||
message ("Unload");
|
||||
// TODO: Remove our CSS here
|
||||
}
|
||||
|
||||
[CCode (cname = "g_io_phosh_plugin_media_player_query")]
|
||||
|
|
|
@ -33,22 +33,16 @@ public class MediaPlayer.Player : Gtk.Box {
|
|||
private string id = Uuid.string_random ();
|
||||
private Gtk.CssProvider css_provider = new Gtk.CssProvider ();
|
||||
construct {
|
||||
warning ("Constructor");
|
||||
info ("Constructor");
|
||||
Gtk.StyleContext.add_provider_for_screen
|
||||
(
|
||||
Gdk.Screen.get_default (),
|
||||
css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
get_style_context ().add_class (id);
|
||||
}
|
||||
static construct {
|
||||
warning ("Class Init");
|
||||
}
|
||||
static ~Player () {
|
||||
warning ("Class Deinit");
|
||||
}
|
||||
|
||||
~Player () {
|
||||
warning ("Destructor");
|
||||
info ("Destructor");
|
||||
Gtk.StyleContext.remove_provider_for_screen (Gdk.Screen.get_default (), css_provider);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue