Susy and device-pixel-ratio - susy-compass

I haven't seen anything about this in Susy's documentation, but is there a means for adding device pixel ratio to Susy's generated media queries? Or is this something that requires customizing the at-breakpoint mixin?

Susy's at-breakpoint is really just a shortcut for the simplest mix/max media-queries. For more powerful media-queries, I recommend the breakpoint plugin. You can use that in conjunction with Susy's layout mixin to re-create the at-breakpoint effect:
#include breakpoint($your-advanced-media-queries) {
#include layout($your-desired-column-count) {
// your styles
}
}

Related

How to start building a GUI toolkit for wayland

I want to create a GUI toolkit for my desktop environment (because neither gtk nor qt don't fit to my needs) but I don't know how to start. I don't want a cross-platform or display-server independent library, theming options, configurable icons etc. just a few basic widgets for making wayland clients. (widgets like button, entry, label, window and images... and I want to use CSD if it's important)
My problem is that I can't understand how graphics work in wayland (in X you only need to create a window and use XDrawLine etc. right?) also I don't know how to write a graphical toolkit. Can you give me some articles or recommendations on how can I do this?
The easiest way to create a wayland client is to use the wayland-client library. Basically, it abstracts the wire format.
example:
#include <stdio.h>
#include <wayland-client.h>
int main(void)
{
struct wl_display *display = wl_display_connect(NULL);
if (display) {
printf("Connected!\n");
} else {
printf("Error connecting ;(\n");
return 1;
}
wl_display_disconnect(display);
return 0;
}

Which library should I link to use DirectX Media Object Wrapper Filter?

I extract a very little snippet of code of my C++ application:
#include <windows.h>
#include "Dshow.h"
#include "dmodshow.h"
int main()
{
IBaseFilter *audioWrapper = NULL;
CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&(audioWrapper));
return 0;
}
Here, I want to create an instance of a DMO Wrapper Filter. The application compiles well but when I link, I get:
error LNK2001: unresolved external symbol _CLSID_DMOWrapperFilter
However, I correctly add Strmiids.lib and Quartz.lib in my dependencies as said in the documentation but it still doesn't work.
I know the SDK is correctly installed on my system because I can compile another application who use DirectShow but I didn't find the dependency is need in this particular case.
So, has anyone an idea of which library I should use to compile my application?
Apparently, the DMO GUIDs are exported by the dmoguids.lib library and CLSID_DMOWrapperFilter is part of it (even if it is defined in dmodshow.h).
Indeed, the documentation page of the DMO GUIDs says:
These GUIDs are defined in the header file Dmoreg.h and exported by the Dmoguids.lib library.

Is it possible to pass a value of 0 to span(0)?

Long tried to create a responsive navigation. But still turned out.
But I'm still not sure I did the right thing. Because I passed a value of 0 in the span. Or so it is still possible to do? It works :)
$big: (columns: 24, gutters: 1/2,math: fluid,gutter-position: split )
#include susy-breakpoint(700px, $big)
.nav-item // is ui>li.nav-item
#include span(0 border-box)
No, this is not a proper way to use Susy. If you look at the output, you will see that you get width: -1.38889%; which is not valid CSS. It works because browsers ignore invalid code - but it's not a good idea, and it's not a meaningful use of Susy.
The only grid-output you need is gutters, so that's all you should ask Susy for. The rest you can do with plain css:
.nav-item {
#include gutters;
box-sizing: border-box;
float: left;
}

How to override span-columns at different breakpoint in SUSY

I think I must be missing something fundamental with how susy works, and the documentation has too few examples to understand how this works.
I want different layouts at different breakpoints. I can make it that far, but I want my elements to span different number of columns depending on what breakpoint is triggered. So if I have a general stylesheet for mobile ('mobile-first') like:
.wrapper{
.element1{
#include span-columns(4);
}
.element2{
#include span-columns(2 omega);
}
}
But once the width changes to my 'tablet' and it changes to an 8 column layout, I want to be able to change this to:
#include at-breakpoint($tablet-break $tablet-layout){
.wrapper{
#include set-container-width;
.element1{
#include span-columns(5);
}
.element2{
#include span-columns(3 omega);
}
}
}
It seems like this not only doesn't 'overwrite' the mobile settings, but it appears, upon firebug inspection, that the elements do not match up with my new tablet columns. I think it is still using a 6 column layout. Adding #include set-container-width doesn't seem to fix the problem; however, if I comment out the mobile layout it works. So it's almost as if these include statements don't overwrite, so I think I'm not understanding how susy works. Here's an example of firebug showing the element not matching the layout:
(Also I'm not sure of any SUSY best practices (except for don't nest more than 4 deep). I could define all my sass with nested #at-breakpoint statements for all my changes, or I could define my default (mobile) css and then create a separate sass block all nested within at-breakpoint. I don't know if this is causing a problem.)
UPDATE
It appears, that if I include at-breakpoint includes after the original (mobile) declaration, it seems to work. Though it does seem to require code repetition:
.element1{
#include span-columns(2 omega);
text-indent: -1em;
text-align: center;
#include at-breakpoint($tablet-break $tablet-layout){
#include span-columns(3 omega);
text-indent: 0;
text-align: left;
}
#include at-breakpoint($desktop-break $desktop-layout){
#include span-columns(3 omega);
text-indent: 0;
text-align: left;
}
}

How to disable warnings 4510 and 4610 from std::list class?

I have a bunch of warnings C4510 and C4610 when I use std::list with my class. It is a warning stating that default constructor is not available, and I want to disable them.
When I put:
#pragma warning(disable: 4510)
inside .cpp file that is instantiating this list nothing happens.
I tried placing this pragmas around function where I instantiate lists and even on top of the .cpp file but the results are the same - nothing happens. It only works if I disable warnings in properties dialog of .cpp file. I hate hiding stuff in properties like that because they get overlooked by developers. I would like to have them localized around the function. Is there something I could do about this?
EDIT:
Ok. This is how my code basically looks like. This code generates warnings 4510 and 4610 on warning level 4:
#include <list>
class foo {
public:
foo(int) { }
};
class bar {};
class problem_class {
foo m_foo;
const bar *m_bar;
public:
problem_class(const foo &_foo, const bar *_bar) : m_foo(_foo), m_bar(_bar) { }
};
void problem_fn(std::list<problem_class> &problem_collection) {
foo _foo(3);
problem_collection.clear();
problem_collection.push_back(problem_class(_foo, new bar));
}
int main(int , char **)
{
std::list<problem_class> collection;
problem_fn(collection);
return 0;
}
Instead of hiding the problem by disabling warnings, how about wrapping your class w/o a default constructor in a proxy class that does have a default constructor*. The proxy's default constructor can then do the proper initialization of the wrapped class. Then store the proxy class in the std::list. This would make your intent clear and eliminate the warning.
*assuming you can't for whatever reason actually make the wrapped class have an appropriatte default constructor.
Include #pragma before including <list>
#pragma warning (disable:4510)
#pragma warning (disable:4610)
#include <list>
You need to post some code that illustrates exactly what you are doing. Warning C4510 says:
The compiler cannot generate a default
constructor for the specified class
and no user-defined constructor was
created. You will not be able to
create objects of this type.
This doesn't seem to have anything to do with std::list, so it maybe that there is something wrong with your code.
I know this is not very helpful, but the code you posted looks fine to me and compiled with no warnings with g++ and comeau. I don't use VC++ anymore, so can't reall help further, I'm afraid.
Further Edit: Purely in the spirit of experimentation, what happens if you change:
const bar *m_bar;
to
bar *m_bar;
The MSDN docs for this warning say that:
There are several situations that
prevent the compiler from generating a
default constructor, including:
* A const data member.
Now the m_bar member isn't const (the thing it points to is) but I wonder if the compiler is a little confused about this.
#pragma warning (disable : 4510 4610)
#pragma warning (push, 3)
#include <list>
#pragma warning (pop)
#pragma warning (default : 4510 4610)
Ok, found it.
My project uses precompiled headers so in some header file that is included from StdAfx.h someone included list. When I added #pragma directives on top of the StdAfx.h everything worked. The thing that confused me is that when I added #pragma in .cpp file in front of
#include "StdAfx.h"
nothing worked (warnings were still displayed). Since list was included in precompiled headers, it had the same warning settings no matter what the .cpp file specified later on.
But, the strange thing is that even if I could not override settings in .cpp file, I could override them by specifying compile properties for that same file. How is that any different?

Resources